@foxy.io/elements 1.41.0-beta.1 → 1.41.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  2. package/dist/cdn/foxy-coupon-form.js +1 -1
  3. package/dist/cdn/foxy-transaction.js +1 -1
  4. package/dist/cdn/translations/coupon-form/en.json +15 -0
  5. package/dist/cdn/translations/transaction/en.json +60 -35
  6. package/dist/elements/public/CouponForm/CouponForm.js +16 -1
  7. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  8. package/dist/elements/public/Transaction/Transaction.js +5 -3
  9. package/dist/elements/public/Transaction/Transaction.js.map +1 -1
  10. package/dist/elements/public/Transaction/index.d.ts +1 -1
  11. package/dist/elements/public/Transaction/index.js +1 -1
  12. package/dist/elements/public/Transaction/index.js.map +1 -1
  13. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +16 -14
  14. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
  15. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.d.ts +1 -1
  16. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js +1 -1
  17. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/dist/cdn/translations/country/zh-cn.json +0 -248
  20. package/dist/cdn/translations/country/zh-hk.json +0 -245
  21. package/dist/cdn/translations/customer-portal/zh-hk.json +0 -1182
  22. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.d.ts +0 -10
  23. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js +0 -60
  24. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js.map +0 -1
  25. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.d.ts +0 -6
  26. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js +0 -8
  27. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js.map +0 -1
