@foxy.io/elements 1.49.0 → 1.50.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +15 -15
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/shared-200aa12d.js +1 -0
- package/dist/cdn/shared-2a84ee72.js +1 -0
- package/dist/cdn/{shared-4bafbc5f.js → shared-986bcd05.js} +1 -1
- package/dist/cdn/{shared-4ffaa9b7.js → shared-ddc1c32f.js} +1 -1
- package/dist/cdn/shared-e6c743bd.js +1 -0
- package/dist/cdn/shared-f05c924a.js +1 -0
- package/dist/cdn/translations/admin-subscription-form/en.json +8 -2
- package/dist/cdn/translations/coupon-form/en.json +1 -1
- package/dist/cdn/translations/customer/en.json +1 -1
- package/dist/cdn/translations/customer-portal/de.json +1 -1
- package/dist/cdn/translations/customer-portal/en.json +1 -1
- package/dist/cdn/translations/customer-portal/sv.json +1 -1
- package/dist/cdn/translations/subscription-form/en.json +1 -1
- package/dist/cdn/translations/transaction/en.json +4 -2
- package/dist/cdn/translations/transaction-card/en.json +1 -1
- package/dist/elements/internal/InternalCalendar/InternalCalendar.js +4 -3
- package/dist/elements/internal/InternalCalendar/InternalCalendar.js.map +1 -1
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js +2 -1
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +1 -0
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormStatusActionForm/InternalAdminSubscriptionFormStatusActionForm.d.ts +1 -0
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormStatusActionForm/InternalAdminSubscriptionFormStatusActionForm.js +28 -9
- package/dist/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormStatusActionForm/InternalAdminSubscriptionFormStatusActionForm.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +2 -2
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/ReportForm/utils.js +16 -15
- package/dist/elements/public/ReportForm/utils.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.js +8 -3
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.d.ts +2 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +16 -2
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.d.ts +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +30 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/utils/parse-date.js +2 -1
- package/dist/utils/parse-date.js.map +1 -1
- package/dist/utils/safe-date.d.ts +1 -0
- package/dist/utils/safe-date.js +9 -0
- package/dist/utils/safe-date.js.map +1 -0
- package/package.json +1 -1
- package/dist/cdn/shared-5078246e.js +0 -1
- package/dist/cdn/shared-af688fe3.js +0 -1
- package/dist/cdn/shared-f0fa0a88.js +0 -1
|
@@ -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-26b55da2.js";import"./shared-be071e3d.js";import{a as e}from"./shared-9a454e09.js";import"./foxy-spinner.js";import{_ as t,B as o}from"./shared-8f9014ff.js";import{h as i,s as r}from"./shared-ba5c42c7.js";import{D as s}from"./shared-67aeac0f.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import{I as l}from"./shared-084e1772.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import{g as d}from"./shared-bab2ea2c.js";import{c}from"./shared-4e709717.js";import{R as u,a as f}from"./shared-328aa161.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-7a5d645f.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-490dadf8.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-1301af85.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-4cc1fb20.js";import"./shared-56a16e03.js";import"./shared-4dc0bd88.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-f7965314.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-d01853e2.js";import"./shared-5078246e.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let h,p,m,v,_,y,x,b=e=>e;let g,w=e=>e;customElements.define("foxy-internal-post-action-control",class extends e{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var e,t;return i(g||(g=w` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(e=this.href)&&void 0!==e?e:void 0),(e=>{e.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(t=this.theme)&&void 0!==t?t:void 0),this.disabled||this.readonly,(e=>{const t=e.currentTarget,o=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==o||o.show(t)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends s{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const e=["close-button",super.hiddenSelector.toString()];return new o(e.join(" ").trim())}render(){var e=this;return super.render((()=>i(h||(h=b` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?r(p||(p=b`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?r(m||(m=b`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):r(v||(v=b`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(_||(_=b` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(y||(y=b` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(e.href&&"idle"===e.__state){e.__state="busy",e.closable=!1;const t=await e.__api.fetch(e.href,{method:"POST"});e.__state=t.ok?"done":"fail",e.closable=!0}})),"busy"===this.__state?i(x||(x=b` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});let $,j,k,S,A=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return t(t({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,s;const n=this.nucleon,l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e._links["fx:customer"].href,u=l?null===(t=null==n?void 0:n.getCustomerPageHref)||void 0===t?void 0:t.call(n,l):void 0;return i($||($=A` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),c({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),a(u),a(l),this.__renderCopyAction(r(j||(j=A`<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",l?String(d(l)):""),this.__renderCopyAction(r(k||(k=A`<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!==(s=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==s?s:""))}__renderCopyAction(e,t,o,r){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return i(S||(S=A` <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(r,o)),(e=>"idle"!==s&&e.stopPropagation()),(e=>"idle"!==s&&e.stopPropagation()),c({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),e,t,c({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let P,C,H,L,E,B,Z,O,R,M,I,q=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{constructor(){super(...arguments),this.folders=null}static get properties(){return t(t({},super.properties),{},{folders:{}})}renderControl(){var e,t,o,r,s,n,a,l,d,c,u,f;return i(P||(P=q` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${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===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r._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===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.__renderArchiveAction(),this.folders?this.__renderFolderSelector(this.folders):"")}__renderSendEmailsAction(){var e,t;return i(C||(C=q` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return i(H||(H=q` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return i(L||(L=q` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(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 i(E||(E=q` <foxy-internal-post-action-control infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(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 r=this.nucleon,s=null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,n=s?null===(o=null==r?void 0:r.getSubscriptionPageHref)||void 0===o?void 0:o.call(r,s):void 0;return i(B||(B=q` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),a(n))}__renderReceiptAction(){var e,t;const o=this.nucleon;return i(Z||(Z=q` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),a(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return i(O||(O=q` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,s;const n=this.renderRoot.querySelector("#foldersLoader"),a=Array.from(null!==(s=null===(o=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==s?s:[]),l=this.nucleon;return i(R||(R=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===a.length,r(M||(M=q`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),a.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return i(I||(I=q` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let G,T,U,V,W,z,D,F,J,N,K,Q=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,r,s,n,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return i(G||(G=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:[],h=null!==(s=null===(r=u._embedded)||void 0===r?void 0:r["fx:shipments"])&&void 0!==s?s:[];return i(T||(T=Q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${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>: ${0} </span> </span> </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===h.length||0===u.total_shipping?i(U||(U=Q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):h.map((e=>i(V||(V=Q` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?i(W||(W=Q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>i(z||(z=Q` <span>${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,r,s,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(s=null===(r=e._embedded)||void 0===r?void 0:r["fx:gift_card_code"])||void 0===s?void 0:s.code;if(a&&l)return i(D||(D=Q` <span data-testclass="gift-card-code">${0} • ${0}:</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>i(F||(F=Q` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?i(J||(J=Q` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,r,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===s?void 0:s.currency_code;return i(N||(N=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 r="";return r=["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",i(K||(K=Q` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),r,o)}});let X,Y,ee,te,oe=e=>e;const ie=u(f(l,"transaction"));class re extends ie{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 re.API(e),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>d(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{re.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 t(t({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,i;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"])||r.push("items","attributes","custom-fields"),new o(r.join(" ").trim())}get hiddenSelector(){var e,t,i,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(i=this.__storeLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new o(s.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const s=null===(e=this.data)||void 0===e?void 0:e.source,n=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,s;const n=super.headerSubtitleBadges,a=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==a?void 0:a.name){const e=null!==(o=a.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:r(X||(X=oe`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:a.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(s=this.data)||void 0===s?void 0:s.is_test)&&n.push({key:"test"}),n}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(){var e,t;const o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:transaction_folders"].href;return i(Y||(Y=oe` <foxy-internal-transaction-actions-control folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),a(o))}renderBody(){var e,t,o,r,s,n,l,d,c,u,f,h,p,m,v,_;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==o?o:""),s=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),y=i.toString(),x=r.toString(),b=s.toString()}catch(e){}return i(ee||(ee=oe` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(r=this.data)||void 0===r?void 0:r.status)&&void 0!==s?s:"")?i(te||(te=oe` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),a(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(d=null===(l=this.__storeLoader)||void 0===l?void 0:l.data)||void 0===d?void 0:d._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},a(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),a(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},a(null===(h=this.data)||void 0===h?void 0:h._links["fx:custom_fields"].href),a(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),a(y),a(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},a(null===(v=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===v?void 0:v.href),(()=>this.refresh()),a(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",re);export{re 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-26b55da2.js";import"./shared-be071e3d.js";import{a as e}from"./shared-9a454e09.js";import"./foxy-spinner.js";import{_ as t,B as o}from"./shared-8f9014ff.js";import{h as i,s as r}from"./shared-ba5c42c7.js";import{D as s}from"./shared-67aeac0f.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import{I as l}from"./shared-084e1772.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import{g as d}from"./shared-bab2ea2c.js";import{c}from"./shared-4e709717.js";import{R as u,a as f}from"./shared-328aa161.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-7a5d645f.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-490dadf8.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-1301af85.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-4cc1fb20.js";import"./shared-56a16e03.js";import"./shared-4dc0bd88.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-f7965314.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-d01853e2.js";import"./shared-f05c924a.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-200aa12d.js";import"./shared-e6c743bd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let p,h,m,v,_,y,x,b=e=>e;let g,w=e=>e;customElements.define("foxy-internal-post-action-control",class extends e{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var e,t;return i(g||(g=w` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(e=this.href)&&void 0!==e?e:void 0),(e=>{e.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(t=this.theme)&&void 0!==t?t:void 0),this.disabled||this.readonly,(e=>{const t=e.currentTarget,o=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==o||o.show(t)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends s{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const e=["close-button",super.hiddenSelector.toString()];return new o(e.join(" ").trim())}render(){var e=this;return super.render((()=>i(p||(p=b` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?r(h||(h=b`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?r(m||(m=b`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):r(v||(v=b`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(_||(_=b` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(y||(y=b` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(e.href&&"idle"===e.__state){e.__state="busy",e.closable=!1;const t=await e.__api.fetch(e.href,{method:"POST"});e.__state=t.ok?"done":"fail",e.closable=!0}})),"busy"===this.__state?i(x||(x=b` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});let $,k,j,S,A=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return t(t({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,s;const n=this.nucleon,l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e._links["fx:customer"].href,u=l?null===(t=null==n?void 0:n.getCustomerPageHref)||void 0===t?void 0:t.call(n,l):void 0;return i($||($=A` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),c({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),a(u),a(l),this.__renderCopyAction(r(k||(k=A`<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",l?String(d(l)):""),this.__renderCopyAction(r(j||(j=A`<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!==(s=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==s?s:""))}__renderCopyAction(e,t,o,r){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return i(S||(S=A` <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(r,o)),(e=>"idle"!==s&&e.stopPropagation()),(e=>"idle"!==s&&e.stopPropagation()),c({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),e,t,c({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let P,C,H,L,E,B,O,Z,R,M,I,q=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{constructor(){super(...arguments),this.currencyDisplay=null,this.folders=null}static get properties(){return t(t({},super.properties),{},{currencyDisplay:{attribute:"currency-display"},folders:{}})}renderControl(){var e,t,o,r,s,n,a,l,d,c,u,f;return i(P||(P=q` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${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===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r._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===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.__renderArchiveAction(),this.folders?this.__renderFolderSelector(this.folders):"")}get __refundAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,s=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:s)}__renderSendEmailsAction(){var e,t;return i(C||(C=q` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return i(H||(H=q` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return i(L||(L=q` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(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,r,s;const n=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code;return i(E||(E=q` <foxy-internal-post-action-control message-options="${0}" infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({currencyDisplay:this.currencyDisplay,amount:`${this.__refundAmount} ${n}`}),a(null===(s=null===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r._links["fx:refund"])||void 0===s?void 0:s.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const r=this.nucleon,s=null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,n=s?null===(o=null==r?void 0:r.getSubscriptionPageHref)||void 0===o?void 0:o.call(r,s):void 0;return i(B||(B=q` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),a(n))}__renderReceiptAction(){var e,t;const o=this.nucleon;return i(O||(O=q` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),a(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return i(Z||(Z=q` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,s;const n=this.renderRoot.querySelector("#foldersLoader"),a=Array.from(null!==(s=null===(o=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==s?s:[]),l=this.nucleon;return i(R||(R=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===a.length,r(M||(M=q`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),a.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return i(I||(I=q` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let D,G,T,U,F,V,W,z,J,N,K,Q,X=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,r,s,n,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return i(D||(D=X``));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===(r=u._embedded)||void 0===r?void 0:r["fx:shipments"])&&void 0!==s?s:[],h=this.__refundableAmount;return i(G||(G=X` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${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>: ${0} </span> </span> ${0} </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?i(T||(T=X` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>i(U||(U=X` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?i(F||(F=X` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>i(V||(V=X` <span>${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,r,s,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(s=null===(r=e._embedded)||void 0===r?void 0:r["fx:gift_card_code"])||void 0===s?void 0:s.code;if(a&&l)return i(W||(W=X` <span data-testclass="gift-card-code">${0} • ${0}:</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>i(z||(z=X` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?i(J||(J=X` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order),h!==u.total_order?i(N||(N=X` <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex justify-end"> <span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="refundable_amount"></foxy-i18n>: ${0} </span> <br> <foxy-i18n class="inline-block whitespace-normal leading-s text-tertiary" style="max-width:48ch" infer="" key="refundable_amount_note"> </foxy-i18n> </span> </span> `),this.__renderPrice(h)):"")}get __refundableAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,s=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:s)}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,r,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===s?void 0:s.currency_code;return i(K||(K=X` <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 r="";return r=["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",i(Q||(Q=X` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),r,o)}});let Y,ee,te,oe,ie=e=>e;const re=u(f(l,"transaction"));class se extends re{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 se.API(e),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>d(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{se.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 t(t({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,i;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"])||r.push("items","attributes","custom-fields"),new o(r.join(" ").trim())}get hiddenSelector(){var e,t,i,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(i=this.__storeLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new o(s.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const s=null===(e=this.data)||void 0===e?void 0:e.source,n=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,s;const n=super.headerSubtitleBadges,a=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==a?void 0:a.name){const e=null!==(o=a.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:r(Y||(Y=ie`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:a.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(s=this.data)||void 0===s?void 0:s.is_test)&&n.push({key:"test"}),n}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(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data,o=null==t?void 0:t._links["fx:transaction_folders"].href;return i(ee||(ee=ie` <foxy-internal-transaction-actions-control currency-display="${0}" folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),(null==t?void 0:t.use_international_currency_symbol)?"code":"symbol",a(o))}renderBody(){var e,t,o,r,s,n,l,d,c,u,f,p,h,m,v,_;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==o?o:""),s=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),y=i.toString(),x=r.toString(),b=s.toString()}catch(e){}return i(te||(te=ie` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(r=this.data)||void 0===r?void 0:r.status)&&void 0!==s?s:"")?i(oe||(oe=ie` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),a(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(d=null===(l=this.__storeLoader)||void 0===l?void 0:l.data)||void 0===d?void 0:d._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},a(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),a(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},a(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),a(null===(h=this.data)||void 0===h?void 0:h._links["fx:attributes"].href),a(y),a(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},a(null===(v=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===v?void 0:v.href),(()=>this.refresh()),a(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",se);export{se as Transaction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r}from"./shared-e6c743bd.js";function s(s){if("0000-00-00"===s)return null;const[e,n,t]=s.split("-").map((r=>parseInt(r,10)));return[e,n,t].some((r=>"number"!=typeof r||isNaN(r)))?null:r(e,n-1,t)}export{s as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-be071e3d.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import{L as t,h as e}from"./shared-ba5c42c7.js";import{T as a}from"./shared-328aa161.js";import{c as s}from"./shared-4e709717.js";import{p as r}from"./shared-200aa12d.js";import{s as i}from"./shared-e6c743bd.js";import{s as n}from"./shared-2061be9a.js";let o,l,d,h,c,u=t=>t;class g extends(a(t)){constructor(){super(...arguments),this.checkAvailability=()=>!0,this.readonly=!1,this.disabled=!1,this.value="",this.start="",this.lang=""}static get properties(){return{checkAvailability:{attribute:!1},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},value:{type:String},start:{type:String},lang:{type:String}}}render(){var t,a;const r=new Date(null!==(a=null!==(t=this.__startAsDate)&&void 0!==t?t:this.__valueAsDate)&&void 0!==a?a:Date.now()),i=new Date(r),n=new Date(r),l=this.lang||navigator.language;return i.setMonth(i.getMonth()-1),n.setMonth(n.getMonth()+1),e(o||(o=u` <div class="text-m text-body font-lumo leading-m"> <div class="grid p-xs" style="grid-template:auto/max-content auto max-content"> <vaadin-button data-testid="prev" aria-label="${0}" theme="icon tertiary" class="px-xs" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:chevron-left"></iron-icon> </vaadin-button> <span data-testid="month" class="${0}"> ${0} </span> <vaadin-button data-testid="next" aria-label="${0}" theme="icon tertiary" class="px-xs" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:chevron-right"></iron-icon> </vaadin-button> </div> ${0} </div> `),i.toLocaleString(l,{year:"numeric",month:"long"}),this.disabled,this.__handlePrevButtonClick,s({"text-center self-center font-medium":!0,"text-disabled":this.disabled}),r.toLocaleDateString(l,{month:"long",year:"numeric"}),n.toLocaleString(l,{year:"numeric",month:"long"}),this.disabled,this.__handleNextButtonClick,this.__renderMonth(r.getMonth(),r.getFullYear()))}get __valueAsDate(){return r(this.value)}set __valueAsDate(t){this.value=t?n(t):""}get __startAsDate(){return r(this.start)}set __startAsDate(t){this.start=t?n(t):""}__renderMonth(t,a){var r,n,o;const c=this.lang||navigator.language,g=i(a,t,1),m=[];for(let t=0;t<7;++t){const a=new Date;for(;a.getDay()!==t;)a.setDate(a.getDate()+1);m.push(e(l||(l=u` <span class="${0}"> ${0} </span> `),s({"self-center text-xxs uppercase font-medium tracking-wider":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),a.toLocaleString(c,{weekday:"short"})))}for(;g.getMonth()===t;){const s=g.getFullYear()===(null===(r=this.__valueAsDate)||void 0===r?void 0:r.getFullYear())&&g.getMonth()===(null===(n=this.__valueAsDate)||void 0===n?void 0:n.getMonth())&&g.getDate()===(null===(o=this.__valueAsDate)||void 0===o?void 0:o.getDate());m.push(e(d||(d=u` <div style="grid-column:${0}" data-testclass="day-of-month"> ${0} </div> `),g.getDay()+1,this.__renderDate(g.getDate(),t,a,s))),g.setDate(g.getDate()+1)}return e(h||(h=u` <form data-testid="grid" class="grid gap-s p-s text-center" style="grid-template:auto/repeat(7,1fr)"> ${0} </form> `),m)}__renderDate(t,a,r,n=!1){const o=this.disabled||this.readonly||!this.checkAvailability(i(r,a,t));return e(c||(c=u` <label class="${0}"> <input name="date" type="radio" value="${0}" class="sr-only" ?disabled="${0}" @change="${0}"> ${0} </label> `),s({"relative flex w-m h-m items-center justify-center rounded-s":!0,"font-tnum text-l select-none leading-none":!0,"cursor-pointer focus-within-ring-2 focus-within-ring-primary-50":!o,"bg-contrast-5 hover-bg-contrast-10":!n&&!o,"bg-primary text-primary-contrast":n&&!o,"border border-dashed border-contrast-20 text-disabled":!n&&o,"border border-dashed border-primary text-primary":n&&o}),t,this.readonly||this.disabled||o,(()=>{this.__valueAsDate=i(r,a,t),this.dispatchEvent(new CustomEvent("change"))}),t)}__handlePrevButtonClick(){var t;const e=null!==(t=this.__startAsDate)&&void 0!==t?t:new Date;this.__startAsDate=new Date(e.setMonth(e.getMonth()-1))}__handleNextButtonClick(){var t;const e=null!==(t=this.__startAsDate)&&void 0!==t?t:new Date;this.__startAsDate=new Date(e.setMonth(e.getMonth()+1))}}customElements.define("foxy-internal-calendar",g);
|