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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  4. package/dist/cdn/foxy-cart-form.js +2 -2
  5. package/dist/cdn/foxy-client-form.js +1 -1
  6. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  7. package/dist/cdn/foxy-coupon-form.js +1 -1
  8. package/dist/cdn/foxy-customer-form.js +1 -1
  9. package/dist/cdn/foxy-customer-portal.js +1 -1
  10. package/dist/cdn/foxy-customer.js +1 -1
  11. package/dist/cdn/foxy-downloadable-form.js +1 -1
  12. package/dist/cdn/foxy-email-template-form.js +1 -1
  13. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  14. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  15. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  16. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  17. package/dist/cdn/foxy-gift-card-form.js +1 -1
  18. package/dist/cdn/foxy-integration-form.js +1 -1
  19. package/dist/cdn/foxy-item-category-form.js +1 -1
  20. package/dist/cdn/foxy-item-form.js +1 -1
  21. package/dist/cdn/foxy-item-option-form.js +1 -1
  22. package/dist/cdn/foxy-native-integration-form.js +1 -1
  23. package/dist/cdn/foxy-passkey-form.js +1 -1
  24. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  25. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  26. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  27. package/dist/cdn/foxy-store-form.js +1 -1
  28. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  29. package/dist/cdn/foxy-subscription-form.js +1 -1
  30. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  31. package/dist/cdn/foxy-template-set-form.js +1 -1
  32. package/dist/cdn/foxy-transaction.js +1 -1
  33. package/dist/cdn/foxy-user-form.js +1 -1
  34. package/dist/cdn/foxy-users-table.js +1 -1
  35. package/dist/cdn/foxy-webhook-form.js +1 -1
  36. package/dist/cdn/shared-3ea78c8d.js +1 -0
  37. package/dist/cdn/shared-a8170f94.js +1 -0
  38. package/dist/cdn/shared-cdf20ded.js +1 -0
  39. package/dist/cdn/shared-e96c5384.js +1 -0
  40. package/dist/cdn/shared-f07d15d6.js +1 -0
  41. package/dist/cdn/translations/item-category-form/en.json +181 -148
  42. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.d.ts +3 -0
  43. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +23 -8
  44. package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
  45. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.d.ts +2 -0
  46. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +11 -1
  47. package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
  48. package/dist/elements/internal/InternalTextControl/InternalTextControl.d.ts +2 -0
  49. package/dist/elements/internal/InternalTextControl/InternalTextControl.js +13 -2
  50. package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
  51. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.d.ts +1 -7
  52. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +109 -135
  53. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
  54. package/dist/elements/public/ItemCategoryForm/index.d.ts +4 -3
  55. package/dist/elements/public/ItemCategoryForm/index.js +4 -3
  56. package/dist/elements/public/ItemCategoryForm/index.js.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/cdn/shared-18cb3cfc.js +0 -1
  59. package/dist/cdn/shared-588c6b15.js +0 -1
  60. package/dist/cdn/shared-666bdabd.js +0 -1
  61. package/dist/cdn/shared-b9138e9f.js +0 -1
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-2d723710.js";import"./shared-5c05ac06.js";import"./shared-fb56178f.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as r,B as s,aH as o}from"./shared-0f6e4584.js";import{h as i,L as n,c as a}from"./shared-dc73b9a5.js";import{A as d}from"./shared-01b2cad8.js";import"./shared-6d645dc5.js";import{C as l}from"./shared-91f5e0b3.js";import{a as c,T as m}from"./shared-075796e2.js";import{i as u}from"./shared-9803aa7c.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-c286c5ad.js";import{C as f}from"./shared-0b01f721.js";import{I as g}from"./shared-f7a1193f.js";import"./shared-30221a16.js";import"./foxy-update-payment-method-form.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-6a4e81ad.js";import"./shared-2099544a.js";import"./shared-8f7a31e0.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-61ade33e.js";import"./shared-7b8ad9c1.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-nucleon-element.js";import"./shared-99940888.js";import"./foxy-template-set-card.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./foxy-payment-card-embed.js";import"./shared-acdcae7e.js";import"./shared-e5d37737.js";import"./shared-2fc671cd.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-a0c6a159.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-10b5e78f.js";import"./shared-e6e84ff5.js";import"./shared-18cb3cfc.js";import"./shared-797ba64a.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-588c6b15.js";import"./foxy-table.js";import"./shared-b731dfc5.js";import"./shared-4993a79d.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-bdd4fbbb.js";import"./shared-644ee296.js";import"./shared-303b428e.js";import"./shared-9a90a24e.js";import"./shared-f22f22ae.js";import"./shared-4c2d43e6.js";import"./shared-2bf89a21.js";import"./shared-b9138e9f.js";import"./shared-d6010c96.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-61f4e91a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-a159ccff.js";import"./shared-f5366dda.js";import"./shared-b738ee96.js";import"./shared-d464d078.js";let $,y,b=e=>e;class v extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e;let t;try{t=new URL("./customer_portal_settings",this.base)}catch(e){t=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=b` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),u(null!==(e=this.embedUrl)&&void 0!==e?e:void 0),this.base,u(null==t?void 0:t.toString()),this.transactionsTableColumns):i(y||(y=b` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(null==t?void 0:t.toString()))}}let S,x,_,j,T=e=>e;class O extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let k,w,z,R,U,E,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let re,se,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,be=e=>e;const ve=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,r,s,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(k||(k=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,r])=>`${e}${t}:${r};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(s=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==s?s:"",null!==(n=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const r="customer:subscriptions";return e(R||(R=C`
1
+ import"./foxy-customer.js";import"./shared-2d723710.js";import"./shared-5c05ac06.js";import"./shared-fb56178f.js";import"./shared-51c4a6dd.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as r,B as s,aH as o}from"./shared-0f6e4584.js";import{h as i,L as n,c as a}from"./shared-dc73b9a5.js";import{A as d}from"./shared-01b2cad8.js";import"./shared-6d645dc5.js";import{C as l}from"./shared-91f5e0b3.js";import{a as c,T as m}from"./shared-075796e2.js";import{i as u}from"./shared-9803aa7c.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-c286c5ad.js";import{C as f}from"./shared-0b01f721.js";import{I as g}from"./shared-f7a1193f.js";import"./shared-30221a16.js";import"./foxy-update-payment-method-form.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-6a4e81ad.js";import"./shared-2099544a.js";import"./shared-8f7a31e0.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-61ade33e.js";import"./shared-7b8ad9c1.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-nucleon-element.js";import"./shared-99940888.js";import"./foxy-template-set-card.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./foxy-payment-card-embed.js";import"./shared-acdcae7e.js";import"./shared-e5d37737.js";import"./shared-2fc671cd.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-a0c6a159.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-10b5e78f.js";import"./shared-e6e84ff5.js";import"./shared-e96c5384.js";import"./shared-797ba64a.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-3ea78c8d.js";import"./shared-22ba9566.js";import"./foxy-table.js";import"./shared-b731dfc5.js";import"./shared-4993a79d.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-bdd4fbbb.js";import"./shared-644ee296.js";import"./shared-303b428e.js";import"./shared-9a90a24e.js";import"./shared-f22f22ae.js";import"./shared-4c2d43e6.js";import"./shared-2bf89a21.js";import"./shared-f07d15d6.js";import"./shared-d6010c96.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-61f4e91a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-a159ccff.js";import"./shared-f5366dda.js";import"./shared-b738ee96.js";import"./shared-d464d078.js";let $,y,b=e=>e;class v extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.embedUrl=null,this.group=""}static get properties(){return r(r({},super.properties),{},{transactionsTableColumns:{attribute:!1},embedUrl:{attribute:"embed-url"},group:{type:String}})}render(){var e;let t;try{t=new URL("./customer_portal_settings",this.base)}catch(e){t=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=b` <foxy-internal-customer-portal-logged-in-view embed-url="${0}" customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),u(null!==(e=this.embedUrl)&&void 0!==e?e:void 0),this.base,u(null==t?void 0:t.toString()),this.transactionsTableColumns):i(y||(y=b` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(null==t?void 0:t.toString()))}}let S,x,_,j,T=e=>e;class O extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return r(r({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let k,w,z,R,U,E,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let re,se,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,be=e=>e;const ve=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{constructor(){var e;super(...arguments),e=this,this.customer="",this.embedUrl=null,this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,r,s,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(k||(k=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,r])=>`${e}${t}:${r};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(s=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==s?s:"",null!==(n=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const r="customer:subscriptions";return e(R||(R=C`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -1,4 +1,4 @@
1
- import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import{h as t}from"./shared-30221a16.js";import"./shared-2d723710.js";import"./shared-51c4a6dd.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-f1d2b5bb.js";import{aH as e,_ as s}from"./shared-0f6e4584.js";import{L as r,h as a,c as o}from"./shared-dc73b9a5.js";import{C as i}from"./shared-0b01f721.js";import"./shared-6a4e81ad.js";import"./shared-ff63a551.js";import{y as h,S as d,T as n,a as l}from"./shared-075796e2.js";import{c as m}from"./shared-4e709717.js";import"./shared-4993a79d.js";import"./shared-7026fb08.js";import{S as c}from"./shared-bdd4fbbb.js";import{G as v}from"./shared-9a90a24e.js";import"./shared-acdcae7e.js";import"./shared-2fc671cd.js";import"./shared-021c7a22.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-e5d37737.js";import{N as p}from"./shared-24d71d01.js";import{S as f}from"./shared-f22f22ae.js";import{i as g}from"./shared-9803aa7c.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-abea5e34.js";import"./shared-2bf89a21.js";import"./foxy-nucleon-element.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-2099544a.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-7b8ad9c1.js";import"./shared-8c1df97c.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-bab2ea2c.js";import"./shared-99940888.js";import"./foxy-template-set-card.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./foxy-payment-card-embed.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";import"./shared-a0c6a159.js";import"./shared-797ba64a.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-b9138e9f.js";import"./shared-df00a537.js";import"./shared-d6010c96.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-61f4e91a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-4c2d43e6.js";import"./shared-b731dfc5.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";import"./shared-a159ccff.js";import"./shared-f5366dda.js";import"./shared-588c6b15.js";import"./shared-b738ee96.js";import"./shared-10b5e78f.js";import"./shared-e6e84ff5.js";import"./shared-18cb3cfc.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-644ee296.js";import"./shared-303b428e.js";let z,u,b,$=t=>t;class y extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import{h as t}from"./shared-30221a16.js";import"./shared-2d723710.js";import"./shared-51c4a6dd.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-f1d2b5bb.js";import{aH as e,_ as s}from"./shared-0f6e4584.js";import{L as r,h as a,c as o}from"./shared-dc73b9a5.js";import{C as i}from"./shared-0b01f721.js";import"./shared-6a4e81ad.js";import"./shared-ff63a551.js";import{y as h,S as d,T as n,a as l}from"./shared-075796e2.js";import{c as m}from"./shared-4e709717.js";import"./shared-4993a79d.js";import"./shared-7026fb08.js";import{S as c}from"./shared-bdd4fbbb.js";import{G as v}from"./shared-9a90a24e.js";import"./shared-acdcae7e.js";import"./shared-2fc671cd.js";import"./shared-021c7a22.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-e5d37737.js";import{N as p}from"./shared-24d71d01.js";import{S as f}from"./shared-f22f22ae.js";import{i as g}from"./shared-9803aa7c.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-abea5e34.js";import"./shared-2bf89a21.js";import"./foxy-nucleon-element.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-2099544a.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-7b8ad9c1.js";import"./shared-8c1df97c.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-bab2ea2c.js";import"./shared-99940888.js";import"./foxy-template-set-card.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./foxy-payment-card-embed.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";import"./shared-a0c6a159.js";import"./shared-797ba64a.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-f07d15d6.js";import"./shared-df00a537.js";import"./shared-d6010c96.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-61f4e91a.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-4c2d43e6.js";import"./shared-b731dfc5.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";import"./shared-a159ccff.js";import"./shared-f5366dda.js";import"./shared-3ea78c8d.js";import"./shared-22ba9566.js";import"./shared-b738ee96.js";import"./shared-10b5e78f.js";import"./shared-e6e84ff5.js";import"./shared-e96c5384.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-644ee296.js";import"./shared-303b428e.js";let z,u,b,$=t=>t;class y extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1,4 +1,4 @@
1
- import{a as e}from"./shared-7b8ad9c1.js";import"./shared-e5d37737.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-2d723710.js";import{h as r,P as t,B as a}from"./shared-30221a16.js";import{E as o,T as i}from"./shared-8f7a31e0.js";import"./shared-fb56178f.js";import"./shared-f1d2b5bb.js";import{w as s,a as n}from"./shared-075796e2.js";import{c as l,h as A}from"./shared-dc73b9a5.js";import{i as d}from"./shared-9803aa7c.js";import{c as p}from"./shared-4e709717.js";import"./shared-fa9e5c7f.js";import"./shared-b9138e9f.js";import"./shared-588c6b15.js";import{I as c}from"./shared-8c1df97c.js";import"./foxy-nucleon-element.js";import{_ as u,B as m}from"./shared-0f6e4584.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-61ade33e.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-df00a537.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const h=r`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
1
+ import{a as e}from"./shared-7b8ad9c1.js";import"./shared-e5d37737.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-2d723710.js";import{h as r,P as t,B as a}from"./shared-30221a16.js";import{E as o,T as i}from"./shared-8f7a31e0.js";import"./shared-fb56178f.js";import"./shared-f1d2b5bb.js";import{w as s,a as n}from"./shared-075796e2.js";import{c as l,h as A}from"./shared-dc73b9a5.js";import{i as d}from"./shared-9803aa7c.js";import{c as p}from"./shared-4e709717.js";import"./shared-fa9e5c7f.js";import"./shared-f07d15d6.js";import"./shared-3ea78c8d.js";import{I as c}from"./shared-8c1df97c.js";import"./foxy-nucleon-element.js";import{_ as u,B as m}from"./shared-0f6e4584.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-61ade33e.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-df00a537.js";import"./shared-22ba9566.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const h=r`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-3e03c988.js";import"./shared-2d723710.js";import"./shared-18cb3cfc.js";import"./shared-abea5e34.js";import"./shared-a036e345.js";import"./shared-588c6b15.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as e}from"./shared-0f6e4584.js";import"./shared-fb56178f.js";import"./shared-6a4e81ad.js";import"./shared-ff63a551.js";import{h as t}from"./shared-dc73b9a5.js";import{S as a,T as s,a as i}from"./shared-075796e2.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-4993a79d.js";import"./shared-7026fb08.js";import"./shared-bdd4fbbb.js";import{G as l}from"./shared-9a90a24e.js";import"./shared-acdcae7e.js";import"./shared-2fc671cd.js";import"./shared-021c7a22.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-e5d37737.js";import{M as d}from"./shared-72c61f43.js";import{C as c}from"./shared-0b01f721.js";import{N as h}from"./shared-24d71d01.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-30221a16.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-2099544a.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-7b8ad9c1.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-5c05ac06.js";import"./shared-343d1fd7.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-644ee296.js";import"./shared-303b428e.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=a(s(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,a,s;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${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> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(s=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,a;const s="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,this.t(s),!this.in("idle")||this.disabledSelector.matches(s),this.readonlySelector.matches(s),null!==(a=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==a?a:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${s}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var a,s;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(a=this.data)||void 0===a?void 0:a[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:a,href:s,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||a.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?s?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const a=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",s=await new g.API(this).fetch(a,{method:"POST"});this.__cacheState=s.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
1
+ import"./shared-3e03c988.js";import"./shared-2d723710.js";import"./shared-e96c5384.js";import"./shared-abea5e34.js";import"./shared-a036e345.js";import"./shared-3ea78c8d.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as e}from"./shared-0f6e4584.js";import"./shared-fb56178f.js";import"./shared-6a4e81ad.js";import"./shared-ff63a551.js";import{h as t}from"./shared-dc73b9a5.js";import{S as a,T as s,a as i}from"./shared-075796e2.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-4993a79d.js";import"./shared-7026fb08.js";import"./shared-bdd4fbbb.js";import{G as l}from"./shared-9a90a24e.js";import"./shared-acdcae7e.js";import"./shared-2fc671cd.js";import"./shared-021c7a22.js";import"./shared-fe77f6f6.js";import"./shared-39a33102.js";import"./shared-e5d37737.js";import{M as d}from"./shared-72c61f43.js";import{C as c}from"./shared-0b01f721.js";import{N as h}from"./shared-24d71d01.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-30221a16.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-2099544a.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-7b8ad9c1.js";import"./shared-f7a1193f.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-5c05ac06.js";import"./shared-343d1fd7.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-77c4acdd.js";import"./shared-e2a61f69.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-644ee296.js";import"./shared-303b428e.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=a(s(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,a,s;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${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> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(s=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==s?s:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const a=t._links["fx:cache"].href,s=await new g.API(this).fetch(a,{method:"POST"});return this.__cacheState=s.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,a;const s="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),s,this.t(s),!this.in("idle")||this.disabledSelector.matches(s),this.readonlySelector.matches(s),null!==(a=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==a?a:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${s}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var a,s;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(a=this.data)||void 0===a?void 0:a[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(s=this.data)||void 0===s?void 0:s[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:a,href:s,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||a.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?s?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const a=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",s=await new g.API(this).fetch(a,{method:"POST"});this.__cacheState=s.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
@@ -1 +1 @@
1
- import{a as e}from"./shared-7b8ad9c1.js";import"./shared-2d723710.js";import"./shared-f1d2b5bb.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-588c6b15.js";import{I as r}from"./shared-8c1df97c.js";import"./foxy-query-builder.js";import{_ as a,B as s}from"./shared-0f6e4584.js";import{a as i}from"./shared-075796e2.js";import{d as o,e as n}from"./shared-6ac0d05e.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-4e709717.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-8874ec69.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a0c6a159.js";let d,l,m=e=>e;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends e{renderControl(){const e=this.nucleon,r=null==e?void 0:e.in({idle:{snapshot:"dirty"}}),a=!!(null==e?void 0:e.data);return t(d||(d=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),a&&r?t(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==e?void 0:e.undo())):"",a?r?"secondary":"error":"success",a&&r?"":"col-span-2",this.disabled,(()=>!a||r?null==e?void 0:e.submit():null==e?void 0:e.delete()),a?r?"update":"delete":"create")}});let h,u=e=>e;const c=i(r,"filter-attribute-form");class f extends c{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const e=this.constructor;return this.__getValueParam(e.filterNameKey)},this.__filterNameSetValue=e=>{const t=this.constructor;this.__setValueParam(t.filterNameKey,e)}}static get properties(){return a(a({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const e=[],t=this.constructor,r=this.__getValueParam(t.filterQueryKey),a=!!this.data;return a||e.push("filter-name"),r||a||e.push("action"),new s(`${e.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const e=this.constructor;return t(h||(h=u` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(e.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(e){var t;if(super.updated(e),"string"==typeof this.form.value){const e=new URL(o(this.form.value),"https://example.com");e.pathname=null!==(t=this.pathname)&&void 0!==t?t:"";const r=n(e.toString().substring(e.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const e=this.constructor;this.edit({visibility:e.attributeVisibility,name:e.attributeName}),super.submit()}__getValueParam(e){var t,r;try{return null!==(r=new URL(o(null!==(t=this.form.value)&&void 0!==t?t:""),"https://example.com").searchParams.get(e))&&void 0!==r?r:""}catch(e){return""}}__setValueParam(e,t){var r;try{const a=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");a.searchParams.set(e,t),this.edit({value:n(a.toString().substring(a.origin.length))})}catch(e){}}__handleFilterQueryChange(e){var t;const r=this.constructor,a=e.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(t=a.value)&&void 0!==t?t:"")}}f.attributeVisibility="restricted",f.filterQueryKey="filter_query",f.attributeName="foxy-admin-bookmark",f.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",f);export{f as FilterAttributeForm};
1
+ import{a as e}from"./shared-7b8ad9c1.js";import"./shared-2d723710.js";import"./shared-f1d2b5bb.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-3ea78c8d.js";import{I as r}from"./shared-8c1df97c.js";import"./foxy-query-builder.js";import{_ as a,B as s}from"./shared-0f6e4584.js";import{a as i}from"./shared-075796e2.js";import{d as o,e as d}from"./shared-6ac0d05e.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-8874ec69.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a0c6a159.js";let n,l,m=e=>e;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends e{renderControl(){const e=this.nucleon,r=null==e?void 0:e.in({idle:{snapshot:"dirty"}}),a=!!(null==e?void 0:e.data);return t(n||(n=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),a&&r?t(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==e?void 0:e.undo())):"",a?r?"secondary":"error":"success",a&&r?"":"col-span-2",this.disabled,(()=>!a||r?null==e?void 0:e.submit():null==e?void 0:e.delete()),a?r?"update":"delete":"create")}});let h,u=e=>e;const c=i(r,"filter-attribute-form");class f extends c{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const e=this.constructor;return this.__getValueParam(e.filterNameKey)},this.__filterNameSetValue=e=>{const t=this.constructor;this.__setValueParam(t.filterNameKey,e)}}static get properties(){return a(a({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const e=[],t=this.constructor,r=this.__getValueParam(t.filterQueryKey),a=!!this.data;return a||e.push("filter-name"),r||a||e.push("action"),new s(`${e.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const e=this.constructor;return t(h||(h=u` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(e.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(e){var t;if(super.updated(e),"string"==typeof this.form.value){const e=new URL(o(this.form.value),"https://example.com");e.pathname=null!==(t=this.pathname)&&void 0!==t?t:"";const r=d(e.toString().substring(e.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const e=this.constructor;this.edit({visibility:e.attributeVisibility,name:e.attributeName}),super.submit()}__getValueParam(e){var t,r;try{return null!==(r=new URL(o(null!==(t=this.form.value)&&void 0!==t?t:""),"https://example.com").searchParams.get(e))&&void 0!==r?r:""}catch(e){return""}}__setValueParam(e,t){var r;try{const a=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");a.searchParams.set(e,t),this.edit({value:d(a.toString().substring(a.origin.length))})}catch(e){}}__handleFilterQueryChange(e){var t;const r=this.constructor,a=e.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(t=a.value)&&void 0!==t?t:"")}}f.attributeVisibility="restricted",f.filterQueryKey="filter_query",f.attributeName="foxy-admin-bookmark",f.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",f);export{f as FilterAttributeForm};
@@ -1 +1 @@
1
- import"./shared-3fa791ca.js";import"./shared-b9138e9f.js";import"./shared-a036e345.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import{a as r}from"./shared-075796e2.js";import{B as s}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-339bbd50.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let o,a=e=>e;const i=r(e,"generate-codes-form");class n extends i{constructor(){super(...arguments),this.__exampleGetValue=()=>{var e,r;const s=null!==(e=this.form.prefix)&&void 0!==e?e:"",t=(null!==(r=this.form.length)&&void 0!==r?r:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((e=>`${s}${e.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:e="",length:r=6})=>r-e.length>0&&r<=50&&!(null==e?void 0:e.includes(" "))||"error:invalid_form"]}get readonlySelector(){const e=["example",super.readonlySelector.toString()];return this.href&&e.push("length number-of-codes current-balance prefix"),new s(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("delete timestamps"),this.href&&e.push("example"),this.errors.includes("error:invalid_form")&&e.push("example"),new s(e.join(" ").trim())}renderBody(){return t(o||(o=a` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",n);export{n as GenerateCodesForm};
1
+ import"./shared-3fa791ca.js";import"./shared-f07d15d6.js";import"./shared-a036e345.js";import"./shared-3ea78c8d.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{B as s}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-339bbd50.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let o,a=r=>r;const i=e(r,"generate-codes-form");class n extends i{constructor(){super(...arguments),this.__exampleGetValue=()=>{var r,e;const s=null!==(r=this.form.prefix)&&void 0!==r?r:"",t=(null!==(e=this.form.length)&&void 0!==e?e:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((r=>`${s}${r.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:r="",length:e=6})=>e-r.length>0&&e<=50&&!(null==r?void 0:r.includes(" "))||"error:invalid_form"]}get readonlySelector(){const r=["example",super.readonlySelector.toString()];return this.href&&r.push("length number-of-codes current-balance prefix"),new s(r.join(" ").trim())}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return r.unshift("delete timestamps"),this.href&&r.push("example"),this.errors.includes("error:invalid_form")&&r.push("example"),new s(r.join(" ").trim())}renderBody(){return t(o||(o=a` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(r){const e=JSON.stringify(r),s=await this._fetch(this.parent,{body:e,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",n);export{n as GenerateCodesForm};
@@ -1 +1 @@
1
- import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-b9138e9f.js";import"./shared-cbb0e610.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import{a as r}from"./shared-7b8ad9c1.js";import"./foxy-item-card.js";import"./shared-f1d2b5bb.js";import{i as t}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import{_ as s,B as a}from"./shared-0f6e4584.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-075796e2.js";import{T as n}from"./shared-8874ec69.js";import"./foxy-nucleon-element.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-2d723710.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-7026fb08.js";import"./shared-0b01f721.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-ffd3690b.js";import"./shared-2fc671cd.js";import"./shared-303b428e.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-61f4e91a.js";import"./shared-a6273e4a.js";import"./shared-51c4a6dd.js";import"./shared-4c2d43e6.js";let l,c=e=>e;customElements.define("foxy-internal-gift-card-code-form-item-control",class extends r{renderControl(){var e,r,s,a;let i;try{const t=new URL(null!==(a=null===(s=null===(r=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===r?void 0:r._links)||void 0===s?void 0:s["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==a?a:"");t.searchParams.set("zoom","item_options"),i=t.toString()}catch(e){i=void 0}return o(l||(l=c` <foxy-i18n infer="" class="text-secondary block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-item-card class="block rounded ring-1 ring-contrast-10" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" infer="card" href="${0}"> </foxy-item-card> `),t(i))}});let m,f=e=>e;const p=d(e,"gift-card-code-form");class h extends p{constructor(){super(...arguments),this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=i(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:n.String,path:"id",label:"filters.id"},{type:n.String,path:"tax_id",label:"filters.tax_id"},{type:n.String,path:"email",label:"filters.email"},{type:n.String,path:"first_name",label:"filters.first_name"},{type:n.String,path:"last_name",label:"filters.last_name"},{type:n.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:n.Date,path:"last_login_date",label:"filters.last_login_date"},{type:n.Date,path:"date_created",label:"filters.date_created"},{type:n.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return s(s({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new a(e.join(" ").trim())}renderBody(){var e,r,s,a,i;return o(m||(m=f` ${0} <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-number-control infer="current-balance"></foxy-internal-number-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-gift-card-code-form-item-control infer="cart-item"> </foxy-internal-gift-card-code-form-item-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),t(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,t(null===(a=null===(s=this.data)||void 0===s?void 0:s._links)||void 0===a?void 0:a["fx:gift_card_code_logs"].href),super.renderBody(),t(null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",h);export{h as GiftCardCodeForm};
1
+ import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-f07d15d6.js";import"./shared-cbb0e610.js";import"./shared-3ea78c8d.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import{a as r}from"./shared-7b8ad9c1.js";import"./foxy-item-card.js";import"./shared-f1d2b5bb.js";import{i as t}from"./shared-9803aa7c.js";import{h as o}from"./shared-dc73b9a5.js";import{_ as s,B as a}from"./shared-0f6e4584.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-075796e2.js";import{T as n}from"./shared-8874ec69.js";import"./foxy-nucleon-element.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-f7a1193f.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-2d723710.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-7026fb08.js";import"./shared-0b01f721.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-ffd3690b.js";import"./shared-2fc671cd.js";import"./shared-303b428e.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-61f4e91a.js";import"./shared-a6273e4a.js";import"./shared-51c4a6dd.js";import"./shared-4c2d43e6.js";let l,c=e=>e;customElements.define("foxy-internal-gift-card-code-form-item-control",class extends r{renderControl(){var e,r,s,a;let i;try{const t=new URL(null!==(a=null===(s=null===(r=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===r?void 0:r._links)||void 0===s?void 0:s["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==a?a:"");t.searchParams.set("zoom","item_options"),i=t.toString()}catch(e){i=void 0}return o(l||(l=c` <foxy-i18n infer="" class="text-secondary block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-item-card class="block rounded ring-1 ring-contrast-10" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" infer="card" href="${0}"> </foxy-item-card> `),t(i))}});let m,f=e=>e;const p=d(e,"gift-card-code-form");class h extends p{constructor(){super(...arguments),this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=i(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:n.String,path:"id",label:"filters.id"},{type:n.String,path:"tax_id",label:"filters.tax_id"},{type:n.String,path:"email",label:"filters.email"},{type:n.String,path:"first_name",label:"filters.first_name"},{type:n.String,path:"last_name",label:"filters.last_name"},{type:n.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:n.Date,path:"last_login_date",label:"filters.last_login_date"},{type:n.Date,path:"date_created",label:"filters.date_created"},{type:n.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return s(s({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new a(e.join(" ").trim())}renderBody(){var e,r,s,a,i;return o(m||(m=f` ${0} <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-number-control infer="current-balance"></foxy-internal-number-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-gift-card-code-form-item-control infer="cart-item"> </foxy-internal-gift-card-code-form-item-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),t(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,t(null===(a=null===(s=this.data)||void 0===s?void 0:s._links)||void 0===a?void 0:a["fx:gift_card_code_logs"].href),super.renderBody(),t(null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",h);export{h as GiftCardCodeForm};
@@ -1 +1 @@
1
- import"./shared-d393bcd8.js";import"./shared-b9138e9f.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{B as s}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-12ac8cc6.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-6a4e81ad.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,d=r=>r;const o=e(r,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var r,e;return null!==(e=null===(r=this.form.gift_card_codes)||void 0===r?void 0:r.map((r=>({value:r}))))&&void 0!==e?e:[]},this.__giftCardCodesSetValue=r=>{this.edit({gift_card_codes:r.map((({value:r})=>r.split(" ").map((r=>r.trim())))).flat().filter(((r,e,s)=>s.indexOf(r)===e))})}}static get v8n(){return[({gift_card_codes:r})=>r&&r.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const r=[super.readonlySelector.toString()];return this.href&&r.push("gift-card-codes"),new s(r.join(" ").trim())}get hiddenSelector(){const r=["delete timestamps",super.hiddenSelector.toString()];return new s(r.join(" ").trim())}renderBody(){return t(a||(a=d` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(r){const e=JSON.stringify(r),s=await this._fetch(this.parent,{body:e,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};
1
+ import"./shared-d393bcd8.js";import"./shared-f07d15d6.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{B as s}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-12ac8cc6.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-6a4e81ad.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,d=r=>r;const o=e(r,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var r,e;return null!==(e=null===(r=this.form.gift_card_codes)||void 0===r?void 0:r.map((r=>({value:r}))))&&void 0!==e?e:[]},this.__giftCardCodesSetValue=r=>{this.edit({gift_card_codes:r.map((({value:r})=>r.split(" ").map((r=>r.trim())))).flat().filter(((r,e,s)=>s.indexOf(r)===e))})}}static get v8n(){return[({gift_card_codes:r})=>r&&r.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const r=[super.readonlySelector.toString()];return this.href&&r.push("gift-card-codes"),new s(r.join(" ").trim())}get hiddenSelector(){const r=["delete timestamps",super.hiddenSelector.toString()];return new s(r.join(" ").trim())}renderBody(){return t(a||(a=d` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(r){const e=JSON.stringify(r),s=await this._fetch(this.parent,{body:e,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};
@@ -1 +1 @@
1
- import"./shared-7fd9a30f.js";import"./shared-1cf1e1a4.js";import"./shared-d393bcd8.js";import"./shared-b98b8d02.js";import"./shared-f8723f3f.js";import"./shared-18cb3cfc.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-10b5e78f.js";import{I as t}from"./shared-7b8ad9c1.js";import"./shared-3fa791ca.js";import{R as r,a as o}from"./shared-075796e2.js";import{h as i}from"./shared-dc73b9a5.js";import{_ as a,B as s}from"./shared-0f6e4584.js";import{T as n}from"./shared-8874ec69.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-22ba9566.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./foxy-swipe-actions.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./foxy-copy-to-clipboard.js";import"./shared-b9138e9f.js";import"./shared-a036e345.js";import"./shared-51c4a6dd.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-61f4e91a.js";import"./shared-7ce91c80.js";import"./shared-cbb0e610.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-4c2d43e6.js";import"./shared-cc79152c.js";let l,c,f=e=>e;const m=r(t);customElements.define("foxy-internal-gift-card-form-provisioning-control",class extends m{constructor(){super(...arguments),this.__maxBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_max},this.__maxBalanceValueSetter=e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:a>e?e:a,initial_balance_max:e}})},this.__minBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_min},this.__minBalanceValueSetter=e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:a<e?e:a}})},this.__toggleValueGetter=()=>{var e,t;return(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?["allow"]:[]},this.__toggleValueSetter=e=>{var t,r,o,i,a,s,n,d;e.includes("allow")?null===(t=this.nucleon)||void 0===t||t.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(i=null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.form.provisioning_config)||void 0===o?void 0:o.initial_balance_min)&&void 0!==i?i:0,initial_balance_max:null!==(n=null===(s=null===(a=this.nucleon)||void 0===a?void 0:a.form.provisioning_config)||void 0===s?void 0:s.initial_balance_max)&&void 0!==n?n:0}}):null===(d=this.nucleon)||void 0===d||d.edit({provisioning_config:null})},this.__toggleOptions=[{label:"text",value:"allow"}]}renderControl(){var e,t;return i(l||(l=f` <foxy-internal-checkbox-group-control infer="toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__toggleValueGetter,this.__toggleValueSetter,this.__toggleOptions,(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?i(c||(c=f` <div class="grid grid-cols-2 sm-grid-cols-4 gap-m mt-s"> <foxy-internal-text-control infer="sku" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-integer-control infer="min-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> </div> `),this.__minBalanceValueGetter,this.__minBalanceValueSetter,this.__maxBalanceValueGetter,this.__maxBalanceValueSetter):"")}});const p=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let u,_,h=e=>e;const g=r(o(e,"gift-card-form"));class v extends g{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:n.String},{label:"current_balance",path:"current_balance",type:n.Number},{label:"end_date",path:"end_date",type:n.Date},{label:"date_created",path:"date_created",type:n.Date},{label:"date_modified",path:"date_modified",type:n.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(t.code),e.__codesActions[0].state="end"}catch(t){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return a(a({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var t;if(null===(t=e.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_min;return!("number"==typeof r&&r<0)||"min-balance:v8n_negative"},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_max;return!("number"==typeof r&&r<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return i(u||(u=h` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,a,s,n,l;let c;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),c=r.toString()}catch(e){c=void 0}return i(_||(_=h` ${0} <div class="grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m"> <foxy-internal-text-control infer="name" class="md-col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" infer="expires"> </foxy-internal-frequency-control> </div> <foxy-internal-gift-card-form-provisioning-control infer="provisioning"> </foxy-internal-gift-card-form-provisioning-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,p.map((e=>({label:this.t(`currency.code_${e}`),value:e}))),c,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===o?void 0:o._links["fx:item_categories"].href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:gift_card_item_categories"].href),d(null===(s=this.data)||void 0===s?void 0:s._links.self.href),d(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",v);export{v as GiftCardForm};
1
+ import"./shared-7fd9a30f.js";import"./shared-1cf1e1a4.js";import"./shared-d393bcd8.js";import"./shared-b98b8d02.js";import"./shared-f8723f3f.js";import"./shared-e96c5384.js";import"./shared-3ea78c8d.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-10b5e78f.js";import{I as t}from"./shared-7b8ad9c1.js";import"./shared-3fa791ca.js";import{R as r,a as o}from"./shared-075796e2.js";import{h as i}from"./shared-dc73b9a5.js";import{_ as a,B as s}from"./shared-0f6e4584.js";import{T as n}from"./shared-8874ec69.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-22ba9566.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./foxy-swipe-actions.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./foxy-copy-to-clipboard.js";import"./shared-f07d15d6.js";import"./shared-a036e345.js";import"./shared-51c4a6dd.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-61f4e91a.js";import"./shared-7ce91c80.js";import"./shared-cbb0e610.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-4c2d43e6.js";import"./shared-cc79152c.js";let l,c,f=e=>e;const m=r(t);customElements.define("foxy-internal-gift-card-form-provisioning-control",class extends m{constructor(){super(...arguments),this.__maxBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_max},this.__maxBalanceValueSetter=e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:a>e?e:a,initial_balance_max:e}})},this.__minBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_min},this.__minBalanceValueSetter=e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:a<e?e:a}})},this.__toggleValueGetter=()=>{var e,t;return(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?["allow"]:[]},this.__toggleValueSetter=e=>{var t,r,o,i,a,s,n,d;e.includes("allow")?null===(t=this.nucleon)||void 0===t||t.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(i=null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.form.provisioning_config)||void 0===o?void 0:o.initial_balance_min)&&void 0!==i?i:0,initial_balance_max:null!==(n=null===(s=null===(a=this.nucleon)||void 0===a?void 0:a.form.provisioning_config)||void 0===s?void 0:s.initial_balance_max)&&void 0!==n?n:0}}):null===(d=this.nucleon)||void 0===d||d.edit({provisioning_config:null})},this.__toggleOptions=[{label:"text",value:"allow"}]}renderControl(){var e,t;return i(l||(l=f` <foxy-internal-checkbox-group-control infer="toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__toggleValueGetter,this.__toggleValueSetter,this.__toggleOptions,(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?i(c||(c=f` <div class="grid grid-cols-2 sm-grid-cols-4 gap-m mt-s"> <foxy-internal-text-control infer="sku" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-integer-control infer="min-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> </div> `),this.__minBalanceValueGetter,this.__minBalanceValueSetter,this.__maxBalanceValueGetter,this.__maxBalanceValueSetter):"")}});const p=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let u,_,h=e=>e;const g=r(o(e,"gift-card-form"));class v extends g{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:n.String},{label:"current_balance",path:"current_balance",type:n.Number},{label:"end_date",path:"end_date",type:n.Date},{label:"date_created",path:"date_created",type:n.Date},{label:"date_modified",path:"date_modified",type:n.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(t.code),e.__codesActions[0].state="end"}catch(t){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return a(a({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var t;if(null===(t=e.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_min;return!("number"==typeof r&&r<0)||"min-balance:v8n_negative"},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_max;return!("number"==typeof r&&r<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return i(u||(u=h` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,a,s,n,l;let c;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),c=r.toString()}catch(e){c=void 0}return i(_||(_=h` ${0} <div class="grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m"> <foxy-internal-text-control infer="name" class="md-col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" infer="expires"> </foxy-internal-frequency-control> </div> <foxy-internal-gift-card-form-provisioning-control infer="provisioning"> </foxy-internal-gift-card-form-provisioning-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,p.map((e=>({label:this.t(`currency.code_${e}`),value:e}))),c,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===o?void 0:o._links["fx:item_categories"].href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:gift_card_item_categories"].href),d(null===(s=this.data)||void 0===s?void 0:s._links.self.href),d(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",v);export{v as GiftCardForm};
@@ -1 +1 @@
1
- import"./shared-2d723710.js";import"./shared-72f41a65.js";import{I as e}from"./shared-8c1df97c.js";import"./shared-588c6b15.js";import"./shared-51c4a6dd.js";import"./foxy-copy-to-clipboard.js";import"./shared-f1d2b5bb.js";import{_ as r,B as t}from"./shared-0f6e4584.js";import{a as s}from"./shared-075796e2.js";import{c as a}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-77c4acdd.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-7b8ad9c1.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-bab2ea2c.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";let i,n,d,l,c,h,p,_,m,b,f,u,y=e=>e;const x=s(e,"integration-form");class j extends x{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return r(r({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:e})=>!!e||"project-name:v8n_required"]}get hiddenSelector(){return new t(`header:copy-id ${super.hiddenSelector}`.trimEnd())}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...e){var r;const t=this.constructor,s=await new t.API(this).fetch(...e),a="string"==typeof e[0]?null===(r=e[1])||void 0===r?void 0:r.method:e[0].method,o="string"==typeof e[0]?e[0]:e[0].url;if(!s.ok)throw s;const i=await s.json();return"POST"===(null==a?void 0:a.toUpperCase())&&o===this.parent&&(this.__postResponse=i),i}__renderSnapshotBody(){const e=this.hiddenSelector,r=this.__postResponse;return o(i||(i=y` ${0} ${0} ${0} <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),this.renderHeader(),e.matches("message",!0)||!r?"":this.__renderMessage(),e.matches("table")?"":this.__renderTable())}__renderTemplateBody(){return o(n||(n=y` ${0} <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-submit-control infer="create"></foxy-internal-submit-control> `),this.renderHeader())}__renderMessage(){return o(d||(d=y` ${0} <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="message" class="block" key="text"></foxy-i18n> <vaadin-button data-testid="message-action" theme="tertiary contrast" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="message" key="action"></foxy-i18n> </vaadin-button> </div> ${0} `),this.renderTemplateOrSlot("message:before"),this.disabledSelector.matches("message",!0),(()=>this.__postResponse=null),this.renderTemplateOrSlot("message:after"))}__renderTable(){var e;const r=this.data,t=new Date(1e3*(null!==(e=r.expires)&&void 0!==e?e:0)),s=this.__postResponse;return o(l||(l=y` ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} </tbody> </table> ${0} `),this.renderTemplateOrSlot("table:before"),this.__renderTableRow({label:this.__renderTableI18n("added_by"),value:this.__renderMailToLink(r.added_by_email,r.added_by_name)}),this.__renderTableRow({label:this.__renderTableI18n("contact"),value:this.__renderMailToLink(r.contact_email,r.contact_name)}),this.__renderTableRow({label:this.__renderTableI18n("company"),value:this.__renderLink(r.company_url,r.company_name)}),this.__renderTableRow({label:this.__renderTableI18n("expires"),value:this.__renderTableI18n("expires_date",{date:t})}),this.__renderTableRow({label:"Client ID",value:this.__renderCopiableText(r.client_id)}),s?o(c||(c=y` ${0} ${0} ${0} `),this.__renderTableRow({highlight:!0,label:"Client secret",value:this.__renderCopiableText(s.client_secret)}),this.__renderTableRow({highlight:!0,label:"Refresh token",value:this.__renderCopiableText(s.refresh_token)}),this.__renderTableRow({highlight:!0,label:"Access token",value:this.__renderCopiableText(s.access_token)})):"",this.__renderTableRow({label:"Scope",value:o(h||(h=y`<code>${0}</code>`),r.scope)}),this.renderTemplateOrSlot("table:after"))}__renderCopiableText(e){return o(p||(p=y` <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> `),e,e)}__renderMailToLink(e,r){return e?this.__renderLink(`mailto:${e}`,r):o(_||(_=y`${0}`),r)}__renderLink(e,r){return e?o(b||(b=y` <a target="_blank" class="font-medium text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),e,r):o(m||(m=y`${0}`),r)}__renderTableRow(e){const{label:r,value:t,highlight:s=!1}=e;return o(f||(f=y` <tr class="${0}"> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m">${0}</td> <td class="max-w-0 truncate py-s text-body w-2-3">${0}</td> </tr> `),a({"font-medium text-success":s}),r,t)}__renderTableI18n(e,r){return o(u||(u=y`<foxy-i18n infer="table" key="${0}" .options="${0}"></foxy-i18n>`),e,r)}}customElements.define("foxy-integration-form",j);export{j as IntegrationForm};
1
+ import"./shared-2d723710.js";import"./shared-72f41a65.js";import{I as e}from"./shared-8c1df97c.js";import"./shared-3ea78c8d.js";import"./shared-51c4a6dd.js";import"./foxy-copy-to-clipboard.js";import"./shared-f1d2b5bb.js";import{_ as r,B as t}from"./shared-0f6e4584.js";import{a as s}from"./shared-075796e2.js";import{c as a}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-77c4acdd.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-7b8ad9c1.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-bab2ea2c.js";import"./shared-22ba9566.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";let i,n,d,l,c,h,p,_,m,b,f,u,y=e=>e;const j=s(e,"integration-form");class x extends j{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return r(r({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:e})=>!!e||"project-name:v8n_required"]}get hiddenSelector(){return new t(`header:copy-id ${super.hiddenSelector}`.trimEnd())}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...e){var r;const t=this.constructor,s=await new t.API(this).fetch(...e),a="string"==typeof e[0]?null===(r=e[1])||void 0===r?void 0:r.method:e[0].method,o="string"==typeof e[0]?e[0]:e[0].url;if(!s.ok)throw s;const i=await s.json();return"POST"===(null==a?void 0:a.toUpperCase())&&o===this.parent&&(this.__postResponse=i),i}__renderSnapshotBody(){const e=this.hiddenSelector,r=this.__postResponse;return o(i||(i=y` ${0} ${0} ${0} <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),this.renderHeader(),e.matches("message",!0)||!r?"":this.__renderMessage(),e.matches("table")?"":this.__renderTable())}__renderTemplateBody(){return o(n||(n=y` ${0} <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-submit-control infer="create"></foxy-internal-submit-control> `),this.renderHeader())}__renderMessage(){return o(d||(d=y` ${0} <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="message" class="block" key="text"></foxy-i18n> <vaadin-button data-testid="message-action" theme="tertiary contrast" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="message" key="action"></foxy-i18n> </vaadin-button> </div> ${0} `),this.renderTemplateOrSlot("message:before"),this.disabledSelector.matches("message",!0),(()=>this.__postResponse=null),this.renderTemplateOrSlot("message:after"))}__renderTable(){var e;const r=this.data,t=new Date(1e3*(null!==(e=r.expires)&&void 0!==e?e:0)),s=this.__postResponse;return o(l||(l=y` ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} </tbody> </table> ${0} `),this.renderTemplateOrSlot("table:before"),this.__renderTableRow({label:this.__renderTableI18n("added_by"),value:this.__renderMailToLink(r.added_by_email,r.added_by_name)}),this.__renderTableRow({label:this.__renderTableI18n("contact"),value:this.__renderMailToLink(r.contact_email,r.contact_name)}),this.__renderTableRow({label:this.__renderTableI18n("company"),value:this.__renderLink(r.company_url,r.company_name)}),this.__renderTableRow({label:this.__renderTableI18n("expires"),value:this.__renderTableI18n("expires_date",{date:t})}),this.__renderTableRow({label:"Client ID",value:this.__renderCopiableText(r.client_id)}),s?o(c||(c=y` ${0} ${0} ${0} `),this.__renderTableRow({highlight:!0,label:"Client secret",value:this.__renderCopiableText(s.client_secret)}),this.__renderTableRow({highlight:!0,label:"Refresh token",value:this.__renderCopiableText(s.refresh_token)}),this.__renderTableRow({highlight:!0,label:"Access token",value:this.__renderCopiableText(s.access_token)})):"",this.__renderTableRow({label:"Scope",value:o(h||(h=y`<code>${0}</code>`),r.scope)}),this.renderTemplateOrSlot("table:after"))}__renderCopiableText(e){return o(p||(p=y` <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> `),e,e)}__renderMailToLink(e,r){return e?this.__renderLink(`mailto:${e}`,r):o(_||(_=y`${0}`),r)}__renderLink(e,r){return e?o(b||(b=y` <a target="_blank" class="font-medium text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),e,r):o(m||(m=y`${0}`),r)}__renderTableRow(e){const{label:r,value:t,highlight:s=!1}=e;return o(f||(f=y` <tr class="${0}"> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m">${0}</td> <td class="max-w-0 truncate py-s text-body w-2-3">${0}</td> </tr> `),a({"font-medium text-success":s}),r,t)}__renderTableI18n(e,r){return o(u||(u=y`<foxy-i18n infer="table" key="${0}" .options="${0}"></foxy-i18n>`),e,r)}}customElements.define("foxy-integration-form",x);export{x as IntegrationForm};
@@ -1 +1 @@
1
- import"./shared-7fd9a30f.js";import"./shared-fa9e5c7f.js";import"./shared-3fa791ca.js";import"./shared-b9138e9f.js";import"./shared-18cb3cfc.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-discount-builder.js";import"./foxy-nucleon-element.js";import"./foxy-tax-card.js";import{_ as t,B as i}from"./shared-0f6e4584.js";import{a as r}from"./shared-075796e2.js";import{i as n}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-bab2ea2c.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-e5d37737.js";import"./shared-651c44fa.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-8438d4ca.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";let o,l,s,d,m,p,_,f,c,u,h,y=e=>e;class g extends(r(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null,this.__giftRecipientEmailTemplateLoaderId="gift-recipient-email-template-loader",this.__customerEmailTemplateLoaderId="customer-email-template-loader",this.__adminEmailTemplateLoaderId="admin-email-template-loader"}static get properties(){return t(t({},super.properties),{},{emailTemplates:{attribute:"email-templates"},taxes:{}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.unshift("taxes"),new i(e.join(" ").trim())}renderBody(){var e,t,i,r,s,d,m,p,_,f;const c=this.form.item_delivery_type,u=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none";return a(o||(o=y` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="tax_uri" foreign-key-for-id="tax_id" own-key-for-uri="item_category_uri" own-uri="${0}" embed-key="fx:tax_item_categories" options-href="${0}" links-href="${0}" infer="taxes" class="col-span-2" limit="5" item="foxy-tax-card"> </foxy-internal-async-resource-link-list-control> </div> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),g.__handlingFeeTypeOptions,"none"===u?"":a(l||(l=y` ${0} ${0} ${0} `),this.__renderHandlingFee(),u.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===u?this.__renderHandlingFeeMinimum():""),g.__itemDeliveryTypeOptions,"downloaded"===c?this.__renderDownloadDeliveryControls():"flat_rate"===c?[this.__renderFlatRateControls(),this.__renderCustomsValue()]:"shipped"===c?[this.__renderShippingControls(),this.__renderCustomsValue()]:"",this.form.discount_name?this.__renderDiscountBuilder():"",n(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",null===(i=this.__adminEmailTemplateLoader)||void 0===i?void 0:i.data,(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",n(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),null===(s=this.__customerEmailTemplateLoader)||void 0===s?void 0:s.data,(e=>this.edit({send_customer_email:!!e.detail})),n(null!==(d=this.emailTemplates)&&void 0!==d?d:void 0),null===(m=this.__giftRecipientEmailTemplateLoader)||void 0===m?void 0:m.data,n(null===(p=this.data)||void 0===p?void 0:p._links.self.href),n(null!==(_=this.taxes)&&void 0!==_?_:void 0),n(null===(f=this.data)||void 0===f?void 0:f._links["fx:tax_item_categories"].href),super.renderBody(),n(this.form.customer_email_template_uri||void 0),this.__customerEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.gift_recipient_email_template_uri||void 0),this.__giftRecipientEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.admin_email_template_uri||void 0),this.__adminEmailTemplateLoaderId,(()=>this.requestUpdate()))}get __giftRecipientEmailTemplateLoader(){const e=this.__giftRecipientEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __customerEmailTemplateLoader(){const e=this.__customerEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __adminEmailTemplateLoader(){const e=this.__adminEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}__renderHandlingFee(){return a(s||(s=y` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return a(d||(d=y` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return a(m||(m=y` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return a(p||(p=y` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return a(_||(_=y` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),g.__shippingFlatRateTypeOptions)}__renderShippingControls(){return a(f||(f=y` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),g.__defaultWeightUnitOptions,g.__defaultLengthUnitOptions)}__renderCustomsValue(){return a(c||(c=y` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const i={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return a(u||(u=y` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),i,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return a(h||(h=y`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}}g.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],g.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],g.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],g.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],g.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",g);export{g as ItemCategoryForm};
1
+ import"./shared-7fd9a30f.js";import"./shared-7ce91c80.js";import"./shared-cdf20ded.js";import"./shared-f07d15d6.js";import"./shared-e96c5384.js";import"./shared-3ea78c8d.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-email-template-card.js";import"./foxy-discount-builder.js";import"./foxy-tax-card.js";import"./shared-f1d2b5bb.js";import{_ as t,B as r}from"./shared-0f6e4584.js";import{a as n}from"./shared-075796e2.js";import{i}from"./shared-9803aa7c.js";import{h as o,s as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-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-nucleon-element.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-bab2ea2c.js";import"./shared-b98b8d02.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-8438d4ca.js";let l,s,d,m,p,u,f,_,c,y,h,g=e=>e;class x extends(n(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null}static get properties(){return t(t({},super.properties),{},{emailTemplates:{attribute:"email-templates"},taxes:{}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative"]}get readonlySelector(){var e;const t=[super.readonlySelector.toString()];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.unshift("code","name"),new r(t.join(" ").trim())}get hiddenSelector(){var e;const t=[super.hiddenSelector.toString()];return this.data||t.unshift("taxes"),"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&t.unshift("delete"),new r(t.join(" ").trim())}renderBody(){var e,t,r,n,m;const p=this.form.item_delivery_type,u=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none";return o(l||(l=g` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control infer="name" layout="summary-item"></foxy-internal-text-control> <foxy-internal-text-control infer="code" layout="summary-item"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="tax_uri" foreign-key-for-id="tax_id" own-key-for-uri="item_category_uri" options-href="${0}" links-href="${0}" embed-key="fx:tax_item_categories" own-uri="${0}" infer="taxes" limit="5" item="foxy-tax-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="delivery"> <foxy-internal-select-control layout="summary-item" infer="item-delivery-type" .options="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="handling-and-discount"> <foxy-internal-select-control layout="summary-item" infer="handling-fee-type" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="discount-name"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="gift-recipient-email-template-uri" item="foxy-email-template-card"> </foxy-internal-resource-picker-control> <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="wip_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> </foxy-internal-summary-control> ${0} `),this.renderHeader(),i(null!==(t=this.taxes)&&void 0!==t?t:void 0),i(null===(r=this.data)||void 0===r?void 0:r._links["fx:tax_item_categories"].href),i(null===(n=this.data)||void 0===n?void 0:n._links.self.href),x.__itemDeliveryTypeOptions,"downloaded"===p?this.__renderDownloadDeliveryControls():"flat_rate"===p?[this.__renderFlatRateControls(),this.__renderCustomsValue()]:"shipped"===p?[this.__renderShippingControls(),this.__renderCustomsValue()]:"",x.__handlingFeeTypeOptions,"none"===u?"":o(s||(s=g` ${0} ${0} ${0} `),this.__renderHandlingFee(),u.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===u?this.__renderHandlingFeeMinimum():""),this.form.discount_name?this.__renderDiscountBuilder():"",i(null!==(m=this.emailTemplates)&&void 0!==m?m:void 0),a(d||(d=g`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),super.renderBody())}__renderHandlingFee(){return o(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="handling-fee" min="0"> </foxy-internal-number-control> `))}__renderHandlingFeePercentage(){return o(p||(p=g` <foxy-internal-number-control layout="summary-item" suffix="%" infer="handling-fee-percentage" min="0"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return o(u||(u=g` <foxy-internal-number-control layout="summary-item" infer="handling-fee-minimum" min="0"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return o(f||(f=g` <foxy-internal-number-control layout="summary-item" infer="max-downloads-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="max-downloads-time-period" step="1" min="0"> </foxy-internal-number-control> `))}__renderFlatRateControls(){return o(_||(_=g` <foxy-internal-number-control layout="summary-item" infer="shipping-flat-rate" min="0"> </foxy-internal-number-control> <foxy-internal-select-control layout="summary-item" infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),x.__shippingFlatRateTypeOptions)}__renderShippingControls(){return o(c||(c=g` <foxy-internal-number-control layout="summary-item" infer="default-weight" min="0"> </foxy-internal-number-control> <foxy-internal-select-control layout="summary-item" infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),x.__defaultWeightUnitOptions,x.__defaultLengthUnitOptions)}__renderCustomsValue(){return o(y||(y=g` <foxy-internal-number-control layout="summary-item" infer="customs-value" min="0"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const r={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return o(h||(h=g` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),r,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}}x.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],x.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],x.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],x.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],x.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",x);export{x as ItemCategoryForm};
@@ -1,4 +1,4 @@
1
- import"./shared-6a4e81ad.js";import"./shared-e5d37737.js";import{h as t,P as e}from"./shared-30221a16.js";import{E as r,T as o}from"./shared-8f7a31e0.js";import{C as i}from"./shared-61ade33e.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-f8723f3f.js";import"./shared-72f41a65.js";import"./shared-3fa791ca.js";import"./shared-b9138e9f.js";import"./shared-588c6b15.js";import"./shared-cbb0e610.js";import{I as s}from"./shared-8c1df97c.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as a}from"./shared-0f6e4584.js";import{a as n}from"./shared-075796e2.js";import{i as l}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-2d723710.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-df00a537.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-77c4acdd.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-8438d4ca.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";const m=t`<dom-module id="lumo-details" theme-for="vaadin-details">
1
+ import"./shared-6a4e81ad.js";import"./shared-e5d37737.js";import{h as t,P as e}from"./shared-30221a16.js";import{E as r,T as o}from"./shared-8f7a31e0.js";import{C as i}from"./shared-61ade33e.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-f8723f3f.js";import"./shared-72f41a65.js";import"./shared-3fa791ca.js";import"./shared-f07d15d6.js";import"./shared-3ea78c8d.js";import"./shared-cbb0e610.js";import{I as s}from"./shared-8c1df97c.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as a}from"./shared-0f6e4584.js";import{a as n}from"./shared-075796e2.js";import{i as l}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-2d723710.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-df00a537.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-77c4acdd.js";import"./shared-22ba9566.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-8438d4ca.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";const m=t`<dom-module id="lumo-details" theme-for="vaadin-details">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-b9138e9f.js";import"./shared-588c6b15.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,o=r=>r;class t extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return s(a||(a=o` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="value" class="col-span-2"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-item-option-form",t);export{t as ItemOptionForm};
1
+ import"./shared-f07d15d6.js";import"./shared-3ea78c8d.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,o=r=>r;class t extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return s(a||(a=o` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="value" class="col-span-2"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-item-option-form",t);export{t as ItemOptionForm};