@foxy.io/elements 1.33.0-beta.3 → 1.34.0-beta.1

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.
@@ -1 +1 @@
1
- import"./shared-9dd252c7.js";import"./shared-47fe9f56.js";import"./shared-136942c7.js";import"./shared-57373d84.js";import{I as r}from"./shared-e8744e04.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import{a as o}from"./shared-684174e7.js";import"./shared-0d4cdb19.js";import{_ as t,B as e}from"./shared-d1195c27.js";import{i as a}from"./shared-9803aa7c.js";import{h as s,s as i}from"./shared-dc73b9a5.js";import{a as n}from"./shared-70612035.js";import"./shared-ff10b9fb.js";import"./shared-6583e3f9.js";import"./shared-6b578d1a.js";import"./shared-08e73812.js";import"./shared-b8ae5af7.js";import"./shared-61ade33e.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-433ff5ae.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-52c9fa57.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-46189aae.js";import"./shared-705ce87a.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-3ef5dcef.js";import"./shared-25b83adb.js";import"./shared-8d826ccb.js";import"./shared-cc8ce493.js";import"./shared-3db18172.js";import"./shared-f6f4bed5.js";import"./shared-7edf38e9.js";import"./shared-f79438f8.js";import"./shared-f4e03cdc.js";import"./shared-651c44fa.js";import"./shared-56ee26d7.js";import"./shared-a9b8c3ab.js";import"./shared-8d5b9662.js";import"./shared-5cdec81e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";import"./shared-77135874.js";import"./shared-cb24170b.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-69cdc370.js";import"./foxy-custom-field-card.js";import"./shared-2aee2a22.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-2bf89a21.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-1d0d814b.js";import"./shared-4f33425a.js";import"./shared-a2616e4b.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-148214ee.js";import"./foxy-item-card.js";import"./shared-1acbd965.js";import"./foxy-item-form.js";import"./shared-b73aaedb.js";import"./shared-67d1de9a.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-8a65adfd.js";import"./foxy-customer-card.js";let d,m=r=>r;customElements.define("foxy-internal-admin-subscription-form-load-in-cart-action",class extends o{constructor(){super(...arguments),this.action=null}static get properties(){return t(t({},super.properties),{},{action:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const a=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");"cancel"===this.action&&a.searchParams.set("sub_cancel","true"),e=a.toString()}catch(r){e=void 0}return s(d||(d=m` <a target="_blank" class="rounded font-medium text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="caption"> </foxy-i18n> </a> `),a(e))}});let c,f,l=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends o{renderControl(){var r,o;return s(c||(c=l` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),i(f||(f=l`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let p,h,j=r=>r;const u=n(r,"admin-subscription-form");class y extends u{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderHeaderActions(r){return s(p||(p=j` <foxy-internal-admin-subscription-form-load-in-cart-action infer="view-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> <foxy-internal-admin-subscription-form-load-in-cart-action action="cancel" infer="cancel-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> `))}renderBody(){var r,o,t,e,i;let n;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),n=t.toString()}catch(r){n=void 0}return s(h||(h=j` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),a(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),a(null===(i=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===i?void 0:i["fx:attributes"].href),a(n),super.renderBody())}}customElements.define("foxy-admin-subscription-form",y);export{y as AdminSubscriptionForm};
1
+ import"./shared-9dd252c7.js";import"./shared-47fe9f56.js";import"./shared-136942c7.js";import"./shared-57373d84.js";import{I as r}from"./shared-e8744e04.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import{a as o}from"./shared-684174e7.js";import"./shared-0d4cdb19.js";import{_ as t,B as e}from"./shared-d1195c27.js";import{i as a}from"./shared-9803aa7c.js";import{h as s,s as i}from"./shared-dc73b9a5.js";import{a as n}from"./shared-70612035.js";import"./shared-ff10b9fb.js";import"./shared-6583e3f9.js";import"./shared-6b578d1a.js";import"./shared-08e73812.js";import"./shared-b8ae5af7.js";import"./shared-61ade33e.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-433ff5ae.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-52c9fa57.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-46189aae.js";import"./shared-705ce87a.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-3ef5dcef.js";import"./shared-25b83adb.js";import"./shared-8d826ccb.js";import"./shared-cc8ce493.js";import"./shared-3db18172.js";import"./shared-f6f4bed5.js";import"./shared-7edf38e9.js";import"./shared-f79438f8.js";import"./shared-f4e03cdc.js";import"./shared-651c44fa.js";import"./shared-56ee26d7.js";import"./shared-a9b8c3ab.js";import"./shared-8d5b9662.js";import"./shared-5cdec81e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";import"./shared-77135874.js";import"./shared-cb24170b.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-69cdc370.js";import"./foxy-custom-field-card.js";import"./shared-2aee2a22.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-2bf89a21.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-1d0d814b.js";import"./shared-4f33425a.js";import"./shared-67d1de9a.js";import"./shared-148214ee.js";import"./shared-a2616e4b.js";import"./shared-22ba9566.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-1acbd965.js";import"./foxy-item-form.js";import"./shared-b73aaedb.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-8a65adfd.js";import"./foxy-customer-card.js";let d,m=r=>r;customElements.define("foxy-internal-admin-subscription-form-load-in-cart-action",class extends o{constructor(){super(...arguments),this.action=null}static get properties(){return t(t({},super.properties),{},{action:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const a=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");"cancel"===this.action&&a.searchParams.set("sub_cancel","true"),e=a.toString()}catch(r){e=void 0}return s(d||(d=m` <a target="_blank" class="rounded font-medium text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="caption"> </foxy-i18n> </a> `),a(e))}});let c,f,l=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends o{renderControl(){var r,o;return s(c||(c=l` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),i(f||(f=l`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let p,h,j=r=>r;const u=n(r,"admin-subscription-form");class y extends u{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderHeaderActions(r){return s(p||(p=j` <foxy-internal-admin-subscription-form-load-in-cart-action infer="view-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> <foxy-internal-admin-subscription-form-load-in-cart-action action="cancel" infer="cancel-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> `))}renderBody(){var r,o,t,e,i;let n;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),n=t.toString()}catch(r){n=void 0}return s(h||(h=j` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),a(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),a(null===(i=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===i?void 0:i["fx:attributes"].href),a(n),super.renderBody())}}customElements.define("foxy-admin-subscription-form",y);export{y as AdminSubscriptionForm};
@@ -1 +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-0d4cdb19.js";import"./shared-9dd252c7.js";import"./shared-67d1de9a.js";import"./shared-8a65adfd.js";import{I as e}from"./shared-e8744e04.js";import"./shared-433ff5ae.js";import"./shared-46189aae.js";import{a as t}from"./shared-684174e7.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{h as r,s}from"./shared-dc73b9a5.js";import{N as n}from"./shared-e8b8c8d0.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-9803aa7c.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-70612035.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";import"./shared-52c9fa57.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-77135874.js";import"./shared-ff10b9fb.js";import"./shared-08e73812.js";import"./shared-61ade33e.js";import"./shared-3db18172.js";import"./shared-cb24170b.js";import"./shared-a0c6a159.js";import"./shared-705ce87a.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-69cdc370.js";import"./shared-b8ae5af7.js";import"./shared-2aee2a22.js";import"./shared-641786b2.js";import"./shared-2bf89a21.js";import"./shared-1d0d814b.js";import"./shared-4f33425a.js";import"./shared-25b83adb.js";import"./shared-cc8ce493.js";import"./shared-8d826ccb.js";import"./shared-a2616e4b.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-148214ee.js";import"./shared-f79438f8.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-f4e03cdc.js";import"./shared-651c44fa.js";import"./shared-56ee26d7.js";import"./shared-a9b8c3ab.js";import"./shared-1acbd965.js";import"./shared-b73aaedb.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-47fe9f56.js";import"./shared-3ef5dcef.js";import"./shared-f6f4bed5.js";import"./shared-7edf38e9.js";import"./shared-136942c7.js";import"./shared-57373d84.js";import"./shared-8d5b9662.js";import"./shared-5cdec81e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=e=>e;customElements.define("foxy-internal-transaction-post-action-control",class extends t{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,_,y,v=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends t{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=v` <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=v`<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(_||(_=v`<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(y||(y=v` <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,w,$,k=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends t{renderControl(){var e,t,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </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():"")}__renderSendEmailsAction(){var e,t;return r(b||(b=k` <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=k` <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=k` <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(w||(w=k` <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` <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))}});let S,P,A,C,H,L,E,I,R,B,q=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends t{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(S||(S=q``));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(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&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(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>r(C||(C=q` <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(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>r(L||(L=q` <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:applied_gift_card_codes"])||void 0===a?void 0:a.map((e=>{var t;return r(E||(E=q` <span>${0}&colon;</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t: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((e=>r(I||(I=q` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!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(R||(R=q` <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(B||(B=q` <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 G,T,U,Z=e=>e;const M=c(u(e,"transaction"));class O extends M{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 O.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=>{O.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 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(G||(G=Z` <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,_;let y,v,x;const b=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),i=new URL(null!==(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data._links["fx:webhooks"].href)&&void 0!==t?t:""),r=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),i.searchParams.set("event_resource","transaction"),r.searchParams.set("zoom","item_options"),y=o.toString(),v=i.toString(),x=r.toString()}catch(e){}return r(T||(T=Z` ${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!==(i=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==i?i:"")?r(U||(U=Z` <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===(s=this.data)||void 0===s?void 0:s.status):"",b.matches("items",!0)&&b.matches("summary",!0),d(x),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(a=null===(n=this.__storeLoader)||void 0===n?void 0:n.data)||void 0===a?void 0:a._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href},d(null===(c=this.data)||void 0===c?void 0:c._links["fx:billing_addresses"].href),d(null===(u=this.data)||void 0===u?void 0:u._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},d(null===(f=this.data)||void 0===f?void 0:f._links["fx:custom_fields"].href),d(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),d(y),d(v),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(h=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===h?void 0:h.href),d(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O 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-0d4cdb19.js";import"./shared-9dd252c7.js";import"./shared-67d1de9a.js";import"./shared-8a65adfd.js";import{I as e}from"./shared-e8744e04.js";import"./shared-433ff5ae.js";import"./shared-46189aae.js";import{a as t}from"./shared-684174e7.js";import{_ as o,B as i}from"./shared-d1195c27.js";import{h as r,s}from"./shared-dc73b9a5.js";import{N as n}from"./shared-e8b8c8d0.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-9803aa7c.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-70612035.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";import"./shared-52c9fa57.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-77135874.js";import"./shared-ff10b9fb.js";import"./shared-08e73812.js";import"./shared-61ade33e.js";import"./shared-3db18172.js";import"./shared-cb24170b.js";import"./shared-a0c6a159.js";import"./shared-705ce87a.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-69cdc370.js";import"./shared-b8ae5af7.js";import"./shared-2aee2a22.js";import"./shared-641786b2.js";import"./shared-2bf89a21.js";import"./shared-1d0d814b.js";import"./shared-4f33425a.js";import"./shared-25b83adb.js";import"./shared-cc8ce493.js";import"./shared-8d826ccb.js";import"./shared-148214ee.js";import"./shared-f79438f8.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-f4e03cdc.js";import"./shared-651c44fa.js";import"./shared-56ee26d7.js";import"./shared-a9b8c3ab.js";import"./shared-a2616e4b.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-1acbd965.js";import"./shared-b73aaedb.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-47fe9f56.js";import"./shared-3ef5dcef.js";import"./shared-f6f4bed5.js";import"./shared-7edf38e9.js";import"./shared-136942c7.js";import"./shared-57373d84.js";import"./shared-8d5b9662.js";import"./shared-5cdec81e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=e=>e;customElements.define("foxy-internal-transaction-post-action-control",class extends t{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,_,y,v=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends t{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=v` <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=v`<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(_||(_=v`<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(y||(y=v` <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,w,$,k=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends t{renderControl(){var e,t,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </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():"")}__renderSendEmailsAction(){var e,t;return r(b||(b=k` <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=k` <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=k` <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(w||(w=k` <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` <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))}});let S,P,A,C,H,L,E,I,R,B,q=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends t{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(S||(S=q``));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(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&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(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>r(C||(C=q` <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(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>r(L||(L=q` <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:applied_gift_card_codes"])||void 0===a?void 0:a.map((e=>{var t;return r(E||(E=q` <span>${0}&colon;</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t: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((e=>r(I||(I=q` <span data-testclass="discount">${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!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(R||(R=q` <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(B||(B=q` <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 G,T,U,Z=e=>e;const M=c(u(e,"transaction"));class O extends M{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 O.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=>{O.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 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(G||(G=Z` <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,_;let y,v,x;const b=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),i=new URL(null!==(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data._links["fx:webhooks"].href)&&void 0!==t?t:""),r=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),i.searchParams.set("event_resource","transaction"),r.searchParams.set("zoom","item_options"),y=o.toString(),v=i.toString(),x=r.toString()}catch(e){}return r(T||(T=Z` ${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!==(i=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==i?i:"")?r(U||(U=Z` <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===(s=this.data)||void 0===s?void 0:s.status):"",b.matches("items",!0)&&b.matches("summary",!0),d(x),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(a=null===(n=this.__storeLoader)||void 0===n?void 0:n.data)||void 0===a?void 0:a._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href},d(null===(c=this.data)||void 0===c?void 0:c._links["fx:billing_addresses"].href),d(null===(u=this.data)||void 0===u?void 0:u._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},d(null===(f=this.data)||void 0===f?void 0:f._links["fx:custom_fields"].href),d(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),d(y),d(v),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(h=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===h?void 0:h.href),d(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O as Transaction};
@@ -1 +1 @@
1
- import"./shared-77135874.js";import"./shared-9dd252c7.js";import"./shared-1d0d814b.js";import"./shared-a2616e4b.js";import{I as r}from"./shared-e8744e04.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{_ as e,B as t}from"./shared-d1195c27.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-70612035.js";import{i as a}from"./shared-9803aa7c.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-ff10b9fb.js";import"./shared-6583e3f9.js";import"./shared-08e73812.js";import"./shared-61ade33e.js";import"./shared-3db18172.js";import"./shared-6b578d1a.js";import"./shared-684174e7.js";import"./shared-51c4a6dd.js";import"./shared-0d4cdb19.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-b8ae5af7.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-433ff5ae.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-52c9fa57.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-46189aae.js";import"./shared-705ce87a.js";import"./foxy-pagination.js";import"./shared-4f33425a.js";import"./shared-25b83adb.js";import"./shared-cc8ce493.js";import"./shared-8d826ccb.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";let n,d,c=r=>r;class p extends(s(r,"webhook-form")){constructor(){super(...arguments),this.resourceUri=null,this.__encryptionKeyGeneratorOptions={separator:"",length:512},this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get properties(){return e(e({},super.properties),{},{resourceUri:{attribute:"resource-uri"}})}static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=255||"name:v8n_too_long",({url:r})=>!r||r.length<=1e3||"url:v8n_too_long",({query:r})=>!r||r.length<=1e3||"query:v8n_too_long",({encryption_key:r})=>!!r||"encryption-key:v8n_required",({encryption_key:r})=>!r||r.length<=1e3||"encryption-key:v8n_too_long"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.data&&r.unshift("event-resource"),new t(r.join(" ").trim())}get headerSubtitleOptions(){var r,e;const t=null===(r=this.data)||void 0===r?void 0:r.format;return{context:"json"===t?null===(e=this.data)||void 0===e?void 0:e.event_resource:t}}edit(r){super.edit(r),this.form.format||super.edit({format:"json"}),this.form.version||super.edit({version:2})}renderBody(){var r,e,t,s;const p=this.resourceUri?o(this.resourceUri):null;let l,h;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:statuses"].href)&&void 0!==e?e:"");null!==p&&t.searchParams.set("resource_id",String(p)),t.searchParams.set("order","date_created desc"),l=t.toString()}catch(r){l=void 0}try{const r=new URL(null!==(s=null===(t=this.data)||void 0===t?void 0:t._links["fx:logs"].href)&&void 0!==s?s:"");null!==p&&r.searchParams.set("resource_id",String(p)),r.searchParams.set("order","date_created desc"),h=r.toString()}catch(r){h=void 0}return i(n||(n=c` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="event-resource" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="query"></foxy-internal-text-control> <foxy-internal-text-control infer="url"></foxy-internal-text-control> <foxy-internal-password-control infer="encryption-key" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} ${0} `),this.renderHeader(),this.__eventResources,this.__encryptionKeyGeneratorOptions,this.data?i(d||(d=c` <foxy-internal-async-list-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" infer="logs" limit="10" item="foxy-webhook-log-card"> </foxy-internal-async-list-control> `),a(l),a(h)):"",super.renderBody())}}customElements.define("foxy-webhook-form",p);export{p as WebhookForm};
1
+ import"./shared-9dd252c7.js";import"./shared-1d0d814b.js";import"./shared-67d1de9a.js";import"./shared-148214ee.js";import"./shared-cb24170b.js";import"./shared-a2616e4b.js";import{I as e}from"./shared-e8744e04.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{g as s}from"./shared-bab2ea2c.js";import{a as o}from"./shared-70612035.js";import{i as a}from"./shared-9803aa7c.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-ff10b9fb.js";import"./shared-6583e3f9.js";import"./shared-6b578d1a.js";import"./shared-08e73812.js";import"./shared-b8ae5af7.js";import"./shared-61ade33e.js";import"./shared-83c8a2d2.js";import"./shared-2dd2ff95.js";import"./shared-95a591b3.js";import"./shared-433ff5ae.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-52c9fa57.js";import"./shared-0d4cdb19.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-46189aae.js";import"./shared-705ce87a.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-684174e7.js";import"./shared-51c4a6dd.js";import"./shared-4f33425a.js";import"./shared-25b83adb.js";import"./shared-cc8ce493.js";import"./shared-3db18172.js";import"./shared-8d826ccb.js";import"./shared-f79438f8.js";import"./shared-f4e03cdc.js";import"./shared-651c44fa.js";import"./shared-56ee26d7.js";import"./shared-a9b8c3ab.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-66e2a4ee.js";import"./shared-a1f697c2.js";import"./shared-ccc7a886.js";import"./shared-6b5e4fe4.js";let n,d=e=>e;class c extends(o(e,"webhook-form")){constructor(){super(...arguments),this.getStatusPageHref=null,this.getLogPageHref=null,this.resourceUri=null,this.__encryptionKeyGeneratorOptions={separator:"",length:512},this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get properties(){return r(r({},super.properties),{},{getStatusPageHref:{attribute:!1},getLogPageHref:{attribute:!1},resourceUri:{attribute:"resource-uri"}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({url:e})=>!e||e.length<=1e3||"url:v8n_too_long",({query:e})=>!e||e.length<=1e3||"query:v8n_too_long",({encryption_key:e})=>!!e||"encryption-key:v8n_required",({encryption_key:e})=>!e||e.length<=1e3||"encryption-key:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.unshift("general:event-resource"):e.unshift("logs","statuses"),new t(e.join(" ").trim())}get headerSubtitleOptions(){var e,r;const t=null===(e=this.data)||void 0===e?void 0:e.format;return{context:"json"===t?null===(r=this.data)||void 0===r?void 0:r.event_resource:t}}edit(e){super.edit(e),this.form.format||super.edit({format:"json"}),this.form.version||super.edit({version:2})}renderBody(){var e,r,t,o;const c=this.resourceUri?s(this.resourceUri):null;let m,l;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:statuses"].href)&&void 0!==r?r:"");null!==c&&t.searchParams.set("resource_id",String(c)),t.searchParams.set("order","date_created desc"),m=t.toString()}catch(e){m=void 0}try{const e=new URL(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:logs"].href)&&void 0!==o?o:"");null!==c&&e.searchParams.set("resource_id",String(c)),e.searchParams.set("order","date_created desc"),l=e.toString()}catch(e){l=void 0}return i(n||(n=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="event-resource" .options="${0}"> </foxy-internal-select-control> <foxy-internal-password-control layout="summary-item" infer="encryption-key" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-source-control infer="query"></foxy-internal-source-control> <foxy-internal-source-control infer="url"></foxy-internal-source-control> <foxy-internal-async-list-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card" .getPageHref="${0}" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" infer="logs" limit="10" item="foxy-webhook-log-card" .getPageHref="${0}" .itemProps="${0}"> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),this.__eventResources,this.__encryptionKeyGeneratorOptions,a(m),this.getStatusPageHref,this.resourceUri?{layout:"resource"}:{},a(l),this.getLogPageHref,this.resourceUri?{layout:"resource"}:{},super.renderBody())}}customElements.define("foxy-webhook-form",c);export{c as WebhookForm};
@@ -1 +1 @@
1
- import"./shared-0d4cdb19.js";import"./shared-ccc7a886.js";import{a as s}from"./shared-70612035.js";import{I as e}from"./shared-6b5e4fe4.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-d1195c27.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./foxy-spinner.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-52c9fa57.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let a,d=s=>s;class t extends(s(e,"webhook-log-card")){renderBody(){var s;const{date_created:e,response_code:t,response_body:o}=null!==(s=this.data)&&void 0!==s?s:{};return r(a||(a=d` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> <span class="text-xs text-tertiary">${0}&ZeroWidthSpace;</span> </p> <p class="text-secondary text-s">${0}&ZeroWidthSpace;</p> </div> `),{value:e},t,o)}}customElements.define("foxy-webhook-log-card",t);export{t as WebhookLogCard};
1
+ import"./shared-0d4cdb19.js";import"./shared-ccc7a886.js";import{_ as s}from"./shared-d1195c27.js";import{a as e}from"./shared-70612035.js";import{I as r}from"./shared-6b5e4fe4.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./foxy-spinner.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-52c9fa57.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let o,a,d=s=>s;class i extends(e(r,"webhook-log-card")){constructor(){super(...arguments),this.layout=null}static get properties(){return s(s({},super.properties),{},{layout:{}})}renderBody(){var s;const{response_body:e,response_code:r,resource_type:i,date_created:p,resource_id:c}=null!==(s=this.data)&&void 0!==s?s:{};return t(o||(o=d` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> ${0} </p> <p class="text-secondary text-s">HTTP ${0} &bull; ${0}</p> </div> `),{value:p},"resource"===this.layout?"":t(a||(a=d`<span class="text-xs text-tertiary capitalize">${0} #${0}</span>`),i,c),r,e)}}customElements.define("foxy-webhook-log-card",i);export{i as WebhookLogCard};
@@ -1 +1 @@
1
- import"./shared-0d4cdb19.js";import"./shared-ccc7a886.js";import{a as s}from"./shared-70612035.js";import{I as e}from"./shared-6b5e4fe4.js";import{h as r}from"./shared-dc73b9a5.js";import{c as t}from"./shared-4e709717.js";import"./shared-d1195c27.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./foxy-spinner.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-52c9fa57.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let a,d=s=>s;const o=s(e,"webhook-status-card");class i extends o{renderBody(){var s,e;const o=null===(s=this.data)||void 0===s?void 0:s.status;return r(a||(a=d` <p class="flex flex-col leading-xs"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> </p> `),{value:null===(e=this.data)||void 0===e?void 0:e.date_created},t({"text-secondary":"pending"===o,"text-success":"successful"===o,"text-error":"failed"===o,"text-s":!0}),o)}}customElements.define("foxy-webhook-status-card",i);export{i as WebhookStatusCard};
1
+ import"./shared-0d4cdb19.js";import"./shared-ccc7a886.js";import{_ as s}from"./shared-d1195c27.js";import{a as e}from"./shared-70612035.js";import{I as r}from"./shared-6b5e4fe4.js";import{h as t}from"./shared-dc73b9a5.js";import{c as a}from"./shared-4e709717.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./foxy-spinner.js";import"./shared-6b578d1a.js";import"./shared-6583e3f9.js";import"./shared-52c9fa57.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let o,d,i=s=>s;const c=e(r,"webhook-status-card");class p extends c{constructor(){super(...arguments),this.layout=null}static get properties(){return s(s({},super.properties),{},{layout:{}})}renderBody(){var s;const{resource_type:e,date_created:r,resource_id:c,status:p}=null!==(s=this.data)&&void 0!==s?s:{};return t(o||(o=i` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> ${0} </p> <p class="${0}"> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </p> </div> `),{value:r},"resource"===this.layout?"":t(d||(d=i`<span class="text-xs text-tertiary capitalize">${0} #${0}</span>`),e,c),a({"text-secondary":"pending"===p,"text-success":"successful"===p,"text-error":"failed"===p,"text-s":!0}),p)}}customElements.define("foxy-webhook-status-card",p);export{p as WebhookStatusCard};
@@ -16,7 +16,7 @@
16
16
  "cart_type_default": "Sidecart",
17
17
  "cart_type_default_explainer": "Default cart appearance in version 2.0",
18
18
  "cart_type_fullpage": "Full page",
19
- "cart_type_fullpage_explainer": "Send all customers to a full page cart while still including minicart functionality",
19
+ "cart_type_fullpage_explainer": "Send all customers to a full page cart while still including mini-cart functionality",
20
20
  "checked_by_default": "Checked by default",
21
21
  "checkout_type": "Accounts",
22
22
  "checkout_type_account_only": "Allow customer accounts only",
@@ -21,39 +21,44 @@
21
21
  "done": "Copied to clipboard"
22
22
  }
23
23
  },
24
- "name": {
25
- "label": "Name",
26
- "placeholder": "My JSON Webhook",
27
- "helper_text": "The name of this webhook.",
28
- "v8n_required": "Webhook name is required",
29
- "v8n_too_long": "Webhook name cannot exceed 255 characters"
24
+ "general": {
25
+ "label": "",
26
+ "helper_text": "",
27
+ "name": {
28
+ "label": "Name",
29
+ "placeholder": "Required",
30
+ "helper_text": "",
31
+ "v8n_required": "Webhook name is required",
32
+ "v8n_too_long": "Webhook name cannot exceed 255 characters"
33
+ },
34
+ "encryption-key": {
35
+ "label": "Encryption key",
36
+ "placeholder": "Required",
37
+ "helper_text": "",
38
+ "v8n_required": "Encryption key is required. Use the ✨ button to generate a new key.",
39
+ "v8n_too_long": "Encryption key cannot exceed 1000 characters"
40
+ },
41
+ "event-resource": {
42
+ "label": "Resource",
43
+ "helper_text": "",
44
+ "placeholder": "Select...",
45
+ "event_resource_subscription": "Subscription",
46
+ "event_resource_transaction": "Transaction",
47
+ "event_resource_customer": "Customer"
48
+ }
30
49
  },
31
50
  "url": {
32
- "label": "URL",
33
- "placeholder": "https://example.com/webhook",
34
- "helper_text": "The endpoint where we will send the webhook data.",
51
+ "label": "Endpoint",
52
+ "placeholder": "Example: https://example.com/webhook",
53
+ "helper_text": "",
35
54
  "v8n_too_long": "URL cannot exceed 1000 characters"
36
55
  },
37
56
  "query": {
38
57
  "label": "Query",
39
- "placeholder": "zoom=items,items:options,customer",
40
- "helper_text": "The webhook payload mirrors the API, and you can include more or less data according to your needs using zoom and other modifiers.",
58
+ "placeholder": "Example: zoom=items,items:options,customer",
59
+ "helper_text": "",
41
60
  "v8n_too_long": "Query cannot exceed 1000 characters"
42
61
  },
43
- "encryption-key": {
44
- "label": "Encryption key",
45
- "placeholder": "HNL978XVXXCM66DM5N2T78D5MT66BC6D",
46
- "helper_text": "The JSON webhooks are encrypted in certain situations. This key is also used to generate a signature to verify the integrity of the payload.",
47
- "v8n_required": "Encryption key is required. Use the ✨ button to generate a new key.",
48
- "v8n_too_long": "Encryption key cannot exceed 1000 characters"
49
- },
50
- "event-resource": {
51
- "label": "Resource",
52
- "helper_text": "Changes in selected resource type will trigger this webhook. Resource type cannot be changed after the webhook has been created.",
53
- "event_resource_subscription": "Subscription",
54
- "event_resource_transaction": "Transaction",
55
- "event_resource_customer": "Customer"
56
- },
57
62
  "statuses": {
58
63
  "label": "Runs",
59
64
  "pagination": {
@@ -1,7 +1,7 @@
1
1
  import type { PropertyDeclarations } from 'lit-element';
2
2
  import type { TemplateResult } from 'lit-html';
3
3
  import type { NucleonV8N } from '../NucleonElement/types';
4
- import type { Data } from './types';
4
+ import type { Data, WebhookLog } from './types';
5
5
  import { BooleanSelector } from '@foxy.io/sdk/core';
6
6
  import { InternalForm } from '../../internal/InternalForm/InternalForm';
7
7
  declare const WebhookForm_base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
@@ -16,6 +16,10 @@ declare const WebhookForm_base: typeof InternalForm & import("lit-element").Cons
16
16
  export declare class WebhookForm extends WebhookForm_base<Data> {
17
17
  static get properties(): PropertyDeclarations;
18
18
  static get v8n(): NucleonV8N<Data>;
19
+ /** If set, renders Statuses list items as <a> tags. */
20
+ getStatusPageHref: ((statusHref: string, status: WebhookLog) => string | null) | null;
21
+ /** If set, renders Logs list items as <a> tags. */
22
+ getLogPageHref: ((logHref: string, log: WebhookLog) => string | null) | null;
19
23
  /**
20
24
  * Optional URI of a transaction, customer or subscription. When provided,
21
25
  * the form will display logs and statuses for that particular resource only.
@@ -12,6 +12,10 @@ import { html } from 'lit-html';
12
12
  export class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form') {
13
13
  constructor() {
14
14
  super(...arguments);
15
+ /** If set, renders Statuses list items as <a> tags. */
16
+ this.getStatusPageHref = null;
17
+ /** If set, renders Logs list items as <a> tags. */
18
+ this.getLogPageHref = null;
15
19
  /**
16
20
  * Optional URI of a transaction, customer or subscription. When provided,
17
21
  * the form will display logs and statuses for that particular resource only.
@@ -27,6 +31,8 @@ export class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')
27
31
  static get properties() {
28
32
  return {
29
33
  ...super.properties,
34
+ getStatusPageHref: { attribute: false },
35
+ getLogPageHref: { attribute: false },
30
36
  resourceUri: { attribute: 'resource-uri' },
31
37
  };
32
38
  }
@@ -42,8 +48,12 @@ export class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')
42
48
  }
43
49
  get hiddenSelector() {
44
50
  const alwaysMatch = [super.hiddenSelector.toString()];
45
- if (this.data)
46
- alwaysMatch.unshift('event-resource');
51
+ if (this.data) {
52
+ alwaysMatch.unshift('general:event-resource');
53
+ }
54
+ else {
55
+ alwaysMatch.unshift('logs', 'statuses');
56
+ }
47
57
  return new BooleanSelector(alwaysMatch.join(' ').trim());
48
58
  }
49
59
  get headerSubtitleOptions() {
@@ -86,40 +96,48 @@ export class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')
86
96
  return html `
87
97
  ${this.renderHeader()}
88
98
 
89
- <foxy-internal-text-control infer="name"></foxy-internal-text-control>
99
+ <foxy-internal-summary-control infer="general">
100
+ <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control>
90
101
 
91
- <foxy-internal-radio-group-control infer="event-resource" .options=${this.__eventResources}>
92
- </foxy-internal-radio-group-control>
102
+ <foxy-internal-select-control
103
+ layout="summary-item"
104
+ infer="event-resource"
105
+ .options=${this.__eventResources}
106
+ >
107
+ </foxy-internal-select-control>
93
108
 
94
- <foxy-internal-text-control infer="query"></foxy-internal-text-control>
95
- <foxy-internal-text-control infer="url"></foxy-internal-text-control>
109
+ <foxy-internal-password-control
110
+ layout="summary-item"
111
+ infer="encryption-key"
112
+ show-generator
113
+ .generatorOptions=${this.__encryptionKeyGeneratorOptions}
114
+ >
115
+ </foxy-internal-password-control>
116
+ </foxy-internal-summary-control>
96
117
 
97
- <foxy-internal-password-control
98
- infer="encryption-key"
99
- show-generator
100
- .generatorOptions=${this.__encryptionKeyGeneratorOptions}
118
+ <foxy-internal-source-control infer="query"></foxy-internal-source-control>
119
+ <foxy-internal-source-control infer="url"></foxy-internal-source-control>
120
+
121
+ <foxy-internal-async-list-control
122
+ first=${ifDefined(statusesLink)}
123
+ infer="statuses"
124
+ limit="10"
125
+ item="foxy-webhook-status-card"
126
+ .getPageHref=${this.getStatusPageHref}
127
+ .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}
101
128
  >
102
- </foxy-internal-password-control>
129
+ </foxy-internal-async-list-control>
103
130
 
104
- ${this.data
105
- ? html `
106
- <foxy-internal-async-list-control
107
- first=${ifDefined(statusesLink)}
108
- infer="statuses"
109
- limit="10"
110
- item="foxy-webhook-status-card"
111
- >
112
- </foxy-internal-async-list-control>
131
+ <foxy-internal-async-list-control
132
+ first=${ifDefined(logsLink)}
133
+ infer="logs"
134
+ limit="10"
135
+ item="foxy-webhook-log-card"
136
+ .getPageHref=${this.getLogPageHref}
137
+ .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}
138
+ >
139
+ </foxy-internal-async-list-control>
113
140
 
114
- <foxy-internal-async-list-control
115
- first=${ifDefined(logsLink)}
116
- infer="logs"
117
- limit="10"
118
- item="foxy-webhook-log-card"
119
- >
120
- </foxy-internal-async-list-control>
121
- `
122
- : ''}
123
141
  ${super.renderBody()}
124
142
  `;
125
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookForm.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/WebhookForm.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\n/**\n * Form element for creating or editing webhooks (`fx:webhook`).\n *\n * @element foxy-webhook-form\n * @since 1.17.0\n */\nexport class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n resourceUri: { attribute: 'resource-uri' },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name:v8n_required',\n ({ name: v }) => (!!v && v.length <= 255) || 'name:v8n_too_long',\n ({ url: v }) => !v || v.length <= 1000 || 'url:v8n_too_long',\n ({ query: v }) => !v || v.length <= 1000 || 'query:v8n_too_long',\n ({ encryption_key: v }) => !!v || 'encryption-key:v8n_required',\n ({ encryption_key: v }) => !v || v.length <= 1000 || 'encryption-key:v8n_too_long',\n ];\n }\n\n /**\n * Optional URI of a transaction, customer or subscription. When provided,\n * the form will display logs and statuses for that particular resource only.\n */\n resourceUri: string | null = null;\n\n private __encryptionKeyGeneratorOptions = { separator: '', length: 512 };\n\n private __eventResources = [\n { value: 'subscription', label: 'event_resource_subscription' },\n { value: 'transaction', label: 'event_resource_transaction' },\n { value: 'customer', label: 'event_resource_customer' },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch: string[] = [super.hiddenSelector.toString()];\n if (this.data) alwaysMatch.unshift('event-resource');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n const format = this.data?.format;\n return { context: format === 'json' ? this.data?.event_resource : format };\n }\n\n edit(data: Partial<Data>): void {\n super.edit(data);\n if (!this.form.format) super.edit({ format: 'json' });\n if (!this.form.version) super.edit({ version: 2 });\n }\n\n renderBody(): TemplateResult {\n const resourceId = this.resourceUri ? getResourceId(this.resourceUri) : null;\n\n let statusesLink: string | undefined;\n let logsLink: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:statuses'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n statusesLink = url.toString();\n } catch {\n statusesLink = undefined;\n }\n\n try {\n const url = new URL(this.data?._links['fx:logs'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n logsLink = url.toString();\n } catch {\n logsLink = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-text-control infer=\"name\"></foxy-internal-text-control>\n\n <foxy-internal-radio-group-control infer=\"event-resource\" .options=${this.__eventResources}>\n </foxy-internal-radio-group-control>\n\n <foxy-internal-text-control infer=\"query\"></foxy-internal-text-control>\n <foxy-internal-text-control infer=\"url\"></foxy-internal-text-control>\n\n <foxy-internal-password-control\n infer=\"encryption-key\"\n show-generator\n .generatorOptions=${this.__encryptionKeyGeneratorOptions}\n >\n </foxy-internal-password-control>\n\n ${this.data\n ? html`\n <foxy-internal-async-list-control\n first=${ifDefined(statusesLink)}\n infer=\"statuses\"\n limit=\"10\"\n item=\"foxy-webhook-status-card\"\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n first=${ifDefined(logsLink)}\n infer=\"logs\"\n limit=\"10\"\n item=\"foxy-webhook-log-card\"\n >\n </foxy-internal-async-list-control>\n `\n : ''}\n ${super.renderBody()}\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"WebhookForm.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/WebhookForm.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data, WebhookLog } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\n/**\n * Form element for creating or editing webhooks (`fx:webhook`).\n *\n * @element foxy-webhook-form\n * @since 1.17.0\n */\nexport class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getStatusPageHref: { attribute: false },\n getLogPageHref: { attribute: false },\n resourceUri: { attribute: 'resource-uri' },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name:v8n_required',\n ({ name: v }) => (!!v && v.length <= 255) || 'name:v8n_too_long',\n ({ url: v }) => !v || v.length <= 1000 || 'url:v8n_too_long',\n ({ query: v }) => !v || v.length <= 1000 || 'query:v8n_too_long',\n ({ encryption_key: v }) => !!v || 'encryption-key:v8n_required',\n ({ encryption_key: v }) => !v || v.length <= 1000 || 'encryption-key:v8n_too_long',\n ];\n }\n\n /** If set, renders Statuses list items as <a> tags. */\n getStatusPageHref: ((statusHref: string, status: WebhookLog) => string | null) | null = null;\n\n /** If set, renders Logs list items as <a> tags. */\n getLogPageHref: ((logHref: string, log: WebhookLog) => string | null) | null = null;\n\n /**\n * Optional URI of a transaction, customer or subscription. When provided,\n * the form will display logs and statuses for that particular resource only.\n */\n resourceUri: string | null = null;\n\n private __encryptionKeyGeneratorOptions = { separator: '', length: 512 };\n\n private __eventResources = [\n { value: 'subscription', label: 'event_resource_subscription' },\n { value: 'transaction', label: 'event_resource_transaction' },\n { value: 'customer', label: 'event_resource_customer' },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch: string[] = [super.hiddenSelector.toString()];\n\n if (this.data) {\n alwaysMatch.unshift('general:event-resource');\n } else {\n alwaysMatch.unshift('logs', 'statuses');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n const format = this.data?.format;\n return { context: format === 'json' ? this.data?.event_resource : format };\n }\n\n edit(data: Partial<Data>): void {\n super.edit(data);\n if (!this.form.format) super.edit({ format: 'json' });\n if (!this.form.version) super.edit({ version: 2 });\n }\n\n renderBody(): TemplateResult {\n const resourceId = this.resourceUri ? getResourceId(this.resourceUri) : null;\n\n let statusesLink: string | undefined;\n let logsLink: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:statuses'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n statusesLink = url.toString();\n } catch {\n statusesLink = undefined;\n }\n\n try {\n const url = new URL(this.data?._links['fx:logs'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n logsLink = url.toString();\n } catch {\n logsLink = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-text-control layout=\"summary-item\" infer=\"name\"></foxy-internal-text-control>\n\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"event-resource\"\n .options=${this.__eventResources}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-password-control\n layout=\"summary-item\"\n infer=\"encryption-key\"\n show-generator\n .generatorOptions=${this.__encryptionKeyGeneratorOptions}\n >\n </foxy-internal-password-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-source-control infer=\"query\"></foxy-internal-source-control>\n <foxy-internal-source-control infer=\"url\"></foxy-internal-source-control>\n\n <foxy-internal-async-list-control\n first=${ifDefined(statusesLink)}\n infer=\"statuses\"\n limit=\"10\"\n item=\"foxy-webhook-status-card\"\n .getPageHref=${this.getStatusPageHref}\n .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n first=${ifDefined(logsLink)}\n infer=\"logs\"\n limit=\"10\"\n item=\"foxy-webhook-log-card\"\n .getPageHref=${this.getLogPageHref}\n .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n `;\n }\n}\n"]}
@@ -1,6 +1,8 @@
1
- import '../../internal/InternalRadioGroupControl/index';
2
1
  import '../../internal/InternalAsyncListControl/index';
3
2
  import '../../internal/InternalPasswordControl/index';
3
+ import '../../internal/InternalSummaryControl/index';
4
+ import '../../internal/InternalSelectControl/index';
5
+ import '../../internal/InternalSourceControl/index';
4
6
  import '../../internal/InternalTextControl/index';
5
7
  import '../../internal/InternalForm/index';
6
8
  import '../WebhookStatusCard/index';
@@ -1,6 +1,8 @@
1
- import "../../internal/InternalRadioGroupControl/index.js";
2
1
  import "../../internal/InternalAsyncListControl/index.js";
3
2
  import "../../internal/InternalPasswordControl/index.js";
3
+ import "../../internal/InternalSummaryControl/index.js";
4
+ import "../../internal/InternalSelectControl/index.js";
5
+ import "../../internal/InternalSourceControl/index.js";
4
6
  import "../../internal/InternalTextControl/index.js";
5
7
  import "../../internal/InternalForm/index.js";
6
8
  import "../WebhookStatusCard/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/index.ts"],"names":[],"mappings":"AAAA,2DAAwD;AACxD,0DAAuD;AACvD,yDAAsD;AACtD,qDAAkD;AAClD,8CAA2C;AAE3C,uCAAoC;AACpC,oCAAiC;AAEjC,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAE5C,cAAc,CAAC,MAAM,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import '../../internal/InternalRadioGroupControl/index';\nimport '../../internal/InternalAsyncListControl/index';\nimport '../../internal/InternalPasswordControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport '../WebhookStatusCard/index';\nimport '../WebhookLogCard/index';\n\nimport { WebhookForm } from './WebhookForm';\n\ncustomElements.define('foxy-webhook-form', WebhookForm);\n\nexport { WebhookForm };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/index.ts"],"names":[],"mappings":"AAAA,0DAAuD;AACvD,yDAAsD;AACtD,wDAAqD;AACrD,uDAAoD;AACpD,uDAAoD;AACpD,qDAAkD;AAClD,8CAA2C;AAE3C,uCAAoC;AACpC,oCAAiC;AAEjC,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAE5C,cAAc,CAAC,MAAM,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import '../../internal/InternalAsyncListControl/index';\nimport '../../internal/InternalPasswordControl/index';\nimport '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalSelectControl/index';\nimport '../../internal/InternalSourceControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport '../WebhookStatusCard/index';\nimport '../WebhookLogCard/index';\n\nimport { WebhookForm } from './WebhookForm';\n\ncustomElements.define('foxy-webhook-form', WebhookForm);\n\nexport { WebhookForm };\n"]}
@@ -1,3 +1,5 @@
1
1
  import type { Rels } from '@foxy.io/sdk/backend';
2
2
  import type { Resource } from '@foxy.io/sdk/core';
3
3
  export declare type Data = Resource<Rels.Webhook>;
4
+ export declare type WebhookLog = Resource<Rels.WebhookLog>;
5
+ export declare type WebhookStatus = Resource<Rels.WebhookStatus>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Rels } from '@foxy.io/sdk/backend';\nimport type { Resource } from '@foxy.io/sdk/core';\n\nexport type Data = Resource<Rels.Webhook>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Rels } from '@foxy.io/sdk/backend';\nimport type { Resource } from '@foxy.io/sdk/core';\n\nexport type Data = Resource<Rels.Webhook>;\nexport type WebhookLog = Resource<Rels.WebhookLog>;\nexport type WebhookStatus = Resource<Rels.WebhookStatus>;\n"]}
@@ -1,3 +1,4 @@
1
+ import type { PropertyDeclarations } from 'lit-element';
1
2
  import type { TemplateResult } from 'lit-html';
2
3
  import type { Data } from './types';
3
4
  import { InternalCard } from '../../internal/InternalCard/InternalCard';
@@ -11,6 +12,9 @@ declare const WebhookLogCard_base: typeof InternalCard & import("lit-element").C
11
12
  * @since 1.17.0
12
13
  */
13
14
  export declare class WebhookLogCard extends WebhookLogCard_base<Data> {
15
+ static get properties(): PropertyDeclarations;
16
+ /** When set to "resource", doesn't render resource type and ID. */
17
+ layout: null | 'resource';
14
18
  renderBody(): TemplateResult;
15
19
  }
16
20
  export {};
@@ -8,18 +8,30 @@ import { html } from 'lit-html';
8
8
  * @since 1.17.0
9
9
  */
10
10
  export class WebhookLogCard extends TranslatableMixin(InternalCard, 'webhook-log-card') {
11
+ constructor() {
12
+ super(...arguments);
13
+ /** When set to "resource", doesn't render resource type and ID. */
14
+ this.layout = null;
15
+ }
16
+ static get properties() {
17
+ return {
18
+ ...super.properties,
19
+ layout: {},
20
+ };
21
+ }
11
22
  renderBody() {
12
23
  var _a;
13
- const { date_created, response_code, response_body } = (_a = this.data) !== null && _a !== void 0 ? _a : {};
24
+ const { response_body: body, response_code: code, resource_type: type, date_created: date, resource_id: id, } = (_a = this.data) !== null && _a !== void 0 ? _a : {};
14
25
  return html `
15
26
  <div class="leading-none space-y-xs">
16
27
  <p class="flex justify-between items-center">
17
- <foxy-i18n .options=${{ value: date_created }} class="font-medium" infer="" key="date">
28
+ <foxy-i18n .options=${{ value: date }} class="font-medium" infer="" key="date">
18
29
  </foxy-i18n>
19
- <span class="text-xs text-tertiary">${response_code}&ZeroWidthSpace;</span>
30
+ ${this.layout === 'resource'
31
+ ? ''
32
+ : html `<span class="text-xs text-tertiary capitalize">${type} #${id}</span>`}
20
33
  </p>
21
-
22
- <p class="text-secondary text-s">${response_body}&ZeroWidthSpace;</p>
34
+ <p class="text-secondary text-s">HTTP ${code} &bull; ${body}</p>
23
35
  </div>
24
36
  `;
25
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookLogCard.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookLogCard/WebhookLogCard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CAAC,YAAY,EAAE,kBAAkB,CAAO;IAC3F,UAAU;;QACR,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,SAAG,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;QAEvE,OAAO,IAAI,CAAA;;;gCAGiB,EAAE,KAAK,EAAE,YAAY,EAAE;;gDAEP,aAAa;;;2CAGlB,aAAa;;KAEnD,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { html } from 'lit-html';\n\n/**\n * Basic card displaying webhook log (`fx:webhook_log`) info.\n *\n * @element foxy-webhook-log-card\n * @since 1.17.0\n */\nexport class WebhookLogCard extends TranslatableMixin(InternalCard, 'webhook-log-card')<Data> {\n renderBody(): TemplateResult {\n const { date_created, response_code, response_body } = this.data ?? {};\n\n return html`\n <div class=\"leading-none space-y-xs\">\n <p class=\"flex justify-between items-center\">\n <foxy-i18n .options=${{ value: date_created }} class=\"font-medium\" infer=\"\" key=\"date\">\n </foxy-i18n>\n <span class=\"text-xs text-tertiary\">${response_code}&ZeroWidthSpace;</span>\n </p>\n\n <p class=\"text-secondary text-s\">${response_body}&ZeroWidthSpace;</p>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"WebhookLogCard.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookLogCard/WebhookLogCard.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB,CAAC,YAAY,EAAE,kBAAkB,CAAO;IAA7F;;QAQE,mEAAmE;QACnE,WAAM,GAAsB,IAAI,CAAC;IAwBnC,CAAC;IAhCC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAKD,UAAU;;QACR,MAAM,EACJ,aAAa,EAAE,IAAI,EACnB,aAAa,EAAE,IAAI,EACnB,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,IAAI,EAClB,WAAW,EAAE,EAAE,GAChB,SAAG,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;QAEpB,OAAO,IAAI,CAAA;;;gCAGiB,EAAE,KAAK,EAAE,IAAI,EAAE;;YAEnC,IAAI,CAAC,MAAM,KAAK,UAAU;YAC1B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,IAAI,CAAA,kDAAkD,IAAI,KAAK,EAAE,SAAS;;gDAExC,IAAI,WAAW,IAAI;;KAE9D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { html } from 'lit-html';\n\n/**\n * Basic card displaying webhook log (`fx:webhook_log`) info.\n *\n * @element foxy-webhook-log-card\n * @since 1.17.0\n */\nexport class WebhookLogCard extends TranslatableMixin(InternalCard, 'webhook-log-card')<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n };\n }\n\n /** When set to \"resource\", doesn't render resource type and ID. */\n layout: null | 'resource' = null;\n\n renderBody(): TemplateResult {\n const {\n response_body: body,\n response_code: code,\n resource_type: type,\n date_created: date,\n resource_id: id,\n } = this.data ?? {};\n\n return html`\n <div class=\"leading-none space-y-xs\">\n <p class=\"flex justify-between items-center\">\n <foxy-i18n .options=${{ value: date }} class=\"font-medium\" infer=\"\" key=\"date\">\n </foxy-i18n>\n ${this.layout === 'resource'\n ? ''\n : html`<span class=\"text-xs text-tertiary capitalize\">${type} #${id}</span>`}\n </p>\n <p class=\"text-secondary text-s\">HTTP ${code} &bull; ${body}</p>\n </div>\n `;\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { PropertyDeclarations } from 'lit-element';
1
2
  import type { TemplateResult } from 'lit-html';
2
3
  import type { Data } from './types';
3
4
  import { InternalCard } from '../../internal/InternalCard/InternalCard';
@@ -11,6 +12,9 @@ declare const Base: typeof InternalCard & import("lit-element").Constructor<impo
11
12
  * @since 1.17.0
12
13
  */
13
14
  export declare class WebhookStatusCard extends Base<Data> {
15
+ static get properties(): PropertyDeclarations;
16
+ /** When set to "resource", doesn't render resource type and ID. */
17
+ layout: null | 'resource';
14
18
  renderBody(): TemplateResult;
15
19
  }
16
20
  export {};
@@ -11,31 +11,40 @@ const Base = TranslatableMixin(InternalCard, NS);
11
11
  * @since 1.17.0
12
12
  */
13
13
  export class WebhookStatusCard extends Base {
14
+ constructor() {
15
+ super(...arguments);
16
+ /** When set to "resource", doesn't render resource type and ID. */
17
+ this.layout = null;
18
+ }
19
+ static get properties() {
20
+ return {
21
+ ...super.properties,
22
+ layout: {},
23
+ };
24
+ }
14
25
  renderBody() {
15
- var _a, _b;
16
- const status = (_a = this.data) === null || _a === void 0 ? void 0 : _a.status;
26
+ var _a;
27
+ const { resource_type: type, date_created: date, resource_id: id, status } = (_a = this.data) !== null && _a !== void 0 ? _a : {};
17
28
  return html `
18
- <p class="flex flex-col leading-xs">
19
- <foxy-i18n
20
- .options=${{ value: (_b = this.data) === null || _b === void 0 ? void 0 : _b.date_created }}
21
- class="font-medium"
22
- infer=""
23
- key="date"
24
- >
25
- </foxy-i18n>
26
-
27
- <foxy-i18n
29
+ <div class="leading-none space-y-xs">
30
+ <p class="flex justify-between items-center">
31
+ <foxy-i18n .options=${{ value: date }} class="font-medium" infer="" key="date">
32
+ </foxy-i18n>
33
+ ${this.layout === 'resource'
34
+ ? ''
35
+ : html `<span class="text-xs text-tertiary capitalize">${type} #${id}</span>`}
36
+ </p>
37
+ <p
28
38
  class=${classMap({
29
39
  'text-secondary': status === 'pending',
30
40
  'text-success': status === 'successful',
31
41
  'text-error': status === 'failed',
32
42
  'text-s': true,
33
43
  })}
34
- infer=""
35
- key="status_${status}"
36
44
  >
37
- </foxy-i18n>
38
- </p>
45
+ <foxy-i18n infer="" key="status_${status}"></foxy-i18n>
46
+ </p>
47
+ </div>
39
48
  `;
40
49
  }
41
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookStatusCard.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookStatusCard/WebhookStatusCard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,EAAE,GAAG,qBAAqB,CAAC;AACjC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,IAAU;IAC/C,UAAU;;QACR,MAAM,MAAM,SAAG,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC;QAEjC,OAAO,IAAI,CAAA;;;qBAGM,EAAE,KAAK,QAAE,IAAI,CAAC,IAAI,0CAAE,YAAY,EAAE;;;;;;;;kBAQrC,QAAQ,CAAC;YACf,gBAAgB,EAAE,MAAM,KAAK,SAAS;YACtC,cAAc,EAAE,MAAM,KAAK,YAAY;YACvC,YAAY,EAAE,MAAM,KAAK,QAAQ;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;;wBAEY,MAAM;;;;KAIzB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { html } from 'lit-html';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'webhook-status-card';\nconst Base = TranslatableMixin(InternalCard, NS);\n\n/**\n * Basic card displaying webhook status (`fx:webhook_status`) info.\n *\n * @element foxy-webhook-status-card\n * @since 1.17.0\n */\nexport class WebhookStatusCard extends Base<Data> {\n renderBody(): TemplateResult {\n const status = this.data?.status;\n\n return html`\n <p class=\"flex flex-col leading-xs\">\n <foxy-i18n\n .options=${{ value: this.data?.date_created }}\n class=\"font-medium\"\n infer=\"\"\n key=\"date\"\n >\n </foxy-i18n>\n\n <foxy-i18n\n class=${classMap({\n 'text-secondary': status === 'pending',\n 'text-success': status === 'successful',\n 'text-error': status === 'failed',\n 'text-s': true,\n })}\n infer=\"\"\n key=\"status_${status}\"\n >\n </foxy-i18n>\n </p>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"WebhookStatusCard.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookStatusCard/WebhookStatusCard.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,EAAE,GAAG,qBAAqB,CAAC;AACjC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,IAAU;IAAjD;;QAQE,mEAAmE;QACnE,WAAM,GAAsB,IAAI,CAAC;IA2BnC,CAAC;IAnCC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAKD,UAAU;;QACR,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,SAAG,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;QAE7F,OAAO,IAAI,CAAA;;;gCAGiB,EAAE,KAAK,EAAE,IAAI,EAAE;;YAEnC,IAAI,CAAC,MAAM,KAAK,UAAU;YAC1B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,IAAI,CAAA,kDAAkD,IAAI,KAAK,EAAE,SAAS;;;kBAGtE,QAAQ,CAAC;YACf,gBAAgB,EAAE,MAAM,KAAK,SAAS;YACtC,cAAc,EAAE,MAAM,KAAK,YAAY;YACvC,YAAY,EAAE,MAAM,KAAK,QAAQ;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;;4CAEgC,MAAM;;;KAG7C,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { html } from 'lit-html';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'webhook-status-card';\nconst Base = TranslatableMixin(InternalCard, NS);\n\n/**\n * Basic card displaying webhook status (`fx:webhook_status`) info.\n *\n * @element foxy-webhook-status-card\n * @since 1.17.0\n */\nexport class WebhookStatusCard extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n };\n }\n\n /** When set to \"resource\", doesn't render resource type and ID. */\n layout: null | 'resource' = null;\n\n renderBody(): TemplateResult {\n const { resource_type: type, date_created: date, resource_id: id, status } = this.data ?? {};\n\n return html`\n <div class=\"leading-none space-y-xs\">\n <p class=\"flex justify-between items-center\">\n <foxy-i18n .options=${{ value: date }} class=\"font-medium\" infer=\"\" key=\"date\">\n </foxy-i18n>\n ${this.layout === 'resource'\n ? ''\n : html`<span class=\"text-xs text-tertiary capitalize\">${type} #${id}</span>`}\n </p>\n <p\n class=${classMap({\n 'text-secondary': status === 'pending',\n 'text-success': status === 'successful',\n 'text-error': status === 'failed',\n 'text-s': true,\n })}\n >\n <foxy-i18n infer=\"\" key=\"status_${status}\"></foxy-i18n>\n </p>\n </div>\n `;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.33.0-beta.3",
4
+ "version": "1.34.0-beta.1",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",