@foxy.io/elements 1.24.1-beta.1 → 1.24.1-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-card.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/shared-fa7539af.js +46 -0
- package/dist/cdn/translations/admin-subscription-card/en.json +1 -0
- package/dist/cdn/translations/cart-form/en.json +2 -0
- package/dist/cdn/translations/customer/en.json +2 -0
- package/dist/cdn/translations/customer-portal/en.json +2 -0
- package/dist/cdn/translations/item-form/en.json +2 -0
- package/dist/cdn/translations/shipment-card/en.json +2 -0
- package/dist/cdn/translations/subscription-card/en.json +1 -0
- package/dist/cdn/translations/subscription-form/en.json +1 -0
- package/dist/cdn/translations/subscriptions-table/en.json +1 -0
- package/dist/cdn/translations/transaction/en.json +4 -0
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +17 -6
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +24 -12
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +11 -4
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +22 -22
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-f29d410a.js +0 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-584174ff.js";import"./foxy-nucleon-element.js";import"./shared-2edcd981.js";import{_ as e}from"./shared-4c2e9064.js";import{a as t}from"./shared-3b709ddc.js";import{C as r}from"./shared-5cf7b194.js";import{p as i}from"./shared-630a0ff2.js";import{I as s}from"./shared-31d8e3b8.js";import{i as
|
|
1
|
+
import"./shared-584174ff.js";import"./foxy-nucleon-element.js";import"./shared-2edcd981.js";import{_ as e}from"./shared-4c2e9064.js";import{a as t}from"./shared-3b709ddc.js";import{C as r}from"./shared-5cf7b194.js";import{p as i}from"./shared-630a0ff2.js";import{I as s}from"./shared-31d8e3b8.js";import{i as a}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-5784c088.js";import"./shared-e5239bec.js";import"./shared-b446c140.js";import"./shared-fd96bcd1.js";import"./shared-343d1fd7.js";import"./shared-9b12aeac.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-4e709717.js";let n,d,l,_,c,u,m,p=e=>e;const f=r(t(s,"admin-subscription-card"));class h extends f{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__itemsLoaderId="itemsLoader",this.__storeLoaderId="storeLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{attribute:"locale-codes"}})}renderBody(){var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.first_failed_transaction_date),r=this.__transactionTemplate,i=this.__priceKey,s=this.__priceOptions,f=this.__summaryOptions,h=this.__summaryKey,v=this.__statusKey,y=this.__statusOptions;return o(n||(n=p` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="text-left leading-s text-tertiary"> <div class="flex items-center space-x-s"> <span class="block flex-1 font-medium text-body truncate"> ${0} </span> <span class="text-s"> ${0} </span> </div> <div class="truncate text-s ${0}"> ${0} </div> <div class="text-tertiary truncate text-s">${0}​</div> </div> `),a(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__itemsHref),this.__itemsLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),f&&h?o(d||(d=p`<foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n>`),h,f):o(l||(l=p`​`)),s&&i?o(_||(_=p`<foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n>`),i,s):o(c||(c=p`​`)),t?"text-error":"text-secondary",y&&v?o(u||(u=p`<foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n>`),v,y):o(m||(m=p`​`)),null==r?void 0:r.customer_email)}get isBodyReady(){const e=!!this.__items&&!!this.__currencyCode&&!!this.__currencyDisplay;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t;const r=this.data;if(!r)return;if("_embedded"in r&&"fx:transaction_template"in r._embedded)return;const i=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction_template"].href)&&void 0!==t?t:"");return i.searchParams.set("zoom","items"),i.toString()}get __defaultTemplateSetHref(){var e,t,r;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(r=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==r?r:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __itemsHref(){const e=this.__transactionTemplate;if(!e)return;if("_embedded"in e&&"fx:items"in e._embedded)return;const t=new URL(e._links["fx:items"].href);return t.searchParams.set("limit","1"),t.toString()}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const r=this.data;if(r&&"_embedded"in r&&"fx:transaction_template"in r._embedded)return r._embedded["fx:transaction_template"];{const r=`#${this.__transactionTemplateLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}}get __defaultTemplateSet(){var e,t;const r=`#${this.__defaultTemplateSetLoaderId}`,i=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const r=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const r=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __items(){const e=this.__transactionTemplate;if(e&&"_embedded"in e&&"fx:items"in e._embedded){const t=e._embedded["fx:items"];return{array:t,count:t.length,isApproximateCount:20===t.length}}const t=this.renderRoot.querySelector(`#${this.__itemsLoaderId}`);return(null==t?void 0:t.data)?{array:t.data._embedded["fx:items"],count:t.data.total_items,isApproximateCount:!1}:null}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t?"symbol":void 0}get __summaryOptions(){var e;const{array:t,count:r}=null!==(e=this.__items)&&void 0!==e?e:{};if(t&&r)return{firstItem:t[0],count:r,countMinus1:r-1}}get __summaryKey(){const e=this.__items;if(e)return e.isApproximateCount?"summary_approximate":"summary"}get __statusOptions(){const e=this.data;if(null!==e)return e.first_failed_transaction_date?{date:e.first_failed_transaction_date}:e.end_date?{date:e.end_date}:!1===e.is_active?{}:new Date(e.start_date)>new Date?{date:e.start_date}:{date:e.next_transaction_date}}get __currencyCode(){var e,t,r;const i=this.__transactionTemplate;if(null==i?void 0:i.currency_code)return i.currency_code;{const i=this.__localeCodesHelper,s=null===(t=null!==(e=this.__templateSet)&&void 0!==e?e:this.__defaultTemplateSet)||void 0===t?void 0:t.locale_code,a=s?null==i?void 0:i.values[s]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}get __priceOptions(){var t,r;const s=this.__currencyDisplay;if(void 0===s)return;const a=this.__currencyCode;if(void 0===a)return;const o=null===(t=this.__transactionTemplate)||void 0===t?void 0:t.total_order;if(void 0===o)return;const n=null===(r=this.data)||void 0===r?void 0:r.frequency;return void 0!==n?e(e({},i(n)),{},{amount:`${o} ${a}`,currencyDisplay:s}):void 0}get __statusKey(){const e=this.data;if(null!==e){if(e.first_failed_transaction_date)return"subscription_failed";if(e.end_date){return new Date(e.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}return!1===e.is_active?"subscription_inactive":new Date(e.start_date)>new Date?"subscription_will_be_active":"subscription_active"}}get __priceKey(){var e;const t=null===(e=this.data)||void 0===e?void 0:e.frequency;if(t)return"price_"+(".5m"===t?"twice_a_month":"recurring")}}customElements.define("foxy-admin-subscription-card",h);export{h as AdminSubscriptionCard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./foxy-customer.js";import"./shared-9048eeb2.js";import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-f9180815.js";import{I as e}from"./shared-5280c80a.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,al as o}from"./shared-4c2e9064.js";import{h as i,L as n,c as a}from"./shared-7f33a83a.js";import{A as d}from"./shared-e006e82c.js";import"./shared-800ee6c0.js";import{C as l}from"./shared-f241722a.js";import{a as c,T as m}from"./shared-3b709ddc.js";import{i as u}from"./shared-d3bf9ac0.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-35728235.js";import{C as f}from"./shared-5cf7b194.js";import{I as g}from"./shared-fd96bcd1.js";import"./shared-e5239bec.js";import"./foxy-attribute-card.js";import"./shared-9b12aeac.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-2edcd981.js";import"./foxy-attribute-form.js";import"./shared-6daeb197.js";import"./shared-eb8a0fdf.js";import"./shared-7abbc95c.js";import"./shared-3f04e4cc.js";import"./shared-799dc083.js";import"./shared-621b3283.js";import"./shared-099c1f57.js";import"./shared-601f27b1.js";import"./shared-13fbea95.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import"./shared-fff03a45.js";import"./shared-11c2efc8.js";import"./shared-f21e5761.js";import"./shared-f5bbb1e0.js";import"./shared-d1f5de89.js";import"./shared-4205699e.js";import"./foxy-address-card.js";import"./shared-9aa72495.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-7a455b15.js";import"./foxy-nucleon-element.js";import"./shared-
|
|
1
|
+
import"./foxy-customer.js";import"./shared-9048eeb2.js";import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-f9180815.js";import{I as e}from"./shared-5280c80a.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-customer-form.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as s,B as r,al as o}from"./shared-4c2e9064.js";import{h as i,L as n,c as a}from"./shared-7f33a83a.js";import{A as d}from"./shared-e006e82c.js";import"./shared-800ee6c0.js";import{C as l}from"./shared-f241722a.js";import{a as c,T as m}from"./shared-3b709ddc.js";import{i as u}from"./shared-d3bf9ac0.js";import{c as h}from"./shared-4e709717.js";import{A as p}from"./shared-35728235.js";import{C as f}from"./shared-5cf7b194.js";import{I as g}from"./shared-fd96bcd1.js";import"./shared-e5239bec.js";import"./foxy-attribute-card.js";import"./shared-9b12aeac.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-2edcd981.js";import"./foxy-attribute-form.js";import"./shared-6daeb197.js";import"./shared-eb8a0fdf.js";import"./shared-7abbc95c.js";import"./shared-3f04e4cc.js";import"./shared-799dc083.js";import"./shared-621b3283.js";import"./shared-099c1f57.js";import"./shared-601f27b1.js";import"./shared-13fbea95.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import"./shared-fff03a45.js";import"./shared-11c2efc8.js";import"./shared-f21e5761.js";import"./shared-f5bbb1e0.js";import"./shared-d1f5de89.js";import"./shared-4205699e.js";import"./foxy-address-card.js";import"./shared-9aa72495.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-7a455b15.js";import"./foxy-nucleon-element.js";import"./shared-fa7539af.js";import"./shared-630a0ff2.js";import"./shared-d7be11de.js";import"./shared-ba93be6b.js";import"./shared-5103c1b4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-ff7fd5fa.js";import"./shared-27d21f4a.js";import"./foxy-cancellation-form.js";import"./shared-efaf8d49.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-584174ff.js";import"./shared-31d8e3b8.js";import"./shared-d519a301.js";import"./shared-b87d1af0.js";import"./shared-1196b6a7.js";import"./shared-de3dae6c.js";import"./shared-d90dbae7.js";import"./shared-b738ee96.js";import"./shared-9954ee26.js";import"./shared-ad80244a.js";let $,y,v=e=>e;class b extends(c(m(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[t.priceColumn,t.summaryColumn,t.statusColumn,t.idColumn,t.dateColumn,t.receiptColumn],this.group=""}static get properties(){return s(s({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){let e;try{e=new URL("./customer_portal_settings",this.base).toString()}catch(t){e=void 0}return this.api.storage.getItem(d.SESSION)?i($||($=v` <foxy-internal-customer-portal-logged-in-view customer="${0}" class="h-full" infer="" href="${0}" .transactionsTableColumns="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.base,u(e),this.transactionsTableColumns):i(y||(y=v` <foxy-internal-customer-portal-logged-out-view class="h-full" infer="" href="${0}"> </foxy-internal-customer-portal-logged-out-view> `),u(e))}}let S,x,_,j,T=e=>e;class k extends(m(n)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return s(s({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=i(S||(S=T` ${0} <slot></slot> `),this.icon?i(x||(x=T`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?i(_||(_=T`<button class="${0}" disabled="disabled">${0}</button>`),e,t):i(j||(j=T` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let O,w,z,R,E,U,N,A,C=e=>e;const H=c(e);let I,F,L,q,P,B,D,G,J,K,M,Q,V,W,X,Y=e=>e;const Z=c(e);const ee=["html"],te=["html"];let se,re,oe,ie,ne,ae,de,le,ce,me,ue,he,pe=e=>e;const fe=c(f(m(g(n))));let ge,$e,ye,ve=e=>e;const be=f(m(c(g(n),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,o,n;const a="customer:header:actions:sign-out",d=this.loggingOutState,l=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==d,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:l?"default":"pointer"};return i(O||(O=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),l,(async function(){try{e.loggingOutState="busy",await new p(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===d?i(w||(w=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):i(z||(z=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===d?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(o=customElements.get("foxy-spinner"))||void 0===o?void 0:o.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(R||(R=C`
|
|
2
2
|
${0}
|
|
3
3
|
|
|
4
4
|
<foxy-internal-customer-portal-subscriptions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-5784c088.js";import"./shared-b446c140.js";import{h as t}from"./shared-e5239bec.js";import"./shared-9048eeb2.js";import"./shared-f9180815.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-2edcd981.js";import{al as e,_ as s}from"./shared-4c2e9064.js";import{L as r,h as a,c as o}from"./shared-7f33a83a.js";import{C as i}from"./shared-5cf7b194.js";import"./shared-eb8a0fdf.js";import"./shared-099c1f57.js";import{w as h,S as d,T as n,a as l}from"./shared-3b709ddc.js";import{c as m}from"./shared-4e709717.js";import"./shared-601f27b1.js";import"./shared-621b3283.js";import{S as c}from"./shared-f21e5761.js";import"./shared-13fbea95.js";import"./shared-7abbc95c.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import{G as v}from"./shared-d1f5de89.js";import"./shared-3f04e4cc.js";import{N as p}from"./shared-9b12aeac.js";import{S as f}from"./shared-
|
|
1
|
+
import"./shared-5784c088.js";import"./shared-b446c140.js";import{h as t}from"./shared-e5239bec.js";import"./shared-9048eeb2.js";import"./shared-f9180815.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-2edcd981.js";import{al as e,_ as s}from"./shared-4c2e9064.js";import{L as r,h as a,c as o}from"./shared-7f33a83a.js";import{C as i}from"./shared-5cf7b194.js";import"./shared-eb8a0fdf.js";import"./shared-099c1f57.js";import{w as h,S as d,T as n,a as l}from"./shared-3b709ddc.js";import{c as m}from"./shared-4e709717.js";import"./shared-601f27b1.js";import"./shared-621b3283.js";import{S as c}from"./shared-f21e5761.js";import"./shared-13fbea95.js";import"./shared-7abbc95c.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import{G as v}from"./shared-d1f5de89.js";import"./shared-3f04e4cc.js";import{N as p}from"./shared-9b12aeac.js";import{S as f}from"./shared-fa7539af.js";import{i as g}from"./shared-d3bf9ac0.js";import"./shared-799dc083.js";import"./shared-d7be11de.js";import"./foxy-nucleon-element.js";import"./shared-35728235.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-fd96bcd1.js";import"./shared-e8a51c60.js";import"./shared-5280c80a.js";import"./shared-ba93be6b.js";import"./shared-5103c1b4.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-ff7fd5fa.js";import"./shared-27d21f4a.js";import"./foxy-cancellation-form.js";import"./shared-efaf8d49.js";import"./shared-79d0699c.js";import"./shared-6daeb197.js";import"./shared-11c2efc8.js";import"./shared-f5bbb1e0.js";import"./shared-fff03a45.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-584174ff.js";import"./shared-31d8e3b8.js";import"./shared-630a0ff2.js";import"./shared-e006e82c.js";import"./shared-800ee6c0.js";import"./shared-d519a301.js";import"./shared-4205699e.js";import"./shared-7a455b15.js";import"./shared-b87d1af0.js";import"./shared-1196b6a7.js";import"./shared-de3dae6c.js";import"./shared-d90dbae7.js";import"./shared-b738ee96.js";import"./shared-9aa72495.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-2edcd981.js";import{_ as t}from"./shared-4c2e9064.js";import{h as
|
|
1
|
+
import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-2edcd981.js";import{_ as t}from"./shared-4c2e9064.js";import{h as e}from"./shared-7f33a83a.js";import{C as s}from"./shared-5cf7b194.js";import{N as i}from"./shared-9b12aeac.js";import{R as a,T as n,a as r}from"./shared-3b709ddc.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-630a0ff2.js";import"./shared-e5239bec.js";import"./shared-fd96bcd1.js";import"./shared-343d1fd7.js";import"./shared-d3bf9ac0.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";let c,l=t=>t;const m=s(a(n(r(i,"subscription-card"))));class f extends m{render(){var t,s,i,a,n;const r=!!(null===(t=this.data)||void 0===t?void 0:t.is_active),d=!!(null===(s=this.data)||void 0===s?void 0:s.first_failed_transaction_date);return e(c||(c=l` <div class="relative text-left"> <div class="${0}"> <div class="${0}"> <iron-icon class="m-auto" icon="${0}"> </iron-icon> </div> <div class="flex-1 min-w-0 leading-xs flex flex-col sm-flex-row sm-items-center"> <div class="order-1 sm-order-0"> <div class="text-body font-medium origin-top-left text-m"> <foxy-i18n data-testid="summary" options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> ​ </div> <div class="${0}"> <foxy-i18n data-testid="status" options="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> <div class="flex-1 font-medium leading-xs mb-xs sm-mb-0 sm-text-right text-xxs sm-text-l tracking-wide sm-tracking-normal uppercase sm-normal-case order-0 sm-order-1 font-tnum text-secondary sm-text-body"> <foxy-i18n data-testid="price" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> </div> <div data-testid="spinner" class="${0}"> <foxy-spinner state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> ${0} `),o({"flex items-start sm-items-center space-x-m transition duration-150 ease-in-out":!0,"opacity-0":!this.in({idle:"snapshot"})}),o({"min-w-0 flex-shrink-0 rounded-full relative flex p-s":!0,"text-success bg-success-10":r&&!d,"text-body bg-contrast-5":!r&&!d,"text-error bg-error-10":d}),d?"error-outline":r?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":!r&&!d,"text-success":r&&!d,"text-error":d}),JSON.stringify(this.__getStatusOptions()),this.lang,this.__getStatusKey(),this.ns,JSON.stringify(this.__getPriceOptions()),this.lang,".5m"===(null===(i=this.data)||void 0===i?void 0:i.frequency)?"twice_a_month":"recurring",this.ns,o({"pointer-events-none absolute inset-0 flex transition ease-in-out duration-150":!0,"opacity-0":this.in({idle:"snapshot"})}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(n=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==n?n:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(null===this.data)return{};const t=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...t].sort(((t,e)=>t.price-e.price))[0],count_minus_one:t.length-1,count:t.length}}__getStatusOptions(){const t=this.data;return null===t?{}:t.first_failed_transaction_date?{date:t.first_failed_transaction_date}:t.end_date?{date:t.end_date}:!1===t.is_active?{}:new Date(t.start_date)>new Date?{date:t.start_date}:{date:t.next_transaction_date}}__getPriceOptions(){if(null===this.data)return{};const e=this.data._embedded["fx:last_transaction"],s=`${e.total_order} ${e.currency_code}`;return t(t({},d(this.data.frequency)),{},{amount:s})}__getStatusKey(){const t=this.data;if(null!==t){if(t.first_failed_transaction_date)return"subscription_failed";if(t.end_date){return new Date(t.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}return!1===t.is_active?"subscription_inactive":new Date(t.start_date)>new Date?"subscription_will_be_active":"subscription_active"}}}customElements.define("foxy-subscription-card",f);export{f as SubscriptionCard};
|
|
@@ -92,7 +92,7 @@ import{h as e,P as t}from"./shared-e5239bec.js";import{E as i,T as s}from"./shar
|
|
|
92
92
|
<iron-icon icon="lumo:cross"></iron-icon>
|
|
93
93
|
</vaadin-button>
|
|
94
94
|
</div>
|
|
95
|
-
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:e,hidden:t,position:i}=this;this.hidden||this._setPosition(e,t,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(e,t){t&&(this._removeTargetEvents(t),t.describedby&&(t.removeAttribute("aria-describedby"),delete t.describedby)),e&&(this._addEvents(),e.getAttribute("aria-describedby")||(e.setAttribute("aria-describedby",this.id),e.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(e){e.removeEventListener("mouseenter",this._boundShow),e.removeEventListener("focus",this._boundShow),e.removeEventListener("mouseleave",this._boundHide),e.removeEventListener("blur",this._boundHide),e.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(e,t,i){if(e&&!t){let e=window.innerHeight,t=window.innerWidth;this.offsetParent&&(e=this.offsetParent.scrollHeight,t=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),o=(s.width-a.width)/2,n=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,o);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,o);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,n,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,n,u)}this._setPositionInVisibleBounds(e,t,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(e,t,i,s,a){i+a.width>t?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>e?(this.style.bottom=e+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(e,t,i,s){switch(this.align){case"left":return e;case"right":return t.left+t.width-i.width;default:return e+s}}_calculateTop(e,t,i,s,a){switch(this.align){case"top":return e+a;case"bottom":return e+t.height-i.height+a;default:return e+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(e){e?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(e){27===e.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function w(e){return function*(e){const t=[];for(const i of e.settings.subscriptions.allowFrequencyModification)if(x(i.jsonataQuery).evaluate(e.subscription))for(const e of i.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}customElements.define($.is,$),window.Vaadin.VcfTooltip=$;class S extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function T(e){const t=864e5,i=31*t;if(".5m"===e)return i/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new S(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*i;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new S(e)}function j(e,t){if("boolean"==typeof t)return t;const i=t.filter((t=>Boolean(x(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var i,s,a,o,n;if(t.min){const i=e.min?T(e.min):1/0;T(t.min)<i&&(e.min=t.min)}if(t.max){const i=e.max?T(e.max):-1/0;T(t.max)>i&&(e.max=t.max)}if("day"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(o=e.allowedDaysOfMonth)&&void 0!==o?o:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(i))}if(t.disallowedDates){const i=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(i))}return e}),{});return 0!==Object.keys(i).length&&i}function E(e){const[t,i,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,i-1,s)}function D(e){const t=e.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,i;const s=E(e.value),a=s.getTime(),o=j(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof o)return o;if(!1===(null===(t=o.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(i=o.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(o.disallowedDates&&o.disallowedDates.find((e=>{const[t,i]=e.split("..").map((e=>E(e).getTime()));return a===t||void 0!==i&&a>=t&&a<=i})))return!1;if(o.min){const e=g(o.min);if(null!==e&&Date.now()+e>=a)return!1}if(o.max){const e=g(o.max);if(null!==e&&Date.now()+e<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:e.subscription,value:e.value})}let k,q,L,H,I,O,A,C,P,z,N,F,R,V,B,M,U,W,K=e=>e;const Q=o(n(r(c,"subscription-form")));class J extends Q{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{var e;const{data:t,lang:i,ns:s}=this;if(t){let a,o,n="text-secondary";if(t.first_failed_transaction_date)n="text-error",a=t.first_failed_transaction_date,o="subscription_failed";else if(t.end_date){a=t.end_date;o=new Date(a).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else a=null!==(e=t.next_transaction_date)&&void 0!==e?e:(new Date).toISOString(),o="subscription_"+(t.is_active?"active":"inactive");const r=d(k||(k=K` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:a}),n,i,o,s);return t.first_failed_transaction_date?d(q||(q=K` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),n,r,t.error_message):r}return d(L||(L=K`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=(e,t)=>{const{data:i,lang:s,ns:a}=this;if(i){const o=y(i.frequency),n=this.__transactionTemplate,r=null==n?void 0:n.total_order;return"string"!=typeof e?d(H||(H=K`--`)):d(I||(I=K` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},o),{},{amount:`${r} ${e}`,currencyDisplay:t})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(O||(O=K`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=(e,t)=>d(A||(A=K` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-medium truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(e,t),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(C||(C=K` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const i=this.__transactionTemplate,s=new URL(null!==(e=null==i?void 0:i._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return d(P||(P=K` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),b(t))},this.__renderEndDate=()=>{const{disabledSelector:e,lang:t,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=K` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),e.zoom("end-date:form").toString(),s,this.parent,this.href,t,i,this.getNestedTemplates("end-date:form"),!this.data||e.matches("end-date",!0),(e=>{this.renderRoot.querySelector("#end-date-form").show(e.currentTarget)}),i,t,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:i}=this;if(t&&i){return D({value:v(e),settings:t,subscription:i})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:e,lang:t,ns:i}=this;return d(N||(N=K` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,t,b(null==e?void 0:e.start_date.substr(0,10)),b(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:i}=this,s=!!(null==e?void 0:e.is_active);return d(F||(F=K` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,t,b(null==e?void 0:e.next_transaction_date.substr(0,10)),b(null==e?void 0:e.next_transaction_date),t,!s||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),i=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",y(e)),value:e})));return d(R||(R=K` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),b(this.form.frequency),i,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:i,ns:s}=this;return d(V||(V=K` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>d(B||(B=K` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(y(e)),e,i,".5m"===e?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(M||(M=K` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,s=i?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,i):void 0;return d(U||(U=K` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),m({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!s,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!s,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!s}),b(s),b(i),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":p,"x-choice":f,"x-group":_}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new h(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var e,t,i,s,a,o,n,r,l;let c;try{const i=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),c=i.toString()}catch(e){c=void 0}const u=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",h=this.__transactionTemplate;let m=null;if(null==h?void 0:h.currency_code)m=h.currency_code;else{const e=this.__localeCodesHelper,t=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=t?null==e?void 0:e.values[t]:void 0;i&&(m=null!==(n=null===(o=/Currency: ([A-Z]{3})/g.exec(i))||void 0===o?void 0:o[1])&&void 0!==n?n:null)}return d(W||(W=K` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),b(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),b(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),b(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),b(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),b(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=m?m:void 0,u),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",b(null!=m?m:void 0),b(null===(l=null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"])||void 0===l?void 0:l.href),b(c),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,i;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(i=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==i?i:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,i;const s=this.data,a=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],o=`#${this.__transactionTemplateLoaderId}`;return null!==(i=null!=a?a:null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==i?i:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),j(e,i)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!w({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=w({subscription:this.data,settings:this.settings});return Array.from(e)}}let G;a("vcf-tooltip",l(G||(G=(e=>e)`
|
|
95
|
+
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:e,hidden:t,position:i}=this;this.hidden||this._setPosition(e,t,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(e,t){t&&(this._removeTargetEvents(t),t.describedby&&(t.removeAttribute("aria-describedby"),delete t.describedby)),e&&(this._addEvents(),e.getAttribute("aria-describedby")||(e.setAttribute("aria-describedby",this.id),e.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(e){e.removeEventListener("mouseenter",this._boundShow),e.removeEventListener("focus",this._boundShow),e.removeEventListener("mouseleave",this._boundHide),e.removeEventListener("blur",this._boundHide),e.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(e,t,i){if(e&&!t){let e=window.innerHeight,t=window.innerWidth;this.offsetParent&&(e=this.offsetParent.scrollHeight,t=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),o=(s.width-a.width)/2,n=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,o);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,o);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,n,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,n,u)}this._setPositionInVisibleBounds(e,t,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(e,t,i,s,a){i+a.width>t?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>e?(this.style.bottom=e+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(e,t,i,s){switch(this.align){case"left":return e;case"right":return t.left+t.width-i.width;default:return e+s}}_calculateTop(e,t,i,s,a){switch(this.align){case"top":return e+a;case"bottom":return e+t.height-i.height+a;default:return e+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(e){e?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(e){27===e.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function w(e){return function*(e){const t=[];for(const i of e.settings.subscriptions.allowFrequencyModification)if(x(i.jsonataQuery).evaluate(e.subscription))for(const e of i.values)!t.includes(e)&&(t.push(e),yield e)}({settings:{subscriptions:{allowFrequencyModification:e.settings.subscriptions.allow_frequency_modification.map((e=>({jsonataQuery:e.jsonata_query,values:e.values})))}},subscription:e.subscription})}customElements.define($.is,$),window.Vaadin.VcfTooltip=$;class S extends Error{constructor(e){super(`Invalid frequency "${e}".`)}}function T(e){const t=864e5,i=31*t;if(".5m"===e)return i/2;const s=parseInt(e.substring(0,e.length-1));if(isNaN(s))throw new S(e);if(e.endsWith("y"))return 31536e6*s;if(e.endsWith("m"))return s*i;if(e.endsWith("w"))return 6048e5*s;if(e.endsWith("d"))return s*t;throw new S(e)}function j(e,t){if("boolean"==typeof t)return t;const i=t.filter((t=>Boolean(x(t.jsonataQuery).evaluate(e)))).reduce(((e,t)=>{var i,s,a,o,n;if(t.min){const i=e.min?T(e.min):1/0;T(t.min)<i&&(e.min=t.min)}if(t.max){const i=e.max?T(e.max):-1/0;T(t.max)>i&&(e.max=t.max)}if("day"===(null===(i=t.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=e.allowedDaysOfWeek)&&void 0!==s?s:[],...t.allowedDays.days];e.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=t.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(o=e.allowedDaysOfMonth)&&void 0!==o?o:[],...t.allowedDays.days];e.allowedDaysOfMonth=Array.from(new Set(i))}if(t.disallowedDates){const i=[...null!==(n=e.disallowedDates)&&void 0!==n?n:[],...t.disallowedDates];e.disallowedDates=Array.from(new Set(i))}return e}),{});return 0!==Object.keys(i).length&&i}function E(e){const[t,i,s]=e.split("-").map((e=>parseInt(e)));return new Date(t,i-1,s)}function D(e){const t=e.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),function(e){var t,i;const s=E(e.value),a=s.getTime(),o=j(e.subscription,e.settings.subscriptions.allowNextDateModification);if("boolean"==typeof o)return o;if(!1===(null===(t=o.allowedDaysOfMonth)||void 0===t?void 0:t.includes(s.getDate())))return!1;if(!1===(null===(i=o.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(o.disallowedDates&&o.disallowedDates.find((e=>{const[t,i]=e.split("..").map((e=>E(e).getTime()));return a===t||void 0!==i&&a>=t&&a<=i})))return!1;if(o.min){const e=g(o.min);if(null!==e&&Date.now()+e>=a)return!1}if(o.max){const e=g(o.max);if(null!==e&&Date.now()+e<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:e.subscription,value:e.value})}let k,q,L,H,A,I,O,C,P,z,N,F,R,V,B,M,U,W,K=e=>e;const Q=o(n(r(c,"subscription-form")));class J extends Q{constructor(){super(...arguments),this.getTransactionPageHref=(e,t)=>null==t?void 0:t._links["fx:receipt"].href,this.getCustomerPageHref=null,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{const{data:e,lang:t,ns:i}=this;if(e){let s,a,o="text-secondary";if(e.first_failed_transaction_date)o="text-error",s=e.first_failed_transaction_date,a="subscription_failed";else if(e.end_date){s=e.end_date;a=new Date(e.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else e.is_active?new Date(e.start_date)>new Date?(s=e.start_date,a="subscription_will_be_active"):(s=e.next_transaction_date,a="subscription_active"):(s="",a="subscription_inactive");const n=d(k||(k=K` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:s}),o,t,a,i);return e.first_failed_transaction_date?d(q||(q=K` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),o,n,e.error_message):n}return d(L||(L=K`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=(e,t)=>{const{data:i,lang:s,ns:a}=this;if(i){const o=y(i.frequency),n=this.__transactionTemplate,r=null==n?void 0:n.total_order;return"string"!=typeof e?d(H||(H=K`--`)):d(A||(A=K` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},o),{},{amount:`${r} ${e}`,currencyDisplay:t})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(I||(I=K`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=(e,t)=>d(O||(O=K` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-medium truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(e,t),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(C||(C=K` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var e;let t;try{const i=this.__transactionTemplate,s=new URL(null!==(e=null==i?void 0:i._links["fx:items"].href)&&void 0!==e?e:"");s.searchParams.set("zoom","item_options"),t=s.toString()}catch(e){t=void 0}return d(P||(P=K` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),b(t))},this.__renderEndDate=()=>{const{disabledSelector:e,lang:t,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=K` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),e.zoom("end-date:form").toString(),s,this.parent,this.href,t,i,this.getNestedTemplates("end-date:form"),!this.data||e.matches("end-date",!0),(e=>{this.renderRoot.querySelector("#end-date-form").show(e.currentTarget)}),i,t,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=e=>{const{settings:t,data:i}=this;if(t&&i){return D({value:v(e),settings:t,subscription:i})}return e.getTime()>=Date.now()},this.__checkStartDateAvailability=e=>e.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:e,lang:t,ns:i}=this;return d(N||(N=K` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,t,b(null==e?void 0:e.start_date.substr(0,10)),b(null==e?void 0:e.start_date),t,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(e=>{const t=e.target;this.edit({start_date:t.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:e,lang:t,ns:i}=this,s=!!(null==e?void 0:e.is_active);return d(F||(F=K` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,t,b(null==e?void 0:e.next_transaction_date.substr(0,10)),b(null==e?void 0:e.next_transaction_date),t,!s||this.readonlySelector.matches("next-transaction-date",!0),!e||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(e=>{const t=e.target;this.edit({next_transaction_date:t.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:e}=this,t=!!(null==e?void 0:e.is_active),i=this.__frequencies.map((e=>({label:this.t(".5m"===e?"twice_a_month":"frequency",y(e)),value:e})));return d(R||(R=K` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!e||this.disabledSelector.matches("frequency",!0),e&&(!t||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),b(this.form.frequency),i,(e=>{this.edit({frequency:e.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var e;const{data:t,lang:i,ns:s}=this;return d(V||(V=K` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(e=this.form.frequency)&&void 0!==e?e:null,!t||this.disabledSelector.matches("frequency",!0),t&&(!t.is_active||this.readonlySelector.matches("frequency",!0)),(e=>{this.edit({frequency:e.target.value})}),this.__frequencies.map((e=>d(B||(B=K` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(y(e)),e,i,".5m"===e?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(M||(M=K` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after")),this.__renderCustomer=()=>{var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links["fx:customer"].href,s=i?null===(t=this.getCustomerPageHref)||void 0===t?void 0:t.call(this,i):void 0;return d(U||(U=K` <div data-testid="customer" class="sm-col-span-2"> ${0} <foxy-i18n infer="customer" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="customer" href="${0}"></foxy-customer-card> </a> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),m({"block rounded transition-colors":!0,"ring-1 ring-contrast-10":!s,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!s,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!s}),b(s),b(i),this.renderTemplateOrSlot("customer:after"))}}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-customer-card":customElements.get("foxy-customer-card"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":p,"x-choice":f,"x-group":_}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new h(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var e,t,i,s,a,o,n,r,l;let c;try{const i=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),c=i.toString()}catch(e){c=void 0}const u=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",h=this.__transactionTemplate;let m=null;if(null==h?void 0:h.currency_code)m=h.currency_code;else{const e=this.__localeCodesHelper,t=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=t?null==e?void 0:e.values[t]:void 0;i&&(m=null!==(n=null===(o=/Currency: ([A-Z]{3})/g.exec(i))||void 0===o?void 0:o[1])&&void 0!==n?n:null)}return d(W||(W=K` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),b(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),b(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),b(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),b(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),b(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=m?m:void 0,u),this.hiddenSelector.matches("customer",!0)?"":this.__renderCustomer(),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",b(null!=m?m:void 0),b(null===(l=null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"])||void 0===l?void 0:l.href),b(c),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var e;const t=this.data;return(null===(e=null==t?void 0:t._embedded)||void 0===e?void 0:e["fx:transaction_template"])||null==t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var e,t,i;if(""===(null===(e=this.__transactionTemplate)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(i=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==i?i:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __templateSetHref(){const e=this.__transactionTemplate;if(!(null==e?void 0:e.currency_code))return(null==e?void 0:e.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t,i;const s=this.data,a=null===(e=null==s?void 0:s._embedded)||void 0===e?void 0:e["fx:transaction_template"],o=`#${this.__transactionTemplateLoaderId}`;return null!==(i=null!=a?a:null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==i?i:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const e=this.settings.subscriptions.allow_next_date_modification;return!!function(e,t){let i;return i="boolean"==typeof t?t:t.map((e=>({allowedDays:e.allowed_days,disallowedDates:e.disallowed_dates,jsonataQuery:e.jsonata_query,max:e.max,min:e.min}))),j(e,i)}(this.data,e)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!w({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const e=w({subscription:this.data,settings:this.settings});return Array.from(e)}}let G;a("vcf-tooltip",l(G||(G=(e=>e)`
|
|
96
96
|
:host([hidden]) [part='container']{
|
|
97
97
|
display:none !important;
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import"./shared-2edcd981.js";import{S as s}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./shared-2edcd981.js";import{S as s}from"./shared-fa7539af.js";export{S as SubscriptionsTable}from"./shared-fa7539af.js";import"./shared-5784c088.js";import"./shared-e5239bec.js";import"./shared-3b709ddc.js";import"./shared-4c2e9064.js";import"./shared-7f33a83a.js";import"./shared-b446c140.js";import"./shared-fd96bcd1.js";import"./shared-343d1fd7.js";import"./shared-7a455b15.js";import"./shared-5cf7b194.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-9b12aeac.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-4e709717.js";import"./shared-630a0ff2.js";customElements.define("foxy-subscriptions-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-2edcd981.js";import"./shared-406ce9ad.js";import{I as t}from"./shared-5280c80a.js";import{I as o}from"./shared-ba93be6b.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as r,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-9048eeb2.js";import"./shared-799dc083.js";import{_ as s,B as n}from"./shared-4c2e9064.js";import{N as a}from"./shared-9b12aeac.js";import{a as d}from"./shared-3b709ddc.js";import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-e5239bec.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-fd96bcd1.js";import"./shared-343d1fd7.js";import"./shared-5cf7b194.js";import"./shared-4e709717.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-6daeb197.js";import"./shared-eb8a0fdf.js";import"./shared-7abbc95c.js";import"./shared-3f04e4cc.js";import"./shared-099c1f57.js";import"./shared-601f27b1.js";import"./shared-13fbea95.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import"./shared-fff03a45.js";import"./shared-11c2efc8.js";import"./shared-621b3283.js";import"./shared-f21e5761.js";import"./shared-f5bbb1e0.js";import"./shared-d1f5de89.js";import"./shared-4205699e.js";import"./shared-ad80244a.js";import"./shared-f0a9f3c2.js";import"./shared-31d8e3b8.js";import"./shared-9aa72495.js";import"./foxy-item-card.js";import"./shared-584174ff.js";import"./foxy-nucleon-element.js";import"./shared-5a889c45.js";import"./shared-ff7fd5fa.js";import"./shared-5103c1b4.js";import"./foxy-collection-page.js";import"./shared-d519a301.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-27d21f4a.js";import"./shared-d90dbae7.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-c839e147.js";import"./foxy-discount-builder.js";import"./shared-bb05cfed.js";import"./shared-773e7177.js";import"./shared-c76ef8d8.js";import"./shared-79d0699c.js";import"./shared-efaf8d49.js";import"./foxy-subscription-card.js";import"./shared-630a0ff2.js";import"./foxy-subscription-form.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-e006e82c.js";import"./shared-800ee6c0.js";import"./shared-d7be11de.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-7a455b15.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b87d1af0.js";import"./shared-1196b6a7.js";import"./shared-de3dae6c.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-f29d410a.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends o{renderControl(){var t,o,e,s;return r(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends o{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,o="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),o,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const o=new a.API(this),r=await o.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=r.ok?"idle":"fail",r.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends o{renderControl(){var t,o,e,i,s,n,a,d;return r(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.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():"")}__renderSendEmailsAction(){var t,o;return r(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,o;return r(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,o,e;return r(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,o,e;return r(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S,A,E=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends o{renderControl(){var t;return r(j||(j=E` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-medium">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,o;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o.status)||"completed";return r(_||(_=E` <foxy-i18n class="flex items-center h-xs px-s text-s font-medium rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const o=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==o?void 0:o.currency_code;if(!o)return r(b||(b=E`--`));const i={amount:`${o.total_order} ${e}`};return r($||($=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t,o;const e=null===(t=this.nucleon)||void 0===t?void 0:t.data,i=null===(o=null==e?void 0:e._embedded)||void 0===o?void 0:o["fx:discounts"],s=null==i?void 0:i.reduce(((t,o)=>t+o.amount),0),n=null==e?void 0:e.currency_code;return r(g||(g=E` ${0} ${0} `),["total_item_price","total_shipping","total_tax"].map((t=>{const o={amount:`${null==e?void 0:e[t]} ${n}`};return r(k||(k=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,e?r(w||(w=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),o):r(S||(S=E`<span>--</span>`)))})),s?r(A||(A=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="total_discount" infer=""></foxy-i18n> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> </div> `),20===(null==i?void 0:i.length)?"total_discount_see_below":"price",{amount:`${s} ${n}`}):"")}});let C,T,P=t=>t;class R extends(d(t,"transaction")){static get styles(){return[...super.styles,e(C||(C=P`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,o,r;return Boolean(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==o?o:null===(r=this.data)||void 0===r?void 0:r._links["fx:refund"])?super.readonlySelector:new n(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,o,e,s,n,a;return r(T||(T=P` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",R);export{R as Transaction};
|
|
1
|
+
import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-2edcd981.js";import"./shared-406ce9ad.js";import{I as t}from"./shared-5280c80a.js";import{I as o}from"./shared-ba93be6b.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as r,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-9048eeb2.js";import"./shared-799dc083.js";import{_ as s,B as n}from"./shared-4c2e9064.js";import{N as a}from"./shared-9b12aeac.js";import{a as d}from"./shared-3b709ddc.js";import"./shared-b446c140.js";import"./shared-5784c088.js";import"./shared-e5239bec.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-fd96bcd1.js";import"./shared-343d1fd7.js";import"./shared-5cf7b194.js";import"./shared-4e709717.js";import"./shared-35728235.js";import"./shared-3ab0306f.js";import"./shared-e8a51c60.js";import"./shared-6daeb197.js";import"./shared-eb8a0fdf.js";import"./shared-7abbc95c.js";import"./shared-3f04e4cc.js";import"./shared-099c1f57.js";import"./shared-601f27b1.js";import"./shared-13fbea95.js";import"./shared-3c2414d4.js";import"./shared-bee111d6.js";import"./shared-ef7f2d07.js";import"./shared-fff03a45.js";import"./shared-11c2efc8.js";import"./shared-621b3283.js";import"./shared-f21e5761.js";import"./shared-f5bbb1e0.js";import"./shared-d1f5de89.js";import"./shared-4205699e.js";import"./shared-ad80244a.js";import"./shared-f0a9f3c2.js";import"./shared-31d8e3b8.js";import"./shared-9aa72495.js";import"./foxy-item-card.js";import"./shared-584174ff.js";import"./foxy-nucleon-element.js";import"./shared-5a889c45.js";import"./shared-ff7fd5fa.js";import"./shared-5103c1b4.js";import"./foxy-collection-page.js";import"./shared-d519a301.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-27d21f4a.js";import"./shared-d90dbae7.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-c839e147.js";import"./foxy-discount-builder.js";import"./shared-bb05cfed.js";import"./shared-773e7177.js";import"./shared-c76ef8d8.js";import"./shared-79d0699c.js";import"./shared-efaf8d49.js";import"./foxy-subscription-card.js";import"./shared-630a0ff2.js";import"./foxy-subscription-form.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-e006e82c.js";import"./shared-800ee6c0.js";import"./shared-d7be11de.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-7a455b15.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b87d1af0.js";import"./shared-1196b6a7.js";import"./shared-de3dae6c.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-fa7539af.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends o{renderControl(){var t,o,e,s;return r(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends o{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,o="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),o,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const o=new a.API(this),r=await o.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=r.ok?"idle":"fail",r.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends o{renderControl(){var t,o,e,i,s,n,a,d;return r(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.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():"")}__renderSendEmailsAction(){var t,o;return r(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,o;return r(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,o,e;return r(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,o,e;return r(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S,A,E=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends o{renderControl(){var t;return r(j||(j=E` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-medium">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,o;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(o=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===o?void 0:o.status)||"completed";return r(_||(_=E` <foxy-i18n class="flex items-center h-xs px-s text-s font-medium rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const o=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==o?void 0:o.currency_code;if(!o)return r(b||(b=E`--`));const i={amount:`${o.total_order} ${e}`};return r($||($=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t,o;const e=null===(t=this.nucleon)||void 0===t?void 0:t.data,i=null===(o=null==e?void 0:e._embedded)||void 0===o?void 0:o["fx:discounts"],s=null==i?void 0:i.reduce(((t,o)=>t+o.amount),0),n=null==e?void 0:e.currency_code;return r(g||(g=E` ${0} ${0} `),["total_item_price","total_shipping","total_tax"].map((t=>{const o={amount:`${null==e?void 0:e[t]} ${n}`};return r(k||(k=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,e?r(w||(w=E`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),o):r(S||(S=E`<span>--</span>`)))})),s?r(A||(A=E` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="total_discount" infer=""></foxy-i18n> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> </div> `),20===(null==i?void 0:i.length)?"total_discount_see_below":"price",{amount:`${s} ${n}`}):"")}});let C,T,P=t=>t;class R extends(d(t,"transaction")){static get styles(){return[...super.styles,e(C||(C=P`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,o,r;return Boolean(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==o?o:null===(r=this.data)||void 0===r?void 0:r._links["fx:refund"])?super.readonlySelector:new n(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,o,e,s,n,a;return r(T||(T=P` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",R);export{R as Transaction};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import{_ as e}from"./shared-4c2e9064.js";import{T as t}from"./shared-7a455b15.js";import{a as s}from"./shared-3b709ddc.js";import{p as n}from"./shared-630a0ff2.js";let a,o,i,r,l=e=>e;class c extends(s(t,"subscriptions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.subTokenURLColumn]}}c.priceColumn={cell:t=>{const s=t.data._embedded["fx:transaction_template"],o=`${s.total_order} ${s.currency_code}`;return t.html(a||(a=l`
|
|
2
|
+
<foxy-i18n
|
|
3
|
+
data-testclass="i18n frequencies"
|
|
4
|
+
class="font-medium text-m font-tnum"
|
|
5
|
+
lang=${0}
|
|
6
|
+
key="price_${0}"
|
|
7
|
+
ns=${0}
|
|
8
|
+
.options=${0}
|
|
9
|
+
>
|
|
10
|
+
</foxy-i18n>
|
|
11
|
+
`),t.lang,".5m"===t.data.frequency?"twice_a_month":"recurring",t.ns,e(e({},n(t.data.frequency)),{},{amount:o}))}},c.summaryColumn={cell:e=>{const t=e.data._embedded["fx:transaction_template"]._embedded["fx:items"],s={most_expensive_item:[...t].sort(((e,t)=>e.price-t.price))[0],count_minus_one:t.length-1,count:t.length};return e.html(o||(o=l`
|
|
12
|
+
<foxy-i18n
|
|
13
|
+
data-testclass="i18n summaries"
|
|
14
|
+
class="text-m"
|
|
15
|
+
lang=${0}
|
|
16
|
+
key="transaction_summary"
|
|
17
|
+
ns=${0}
|
|
18
|
+
.options=${0}
|
|
19
|
+
>
|
|
20
|
+
</foxy-i18n>
|
|
21
|
+
`),e.lang,e.ns,s)}},c.statusColumn={hideBelow:"sm",cell:({ns:e,lang:t,data:s,html:n})=>{let a,o,r="bg-contrast-5 text-secondary";if(s.first_failed_transaction_date)r="bg-error-10 text-error",a=s.first_failed_transaction_date,o="subscription_failed";else if(s.end_date){a=s.end_date;o=new Date(s.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else s.is_active?new Date(s.start_date)>new Date?(a=s.start_date,o="subscription_will_be_active"):(r="bg-success-10 text-success",a=s.next_transaction_date,o="subscription_active"):(a="",o="subscription_inactive");return n(i||(i=l`
|
|
22
|
+
<foxy-i18n
|
|
23
|
+
data-testclass="i18n statuses"
|
|
24
|
+
class="px-s py-xs text-m font-medium block whitespace-normal rounded ${0}"
|
|
25
|
+
lang=${0}
|
|
26
|
+
key=${0}
|
|
27
|
+
ns=${0}
|
|
28
|
+
.options=${0}
|
|
29
|
+
>
|
|
30
|
+
</foxy-i18n>
|
|
31
|
+
`),r,t,o,e,{date:a})}},c.subTokenURLColumn={cell:e=>e.html(r||(r=l`
|
|
32
|
+
<a
|
|
33
|
+
data-testclass="links"
|
|
34
|
+
target="_blank"
|
|
35
|
+
class="text-m font-medium text-primary rounded hover-underline focus-outline-none focus-shadow-outline"
|
|
36
|
+
href=${0}
|
|
37
|
+
>
|
|
38
|
+
<foxy-i18n
|
|
39
|
+
data-testclass="i18n"
|
|
40
|
+
lang=${0}
|
|
41
|
+
key="update"
|
|
42
|
+
ns=${0}
|
|
43
|
+
>
|
|
44
|
+
</foxy-i18n>
|
|
45
|
+
</a>
|
|
46
|
+
`),e.data._links["fx:sub_token_url"].href,e.lang,e.ns)};export{c as S};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
12
12
|
"subscription_inactive": "Inactive",
|
|
13
13
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
14
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
14
15
|
"summary": "{{ firstItem.name }}",
|
|
15
16
|
"summary_plural": "{{ firstItem.name }} + {{ countMinus1 }} more",
|
|
16
17
|
"summary_approximate": "{{ firstItem.name }} + more",
|
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
133
133
|
"subscription_inactive": "Inactive",
|
|
134
134
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
135
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
135
136
|
"transaction_plural": "Transactions",
|
|
136
137
|
"twice_a_month": "Twice a month",
|
|
137
138
|
"undo_cancel": "Review",
|
|
@@ -193,6 +194,7 @@
|
|
|
193
194
|
"subscription_inactive": "Inactive",
|
|
194
195
|
"subscription_plural": "Subscriptions",
|
|
195
196
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
197
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
196
198
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
199
|
"twice_a_month": "Twice a month",
|
|
198
200
|
"weekly": "Weekly",
|
|
@@ -783,6 +783,7 @@
|
|
|
783
783
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
784
784
|
"subscription_inactive": "Inactive",
|
|
785
785
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
786
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
786
787
|
"transaction_plural": "Transactions",
|
|
787
788
|
"twice_a_month": "Twice a month",
|
|
788
789
|
"undo_cancel": "Review",
|
|
@@ -847,6 +848,7 @@
|
|
|
847
848
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
848
849
|
"subscription_inactive": "Inactive",
|
|
849
850
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
851
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
850
852
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
851
853
|
"twice_a_month": "Twice a month",
|
|
852
854
|
"update": "Update",
|
|
@@ -732,6 +732,7 @@
|
|
|
732
732
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
733
733
|
"subscription_inactive": "Inactive",
|
|
734
734
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
735
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
735
736
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
736
737
|
"twice_a_month": "twice a month",
|
|
737
738
|
"weekly": "/ week",
|
|
@@ -774,6 +775,7 @@
|
|
|
774
775
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
775
776
|
"subscription_inactive": "Inactive",
|
|
776
777
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
778
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
777
779
|
"transaction_plural": "Transactions",
|
|
778
780
|
"twice_a_month": "Twice a month",
|
|
779
781
|
"update_billing": "Update billing",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
80
80
|
"subscription_inactive": "Inactive",
|
|
81
81
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
82
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
82
83
|
"transaction_plural": "Transactions",
|
|
83
84
|
"twice_a_month": "Twice a month",
|
|
84
85
|
"undo_cancel": "Review",
|
|
@@ -140,6 +141,7 @@
|
|
|
140
141
|
"subscription_inactive": "Inactive",
|
|
141
142
|
"subscription_plural": "Subscriptions",
|
|
142
143
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
144
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
143
145
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
144
146
|
"twice_a_month": "Twice a month",
|
|
145
147
|
"weekly": "Weekly",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
108
108
|
"subscription_inactive": "Inactive",
|
|
109
109
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
110
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
110
111
|
"transaction_plural": "Transactions",
|
|
111
112
|
"twice_a_month": "Twice a month",
|
|
112
113
|
"undo_cancel": "Review",
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
"subscription_inactive": "Inactive",
|
|
169
170
|
"subscription_plural": "Subscriptions",
|
|
170
171
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
172
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
171
173
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
172
174
|
"twice_a_month": "Twice a month",
|
|
173
175
|
"weekly": "Weekly",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"subscription_inactive": "Inactive",
|
|
13
13
|
"subscription_plural": "Subscriptions",
|
|
14
14
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
15
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
15
16
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
16
17
|
"twice_a_month": "Twice a month",
|
|
17
18
|
"weekly": "Weekly",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
29
29
|
"subscription_inactive": "Inactive",
|
|
30
30
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
31
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
31
32
|
"transaction_plural": "Transactions",
|
|
32
33
|
"twice_a_month": "Twice a month",
|
|
33
34
|
"undo_cancel": "Review",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
12
12
|
"subscription_inactive": "Inactive",
|
|
13
13
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
14
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
14
15
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
15
16
|
"twice_a_month": "Twice a month",
|
|
16
17
|
"update": "Update",
|
|
@@ -214,6 +214,7 @@
|
|
|
214
214
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
215
215
|
"subscription_inactive": "Inactive",
|
|
216
216
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
217
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
217
218
|
"transaction_plural": "Transactions",
|
|
218
219
|
"twice_a_month": "Twice a month",
|
|
219
220
|
"undo_cancel": "Review",
|
|
@@ -278,6 +279,7 @@
|
|
|
278
279
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
279
280
|
"subscription_inactive": "Inactive",
|
|
280
281
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
282
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
281
283
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
282
284
|
"twice_a_month": "Twice a month",
|
|
283
285
|
"update": "Update",
|
|
@@ -509,6 +511,7 @@
|
|
|
509
511
|
"subscription_failed": "Payment failed on {{date, date}}",
|
|
510
512
|
"subscription_inactive": "Inactive",
|
|
511
513
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
514
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
512
515
|
"transaction_plural": "Transactions",
|
|
513
516
|
"twice_a_month": "Twice a month",
|
|
514
517
|
"undo_cancel": "Review",
|
|
@@ -570,6 +573,7 @@
|
|
|
570
573
|
"subscription_inactive": "Inactive",
|
|
571
574
|
"subscription_plural": "Subscriptions",
|
|
572
575
|
"subscription_will_be_cancelled": "Ends on {{date, date}}",
|
|
576
|
+
"subscription_will_be_active": "Starts on {{date, date}}",
|
|
573
577
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
574
578
|
"twice_a_month": "Twice a month",
|
|
575
579
|
"weekly": "Weekly",
|