@foxy.io/elements 1.32.0-beta.4 → 1.32.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  2. package/dist/cdn/translations/user-invitation-card/en.json +2 -0
  3. package/dist/cdn/translations/user-invitation-form/en.json +26 -22
  4. package/dist/elements/public/UserInvitationForm/UserInvitationForm.d.ts +2 -0
  5. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js +63 -47
  6. package/dist/elements/public/UserInvitationForm/UserInvitationForm.js.map +1 -1
  7. package/dist/elements/public/UserInvitationForm/index.d.ts +1 -1
  8. package/dist/elements/public/UserInvitationForm/index.js +1 -1
  9. package/dist/elements/public/UserInvitationForm/index.js.map +1 -1
  10. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js +3 -3
  11. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.js.map +1 -1
  12. package/dist/elements/public/UserInvitationForm/types.d.ts +10 -1
  13. package/dist/elements/public/UserInvitationForm/types.js.map +1 -1
  14. package/package.json +1 -1
  15. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.d.ts +0 -9
  16. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.js +0 -32
  17. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.js.map +0 -1
  18. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.d.ts +0 -5
  19. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.js +0 -7
  20. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.js.map +0 -1
@@ -1 +1 @@
1
- import"./shared-89db9c39.js";import"./shared-0e58c95c.js";import{I as e}from"./shared-0ec6badf.js";import"./shared-12c2e2c7.js";import{a as t}from"./shared-1e827d8b.js";import"./shared-af70646d.js";import{_ as a,B as r,aP as s,aQ as i}from"./shared-d1195c27.js";import{N as o}from"./shared-2ad18636.js";import{i as n}from"./shared-9803aa7c.js";import{h as l,c as d,s as c}from"./shared-dc73b9a5.js";import{a as m}from"./shared-001dfdb6.js";import{a as u,g as v}from"./shared-d8bffb38.js";import{c as h}from"./shared-4e709717.js";import"./shared-0e80f20c.js";import"./shared-555c2785.js";import"./shared-bd59ddc4.js";import"./shared-68470d06.js";import"./shared-b4b7767a.js";import"./shared-8f8c3902.js";import"./shared-61ade33e.js";import"./shared-960eac62.js";import"./shared-22ba9566.js";import"./shared-ca0700a7.js";import"./shared-51415f88.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./foxy-copy-to-clipboard.js";import"./shared-08e7b7e5.js";import"./shared-f23cde6c.js";import"./shared-20b733ff.js";import"./shared-11902e83.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let f,p=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return a(a({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"idle"===e?this.theme:"";return l(f||(f=p` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),n(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e;if("busy"!==this.__state)try{this.__state="busy";const t=new o.API(this),a=await t.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});this.__state=a.ok?"idle":"fail",a.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(e){this.__state="fail"}}});let y,x=e=>e;customElements.define("foxy-internal-user-invitation-form-sync-action",class extends t{constructor(){super(...arguments),this.status=null,this.theme=null}static get properties(){return a(a({},super.properties),{},{status:{},theme:{}})}renderControl(){var e;return l(y||(y=x` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="caption"></foxy-i18n> </vaadin-button> `),n(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled,(()=>{const e=this.nucleon,t=this.status;t&&(null==e||e.edit({status:t}),null==e||e.submit())}))}});let g,_,b,j,Z,w,S,$,k,M,C,B,L=e=>e;const V=m(e,"user-invitation-form");class A extends V{constructor(){super(...arguments),this.defaultDomain=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,a=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==a?void 0:a.includes("."))||!t?a:`${a}.${t}`}}static get properties(){return a(a({},super.properties),{},{defaultDomain:{attribute:"default-domain"},layout:{}})}static get styles(){return[...super.styles,d(g||(g=L`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required"]}get readonlySelector(){const e=["store",super.readonlySelector.toString()];return new r(e.join(" ").trim())}get hiddenSelector(){var e;const t=["timestamps","submit","undo",super.hiddenSelector.toString()],a=null===(e=this.data)||void 0===e?void 0:e.status;return"accepted"!==a&&"sent"!==a&&t.unshift("revoke"),"rejected"!==a&&t.unshift("delete"),"accepted"!==a&&t.unshift("leave"),"revoked"!==a&&t.unshift("invite-again"),"sent"!==a&&t.unshift("resend","accept","reject"),new r(t.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("already been created for this email and store")?["error:invitation_exists"]:t.includes("already has access to this store")?["error:already_has_access"]:e}}__getGravatar(e){return s((function*(){yield l(_||(_=L` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield l(b||(b=L` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield i(v(e))))}))()}__renderAdminTemplateState(){return l(j||(j=L` ${0} <foxy-internal-text-control infer="email"></foxy-internal-text-control> ${0} `),this.renderHeader(),super.renderBody())}__renderUserTemplateState(){return l(Z||(Z=L` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t}){var a,r,s,i,o,d,m,v,f,p,y,x,g;const _=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),b={first_name:e,last_name:t,context:_?"":"empty"},j=this.hiddenSelector;return l(w||(w=L` <div style="padding-top:3.5rem"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <foxy-internal-user-invitation-form-sync-action status="sent" infer="invite-again"> </foxy-internal-user-invitation-form-sync-action> <div class="flex gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-sync-action status="revoked" class="flex-1" theme="error" infer="revoke"> </foxy-internal-user-invitation-form-sync-action> <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> </div> </div> </div> `),u(this.__getGravatar(null===(a=this.data)||void 0===a?void 0:a.email)),b,null===(r=this.data)||void 0===r?void 0:r.email,h({"border rounded":!0,"border-contrast text-contrast":"revoked"===(null===(s=this.data)||void 0===s?void 0:s.status),"border-success text-success":"accepted"===(null===(i=this.data)||void 0===i?void 0:i.status),"border-primary text-primary":"sent"===(null===(o=this.data)||void 0===o?void 0:o.status),"border-error text-error":"rejected"===(null===(d=this.data)||void 0===d?void 0:d.status)}),"revoked"===(null===(m=this.data)||void 0===m?void 0:m.status)?c(S||(S=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===(null===(v=this.data)||void 0===v?void 0:v.status)?c($||($=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===(null===(f=this.data)||void 0===f?void 0:f.status)?c(k||(k=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===(null===(p=this.data)||void 0===p?void 0:p.status)?c(M||(M=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"",{context:null===(y=this.data)||void 0===y?void 0:y.status},{context:null===(x=this.data)||void 0===x?void 0:x.status},j.matches("revoke",!0)&&j.matches("resend",!0),n(null===(g=this.data)||void 0===g?void 0:g._links["fx:resend"].href))}__renderUserSnapshotState({status:e,store_name:t}){const r=this.hiddenSelector,s={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e,"text-body":"revoked"===e};return l(C||(C=L` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> <foxy-internal-user-invitation-form-sync-action status="revoked" theme="error" class="flex-1" infer="leave"> </foxy-internal-user-invitation-form-sync-action> <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-sync-action status="rejected" theme="error primary" infer="reject"> </foxy-internal-user-invitation-form-sync-action> <foxy-internal-user-invitation-form-sync-action status="accepted" theme="success primary" infer="accept"> </foxy-internal-user-invitation-form-sync-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),h(a({"flex items-center gap-m":!0},s)),c(B||(B=L`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),h(a({"block text-center text-xl font-medium":!0},s)),{context:e,store_name:t},this.__storeDomainGetValue,{context:e,store_name:t},r.matches("reject",!0)&&r.matches("accept",!0))}}customElements.define("foxy-user-invitation-form",A);export{A as UserInvitationForm};
1
+ import"./shared-89db9c39.js";import{I as e}from"./shared-0ec6badf.js";import"./shared-0e58c95c.js";import"./shared-12c2e2c7.js";import{a as t}from"./shared-1e827d8b.js";import"./shared-af70646d.js";import{_ as a,B as r,aP as i,aQ as s}from"./shared-d1195c27.js";import{N as l}from"./shared-2ad18636.js";import{i as o}from"./shared-9803aa7c.js";import{h as n,c as d,s as c}from"./shared-dc73b9a5.js";import{a as m}from"./shared-001dfdb6.js";import{a as h,g as f}from"./shared-d8bffb38.js";import{c as v}from"./shared-4e709717.js";import"./shared-ca0700a7.js";import"./shared-51415f88.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./foxy-copy-to-clipboard.js";import"./shared-08e7b7e5.js";import"./shared-bd59ddc4.js";import"./shared-960eac62.js";import"./shared-555c2785.js";import"./shared-f23cde6c.js";import"./shared-20b733ff.js";import"./shared-11902e83.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-0e80f20c.js";import"./shared-68470d06.js";import"./shared-b4b7767a.js";import"./shared-8f8c3902.js";import"./shared-61ade33e.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let u,p=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return a(a({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"idle"===e?this.theme:"";return n(u||(u=p` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),o(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e,t;if("busy"!==this.__state)try{this.__state="busy";const a=new l.API(this),r=await a.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});this.__state=r.ok?"idle":"fail",r.ok&&(null===(t=this.nucleon)||void 0===t||t.refresh())}catch(e){this.__state="fail"}}});let y,x,g,_,b,Z,j,w,S,$,k,M,C,L,B=e=>e;const H=m(e,"user-invitation-form");class P extends H{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,a=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==a?void 0:a.includes("."))||!t?a:`${a}.${t}`}}static get properties(){return a(a({},super.properties),{},{getStorePageHref:{attribute:!1},defaultDomain:{attribute:"default-domain"},layout:{}})}static get styles(){return[...super.styles,d(y||(y=B`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required"]}get readonlySelector(){const e=["store",super.readonlySelector.toString()];return new r(e.join(" ").trim())}get hiddenSelector(){var e,t;const a=["timestamps","submit","undo",super.hiddenSelector.toString()],i=null===(e=this.data)||void 0===e?void 0:e.status,s=null!==(t=this.layout)&&void 0!==t?t:"user";return"accepted"!==i&&"sent"!==i&&a.unshift("revoke"),"accepted"!==i&&a.unshift("leave"),"sent"!==i&&a.unshift("accept","reject"),"rejected"===i&&"user"===s||"expired"===i&&"admin"===s||a.unshift("delete"),"sent"===i||"revoked"===i||"expired"===i&&"admin"===s||a.unshift("resend"),new r(a.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("already been created for this email and store")?["error:invitation_exists"]:t.includes("already has access to this store")?["error:already_has_access"]:e}}__getGravatar(e){return i((function*(){yield n(x||(x=B` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield n(g||(g=B` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield s(f(e))))}))()}__renderAdminTemplateState(){return n(_||(_=B` ${0} <foxy-internal-text-control infer="email"></foxy-internal-text-control> ${0} `),this.renderHeader(),super.renderBody())}__renderUserTemplateState(){return n(b||(b=B` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t}){var a,r,i,s,l,d,m;const f=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),u={first_name:e,last_name:t,context:f?"":"empty"},p=null===(a=this.data)||void 0===a?void 0:a.status,y=this.hiddenSelector;return n(Z||(Z=B` <div style="padding-top:3.5rem"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <div class="flex gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-delete-control infer="delete" class="flex-1"> </foxy-internal-delete-control> </div> </div> </div> </div> `),h(this.__getGravatar(null===(r=this.data)||void 0===r?void 0:r.email)),u,null===(i=this.data)||void 0===i?void 0:i.email,v({"border rounded":!0,"border-contrast text-contrast":"revoked"===p||"expired"===p,"border-success text-success":"accepted"===p,"border-primary text-primary":"sent"===p,"border-error text-error":"rejected"===p}),"revoked"===p?c(j||(j=B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===p?c(w||(w=B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===p?c(S||(S=B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===p?c($||($=B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"expired"===p?c(k||(k=B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)):"",{context:p},{context:p},y.matches("revoke",!0)&&y.matches("resend",!0)&&y.matches("delete",!0),o(null===(l=null===(s=this.data)||void 0===s?void 0:s._links["fx:revoke"])||void 0===l?void 0:l.href),o(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:resend"])||void 0===m?void 0:m.href))}__renderUserSnapshotState({status:e,store_name:t}){var r,i,s,l,d,m;const h=this.hiddenSelector,f={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e};return n(M||(M=B` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> <foxy-internal-user-invitation-form-async-action theme="error" class="flex-1" infer="leave" href="${0}"> </foxy-internal-user-invitation-form-async-action> <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action theme="error primary" infer="reject" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action theme="success primary" infer="accept" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),v(a({"flex items-center gap-m":!0},f)),c(C||(C=B`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),v(a({"block text-center text-xl font-medium":!0},f)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?n(L||(L=B` <div ?hidden="${0}"> <a class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="store_link"></foxy-i18n> </a> </div> `),"accepted"!==e||!this.getStorePageHref,this.getStorePageHref(this.data._links["fx:store"].href)):"",{context:e,store_name:t},o(null===(i=null===(r=this.data)||void 0===r?void 0:r._links["fx:revoke"])||void 0===i?void 0:i.href),h.matches("reject",!0)&&h.matches("accept",!0),o(null===(l=null===(s=this.data)||void 0===s?void 0:s._links["fx:reject"])||void 0===l?void 0:l.href),o(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:accept"])||void 0===m?void 0:m.href))}}customElements.define("foxy-user-invitation-form",P);export{P as UserInvitationForm};
@@ -3,10 +3,12 @@
3
3
  "status_admin_rejected": "{{ email }} • Invitation rejected",
4
4
  "status_admin_revoked": "{{ email }} • Access revoked",
5
5
  "status_admin_sent": "{{ email }} • Invited",
6
+ "status_admin_expired": "{{ email }} • Expired",
6
7
  "status_user_accepted": "{{ domain }} • Accepted",
7
8
  "status_user_rejected": "{{ domain }} • Rejected",
8
9
  "status_user_revoked": "{{ domain }} • Revoked",
9
10
  "status_user_sent": "{{ domain }} • Pending",
11
+ "status_user_expired": "{{ domain }} • Expired",
10
12
  "full_name": "{{ first_name }} {{ last_name }}",
11
13
  "full_name_empty": "Unknown user",
12
14
  "spinner": {
@@ -6,39 +6,38 @@
6
6
  "admin_status_title_sent": "Invitation sent",
7
7
  "admin_status_title_rejected": "Invitation rejected",
8
8
  "admin_status_title_accepted": "This user is a store admin",
9
- "admin_status_text_revoked": "This user may have been an admin in the past but has no access to this store at the moment. We will keep this record for historical purposes.",
10
- "admin_status_text_sent": "We've sent an email to this user asking them to join this store. Once they accept, they will be granted full admin access.",
9
+ "admin_status_title_expired": "Invitation expired",
10
+ "admin_status_text_revoked": "This user may have been an admin in the past but has no access to this store at the moment. We will keep this record for historical purposes. To restore this user's access, resend the invitation using the button below.",
11
+ "admin_status_text_sent": "We've sent an email to this user asking them to join this store. Once they accept, they will be granted full admin access. If they don't accept within 2 weeks, this invitation will expire.",
11
12
  "admin_status_text_rejected": "If this was a mistake, ask the user to delete this invitation in profile settings. You will be able to invite them again after that.",
12
13
  "admin_status_text_accepted": "They have full access to this store, including the ability to add and remove users.",
14
+ "admin_status_text_expired": "This invitation has expired. You can resend this invitation using the button below.",
15
+ "user_status_title_rejected": "You've rejected an invitation to join {{ store_name }} as administrator",
16
+ "user_status_title_accepted": "You're a store administrator at {{ store_name }}",
13
17
  "user_status_title_revoked": "You no longer have access to {{ store_name }}",
14
- "user_status_text_revoked": "If you'd like to join this store again, please ask the store owner to reactivate your access in settings.",
15
18
  "user_status_title_sent": "You've been invited to join {{ store_name }} as administrator",
16
- "user_status_text_sent": "Accepting this invitation will grant you full access to this store. Rejecting it will prevent this store from inviting you again.",
17
- "user_status_title_rejected": "You've rejected an invitation to join {{ store_name }} as administrator",
19
+ "user_status_title_expired": "This invitation to join {{ store_name }} as administrator has expired",
18
20
  "user_status_text_rejected": "This store won't be able to contact you again. If you changed your mind, delete this invitation and ask the store owner to invite you again.",
19
- "user_status_title_accepted": "You're a store administrator at {{ store_name }}",
20
21
  "user_status_text_accepted": "If you'd like to leave this store, you can do so by pressing the button below. Please note that if you'd like to join again, the store owner will need to invite you.",
22
+ "user_status_text_revoked": "If you'd like to join this store again, please ask the store owner to reactivate your access in settings.",
23
+ "user_status_text_sent": "Accepting this invitation will grant you full access to this store. Rejecting it will prevent this store from inviting you again.",
24
+ "user_status_text_expired": "To join this store, please ask the store owner to delete this invitation and invite you again.",
21
25
  "full_name": "{{ first_name }} {{ last_name }}",
22
26
  "full_name_empty": "Unknown User",
23
27
  "leave": {
24
- "caption": "Leave this store"
28
+ "idle": "Leave this store",
29
+ "busy": "Leaving...",
30
+ "fail": "Failed to leave"
25
31
  },
26
32
  "revoke": {
27
- "caption": "Revoke access"
28
- },
29
- "invite-again": {
30
- "caption": "Invite again"
33
+ "idle": "Revoke access",
34
+ "busy": "Revoking...",
35
+ "fail": "Failed to revoke"
31
36
  },
32
37
  "resend": {
33
- "idle": "Resend email",
38
+ "idle": "Resend invitation",
34
39
  "busy": "Resending...",
35
- "fail": "Failed to resend",
36
- "confirm": {
37
- "header": "Resend email",
38
- "message": "Please confirm that you'd like to resend the invitation email to this user.",
39
- "confirm": "Resend",
40
- "cancel": "Cancel"
41
- }
40
+ "fail": "Failed to resend"
42
41
  },
43
42
  "error": {
44
43
  "invitation_exists": "This user has already been invited to this store.",
@@ -47,6 +46,7 @@
47
46
  "store": {
48
47
  "label": "",
49
48
  "helper_text": "",
49
+ "store_link": "Open store dashboard",
50
50
  "store-domain": {
51
51
  "label": "Store domain",
52
52
  "placeholder": "Unknown",
@@ -70,10 +70,14 @@
70
70
  "v8n_required": "Please enter an email address."
71
71
  },
72
72
  "accept": {
73
- "caption": "Accept"
73
+ "idle": "Accept",
74
+ "busy": "Accepting...",
75
+ "fail": "Failed to accept"
74
76
  },
75
77
  "reject": {
76
- "caption": "Reject"
78
+ "idle": "Reject",
79
+ "busy": "Rejecting...",
80
+ "fail": "Failed to reject"
77
81
  },
78
82
  "create": {
79
83
  "caption": "Send invitation"
@@ -81,7 +85,7 @@
81
85
  "delete": {
82
86
  "delete": "Delete",
83
87
  "cancel": "Cancel",
84
- "delete_prompt": "Deleting an invitation allows the store owner to invite you again. Would you like to proceed?"
88
+ "delete_prompt": "This invitation will be permanently deleted. Would you like to proceed?"
85
89
  },
86
90
  "unavailable": {
87
91
  "loading_empty": "Creating an invitation is not available in this context."
@@ -11,6 +11,8 @@ export declare class UserInvitationForm extends Base<Data> {
11
11
  static get properties(): PropertyDeclarations;
12
12
  static get styles(): CSSResultArray;
13
13
  static get v8n(): NucleonV8N<Data>;
14
+ /** When provided, displays a link to Store Dashboard in user layout. */
15
+ getStorePageHref: ((storeHref: string) => string) | null;
14
16
  /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */
15
17
  defaultDomain: string | null;
16
18
  /** Admin layout will display user info, user layout (default) will display store info. */
@@ -11,6 +11,8 @@ const Base = TranslatableMixin(InternalForm, NS);
11
11
  export class UserInvitationForm extends Base {
12
12
  constructor() {
13
13
  super(...arguments);
14
+ /** When provided, displays a link to Store Dashboard in user layout. */
15
+ this.getStorePageHref = null;
14
16
  /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */
15
17
  this.defaultDomain = null;
16
18
  /** Admin layout will display user info, user layout (default) will display store info. */
@@ -25,6 +27,7 @@ export class UserInvitationForm extends Base {
25
27
  static get properties() {
26
28
  return {
27
29
  ...super.properties,
30
+ getStorePageHref: { attribute: false },
28
31
  defaultDomain: { attribute: 'default-domain' },
29
32
  layout: {},
30
33
  };
@@ -61,19 +64,23 @@ export class UserInvitationForm extends Base {
61
64
  return new BooleanSelector(alwaysMatch.join(' ').trim());
62
65
  }
63
66
  get hiddenSelector() {
64
- var _a;
67
+ var _a, _b;
65
68
  const alwaysMatch = ['timestamps', 'submit', 'undo', super.hiddenSelector.toString()];
66
69
  const status = (_a = this.data) === null || _a === void 0 ? void 0 : _a.status;
70
+ const layout = (_b = this.layout) !== null && _b !== void 0 ? _b : 'user';
67
71
  if (status !== 'accepted' && status !== 'sent')
68
72
  alwaysMatch.unshift('revoke');
69
- if (status !== 'rejected')
70
- alwaysMatch.unshift('delete');
71
73
  if (status !== 'accepted')
72
74
  alwaysMatch.unshift('leave');
73
- if (status !== 'revoked')
74
- alwaysMatch.unshift('invite-again');
75
75
  if (status !== 'sent')
76
- alwaysMatch.unshift('resend', 'accept', 'reject');
76
+ alwaysMatch.unshift('accept', 'reject');
77
+ if ((status !== 'rejected' || layout !== 'user') &&
78
+ (status !== 'expired' || layout !== 'admin')) {
79
+ alwaysMatch.unshift('delete');
80
+ }
81
+ if (status !== 'sent' && status !== 'revoked' && (status !== 'expired' || layout !== 'admin')) {
82
+ alwaysMatch.unshift('resend');
83
+ }
77
84
  return new BooleanSelector(alwaysMatch.join(' ').trim());
78
85
  }
79
86
  renderBody() {
@@ -142,15 +149,16 @@ export class UserInvitationForm extends Base {
142
149
  `;
143
150
  }
144
151
  __renderAdminSnapshotState({ first_name, last_name }) {
145
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
152
+ var _a, _b, _c, _d, _e, _f, _g;
146
153
  const hasName = (first_name === null || first_name === void 0 ? void 0 : first_name.trim()) || (last_name === null || last_name === void 0 ? void 0 : last_name.trim());
147
154
  const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };
155
+ const status = (_a = this.data) === null || _a === void 0 ? void 0 : _a.status;
148
156
  const hidden = this.hiddenSelector;
149
157
  return html `
150
158
  <div style="padding-top: 3.5rem">
151
159
  <div class="relative">
152
160
  <div class="inner-curve bg-contrast-5 absolute inset-0"></div>
153
- ${asyncReplace(this.__getGravatar((_a = this.data) === null || _a === void 0 ? void 0 : _a.email))}
161
+ ${asyncReplace(this.__getGravatar((_b = this.data) === null || _b === void 0 ? void 0 : _b.email))}
154
162
 
155
163
  <div
156
164
  class="relative pb-m px-m leading-xs grid gap-m"
@@ -164,34 +172,32 @@ export class UserInvitationForm extends Base {
164
172
  .options=${nameOptions}
165
173
  >
166
174
  </foxy-i18n>
167
- <div class="text-m text-center text-secondary">${(_b = this.data) === null || _b === void 0 ? void 0 : _b.email}</div>
175
+ <div class="text-m text-center text-secondary">${(_c = this.data) === null || _c === void 0 ? void 0 : _c.email}</div>
168
176
  </div>
169
177
 
170
178
  <div
171
179
  style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
172
180
  class=${classMap({
173
181
  'border rounded': true,
174
- 'border-contrast text-contrast': ((_c = this.data) === null || _c === void 0 ? void 0 : _c.status) === 'revoked',
175
- 'border-success text-success': ((_d = this.data) === null || _d === void 0 ? void 0 : _d.status) === 'accepted',
176
- 'border-primary text-primary': ((_e = this.data) === null || _e === void 0 ? void 0 : _e.status) === 'sent',
177
- 'border-error text-error': ((_f = this.data) === null || _f === void 0 ? void 0 : _f.status) === 'rejected',
182
+ 'border-contrast text-contrast': status === 'revoked' || status === 'expired',
183
+ 'border-success text-success': status === 'accepted',
184
+ 'border-primary text-primary': status === 'sent',
185
+ 'border-error text-error': status === 'rejected',
178
186
  })}
179
187
  >
180
188
  <p class="font-medium flex items-center gap-s">
181
- ${((_g = this.data) === null || _g === void 0 ? void 0 : _g.status) === 'revoked'
189
+ ${status === 'revoked'
182
190
  ? svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`
183
- : ((_h = this.data) === null || _h === void 0 ? void 0 : _h.status) === 'sent'
191
+ : status === 'sent'
184
192
  ? svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`
185
- : ((_j = this.data) === null || _j === void 0 ? void 0 : _j.status) === 'rejected'
193
+ : status === 'rejected'
186
194
  ? svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`
187
- : ((_k = this.data) === null || _k === void 0 ? void 0 : _k.status) === 'accepted'
195
+ : status === 'accepted'
188
196
  ? svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`
189
- : ''}
190
- <foxy-i18n
191
- infer=""
192
- key="admin_status_title"
193
- .options=${{ context: (_l = this.data) === null || _l === void 0 ? void 0 : _l.status }}
194
- >
197
+ : status === 'expired'
198
+ ? svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`
199
+ : ''}
200
+ <foxy-i18n infer="" key="admin_status_title" .options=${{ context: status }}>
195
201
  </foxy-i18n>
196
202
  </p>
197
203
 
@@ -199,36 +205,34 @@ export class UserInvitationForm extends Base {
199
205
  class="text-body"
200
206
  style="padding-left: calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"
201
207
  >
202
- <foxy-i18n
203
- infer=""
204
- key="admin_status_text"
205
- .options=${{ context: (_m = this.data) === null || _m === void 0 ? void 0 : _m.status }}
206
- >
208
+ <foxy-i18n infer="" key="admin_status_text" .options=${{ context: status }}>
207
209
  </foxy-i18n>
208
210
  </p>
209
211
  </div>
210
212
 
211
- <foxy-internal-user-invitation-form-sync-action status="sent" infer="invite-again">
212
- </foxy-internal-user-invitation-form-sync-action>
213
-
214
213
  <div
215
214
  class="flex gap-m"
216
- ?hidden=${hidden.matches('revoke', true) && hidden.matches('resend', true)}
215
+ ?hidden=${hidden.matches('revoke', true) &&
216
+ hidden.matches('resend', true) &&
217
+ hidden.matches('delete', true)}
217
218
  >
218
- <foxy-internal-user-invitation-form-sync-action
219
- status="revoked"
219
+ <foxy-internal-user-invitation-form-async-action
220
+ infer="revoke"
220
221
  class="flex-1"
221
222
  theme="error"
222
- infer="revoke"
223
+ href=${ifDefined((_e = (_d = this.data) === null || _d === void 0 ? void 0 : _d._links['fx:revoke']) === null || _e === void 0 ? void 0 : _e.href)}
223
224
  >
224
- </foxy-internal-user-invitation-form-sync-action>
225
+ </foxy-internal-user-invitation-form-async-action>
225
226
 
226
227
  <foxy-internal-user-invitation-form-async-action
227
228
  infer="resend"
228
229
  class="flex-1"
229
- href=${ifDefined((_o = this.data) === null || _o === void 0 ? void 0 : _o._links['fx:resend'].href)}
230
+ href=${ifDefined((_g = (_f = this.data) === null || _f === void 0 ? void 0 : _f._links['fx:resend']) === null || _g === void 0 ? void 0 : _g.href)}
230
231
  >
231
232
  </foxy-internal-user-invitation-form-async-action>
233
+
234
+ <foxy-internal-delete-control infer="delete" class="flex-1">
235
+ </foxy-internal-delete-control>
232
236
  </div>
233
237
  </div>
234
238
  </div>
@@ -236,12 +240,12 @@ export class UserInvitationForm extends Base {
236
240
  `;
237
241
  }
238
242
  __renderUserSnapshotState({ status, store_name }) {
243
+ var _a, _b, _c, _d, _e, _f;
239
244
  const hidden = this.hiddenSelector;
240
245
  const textColorMap = {
241
246
  'text-primary': status === 'sent',
242
247
  'text-success': status === 'accepted',
243
248
  'text-error': status === 'rejected',
244
- 'text-body': status === 'revoked',
245
249
  };
246
250
  return html `
247
251
  <div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>
@@ -269,6 +273,18 @@ export class UserInvitationForm extends Base {
269
273
  </foxy-internal-text-control>
270
274
  <foxy-internal-text-control layout="summary-item" infer="store-email">
271
275
  </foxy-internal-text-control>
276
+ ${status === 'accepted' && this.getStorePageHref && this.data
277
+ ? html `
278
+ <div ?hidden=${status !== 'accepted' || !this.getStorePageHref}>
279
+ <a
280
+ class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50"
281
+ href=${this.getStorePageHref(this.data._links['fx:store'].href)}
282
+ >
283
+ <foxy-i18n infer="" key="store_link"></foxy-i18n>
284
+ </a>
285
+ </div>
286
+ `
287
+ : ''}
272
288
  </foxy-internal-summary-control>
273
289
 
274
290
  <foxy-i18n
@@ -279,31 +295,31 @@ export class UserInvitationForm extends Base {
279
295
  >
280
296
  </foxy-i18n>
281
297
 
282
- <foxy-internal-user-invitation-form-sync-action
283
- status="revoked"
298
+ <foxy-internal-user-invitation-form-async-action
284
299
  theme="error"
285
300
  class="flex-1"
286
301
  infer="leave"
302
+ href=${ifDefined((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links['fx:revoke']) === null || _b === void 0 ? void 0 : _b.href)}
287
303
  >
288
- </foxy-internal-user-invitation-form-sync-action>
304
+ </foxy-internal-user-invitation-form-async-action>
289
305
 
290
306
  <div
291
307
  class="grid grid-cols-2 gap-m"
292
308
  ?hidden=${hidden.matches('reject', true) && hidden.matches('accept', true)}
293
309
  >
294
- <foxy-internal-user-invitation-form-sync-action
295
- status="rejected"
310
+ <foxy-internal-user-invitation-form-async-action
296
311
  theme="error primary"
297
312
  infer="reject"
313
+ href=${ifDefined((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c._links['fx:reject']) === null || _d === void 0 ? void 0 : _d.href)}
298
314
  >
299
- </foxy-internal-user-invitation-form-sync-action>
315
+ </foxy-internal-user-invitation-form-async-action>
300
316
 
301
- <foxy-internal-user-invitation-form-sync-action
302
- status="accepted"
317
+ <foxy-internal-user-invitation-form-async-action
303
318
  theme="success primary"
304
319
  infer="accept"
320
+ href=${ifDefined((_f = (_e = this.data) === null || _e === void 0 ? void 0 : _e._links['fx:accept']) === null || _f === void 0 ? void 0 : _f.href)}
305
321
  >
306
- </foxy-internal-user-invitation-form-sync-action>
322
+ </foxy-internal-user-invitation-form-async-action>
307
323
  </div>
308
324
 
309
325
  <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control>
@@ -1 +1 @@
1
- {"version":3,"file":"UserInvitationForm.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/UserInvitationForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAClC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,kBAAmB,SAAQ,IAAU;IAAlD;;QAwCE,+FAA+F;QAC/F,kBAAa,GAAkB,IAAI,CAAC;QAEpC,0FAA0F;QAC1F,WAAM,GAA4B,IAAI,CAAC;QAEtB,0BAAqB,GAAG,GAAG,EAAE;;YAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;YACpC,MAAM,MAAM,SAAG,IAAI,CAAC,IAAI,0CAAE,YAAY,CAAC;YACvC,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,GAAG,MAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC/E,CAAC,CAAC;IAmQJ,CAAC;IApTC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,aAAa,EAAE,EAAE,SAAS,EAAE,gB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AAE,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC;;mBAEzE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;;;;;;;;sBAQ5B,IAAI,CAAC,qBAAqB;;;;;;;;;;;;;mBAa7B,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;;;;;;;;;;;;;;kBAchC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;;;;;;;;;;;;;;;;;;KAkB7E,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { getGravatarUrl } from '../../../utils/get-gravatar-url';\nimport { html, svg, css } from 'lit-element';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { asyncReplace } from 'lit-html/directives/async-replace';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'user-invitation-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class UserInvitationForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n defaultDomain: { attribute: 'default-domain' },\n layout: {},\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n .inner-curve {\n --r: var(--lumo-border-radius-l); /* control the rounded part */\n --s: 3rem; /* control the size of the cut */\n --a: 12deg; /* control the depth of the curvature */\n --m: 0 / calc(2 * var(--r)) var(--r) no-repeat\n radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);\n --d: (var(--s) + var(--r)) * cos(var(--a));\n\n border-radius: var(--r);\n width: 100%;\n mask: calc(50% + var(--d)) var(--m), calc(50% - var(--d)) var(--m),\n radial-gradient(\n var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),\n #0000 100%,\n #000 calc(100% + 1px)\n )\n 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,\n linear-gradient(90deg, #000 calc(50% - var(--d)), #0000 0 calc(50% + var(--d)), #000 0);\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [({ email: v }) => !!v || 'email:v8n_required'];\n }\n\n /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */\n defaultDomain: string | null = null;\n\n /** Admin layout will display user info, user layout (default) will display store info. */\n layout: 'admin' | 'user' | null = null;\n\n private readonly __storeDomainGetValue = () => {\n const defaultD = this.defaultDomain;\n const domain = this.data?.store_domain;\n return domain?.includes('.') || !defaultD ? domain : `${domain}.${defaultD}`;\n };\n\n get readonlySelector(): BooleanSelector {\n const alwaysMatch = ['store', super.readonlySelector.toString()];\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['timestamps', 'submit', 'undo', super.hiddenSelector.toString()];\n const status = this.data?.status;\n\n if (status !== 'accepted' && status !== 'sent') alwaysMatch.unshift('revoke');\n if (status !== 'rejected') alwaysMatch.unshift('delete');\n if (status !== 'accepted') alwaysMatch.unshift('leave');\n if (status !== 'revoked') alwaysMatch.unshift('invite-again');\n if (status !== 'sent') alwaysMatch.unshift('resend', 'accept', 'reject');\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderBody(): TemplateResult {\n const { layout, data } = this;\n\n if (layout === 'admin') {\n return data ? this.__renderAdminSnapshotState(data) : this.__renderAdminTemplateState();\n } else {\n return data ? this.__renderUserSnapshotState(data) : this.__renderUserTemplateState();\n }\n }\n\n protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {\n try {\n return await super._fetch(...args);\n } catch (err) {\n let message;\n\n try {\n message = (await (err as Response).json())._embedded['fx:errors'][0].message;\n } catch {\n throw err;\n }\n\n if (message.includes('already been created for this email and store')) {\n throw ['error:invitation_exists'];\n } else if (message.includes('already has access to this store')) {\n throw ['error:already_has_access'];\n } else {\n throw err;\n }\n }\n }\n\n private async *__getGravatar(email?: string) {\n yield html`\n <div\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5\"\n ></div>\n `;\n\n if (email) {\n yield html`\n <img\n data-testid=\"gravatar\"\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5 shadow-xs\"\n src=${await getGravatarUrl(email)}\n alt=\"\"\n />\n `;\n }\n }\n\n private __renderAdminTemplateState() {\n return html`\n ${this.renderHeader()}\n <foxy-internal-text-control infer=\"email\"></foxy-internal-text-control>\n ${super.renderBody()}\n `;\n }\n\n private __renderUserTemplateState() {\n return html`\n <div class=\"p-xl flex items-center justify-center\">\n <foxy-spinner layout=\"vertical\" infer=\"unavailable\" state=\"empty\"></foxy-spinner>\n </div>\n `;\n }\n\n private __renderAdminSnapshotState({ first_name, last_name }: Data) {\n const hasName = first_name?.trim() || last_name?.trim();\n const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };\n const hidden = this.hiddenSelector;\n\n return html`\n <div style=\"padding-top: 3.5rem\">\n <div class=\"relative\">\n <div class=\"inner-curve bg-contrast-5 absolute inset-0\"></div>\n ${asyncReplace(this.__getGravatar(this.data?.email))}\n\n <div\n class=\"relative pb-m px-m leading-xs grid gap-m\"\n style=\"padding-top: calc(2.5rem + var(--lumo-space-m))\"\n >\n <div>\n <foxy-i18n\n class=\"block text-xl font-medium text-center\"\n infer=\"\"\n key=\"full_name\"\n .options=${nameOptions}\n >\n </foxy-i18n>\n <div class=\"text-m text-center text-secondary\">${this.data?.email}</div>\n </div>\n\n <div\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'border rounded': true,\n 'border-contrast text-contrast': this.data?.status === 'revoked',\n 'border-success text-success': this.data?.status === 'accepted',\n 'border-primary text-primary': this.data?.status === 'sent',\n 'border-error text-error': this.data?.status === 'rejected',\n })}\n >\n <p class=\"font-medium flex items-center gap-s\">\n ${this.data?.status === 'revoked'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z\" clip-rule=\"evenodd\" /></svg>`\n : this.data?.status === 'sent'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z\" clip-rule=\"evenodd\" /></svg>`\n : this.data?.status === 'rejected'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\" clip-rule=\"evenodd\" /></svg>`\n : this.data?.status === 'accepted'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\" clip-rule=\"evenodd\" /></svg>`\n : ''}\n <foxy-i18n\n infer=\"\"\n key=\"admin_status_title\"\n .options=${{ context: this.data?.status }}\n >\n </foxy-i18n>\n </p>\n\n <p\n class=\"text-body\"\n style=\"padding-left: calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))\"\n >\n <foxy-i18n\n infer=\"\"\n key=\"admin_status_text\"\n .options=${{ context: this.data?.status }}\n >\n </foxy-i18n>\n </p>\n </div>\n\n <foxy-internal-user-invitation-form-sync-action status=\"sent\" infer=\"invite-again\">\n </foxy-internal-user-invitation-form-sync-action>\n\n <div\n class=\"flex gap-m\"\n ?hidden=${hidden.matches('revoke', true) && hidden.matches('resend', true)}\n >\n <foxy-internal-user-invitation-form-sync-action\n status=\"revoked\"\n class=\"flex-1\"\n theme=\"error\"\n infer=\"revoke\"\n >\n </foxy-internal-user-invitation-form-sync-action>\n\n <foxy-internal-user-invitation-form-async-action\n infer=\"resend\"\n class=\"flex-1\"\n href=${ifDefined(this.data?._links['fx:resend'].href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n private __renderUserSnapshotState({ status, store_name }: Data) {\n const hidden = this.hiddenSelector;\n const textColorMap = {\n 'text-primary': status === 'sent',\n 'text-success': status === 'accepted',\n 'text-error': status === 'rejected',\n 'text-body': status === 'revoked',\n };\n\n return html`\n <div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>\n <div class=\"border-t flex-1\"></div>\n ${svg`<svg style=\"height: 5rem; width: 5rem\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 256 256\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" d=\"M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z\"/></svg>`}\n <div class=\"border-t flex-1\"></div>\n </div>\n\n <foxy-i18n\n infer=\"\"\n class=${classMap({ 'block text-center text-xl font-medium': true, ...textColorMap })}\n key=\"user_status_title\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-summary-control infer=\"store\">\n <foxy-internal-text-control\n layout=\"summary-item\"\n infer=\"store-domain\"\n .getValue=${this.__storeDomainGetValue}\n >\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-url\">\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-email\">\n </foxy-internal-text-control>\n </foxy-internal-summary-control>\n\n <foxy-i18n\n class=\"block text-secondary text-center\"\n infer=\"\"\n key=\"user_status_text\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-user-invitation-form-sync-action\n status=\"revoked\"\n theme=\"error\"\n class=\"flex-1\"\n infer=\"leave\"\n >\n </foxy-internal-user-invitation-form-sync-action>\n\n <div\n class=\"grid grid-cols-2 gap-m\"\n ?hidden=${hidden.matches('reject', true) && hidden.matches('accept', true)}\n >\n <foxy-internal-user-invitation-form-sync-action\n status=\"rejected\"\n theme=\"error primary\"\n infer=\"reject\"\n >\n </foxy-internal-user-invitation-form-sync-action>\n\n <foxy-internal-user-invitation-form-sync-action\n status=\"accepted\"\n theme=\"success primary\"\n infer=\"accept\"\n >\n </foxy-internal-user-invitation-form-sync-action>\n </div>\n\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"UserInvitationForm.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/UserInvitationForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAClC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,kBAAmB,SAAQ,IAAU;IAAlD;;QAyCE,wEAAwE;QACxE,qBAAgB,GAA2C,IAAI,CAAC;QAEhE,+FAA+F;QAC/F,kBAAa,GAAkB,IAAI,CAAC;QAEpC,0FAA0F;QAC1F,WAAM,GAA4B,IAAI,CAAC;QAEtB,0BAAqB,GAAG,GAAG,EAAE;;YAC5C,MAAM,QAAQ,GAAG,IA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AAI,CAAC;;;;;;kBAM5C,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;;;;;iBAKjE,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;;iBAO/C,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;KAM3D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { getGravatarUrl } from '../../../utils/get-gravatar-url';\nimport { html, svg, css } from 'lit-element';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { asyncReplace } from 'lit-html/directives/async-replace';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'user-invitation-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class UserInvitationForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getStorePageHref: { attribute: false },\n defaultDomain: { attribute: 'default-domain' },\n layout: {},\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n .inner-curve {\n --r: var(--lumo-border-radius-l); /* control the rounded part */\n --s: 3rem; /* control the size of the cut */\n --a: 12deg; /* control the depth of the curvature */\n --m: 0 / calc(2 * var(--r)) var(--r) no-repeat\n radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);\n --d: (var(--s) + var(--r)) * cos(var(--a));\n\n border-radius: var(--r);\n width: 100%;\n mask: calc(50% + var(--d)) var(--m), calc(50% - var(--d)) var(--m),\n radial-gradient(\n var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),\n #0000 100%,\n #000 calc(100% + 1px)\n )\n 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,\n linear-gradient(90deg, #000 calc(50% - var(--d)), #0000 0 calc(50% + var(--d)), #000 0);\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [({ email: v }) => !!v || 'email:v8n_required'];\n }\n\n /** When provided, displays a link to Store Dashboard in user layout. */\n getStorePageHref: ((storeHref: string) => string) | null = null;\n\n /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */\n defaultDomain: string | null = null;\n\n /** Admin layout will display user info, user layout (default) will display store info. */\n layout: 'admin' | 'user' | null = null;\n\n private readonly __storeDomainGetValue = () => {\n const defaultD = this.defaultDomain;\n const domain = this.data?.store_domain;\n return domain?.includes('.') || !defaultD ? domain : `${domain}.${defaultD}`;\n };\n\n get readonlySelector(): BooleanSelector {\n const alwaysMatch = ['store', super.readonlySelector.toString()];\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['timestamps', 'submit', 'undo', super.hiddenSelector.toString()];\n const status = this.data?.status;\n const layout = this.layout ?? 'user';\n\n if (status !== 'accepted' && status !== 'sent') alwaysMatch.unshift('revoke');\n if (status !== 'accepted') alwaysMatch.unshift('leave');\n if (status !== 'sent') alwaysMatch.unshift('accept', 'reject');\n\n if (\n (status !== 'rejected' || layout !== 'user') &&\n (status !== 'expired' || layout !== 'admin')\n ) {\n alwaysMatch.unshift('delete');\n }\n\n if (status !== 'sent' && status !== 'revoked' && (status !== 'expired' || layout !== 'admin')) {\n alwaysMatch.unshift('resend');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderBody(): TemplateResult {\n const { layout, data } = this;\n\n if (layout === 'admin') {\n return data ? this.__renderAdminSnapshotState(data) : this.__renderAdminTemplateState();\n } else {\n return data ? this.__renderUserSnapshotState(data) : this.__renderUserTemplateState();\n }\n }\n\n protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {\n try {\n return await super._fetch(...args);\n } catch (err) {\n let message;\n\n try {\n message = (await (err as Response).json())._embedded['fx:errors'][0].message;\n } catch {\n throw err;\n }\n\n if (message.includes('already been created for this email and store')) {\n throw ['error:invitation_exists'];\n } else if (message.includes('already has access to this store')) {\n throw ['error:already_has_access'];\n } else {\n throw err;\n }\n }\n }\n\n private async *__getGravatar(email?: string) {\n yield html`\n <div\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5\"\n ></div>\n `;\n\n if (email) {\n yield html`\n <img\n data-testid=\"gravatar\"\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5 shadow-xs\"\n src=${await getGravatarUrl(email)}\n alt=\"\"\n />\n `;\n }\n }\n\n private __renderAdminTemplateState() {\n return html`\n ${this.renderHeader()}\n <foxy-internal-text-control infer=\"email\"></foxy-internal-text-control>\n ${super.renderBody()}\n `;\n }\n\n private __renderUserTemplateState() {\n return html`\n <div class=\"p-xl flex items-center justify-center\">\n <foxy-spinner layout=\"vertical\" infer=\"unavailable\" state=\"empty\"></foxy-spinner>\n </div>\n `;\n }\n\n private __renderAdminSnapshotState({ first_name, last_name }: Data) {\n const hasName = first_name?.trim() || last_name?.trim();\n const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };\n const status = this.data?.status;\n const hidden = this.hiddenSelector;\n\n return html`\n <div style=\"padding-top: 3.5rem\">\n <div class=\"relative\">\n <div class=\"inner-curve bg-contrast-5 absolute inset-0\"></div>\n ${asyncReplace(this.__getGravatar(this.data?.email))}\n\n <div\n class=\"relative pb-m px-m leading-xs grid gap-m\"\n style=\"padding-top: calc(2.5rem + var(--lumo-space-m))\"\n >\n <div>\n <foxy-i18n\n class=\"block text-xl font-medium text-center\"\n infer=\"\"\n key=\"full_name\"\n .options=${nameOptions}\n >\n </foxy-i18n>\n <div class=\"text-m text-center text-secondary\">${this.data?.email}</div>\n </div>\n\n <div\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'border rounded': true,\n 'border-contrast text-contrast': status === 'revoked' || status === 'expired',\n 'border-success text-success': status === 'accepted',\n 'border-primary text-primary': status === 'sent',\n 'border-error text-error': status === 'rejected',\n })}\n >\n <p class=\"font-medium flex items-center gap-s\">\n ${status === 'revoked'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'sent'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'rejected'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'accepted'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'expired'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path d=\"M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z\" /><path fill-rule=\"evenodd\" d=\"m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" /></svg>`\n : ''}\n <foxy-i18n infer=\"\" key=\"admin_status_title\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n\n <p\n class=\"text-body\"\n style=\"padding-left: calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))\"\n >\n <foxy-i18n infer=\"\" key=\"admin_status_text\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n </div>\n\n <div\n class=\"flex gap-m\"\n ?hidden=${hidden.matches('revoke', true) &&\n hidden.matches('resend', true) &&\n hidden.matches('delete', true)}\n >\n <foxy-internal-user-invitation-form-async-action\n infer=\"revoke\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-user-invitation-form-async-action\n infer=\"resend\"\n class=\"flex-1\"\n href=${ifDefined(this.data?._links['fx:resend']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-delete-control infer=\"delete\" class=\"flex-1\">\n </foxy-internal-delete-control>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n private __renderUserSnapshotState({ status, store_name }: Data) {\n const hidden = this.hiddenSelector;\n const textColorMap = {\n 'text-primary': status === 'sent',\n 'text-success': status === 'accepted',\n 'text-error': status === 'rejected',\n };\n\n return html`\n <div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>\n <div class=\"border-t flex-1\"></div>\n ${svg`<svg style=\"height: 5rem; width: 5rem\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 256 256\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" d=\"M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z\"/></svg>`}\n <div class=\"border-t flex-1\"></div>\n </div>\n\n <foxy-i18n\n infer=\"\"\n class=${classMap({ 'block text-center text-xl font-medium': true, ...textColorMap })}\n key=\"user_status_title\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-summary-control infer=\"store\">\n <foxy-internal-text-control\n layout=\"summary-item\"\n infer=\"store-domain\"\n .getValue=${this.__storeDomainGetValue}\n >\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-url\">\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-email\">\n </foxy-internal-text-control>\n ${status === 'accepted' && this.getStorePageHref && this.data\n ? html`\n <div ?hidden=${status !== 'accepted' || !this.getStorePageHref}>\n <a\n class=\"text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${this.getStorePageHref(this.data._links['fx:store'].href)}\n >\n <foxy-i18n infer=\"\" key=\"store_link\"></foxy-i18n>\n </a>\n </div>\n `\n : ''}\n </foxy-internal-summary-control>\n\n <foxy-i18n\n class=\"block text-secondary text-center\"\n infer=\"\"\n key=\"user_status_text\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-user-invitation-form-async-action\n theme=\"error\"\n class=\"flex-1\"\n infer=\"leave\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <div\n class=\"grid grid-cols-2 gap-m\"\n ?hidden=${hidden.matches('reject', true) && hidden.matches('accept', true)}\n >\n <foxy-internal-user-invitation-form-async-action\n theme=\"error primary\"\n infer=\"reject\"\n href=${ifDefined(this.data?._links['fx:reject']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-user-invitation-form-async-action\n theme=\"success primary\"\n infer=\"accept\"\n href=${ifDefined(this.data?._links['fx:accept']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n </div>\n\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import '../../internal/InternalSummaryControl/index';
2
+ import '../../internal/InternalDeleteControl/index';
2
3
  import '../../internal/InternalTextControl/index';
3
4
  import '../../internal/InternalForm/index';
4
5
  import './internal/InternalUserInvitationFormAsyncAction/index';
5
- import './internal/InternalUserInvitationFormSyncAction/index';
6
6
  import { UserInvitationForm } from './UserInvitationForm';
7
7
  export { UserInvitationForm };
@@ -1,8 +1,8 @@
1
1
  import "../../internal/InternalSummaryControl/index.js";
2
+ import "../../internal/InternalDeleteControl/index.js";
2
3
  import "../../internal/InternalTextControl/index.js";
3
4
  import "../../internal/InternalForm/index.js";
4
5
  import "./internal/InternalUserInvitationFormAsyncAction/index.js";
5
- import "./internal/InternalUserInvitationFormSyncAction/index.js";
6
6
  import { UserInvitationForm } from "./UserInvitationForm.js";
7
7
  customElements.define('foxy-user-invitation-form', UserInvitationForm);
8
8
  export { UserInvitationForm };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/index.ts"],"names":[],"mappings":"AAAA,wDAAqD;AACrD,qDAAkD;AAClD,8CAA2C;AAE3C,mEAAgE;AAChE,kEAA+D;AAE/D,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAE1D,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport './internal/InternalUserInvitationFormAsyncAction/index';\nimport './internal/InternalUserInvitationFormSyncAction/index';\n\nimport { UserInvitationForm } from './UserInvitationForm';\n\ncustomElements.define('foxy-user-invitation-form', UserInvitationForm);\n\nexport { UserInvitationForm };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/index.ts"],"names":[],"mappings":"AAAA,wDAAqD;AACrD,uDAAoD;AACpD,qDAAkD;AAClD,8CAA2C;AAE3C,mEAAgE;AAEhE,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAE1D,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalDeleteControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport './internal/InternalUserInvitationFormAsyncAction/index';\n\nimport { UserInvitationForm } from './UserInvitationForm';\n\ncustomElements.define('foxy-user-invitation-form', UserInvitationForm);\n\nexport { UserInvitationForm };\n"]}
@@ -32,7 +32,7 @@ export class InternalUserInvitationFormAsyncAction extends InternalControl {
32
32
  `;
33
33
  }
34
34
  async __submit() {
35
- var _a;
35
+ var _a, _b;
36
36
  if (this.__state === 'busy')
37
37
  return;
38
38
  try {
@@ -41,9 +41,9 @@ export class InternalUserInvitationFormAsyncAction extends InternalControl {
41
41
  const response = await api.fetch((_a = this.href) !== null && _a !== void 0 ? _a : '', { method: 'POST' });
42
42
  this.__state = response.ok ? 'idle' : 'fail';
43
43
  if (response.ok)
44
- this.dispatchEvent(new CustomEvent('done'));
44
+ (_b = this.nucleon) === null || _b === void 0 ? void 0 : _b.refresh();
45
45
  }
46
- catch (_b) {
46
+ catch (_c) {
47
47
  this.__state = 'fail';
48
48
  }
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InternalUserInvitationFormAsyncAction.js","sourceRoot":"","sources":["../../../../../../src/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.ts"],"names":[],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C;YACzC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,OAAC,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAEtE,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7C,IAAI,QAAQ,CAAC,EAAE;gBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;SAC9D;QAAC,WAAM;YACN,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;SACvB;IACH,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\n\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { NucleonElement } from '../../../NucleonElement/NucleonElement';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\nexport class InternalUserInvitationFormAsyncAction extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __state: { type: String },\n theme: { type: String },\n href: { type: String },\n };\n }\n\n theme: string | null = null;\n\n href: string | null = null;\n\n private __state = 'idle';\n\n renderControl(): TemplateResult {\n const state = this.__state;\n const theme = state === 'fail' ? 'error' : state === 'idle' ? this.theme : '';\n\n return html`\n <vaadin-button\n theme=${ifDefined(theme ?? void 0)}\n class=\"w-full\"\n ?disabled=${state === 'busy' || this.disabled}\n @click=${this.__submit}\n >\n <foxy-i18n key=${state} infer=\"\"></foxy-i18n>\n </vaadin-button>\n `;\n }\n\n private async __submit(): Promise<void> {\n if (this.__state === 'busy') return;\n\n try {\n this.__state = 'busy';\n\n const api = new NucleonElement.API(this);\n const response = await api.fetch(this.href ?? '', { method: 'POST' });\n\n this.__state = response.ok ? 'idle' : 'fail';\n if (response.ok) this.dispatchEvent(new CustomEvent('done'));\n } catch {\n this.__state = 'fail';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"InternalUserInvitationFormAsyncAction.js","sourceRoot":"","sources":["../../../../../../src/elements/public/UserInvitationForm/internal/InternalUserInvitationFormAsyncAction/InternalUserInvitationFormAsyncAction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,cAAc,EAAE,kDAA+C;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,OAAO,qCAAsC,SAAQ,eAAe;IAA1E;;QAUE,UAAK,GAAkB,IAAI,CAAC;QAE5B,SAAI,GAAkB,IAAI,CAAC;QAEnB,YAAO,GAAG,MAAM,CAAC;IAiC3B,CAAC;IA9CC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACvB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACvB,CAAC;IACJ,CAAC;IAQD,aAAa;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,MAAM,KAAK,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9E,OAAO,IAAI,CAAA;;gBAEC,SAAS,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,CAAC;;oBAEtB,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ;iBACpC,IAAI,CAAC,QAAQ;;yBAEL,KAAK;;KAEzB,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,QAAQ;;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM;YAAE,OAAO;QAEpC,IAAI;YACF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;YAEtB,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,OAAC,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAEtE,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7C,IAAI,QAAQ,CAAC,EAAE;gBAAE,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,GAAG;SAC1C;QAAC,WAAM;YACN,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;SACvB;IACH,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\n\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { NucleonElement } from '../../../NucleonElement/NucleonElement';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\nexport class InternalUserInvitationFormAsyncAction extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __state: { type: String },\n theme: { type: String },\n href: { type: String },\n };\n }\n\n theme: string | null = null;\n\n href: string | null = null;\n\n private __state = 'idle';\n\n renderControl(): TemplateResult {\n const state = this.__state;\n const theme = state === 'fail' ? 'error' : state === 'idle' ? this.theme : '';\n\n return html`\n <vaadin-button\n theme=${ifDefined(theme ?? void 0)}\n class=\"w-full\"\n ?disabled=${state === 'busy' || this.disabled}\n @click=${this.__submit}\n >\n <foxy-i18n key=${state} infer=\"\"></foxy-i18n>\n </vaadin-button>\n `;\n }\n\n private async __submit(): Promise<void> {\n if (this.__state === 'busy') return;\n\n try {\n this.__state = 'busy';\n\n const api = new NucleonElement.API(this);\n const response = await api.fetch(this.href ?? '', { method: 'POST' });\n\n this.__state = response.ok ? 'idle' : 'fail';\n if (response.ok) this.nucleon?.refresh();\n } catch {\n this.__state = 'fail';\n }\n }\n}\n"]}
@@ -10,6 +10,15 @@ export interface UserInvitation extends Graph {
10
10
  'fx:resend': {
11
11
  curie: 'fx:resend';
12
12
  };
13
+ 'fx:accept': {
14
+ curie: 'fx:accept';
15
+ };
16
+ 'fx:reject': {
17
+ curie: 'fx:reject';
18
+ };
19
+ 'fx:revoke': {
20
+ curie: 'fx:revoke';
21
+ };
13
22
  };
14
23
  props: {
15
24
  store_url: string;
@@ -19,7 +28,7 @@ export interface UserInvitation extends Graph {
19
28
  first_name: string | null;
20
29
  last_name: string | null;
21
30
  email: string;
22
- status: 'sent' | 'accepted' | 'rejected' | 'revoked';
31
+ status: 'sent' | 'accepted' | 'rejected' | 'revoked' | 'expired';
23
32
  date_created: string;
24
33
  date_modified: string;
25
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CollectionGraphLinks,\n CollectionGraphProps,\n} from '@foxy.io/sdk/dist/types/core/defaults';\n\nimport type { Graph, Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\n// TODO: replace with SDK import when SDK has the types\nexport interface UserInvitation extends Graph {\n curie: 'fx:user_invitation';\n links: {\n 'self': UserInvitation;\n 'fx:user': Rels.User;\n 'fx:store': Rels.Store;\n 'fx:resend': { curie: 'fx:resend' };\n };\n props: {\n store_url: string;\n store_name: string;\n store_email: string;\n store_domain: string;\n first_name: string | null;\n last_name: string | null;\n email: string;\n status: 'sent' | 'accepted' | 'rejected' | 'revoked';\n date_created: string;\n date_modified: string;\n };\n}\n\n// TODO: replace with SDK import when SDK has the types\nexport interface UserInvitations extends Graph {\n curie: 'fx:user_invitations';\n links: CollectionGraphLinks<UserInvitations>;\n props: CollectionGraphProps;\n child: UserInvitation;\n}\n\nexport type Data = Resource<UserInvitation>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CollectionGraphLinks,\n CollectionGraphProps,\n} from '@foxy.io/sdk/dist/types/core/defaults';\n\nimport type { Graph, Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\n// TODO: replace with SDK import when SDK has the types\nexport interface UserInvitation extends Graph {\n curie: 'fx:user_invitation';\n links: {\n 'self': UserInvitation;\n 'fx:user': Rels.User;\n 'fx:store': Rels.Store;\n 'fx:resend': { curie: 'fx:resend' };\n 'fx:accept': { curie: 'fx:accept' };\n 'fx:reject': { curie: 'fx:reject' };\n 'fx:revoke': { curie: 'fx:revoke' };\n };\n props: {\n store_url: string;\n store_name: string;\n store_email: string;\n store_domain: string;\n first_name: string | null;\n last_name: string | null;\n email: string;\n status: 'sent' | 'accepted' | 'rejected' | 'revoked' | 'expired';\n date_created: string;\n date_modified: string;\n };\n}\n\n// TODO: replace with SDK import when SDK has the types\nexport interface UserInvitations extends Graph {\n curie: 'fx:user_invitations';\n links: CollectionGraphLinks<UserInvitations>;\n props: CollectionGraphProps;\n child: UserInvitation;\n}\n\nexport type Data = Resource<UserInvitation>;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.32.0-beta.4",
4
+ "version": "1.32.0-beta.5",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,9 +0,0 @@
1
- import type { PropertyDeclarations, TemplateResult } from 'lit-element';
2
- import type { Data } from '../../types';
3
- import { InternalControl } from '../../../../internal/InternalControl/InternalControl';
4
- export declare class InternalUserInvitationFormSyncAction extends InternalControl {
5
- static get properties(): PropertyDeclarations;
6
- status: Data['status'] | null;
7
- theme: string | null;
8
- renderControl(): TemplateResult;
9
- }
@@ -1,32 +0,0 @@
1
- import { InternalControl } from "../../../../internal/InternalControl/InternalControl.js";
2
- import { ifDefined } from 'lit-html/directives/if-defined';
3
- import { html } from 'lit-html';
4
- export class InternalUserInvitationFormSyncAction extends InternalControl {
5
- constructor() {
6
- super(...arguments);
7
- this.status = null;
8
- this.theme = null;
9
- }
10
- static get properties() {
11
- return { ...super.properties, status: {}, theme: {} };
12
- }
13
- renderControl() {
14
- var _a;
15
- return html `
16
- <vaadin-button
17
- theme=${ifDefined((_a = this.theme) !== null && _a !== void 0 ? _a : void 0)}
18
- class="w-full"
19
- ?disabled=${this.disabled}
20
- @click=${() => {
21
- const nucleon = this.nucleon;
22
- const status = this.status;
23
- if (status)
24
- nucleon === null || nucleon === void 0 ? void 0 : nucleon.edit({ status }), nucleon === null || nucleon === void 0 ? void 0 : nucleon.submit();
25
- }}
26
- >
27
- <foxy-i18n infer="" key="caption"></foxy-i18n>
28
- </vaadin-button>
29
- `;
30
- }
31
- }
32
- //# sourceMappingURL=InternalUserInvitationFormSyncAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InternalUserInvitationFormSyncAction.js","sourceRoot":"","sources":["../../../../../../src/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/InternalUserInvitationFormSyncAction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,oCAAqC,SAAQ,eAAe;IAAzE;;QAKE,WAAM,GAA0B,IAAI,CAAC;QAErC,UAAK,GAAkB,IAAI,CAAC;IAkB9B,CAAC;IAxBC,MAAM,KAAK,UAAU;QACnB,OAAO,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACxD,CAAC;IAMD,aAAa;;QACX,OAAO,IAAI,CAAA;;gBAEC,SAAS,OAAC,IAAI,CAAC,KAAK,mCAAI,KAAK,CAAC,CAAC;;oBAE3B,IAAI,CAAC,QAAQ;iBAChB,GAAG,EAAE;YACZ,MAAM,OAAO,GAAG,IAAI,CAAC,OAAoC,CAAC;YAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,MAAM;gBAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,CAAC;QAC3D,CAAC;;;;KAIJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { UserInvitationForm } from '../../UserInvitationForm';\nimport type { Data } from '../../types';\n\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nexport class InternalUserInvitationFormSyncAction extends InternalControl {\n static get properties(): PropertyDeclarations {\n return { ...super.properties, status: {}, theme: {} };\n }\n\n status: Data['status'] | null = null;\n\n theme: string | null = null;\n\n renderControl(): TemplateResult {\n return html`\n <vaadin-button\n theme=${ifDefined(this.theme ?? void 0)}\n class=\"w-full\"\n ?disabled=${this.disabled}\n @click=${() => {\n const nucleon = this.nucleon as UserInvitationForm | null;\n const status = this.status;\n if (status) nucleon?.edit({ status }), nucleon?.submit();\n }}\n >\n <foxy-i18n infer=\"\" key=\"caption\"></foxy-i18n>\n </vaadin-button>\n `;\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- import '@vaadin/vaadin-button';
2
- import '../../../../internal/InternalControl/index';
3
- import '../../../I18n/index';
4
- import { InternalUserInvitationFormSyncAction } from './InternalUserInvitationFormSyncAction';
5
- export { InternalUserInvitationFormSyncAction };
@@ -1,7 +0,0 @@
1
- import '@vaadin/vaadin-button';
2
- import "../../../../internal/InternalControl/index.js";
3
- import "../../../I18n/index.js";
4
- import { InternalUserInvitationFormSyncAction } from "./InternalUserInvitationFormSyncAction.js";
5
- customElements.define('foxy-internal-user-invitation-form-sync-action', InternalUserInvitationFormSyncAction);
6
- export { InternalUserInvitationFormSyncAction };
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/elements/public/UserInvitationForm/internal/InternalUserInvitationFormSyncAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAC/B,uDAAoD;AACpD,gCAA6B;AAE7B,OAAO,EAAE,oCAAoC,EAAE,kDAA+C;AAE9F,cAAc,CAAC,MAAM,CACnB,gDAAgD,EAChD,oCAAoC,CACrC,CAAC;AAEF,OAAO,EAAE,oCAAoC,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-button';\nimport '../../../../internal/InternalControl/index';\nimport '../../../I18n/index';\n\nimport { InternalUserInvitationFormSyncAction } from './InternalUserInvitationFormSyncAction';\n\ncustomElements.define(\n 'foxy-internal-user-invitation-form-sync-action',\n InternalUserInvitationFormSyncAction\n);\n\nexport { InternalUserInvitationFormSyncAction };\n"]}