@@ -1 +1 @@
1
- import"./shared-7097e2e1.js";import"./shared-8ef0ca65.js";import"./shared-1100bca8.js";import{b as e,I as t}from"./shared-109ec474.js";import"./shared-4d32d19e.js";import{_ as r,B as o}from"./shared-cb58dfcd.js";import{h as i,r as s,s as a}from"./shared-ba5c42c7.js";import{i as n}from"./shared-53e42a77.js";import{A as d}from"./shared-5592ec6e.js";import"./shared-77132fe8.js";import"./shared-88220d9e.js";import"./shared-67f73b81.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./foxy-copy-to-clipboard.js";import{R as l,a as c}from"./shared-11351c00.js";import{g as m}from"./shared-ada5e9f5.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-37348820.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-e41fced3.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-048d5cae.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-47d95cdd.js";import"./shared-6199cae2.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-35a49192.js";import"./foxy-custom-field-card.js";import"./shared-0df46275.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-eb963ba3.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-888018de.js";import"./shared-8b25a098.js";import"./shared-63eef674.js";import"./shared-43637d69.js";import"./shared-9a64bf35.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./foxy-item-form.js";import"./shared-864ff856.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";let f,p,h=e=>e;customElements.define("foxy-internal-post-action-control",class extends e{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null,this.__buttonState="idle",this.__api=new d(this)}static get properties(){return r(r({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{},__buttonState:{}})}renderControl(){var e;return i(f||(f=h` <foxy-internal-confirm-dialog header="header" infer="confirm-dialog" id="confirm-dialog" .messageOptions="${0}" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-notification position="bottom-end" duration="3000" theme="success" id="success-notification" .renderer="${0}"> </vaadin-notification> <vaadin-notification position="bottom-end" duration="3000" theme="error" id="error-notification" .renderer="${0}"> </vaadin-notification> <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="button" key="${0}"></foxy-i18n> </vaadin-button> `),this.messageOptions,(e=>{e.detail.cancelled||this.__sendPost()}),this.__getNotificationRenderer("success"),this.__getNotificationRenderer("error"),n(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly||"idle"!==this.__buttonState,(e=>{const t=e.currentTarget,r=this.renderRoot.querySelector("#confirm-dialog");null==r||r.show(t)}),this.__buttonState)}async __sendPost(){if(this.href&&"idle"===this.__buttonState){this.__buttonState="busy";const e=(await this.__api.fetch(this.href,{method:"POST"})).ok?"success":"error",t=`#${e}-notification`,r=this.renderRoot.querySelector(t);null==r||r.open(),this.__buttonState="idle",this.dispatchEvent(new CustomEvent(e))}}__getNotificationRenderer(e){return t=>{t.firstElementChild||(t.innerHTML="<span></span>");const r=i(p||(p=h` <foxy-i18n style="color:var(--lumo-${0}-contrast-color)" lang="${0}" key="${0}" ns="${0} notification"> </foxy-i18n> `),e,this.lang,e,this.ns);s(r,t.firstElementChild)}}});let u,y=e=>e;class x extends(l(e)){constructor(){super(...arguments),this.search=null}static get properties(){return r(r({},super.properties),{},{search:{}})}renderControl(){var e,t;const r=this.nucleon;let o;try{const i=new URL(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:sub_token_url"].href)&&void 0!==t?t:"");if(this.search){const e=new URLSearchParams(i.search);i.search=this.search,e.forEach(((e,t)=>i.searchParams.set(t,e)))}o=i.toString()}catch(e){o=void 0}return i(u||(u=y` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> &bull; </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),o)}}customElements.define("foxy-internal-admin-subscription-form-link-control",x);let j,b,v=e=>e;customElements.define("foxy-internal-admin-subscription-form-error",class extends e{renderControl(){var e,t;return i(j||(j=v` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),a(b||(b=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error_message)}});let g,_,k,w,$=e=>e;const S=c(t,"admin-subscription-form");class P extends S{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return r(r({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){var e,t;const r=["delete",super.hiddenSelector.toString()];return(null===(e=this.data)||void 0===e?void 0:e.error_message)||r.unshift("error-message"),(null===(t=this.data)||void 0===t?void 0:t.is_active)||r.unshift("view-action","cancel-action"),new o(r.join(" ").trim())}get headerSubtitleKey(){const e=m(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderBody(){var e,t,r,o,s,d,l,c;let m;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");r.searchParams.set("zoom","items"),m=r.toString()}catch(e){m=void 0}const f=null===(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:charge_past_due"])||void 0===o?void 0:o.href,p=null===(s=this.data)||void 0===s?void 0:s.past_due_amount,h=null===(d=this.data)||void 0===d?void 0:d._embedded["fx:transaction_template"].currency_code;return i(g||(g=$` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),n(h),f&&h&&p?i(_||(_=$` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${p} ${h}`}),f,(()=>this.refresh())):"",a(k||(k=$`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?i(w||(w=$` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),n(null===(c=null===(l=this.data)||void 0===l?void 0:l._links)||void 0===c?void 0:c["fx:attributes"].href),n(m),super.renderBody())}}customElements.define("foxy-admin-subscription-form",P);export{P as AdminSubscriptionForm};
1
+ import"./foxy-transaction.js";import"./shared-7097e2e1.js";import"./shared-77132fe8.js";import"./shared-88220d9e.js";import"./shared-67f73b81.js";import{b as r,I as e}from"./shared-109ec474.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-copy-to-clipboard.js";import"./shared-4d32d19e.js";import{_ as t,B as o}from"./shared-cb58dfcd.js";import{R as s,a as i}from"./shared-11351c00.js";import{h as a,s as n}from"./shared-ba5c42c7.js";import{g as d}from"./shared-ada5e9f5.js";import{i as l}from"./shared-53e42a77.js";import"./foxy-billing-address-card.js";import"./shared-3661a086.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-f1a70f51.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-4e709717.js";import"./foxy-custom-field-form.js";import"./shared-35a49192.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./shared-f989c70e.js";import"./shared-6199cae2.js";import"./shared-5fd5805c.js";import"./foxy-custom-field-card.js";import"./shared-5212ef4f.js";import"./shared-0df46275.js";import"./shared-5afb584d.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-eb963ba3.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./shared-bab2ea2c.js";import"./foxy-webhook-form.js";import"./shared-888018de.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-be442f26.js";import"./shared-e41fced3.js";import"./shared-63eef674.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-43637d69.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-9a64bf35.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-1100bca8.js";import"./shared-048d5cae.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./foxy-item-form.js";import"./shared-864ff856.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-47d95cdd.js";let m,c=r=>r;class f extends(s(r)){constructor(){super(...arguments),this.search=null}static get properties(){return t(t({},super.properties),{},{search:{}})}renderControl(){var r,e;const t=this.nucleon;let o;try{const s=new URL(null!==(e=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==e?e:"");if(this.search){const r=new URLSearchParams(s.search);s.search=this.search,r.forEach(((r,e)=>s.searchParams.set(e,r)))}o=s.toString()}catch(r){o=void 0}return a(m||(m=c` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> &bull; </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),o)}}customElements.define("foxy-internal-admin-subscription-form-link-control",f);let p,h,u=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends r{renderControl(){var r,e;return a(p||(p=u` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(h||(h=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(e=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===e?void 0:e.error_message)}});let y,x,j,b,v=r=>r;const g=i(e,"admin-subscription-form");class k extends g{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return t(t({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){var r,e;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(e=this.data)||void 0===e?void 0:e.is_active)||t.unshift("view-action","cancel-action"),new o(t.join(" ").trim())}get headerSubtitleKey(){const r=d(this.data);return r?`subtitle_${r}`:super.headerSubtitleKey}renderBody(){var r,e,t,o,s,i,d,m;let c;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),c=t.toString()}catch(r){c=void 0}const f=null===(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:charge_past_due"])||void 0===o?void 0:o.href,p=null===(s=this.data)||void 0===s?void 0:s.past_due_amount,h=null===(i=this.data)||void 0===i?void 0:i._embedded["fx:transaction_template"].currency_code;return a(y||(y=v` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),l(h),f&&h&&p?a(x||(x=v` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${p} ${h}`}),f,(()=>this.refresh())):"",n(j||(j=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?a(b||(b=v` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),l(null===(m=null===(d=this.data)||void 0===d?void 0:d._links)||void 0===m?void 0:m["fx:attributes"].href),l(c),super.renderBody())}}customElements.define("foxy-admin-subscription-form",k);export{k as AdminSubscriptionForm};
@@ -1 +1 @@
1
- import"./shared-57a179b3.js";import"./shared-697d44e6.js";import"./shared-18e3b778.js";import{a as e,I as t}from"./shared-109ec474.js";import{p as r,s}from"./shared-2d596f72.js";import{_ as o,B as i}from"./shared-cb58dfcd.js";import{O as n,T as a}from"./shared-8874ec69.js";import{h as l,c as d,s as c}from"./shared-ba5c42c7.js";import"./shared-4d32d19e.js";import{R as u,a as m}from"./shared-11351c00.js";import{c as p}from"./shared-4e709717.js";import{r as f}from"./shared-5fd5805c.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import"./shared-88220d9e.js";import"./shared-9a64bf35.js";import"./shared-67f73b81.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./foxy-form-dialog.js";import"./shared-1100bca8.js";import"./shared-048d5cae.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-63c32024.js";import"./shared-79d0699c.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-29f60d2f.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-43e2c3f6.js";import"./shared-83c5e004.js";import"./shared-6199cae2.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-3661a086.js";import"./shared-7097e2e1.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-47d95cdd.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(n)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly;return l(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?l(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?l(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),s?l(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(u(e)){static get styles(){return[super.styles,d(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=l(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return l($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,f([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,s;const o={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)o[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?o[e.key]=[...t,...e.items]:(o[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else o[a]=null!==(s=this._value[a])&&void 0!==s?s:[]}this._value=o},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var s,o;const i=null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[];return l(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),p({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),c(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(o=null==e?void 0:e.key)&&void 0!==o?o:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),c(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),f(this.readonly?i:[...i,null],((e,t)=>t),((t,s)=>l(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(s+1):this.t("add_value"),onChange:o=>{const n=[...i];o?null===t?n.push(o):n[s]=o:n.splice(s,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),p({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),c(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return l(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":l(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,M,I,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",o=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),a=this._errorMessage;return l(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:s,type:o,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?l(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!a||this.disabled||this.readonly?"":l(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",o=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return o?this.t("discount_summary",{params:{details:o,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return l(M||(M=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),p({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>l(I||(I=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=u(m(t,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[n.Not,n.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const t=r(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return s(t,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const t=r(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:s(t,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"used_codes",path:"number_of_uses_to_date",type:a.Number},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("coupon-codes","category-restrictions","attributes"),new i(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return l(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,s,o,i,n,a;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return l(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-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(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,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"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(o=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===o?void 0:o._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(a=this.data)||void 0===a?void 0:a._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
1
+ import"./shared-57a179b3.js";import"./shared-697d44e6.js";import"./shared-18e3b778.js";import{a as e,I as t}from"./shared-109ec474.js";import{p as r,s}from"./shared-2d596f72.js";import{_ as o,B as i}from"./shared-cb58dfcd.js";import{O as n,T as a}from"./shared-8874ec69.js";import{h as l,c as d,s as c}from"./shared-ba5c42c7.js";import"./shared-4d32d19e.js";import{R as u,a as m}from"./shared-11351c00.js";import{c as p}from"./shared-4e709717.js";import{r as f}from"./shared-5fd5805c.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import"./shared-88220d9e.js";import"./shared-9a64bf35.js";import"./shared-67f73b81.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./foxy-form-dialog.js";import"./shared-1100bca8.js";import"./shared-048d5cae.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-63c32024.js";import"./shared-79d0699c.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-29f60d2f.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-43e2c3f6.js";import"./shared-83c5e004.js";import"./shared-6199cae2.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-3661a086.js";import"./shared-7097e2e1.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-47d95cdd.js";let y,_,x,b,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(n)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,s=r&&!this.disabled&&!this.readonly;return l(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?l(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?l(x||(x=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),s?l(b||(b=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(u(e)){static get styles(){return[super.styles,d(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=l(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return l($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,f([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,s;const o={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)o[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?o[e.key]=[...t,...e.items]:(o[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else o[a]=null!==(s=this._value[a])&&void 0!==s?s:[]}this._value=o},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var s,o;const i=null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[];return l(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),p({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),c(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(o=null==e?void 0:e.key)&&void 0!==o?o:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),c(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),f(this.readonly?i:[...i,null],((e,t)=>t),((t,s)=>l(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(s+1):this.t("add_value"),onChange:o=>{const n=[...i];o?null===t?n.push(o):n[s]=o:n.splice(s,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),p({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),c(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return l(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":l(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,M,I,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",o=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),a=this._errorMessage;return l(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:s,type:o,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?l(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!a||this.disabled||this.readonly?"":l(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,s=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",o=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return o?this.t("discount_summary",{params:{details:o,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return l(M||(M=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),p({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>l(I||(I=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=u(m(t,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[n.Not,n.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const t=r(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return s(t,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const t=r(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:s(t,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"used_codes",path:"number_of_uses_to_date",type:a.Number},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.push("coupon-codes-stub","category-restrictions-stub","attributes-stub"):e.push("coupon-codes","category-restrictions","attributes"),new i(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return l(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,s,o,i,n,a;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return l(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-summary-control infer="coupon-codes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-restrictions-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="attributes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-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(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,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"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(o=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===o?void 0:o._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(a=this.data)||void 0===a?void 0:a._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
@@ -1 +1 @@
1
- import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-4d32d19e.js";import"./shared-7097e2e1.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import{b as e,I as t}from"./shared-109ec474.js";import"./shared-8ef0ca65.js";import"./shared-1100bca8.js";import{_ as o,B as i}from"./shared-cb58dfcd.js";import{h as r,s}from"./shared-ba5c42c7.js";import{N as n}from"./shared-f83207fb.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as a}from"./shared-bab2ea2c.js";import{i as d}from"./shared-53e42a77.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-11351c00.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-47d95cdd.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-f989c70e.js";import"./shared-6199cae2.js";import"./shared-5fd5805c.js";import"./shared-048d5cae.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-35a49192.js";import"./shared-6957b8e6.js";import"./shared-0df46275.js";import"./shared-eb963ba3.js";import"./shared-cf613436.js";import"./shared-888018de.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-be442f26.js";import"./shared-63eef674.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-9a64bf35.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-8eeddc22.js";import"./shared-864ff856.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-77132fe8.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-88220d9e.js";import"./shared-67f73b81.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=e=>e;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return o(o({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"idle"===e?this.theme:"";return r(f||(f=p` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(e=>!e.detail.cancelled&&this.__submit()),t,"busy"===e||this.disabled,(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),e)}async __submit(){var e;if("busy"!==this.__state)try{this.__state="busy";const t=new n.API(this),o=await t.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(e){this.__state="fail"}}});let m,h,_,v,y=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,i;const n=this.nucleon,c=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e._links["fx:customer"].href,u=c?null===(t=null==n?void 0:n.getCustomerPageHref)||void 0===t?void 0:t.call(n,c):void 0;return r(m||(m=y` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),d(u),d(c),this.__renderCopyAction(s(h||(h=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(a(c)):""),this.__renderCopyAction(s(_||(_=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(e,t,o,i){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return r(v||(v=y` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(i,o)),(e=>"idle"!==s&&e.stopPropagation()),(e=>"idle"!==s&&e.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),e,t,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let x,b,g,j,$,k,w,S=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var e,t,o,i,s,n,a,d,l,c,u,f;const p=this.nucleon;return r(x||(x=S` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.disabledSelector.matches("archive",!0),(()=>{null==p||p.edit({hide_transaction:!(null==p?void 0:p.form.hide_transaction)}),null==p||p.submit()}),(null==p?void 0:p.form.hide_transaction)?"unarchive":"archive")}__renderSendEmailsAction(){var e,t;return r(b||(b=S` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return r(g||(g=S` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return r(j||(j=S` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,o;return r($||($=S` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:refund"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const i=this.nucleon,s=null===(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,n=s?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,s):void 0;return r(k||(k=S` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),d(n))}__renderReceiptAction(){var e,t;const o=this.nucleon;return r(w||(w=S` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),d(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}});let P,A,C,H,L,E,R,I,B,q,G,T=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,i,s,n,a,l,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return r(P||(P=T``));const f=null!==(o=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==s?s:[];return r(A||(A=T` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),d(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(C||(C=T` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>r(H||(H=T` <span>${0}&colon;</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?r(L||(L=T` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>r(E||(E=T` <span>${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(a=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:gift_card_code_logs"])||void 0===a?void 0:a.map((e=>{var t,o,i,s,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,d=null===(s=null===(i=e._embedded)||void 0===i?void 0:i["fx:gift_card_code"])||void 0===s?void 0:s.code;if(a&&d)return r(R||(R=T` <span data-testclass="gift-card-code">${0} &bull; ${0}&colon;</span> <span>${0}</span> `),a,d,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>r(I||(I=T` <span data-testclass="discount">${0}${0}&colon;</span> <span>${0}</span> `),e,t?r(B||(B=T` &bull; ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,i,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===s?void 0:s.currency_code;return r(q||(q=T` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const o=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(G||(G=T` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let U,Z,M,O=e=>e;const W=c(u(t,"transaction"));class z extends W{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const o=e.data._links["fx:send_webhooks"].href,i=new z.API(e),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>a(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{z.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,o;const r=["billing-addresses","datafeed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var e,t,o,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new i(s.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const s=null===(e=this.data)||void 0===e?void 0:e.source,n=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t;const o=super.headerSubtitleBadges;return(null===(e=this.data)||void 0===e?void 0:e.is_test)&&o.push({key:"test"}),(null===(t=this.data)||void 0===t?void 0:t.hide_transaction)&&o.push({key:"archived"}),o}get headerCopyIdValue(){var e,t,o;return null!==(o=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==o?o:""}renderHeaderActions(){return r(U||(U=O` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var e,t,o,i,s,n,a,l,c,u,f,p,m,h,_,v;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==o?o:""),s=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),y=i.toString(),x=r.toString(),b=s.toString()}catch(e){}return r(Z||(Z=O` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-transaction-post-action-control infer="process-webhook" href="${0}"> </foxy-internal-transaction-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(i=this.data)||void 0===i?void 0:i.status)&&void 0!==s?s:"")?r(M||(M=O` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),d(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(l=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},d(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),d(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},d(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),d(null===(m=this.data)||void 0===m?void 0:m._links["fx:attributes"].href),d(y),d(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(_=null===(h=this.data)||void 0===h?void 0:h._links["fx:process_webhook"])||void 0===_?void 0:_.href),d(null===(v=this.data)||void 0===v?void 0:v._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",z);export{z as Transaction};
1
+ import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-4d32d19e.js";import"./shared-7097e2e1.js";import"./shared-8ef0ca65.js";import"./shared-1100bca8.js";import{b as e,I as t}from"./shared-109ec474.js";import{_ as i,B as o}from"./shared-cb58dfcd.js";import{h as r,r as s,s as n}from"./shared-ba5c42c7.js";import{i as a}from"./shared-53e42a77.js";import{A as d}from"./shared-5592ec6e.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as l}from"./shared-bab2ea2c.js";import{c}from"./shared-4e709717.js";import{R as u,a as f}from"./shared-11351c00.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-21e68b72.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-47d95cdd.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-f989c70e.js";import"./shared-6199cae2.js";import"./shared-5fd5805c.js";import"./shared-35a49192.js";import"./shared-6957b8e6.js";import"./shared-0df46275.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-eb963ba3.js";import"./shared-cf613436.js";import"./shared-888018de.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-be442f26.js";import"./shared-63eef674.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-9a64bf35.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-048d5cae.js";import"./shared-8eeddc22.js";import"./shared-864ff856.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-77132fe8.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-88220d9e.js";import"./shared-67f73b81.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let p,h,m=e=>e;customElements.define("foxy-internal-post-action-control",class extends e{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null,this.__buttonState="idle",this.__api=new d(this)}static get properties(){return i(i({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{},__buttonState:{}})}renderControl(){var e;return r(p||(p=m` <foxy-internal-confirm-dialog header="header" infer="confirm-dialog" id="confirm-dialog" .messageOptions="${0}" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-notification position="bottom-end" duration="3000" theme="success" id="success-notification" .renderer="${0}"> </vaadin-notification> <vaadin-notification position="bottom-end" duration="3000" theme="error" id="error-notification" .renderer="${0}"> </vaadin-notification> <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="button" key="${0}"></foxy-i18n> </vaadin-button> `),this.messageOptions,(e=>{e.detail.cancelled||this.__sendPost()}),this.__getNotificationRenderer("success"),this.__getNotificationRenderer("error"),a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly||"idle"!==this.__buttonState,(e=>{const t=e.currentTarget,i=this.renderRoot.querySelector("#confirm-dialog");null==i||i.show(t)}),this.__buttonState)}async __sendPost(){if(this.href&&"idle"===this.__buttonState){this.__buttonState="busy";const e=(await this.__api.fetch(this.href,{method:"POST"})).ok?"success":"error",t=`#${e}-notification`,i=this.renderRoot.querySelector(t);null==i||i.open(),this.__buttonState="idle",this.dispatchEvent(new CustomEvent(e))}}__getNotificationRenderer(e){return t=>{t.firstElementChild||(t.innerHTML="<span></span>");const i=r(h||(h=m` <foxy-i18n style="color:var(--lumo-${0}-contrast-color)" lang="${0}" key="${0}" ns="${0} notification"> </foxy-i18n> `),e,this.lang,e,this.ns);s(i,t.firstElementChild)}}});let _,v,y,x,b=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return i(i({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,i,o;const s=this.nucleon,d=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._links["fx:customer"].href,u=d?null===(t=null==s?void 0:s.getCustomerPageHref)||void 0===t?void 0:t.call(s,d):void 0;return r(_||(_=b` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),c({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),a(u),a(d),this.__renderCopyAction(n(v||(v=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",d?String(l(d)):""),this.__renderCopyAction(n(y||(y=b`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(o=null===(i=null==s?void 0:s.data)||void 0===i?void 0:i.customer_email)&&void 0!==o?o:""))}__renderCopyAction(e,t,i,o){const s=this[i],n="fail"===s?"error":"done"===s?"end":"busy";return r(x||(x=b` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(o,i)),(e=>"idle"!==s&&e.stopPropagation()),(e=>"idle"!==s&&e.stopPropagation()),c({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),e,t,c({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let g,j,$,k,w,S,P,A=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var e,t,i,o,s,n,a,d,l,c,u,f;const p=this.nucleon;return r(g||(g=A` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.disabledSelector.matches("archive",!0),(()=>{null==p||p.edit({hide_transaction:!(null==p?void 0:p.form.hide_transaction)}),null==p||p.submit()}),(null==p?void 0:p.form.hide_transaction)?"unarchive":"archive")}__renderSendEmailsAction(){var e,t;return r(j||(j=A` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return r($||($=A` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,i;return r(k||(k=A` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(i=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===i?void 0:i.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,i;return r(w||(w=A` <foxy-internal-post-action-control infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(i=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:refund"])||void 0===i?void 0:i.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,i;const o=this.nucleon,s=null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,n=s?null===(i=null==o?void 0:o.getSubscriptionPageHref)||void 0===i?void 0:i.call(o,s):void 0;return r(S||(S=A` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),a(n))}__renderReceiptAction(){var e,t;const i=this.nucleon;return r(P||(P=A` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),a(null===(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}});let C,H,L,E,R,B,I,O,q,G,T,M=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,i,o,s,n,d,l,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return r(C||(C=M``));const f=null!==(i=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==i?i:[],p=null!==(s=null===(o=u._embedded)||void 0===o?void 0:o["fx:shipments"])&&void 0!==s?s:[];return r(H||(H=M` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(L||(L=M` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>r(E||(E=M` <span>${0}&colon;</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?r(R||(R=M` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>r(B||(B=M` <span>${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(d=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:gift_card_code_logs"])||void 0===d?void 0:d.map((e=>{var t,i,o,s,n;const a=null===(i=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===i?void 0:i.name,d=null===(s=null===(o=e._embedded)||void 0===o?void 0:o["fx:gift_card_code"])||void 0===s?void 0:s.code;if(a&&d)return r(I||(I=M` <span data-testclass="gift-card-code">${0} &bull; ${0}&colon;</span> <span>${0}</span> `),a,d,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:i})=>r(O||(O=M` <span data-testclass="discount">${0}${0}&colon;</span> <span>${0}</span> `),e,t?r(q||(q=M` &bull; ${0}`),t):"",this.__renderPrice(i,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var e,t,i;return null===(i=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===i?void 0:i.href}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var i,o,s;const n=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===s?void 0:s.currency_code;return r(G||(G=M` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const i=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let o="";return o=["capturing","captured","approved","authorized","pending"].includes(i)?"text-success bg-success-10":i&&"completed"!==i?["problem","pending_fraud_review","rejected","declined"].includes(i)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(T||(T=M` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),o,i)}});let U,Z,N,W=e=>e;const z=u(f(t,"transaction"));class V extends z{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const i=e.data._links["fx:send_webhooks"].href,o=new V.API(e),r=await o.fetch(i,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>l(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{V.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return i(i({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,i;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"])||r.push("items","attributes","custom-fields"),new o(r.join(" ").trim())}get hiddenSelector(){var e,t,i,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(i=this.__storeLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new o(s.join(" ").trim())}get headerSubtitleOptions(){var e,t,i,o,r;const s=null===(e=this.data)||void 0===e?void 0:e.source,n=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(i=this.data)||void 0===i?void 0:i._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(o=this.data)||void 0===o?void 0:o.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t;const i=super.headerSubtitleBadges;return(null===(e=this.data)||void 0===e?void 0:e.is_test)&&i.push({key:"test"}),(null===(t=this.data)||void 0===t?void 0:t.hide_transaction)&&i.push({key:"archived"}),i}get headerCopyIdValue(){var e,t,i;return null!==(i=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==i?i:""}renderHeaderActions(){return r(U||(U=W` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var e,t,i,o,s,n,d,l,c,u,f,p,h,m,_,v;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(i=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==i?i:""),s=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),y=o.toString(),x=r.toString(),b=s.toString()}catch(e){}return r(Z||(Z=W` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==s?s:"")?r(N||(N=W` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),a(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(l=null===(d=this.__storeLoader)||void 0===d?void 0:d.data)||void 0===l?void 0:l._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},a(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),a(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},a(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),a(null===(h=this.data)||void 0===h?void 0:h._links["fx:attributes"].href),a(y),a(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},a(null===(_=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===_?void 0:_.href),(()=>this.refresh()),a(null===(v=this.data)||void 0===v?void 0:v._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",V);export{V as Transaction};
@@ -171,6 +171,11 @@
171
171
  "description": "Description",
172
172
  "url_parameter": "URL parameter"
173
173
  },
174
+ "coupon-codes-stub": {
175
+ "label": "Codes",
176
+ "helper_text": "",
177
+ "text": "Coupon codes can be added after creating the coupon."
178
+ },
174
179
  "coupon-codes": {
175
180
  "label": "Codes",
176
181
  "delete_header": "Remove code?",
@@ -349,6 +354,11 @@
349
354
  "value": "Value"
350
355
  }
351
356
  },
357
+ "attributes-stub": {
358
+ "label": "Attributes",
359
+ "helper_text": "",
360
+ "text": "Attributes can be added after creating the coupon."
361
+ },
352
362
  "attributes": {
353
363
  "label": "Attributes",
354
364
  "delete_header": "Remove attribute?",
@@ -546,6 +556,11 @@
546
556
  "option_name": "Option name",
547
557
  "rule": "Rule"
548
558
  },
559
+ "category-restrictions-stub": {
560
+ "label": "Item category restrictions",
561
+ "helper_text": "",
562
+ "text": "Item category restrictions can be added after creating the coupon."
563
+ },
549
564
  "category-restrictions": {
550
565
  "label": "Item category restrictions",
551
566
  "status_saving": "Saving...",
@@ -869,14 +869,19 @@
869
869
  "unchecked": "Not sent"
870
870
  },
871
871
  "process-webhook": {
872
- "idle": "Resend datafeed",
873
- "busy": "Resending datafeed...",
874
- "fail": "Failed to resend datafeed",
875
- "confirm": {
876
- "header": "Resend datafeed",
877
- "message": "Are you sure you'd like to resend XML datafeed for this transaction?",
872
+ "button": {
873
+ "idle": "Resend datafeed",
874
+ "busy": "Processing..."
875
+ },
876
+ "notification": {
877
+ "success": "XML datafeed resent successfully",
878
+ "error": "Failed to resend datafeed"
879
+ },
880
+ "confirm-dialog": {
881
+ "message": "This will attempt to resend the XML datafeed. Would you like to proceed?",
878
882
  "confirm": "Yes",
879
- "cancel": "No"
883
+ "cancel": "No",
884
+ "header": "Resend datafeed"
880
885
  }
881
886
  }
882
887
  },
@@ -1674,47 +1679,67 @@
1674
1679
  },
1675
1680
  "actions": {
1676
1681
  "capture": {
1677
- "idle": "Capture",
1678
- "busy": "Capturing...",
1679
- "fail": "Failed to capture",
1680
- "confirm": {
1681
- "header": "Capture",
1682
- "message": "Are you sure you'd like to capture this transaction?",
1682
+ "button": {
1683
+ "idle": "Capture",
1684
+ "busy": "Processing..."
1685
+ },
1686
+ "notification": {
1687
+ "success": "Captured successfully",
1688
+ "error": "Failed to capture"
1689
+ },
1690
+ "confirm-dialog": {
1691
+ "message": "This will attempt to capture this transaction. Would you like to proceed?",
1683
1692
  "confirm": "Yes",
1684
- "cancel": "No"
1693
+ "cancel": "No",
1694
+ "header": "Capture"
1685
1695
  }
1686
1696
  },
1687
1697
  "void": {
1688
- "idle": "Void",
1689
- "busy": "Voiding...",
1690
- "fail": "Failed to void",
1691
- "confirm": {
1692
- "header": "Void",
1693
- "message": "Are you sure you'd like to void this transaction?",
1698
+ "button": {
1699
+ "idle": "Void",
1700
+ "busy": "Processing..."
1701
+ },
1702
+ "notification": {
1703
+ "success": "Voided successfully",
1704
+ "error": "Failed to void"
1705
+ },
1706
+ "confirm-dialog": {
1707
+ "message": "This will attempt to void this transaction. Would you like to proceed?",
1694
1708
  "confirm": "Yes",
1695
- "cancel": "No"
1709
+ "cancel": "No",
1710
+ "header": "Void"
1696
1711
  }
1697
1712
  },
1698
1713
  "refund": {
1699
- "idle": "Refund",
1700
- "busy": "Refunding...",
1701
- "fail": "Failed to refund",
1702
- "confirm": {
1703
- "header": "Refund",
1704
- "message": "Are you sure you'd like to refund this transaction?",
1714
+ "button": {
1715
+ "idle": "Refund",
1716
+ "busy": "Processing..."
1717
+ },
1718
+ "notification": {
1719
+ "success": "Refunded successfully",
1720
+ "error": "Failed to refund"
1721
+ },
1722
+ "confirm-dialog": {
1723
+ "message": "This will attempt to refund this transaction. Would you like to proceed?",
1705
1724
  "confirm": "Yes",
1706
- "cancel": "No"
1725
+ "cancel": "No",
1726
+ "header": "Refund"
1707
1727
  }
1708
1728
  },
1709
1729
  "send-emails": {
1710
- "idle": "Resend emails",
1711
- "busy": "Resending emails...",
1712
- "fail": "Failed to resend emails",
1713
- "confirm": {
1714
- "header": "Send emails",
1715
- "message": "Are you sure you'd like to send emails for this transaction?",
1730
+ "button": {
1731
+ "idle": "Resend emails",
1732
+ "busy": "Sending..."
1733
+ },
1734
+ "notification": {
1735
+ "success": "Emails resent successfully",
1736
+ "error": "Failed to resend emails"
1737
+ },
1738
+ "confirm-dialog": {
1739
+ "message": "This will attempt to resend emails for this transaction. Would you like to proceed?",
1716
1740
  "confirm": "Yes",
1717
- "cancel": "No"
1741
+ "cancel": "No",
1742
+ "header": "Resend emails"
1718
1743
  }
1719
1744
  },
1720
1745
  "subscription": {
@@ -170,7 +170,10 @@ export class CouponForm extends Base {
170
170
  }
171
171
  get hiddenSelector() {
172
172
  const alwaysMatch = [super.hiddenSelector.toString()];
173
- if (!this.data) {
173
+ if (this.data) {
174
+ alwaysMatch.push('coupon-codes-stub', 'category-restrictions-stub', 'attributes-stub');
175
+ }
176
+ else {
174
177
  alwaysMatch.push('coupon-codes', 'category-restrictions', 'attributes');
175
178
  }
176
179
  return new BooleanSelector(alwaysMatch.join(' ').trim());
@@ -220,6 +223,10 @@ export class CouponForm extends Base {
220
223
  <foxy-internal-coupon-form-rules-control infer="rules">
221
224
  </foxy-internal-coupon-form-rules-control>
222
225
 
226
+ <foxy-internal-summary-control infer="coupon-codes-stub">
227
+ <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p>
228
+ </foxy-internal-summary-control>
229
+
223
230
  <foxy-internal-async-list-control
224
231
  first=${codesUrl}
225
232
  limit="5"
@@ -268,6 +275,10 @@ export class CouponForm extends Base {
268
275
  <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control>
269
276
  </foxy-internal-summary-control>
270
277
 
278
+ <foxy-internal-summary-control infer="category-restrictions-stub">
279
+ <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p>
280
+ </foxy-internal-summary-control>
281
+
271
282
  <foxy-internal-async-resource-link-list-control
272
283
  foreign-key-for-uri="item_category_uri"
273
284
  foreign-key-for-id="item_category_id"
@@ -336,6 +347,10 @@ export class CouponForm extends Base {
336
347
  <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control>
337
348
  </foxy-internal-summary-control>
338
349
 
350
+ <foxy-internal-summary-control infer="attributes-stub">
351
+ <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p>
352
+ </foxy-internal-summary-control>
353
+
339
354
  <foxy-internal-async-list-control
340
355
  first=${ifDefined((_g = this.data) === null || _g === void 0 ? void 0 : _g._links['fx:attributes'].href)}
341
356
  limit="5"