@foxy.io/elements 1.9.0-beta.1 → 1.11.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-attribute-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cancellation-form.js +1 -1
  7. package/dist/cdn/foxy-collection-page.js +1 -1
  8. package/dist/cdn/foxy-collection-pages.js +1 -1
  9. package/dist/cdn/foxy-customer-form.js +1 -1
  10. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  11. package/dist/cdn/foxy-customer-portal.js +1 -1
  12. package/dist/cdn/foxy-customer.js +1 -1
  13. package/dist/cdn/foxy-customers-table.js +1 -1
  14. package/dist/cdn/foxy-error-entry-card.js +1 -1
  15. package/dist/cdn/foxy-nucleon-element.js +1 -1
  16. package/dist/cdn/foxy-payment-method-card.js +1 -1
  17. package/dist/cdn/foxy-sign-in-form.js +1 -1
  18. package/dist/cdn/foxy-subscription-card.js +1 -1
  19. package/dist/cdn/foxy-subscription-form.js +1 -1
  20. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  21. package/dist/cdn/foxy-table.js +1 -1
  22. package/dist/cdn/foxy-transactions-table.js +1 -1
  23. package/dist/cdn/foxy-user-form.js +1 -1
  24. package/dist/cdn/foxy-users-table.js +1 -1
  25. package/dist/cdn/{shared-77bdf956.js → shared-1e8cda7a.js} +1 -1
  26. package/dist/cdn/{shared-6f84ea16.js → shared-43316b66.js} +1 -1
  27. package/dist/cdn/{shared-8f34ce95.js → shared-5ad54678.js} +1 -1
  28. package/dist/cdn/{shared-92d03925.js → shared-750035db.js} +1 -1
  29. package/dist/cdn/{shared-1d0ef57d.js → shared-9ba229fb.js} +1 -1
  30. package/dist/cdn/shared-a110de43.js +1 -0
  31. package/dist/cdn/{shared-4b33c6d2.js → shared-b0c39c37.js} +1 -1
  32. package/dist/cdn/translations/country/de.json +251 -0
  33. package/dist/cdn/translations/customer-portal-settings/en.json +4 -0
  34. package/dist/cdn/translations/region/de.json +66 -0
  35. package/dist/cdn/translations/shared/de.json +117 -0
  36. package/dist/elements/public/CollectionPages/CollectionPages.js +6 -11
  37. package/dist/elements/public/CollectionPages/CollectionPages.js.map +1 -1
  38. package/dist/elements/public/CustomerPortalSettings/CustomerPortalSettings.js +17 -3
  39. package/dist/elements/public/CustomerPortalSettings/CustomerPortalSettings.js.map +1 -1
  40. package/dist/elements/public/CustomerPortalSettings/machine.js +8 -0
  41. package/dist/elements/public/CustomerPortalSettings/machine.js.map +1 -1
  42. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitch.d.ts +13 -0
  43. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitch.js +53 -0
  44. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitch.js.map +1 -0
  45. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitchChangeEvent.d.ts +3 -0
  46. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitchChangeEvent.js +6 -0
  47. package/dist/elements/public/CustomerPortalSettings/private/SSOSwitch/SSOSwitchChangeEvent.js.map +1 -0
  48. package/dist/elements/public/CustomerPortalSettings/types.d.ts +5 -1
  49. package/dist/elements/public/CustomerPortalSettings/types.js.map +1 -1
  50. package/dist/elements/public/NucleonElement/NucleonElement.js +6 -11
  51. package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
  52. package/dist/elements/public/NucleonElement/serveFromCache.d.ts +1 -0
  53. package/dist/elements/public/NucleonElement/serveFromCache.js +49 -0
  54. package/dist/elements/public/NucleonElement/serveFromCache.js.map +1 -0
  55. package/package.json +1 -1
  56. package/dist/cdn/shared-b13a5ed3.js +0 -1
@@ -1 +1 @@
1
- import"./shared-5fedf5e4.js";import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as e}from"./shared-84203d52.js";import{i as s,C as t}from"./shared-23966eed.js";import{N as i}from"./shared-b13a5ed3.js";import{T as r,a}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import{v as n}from"./shared-b738ee96.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let o,d,m,h,c=e=>e;const u=r(t(a(i,"access-recovery-form")));class p extends u{constructor(){super(...arguments),this.templates={},this.__checkEmailValidity=()=>!this.errors.some((e=>e.startsWith("email"))),this.__renderEmail=()=>{var t;const i=this.in("fail"),r=this.in("busy"),a=this.errors.filter((e=>e.startsWith("email"))).map((e=>e.replace("email","v8n"))),l=a[0]?this.t(a[0]).toString():"";return e(o||(o=c` <div> ${0} <vaadin-email-field error-message="${0}" data-testid="email" class="w-full" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @input="${0}" @keydown="${0}"> </vaadin-email-field> ${0} </div> `),this.renderTemplateOrSlot("email:before"),l,this.t("email").toString(),s(null===(t=this.form.detail)||void 0===t?void 0:t.email),r||i||this.disabledSelector.matches("email",!0),this.readonlySelector.matches("email",!0),this.__checkEmailValidity,(e=>{this.edit({detail:{email:e.target.value},type:"email"})}),(e=>{"Enter"===e.key&&this.submit()}),this.renderTemplateOrSlot("email:after"))},this.__renderMessage=()=>{const s=this.in("fail"),t=s?"bg-error-10 text-error":"bg-success-10 text-success",i=s?"lumo:error":"lumo:cog",r=s?"unknown_error":"recover_access_success";return e(d||(d=c` <div> ${0} <p class="leading-s flex items-start text-s rounded p-s ${0}"> <iron-icon class="flex-shrink-0 mr-s" icon="${0}"></iron-icon> <foxy-i18n lang="${0}" key="${0}" ns="${0}" data-testid="message"></foxy-i18n> </p> ${0} </div> `),this.renderTemplateOrSlot("message:before"),t,i,this.lang,r,this.ns,this.renderTemplateOrSlot("message:after"))},this.__renderSubmit=()=>{const s=this.in("fail"),t=0===this.errors.length,i=this.in("busy");return e(m||(m=c` <div> ${0} <vaadin-button data-testid="submit" class="w-full" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),i||!t||s||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.lang,this.ns,this.renderTemplateOrSlot("submit:after"))}}static get v8n(){return[({detail:e})=>(null==e?void 0:e.email)&&e.email.length>0||"email_required",({detail:e})=>{var s;return n(null!==(s=null==e?void 0:e.email)&&void 0!==s?s:"")||"email_invalid_email"}]}render(){var s,t;const i=this.hiddenSelector,r=this.in({idle:"snapshot"})||this.in("fail"),a=this.in("busy");return e(h||(h=c` <main data-testid="wrapper" aria-live="polite" aria-busy="${0}" class="relative font-lumo text-m leading-m space-y-m"> ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="busy" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </main> `),a,i.matches("email",!0)?"":this.__renderEmail(),i.matches("message",!0)||!r?"":this.__renderMessage(),i.matches("submit",!0)?"":this.__renderSubmit(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!a}),this.lang,this.ns,null!==(t=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==t?t:"")}}customElements.define("foxy-access-recovery-form",p);export{p as AccessRecoveryForm};
1
+ import"./shared-5fedf5e4.js";import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h as e}from"./shared-84203d52.js";import{i as s,C as t}from"./shared-23966eed.js";import{N as i}from"./shared-a110de43.js";import{T as r,a}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import{v as n}from"./shared-b738ee96.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let o,d,m,h,c=e=>e;const u=r(t(a(i,"access-recovery-form")));class p extends u{constructor(){super(...arguments),this.templates={},this.__checkEmailValidity=()=>!this.errors.some((e=>e.startsWith("email"))),this.__renderEmail=()=>{var t;const i=this.in("fail"),r=this.in("busy"),a=this.errors.filter((e=>e.startsWith("email"))).map((e=>e.replace("email","v8n"))),l=a[0]?this.t(a[0]).toString():"";return e(o||(o=c` <div> ${0} <vaadin-email-field error-message="${0}" data-testid="email" class="w-full" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @input="${0}" @keydown="${0}"> </vaadin-email-field> ${0} </div> `),this.renderTemplateOrSlot("email:before"),l,this.t("email").toString(),s(null===(t=this.form.detail)||void 0===t?void 0:t.email),r||i||this.disabledSelector.matches("email",!0),this.readonlySelector.matches("email",!0),this.__checkEmailValidity,(e=>{this.edit({detail:{email:e.target.value},type:"email"})}),(e=>{"Enter"===e.key&&this.submit()}),this.renderTemplateOrSlot("email:after"))},this.__renderMessage=()=>{const s=this.in("fail"),t=s?"bg-error-10 text-error":"bg-success-10 text-success",i=s?"lumo:error":"lumo:cog",r=s?"unknown_error":"recover_access_success";return e(d||(d=c` <div> ${0} <p class="leading-s flex items-start text-s rounded p-s ${0}"> <iron-icon class="flex-shrink-0 mr-s" icon="${0}"></iron-icon> <foxy-i18n lang="${0}" key="${0}" ns="${0}" data-testid="message"></foxy-i18n> </p> ${0} </div> `),this.renderTemplateOrSlot("message:before"),t,i,this.lang,r,this.ns,this.renderTemplateOrSlot("message:after"))},this.__renderSubmit=()=>{const s=this.in("fail"),t=0===this.errors.length,i=this.in("busy");return e(m||(m=c` <div> ${0} <vaadin-button data-testid="submit" class="w-full" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),i||!t||s||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.lang,this.ns,this.renderTemplateOrSlot("submit:after"))}}static get v8n(){return[({detail:e})=>(null==e?void 0:e.email)&&e.email.length>0||"email_required",({detail:e})=>{var s;return n(null!==(s=null==e?void 0:e.email)&&void 0!==s?s:"")||"email_invalid_email"}]}render(){var s,t;const i=this.hiddenSelector,r=this.in({idle:"snapshot"})||this.in("fail"),a=this.in("busy");return e(h||(h=c` <main data-testid="wrapper" aria-live="polite" aria-busy="${0}" class="relative font-lumo text-m leading-m space-y-m"> ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="busy" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </main> `),a,i.matches("email",!0)?"":this.__renderEmail(),i.matches("message",!0)||!r?"":this.__renderMessage(),i.matches("submit",!0)?"":this.__renderSubmit(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!a}),this.lang,this.ns,null!==(t=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==t?t:"")}}customElements.define("foxy-access-recovery-form",p);export{p as AccessRecoveryForm};
@@ -1,4 +1,4 @@
1
- import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as c}from"./shared-747b0842.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h}from"./shared-84203d52.js";import{C as t}from"./shared-23966eed.js";import{N as a}from"./shared-b13a5ed3.js";import{T as s,a as i}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";
1
+ import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as c}from"./shared-747b0842.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{h}from"./shared-84203d52.js";import{C as t}from"./shared-23966eed.js";import{N as a}from"./shared-a110de43.js";import{T as s,a as i}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1 +1 @@
1
- import"./shared-b98f88c9.js";import"./shared-54c485d2.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{e,h as t}from"./shared-84203d52.js";import{C as i,i as s}from"./shared-23966eed.js";import{N as a}from"./shared-b13a5ed3.js";import{P as r}from"./shared-a7709d26.js";import{S as d,T as o,a as n}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./shared-3ae39e52.js";import"./shared-45d647e4.js";import"./shared-851b97ef.js";import"./shared-497fd63c.js";import"./shared-cd700eac.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";const m=["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","CW","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","SX","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","SS","ST","SA","SN","RS","SC","SL","SG","SK","SI","SB","SO","ZA","GS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"],h=["AL","AK","AS","AZ","AR","AF","AA","AC","AE","AM","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"];let c,_,f,p,u,g=e=>e;const b=d(i(o(n(a,"address-form"))));class y extends b{constructor(){super(...arguments),this.templates={},this.__getValidator=e((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__bindField=e((e=>t=>{const i=t.target;this.edit({[e]:i.value})})),this.__maybeRenderComboBox=e=>{var i,a;const{source:r,field:d,custom:o=!1}=e,n=d.replace(/_/,"-");if(this.hiddenSelector.matches(n))return"";const l=customElements.get("foxy-i18n").i18next.getFixedT(this.lang,d);return t(c||(c=g` <div> ${0} <vaadin-combo-box class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" item-value-path="code" item-label-path="text" .checkValidity="${0}" .items="${0}" ?allow-custom-value="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot(`${n}:before`),this.t(d).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[d])||void 0===a?void 0:a.toString()),this.__getErrorMessage(d),n,this.__getValidator(d),r.map((e=>({text:l(e).toString(),code:e}))),o,this.readonlySelector.matches(n,!0),!this.in("idle")||this.disabledSelector.matches(n,!0),this.__bindField(d),this.renderTemplateOrSlot(`${n}:after`))},this.__maybeRenderTextField=e=>{var i,a;const{field:r,wide:d=!1,readonly:o=!1,required:n=!1}=e,m=r.replace(/_/,"-").replace("1","-one").replace("2","-two");return this.hiddenSelector.matches(m)?"":t(_||(_=g` <div class="${0}"> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?required="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),l({"col-span-2":d}),this.renderTemplateOrSlot(`${m}:before`),this.t(r).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[r])||void 0===a?void 0:a.toString()),this.__getErrorMessage(r),m,this.__getValidator(r),!this.in("idle")||this.disabledSelector.matches(m),n,o||this.readonlySelector.matches(m),this.__bindField(r),this.__handleKeyDown,this.renderTemplateOrSlot(`${m}:after`))},this.__renderTimestamps=()=>{const e=["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""})));return t(f||(f=g` <div> ${0} <x-property-table .items="${0}" data-testid="timestamps"></x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),e,this.renderTemplateOrSlot("timestamps:after"))},this.__renderAction=e=>{var i,s;const a=this.in({idle:{template:{dirty:"valid"}}}),r=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||this.disabledSelector.matches(e,!0),o=!!(null===(i=this.form)||void 0===i?void 0:i.is_default_shipping),n=!!(null===(s=this.form)||void 0===s?void 0:s.is_default_billing),l=o||n,m=a||r;return t(p||(p=g` <div> ${0} <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.in("idle")?"primary "+(this.href?"error":"success"):"",e,this.in({idle:"template"})&&!m||d||l,this.__handleActionClick,this.ns,e,this.lang,this.renderTemplateOrSlot(`${e}:after`))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"x-property-table":r,"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n")}}static get v8n(){return[({address_name:e})=>e&&e.length>0||"address_name_required",({address_name:e})=>!e||e.length<=100||"address_name_too_long",({first_name:e})=>!e||e.length<=50||"first_name_too_long",({last_name:e})=>!e||e.length<=50||"last_name_too_long",({region:e})=>!e||e.length<=50||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({phone:e})=>!e||e.length<=50||"phone_too_long",({company:e})=>!e||e.length<=50||"company_too_long",({address2:e})=>!e||e.length<=100||"address2_too_long",({address1:e})=>e&&e.length>0||"address1_required",({address1:e})=>e&&e.length<=100||"address1_too_long",({postal_code:e})=>!e||e.length<=50||"postal_code_too_long"]}connectedCallback(){super.connectedCallback(),customElements.get("foxy-i18n").i18next.loadNamespaces(["country","region"])}render(){var e,i,s,a;const{hiddenSelector:r,lang:d,ns:o}=this,n=this.href?"delete":"create",c=!!(null===(e=this.form)||void 0===e?void 0:e.is_default_shipping),_=!!(null===(i=this.form)||void 0===i?void 0:i.is_default_billing),f=c||_,p=this.in("busy"),b=this.in("fail");return t(u||(u=g` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="space-y-l font-lumo text-m leading-m text-body relative" aria-busy="${0}" aria-live="polite" data-testid="wrapper"> <div class="grid grid-cols-2 gap-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),d,o,this.__handleConfirmHide,this.in("busy"),this.__maybeRenderTextField({field:"address_name",wide:!0,readonly:f,required:!0}),this.__maybeRenderTextField({field:"first_name"}),this.__maybeRenderTextField({field:"last_name"}),this.__maybeRenderTextField({field:"company"}),this.__maybeRenderTextField({field:"phone"}),this.__maybeRenderTextField({field:"address1",wide:!0,required:!0}),this.__maybeRenderTextField({field:"address2",wide:!0}),this.__maybeRenderComboBox({field:"country",source:m}),this.__maybeRenderComboBox({field:"region",source:h,custom:!0}),this.__maybeRenderTextField({field:"city"}),this.__maybeRenderTextField({field:"postal_code"}),!this.data||r.matches("timestamps",!0)?"":this.__renderTimestamps(),r.matches(n,!0)?"":this.__renderAction(n),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!p&&!b}),b?"error":p?"busy":"empty",d,this.ns,null!==(a=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==a?a:"")}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(t=(e=this.__getValidator.cache).clear)||void 0===t||t.call(e)}__handleKeyDown(e){"Enter"===e.key&&this.submit()}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__handleActionClick(e){if(this.in({idle:"snapshot"})){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}else this.submit()}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-address-form",y);export{y as AddressForm};
1
+ import"./shared-b98f88c9.js";import"./shared-54c485d2.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{e,h as t}from"./shared-84203d52.js";import{C as i,i as s}from"./shared-23966eed.js";import{N as a}from"./shared-a110de43.js";import{P as r}from"./shared-a7709d26.js";import{S as d,T as o,a as n}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./shared-3ae39e52.js";import"./shared-45d647e4.js";import"./shared-851b97ef.js";import"./shared-497fd63c.js";import"./shared-cd700eac.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";const m=["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","CW","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","SX","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","SS","ST","SA","SN","RS","SC","SL","SG","SK","SI","SB","SO","ZA","GS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"],h=["AL","AK","AS","AZ","AR","AF","AA","AC","AE","AM","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"];let c,_,f,p,u,g=e=>e;const b=d(i(o(n(a,"address-form"))));class y extends b{constructor(){super(...arguments),this.templates={},this.__getValidator=e((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__bindField=e((e=>t=>{const i=t.target;this.edit({[e]:i.value})})),this.__maybeRenderComboBox=e=>{var i,a;const{source:r,field:d,custom:o=!1}=e,n=d.replace(/_/,"-");if(this.hiddenSelector.matches(n))return"";const l=customElements.get("foxy-i18n").i18next.getFixedT(this.lang,d);return t(c||(c=g` <div> ${0} <vaadin-combo-box class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" item-value-path="code" item-label-path="text" .checkValidity="${0}" .items="${0}" ?allow-custom-value="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot(`${n}:before`),this.t(d).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[d])||void 0===a?void 0:a.toString()),this.__getErrorMessage(d),n,this.__getValidator(d),r.map((e=>({text:l(e).toString(),code:e}))),o,this.readonlySelector.matches(n,!0),!this.in("idle")||this.disabledSelector.matches(n,!0),this.__bindField(d),this.renderTemplateOrSlot(`${n}:after`))},this.__maybeRenderTextField=e=>{var i,a;const{field:r,wide:d=!1,readonly:o=!1,required:n=!1}=e,m=r.replace(/_/,"-").replace("1","-one").replace("2","-two");return this.hiddenSelector.matches(m)?"":t(_||(_=g` <div class="${0}"> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?required="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),l({"col-span-2":d}),this.renderTemplateOrSlot(`${m}:before`),this.t(r).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[r])||void 0===a?void 0:a.toString()),this.__getErrorMessage(r),m,this.__getValidator(r),!this.in("idle")||this.disabledSelector.matches(m),n,o||this.readonlySelector.matches(m),this.__bindField(r),this.__handleKeyDown,this.renderTemplateOrSlot(`${m}:after`))},this.__renderTimestamps=()=>{const e=["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""})));return t(f||(f=g` <div> ${0} <x-property-table .items="${0}" data-testid="timestamps"></x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),e,this.renderTemplateOrSlot("timestamps:after"))},this.__renderAction=e=>{var i,s;const a=this.in({idle:{template:{dirty:"valid"}}}),r=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||this.disabledSelector.matches(e,!0),o=!!(null===(i=this.form)||void 0===i?void 0:i.is_default_shipping),n=!!(null===(s=this.form)||void 0===s?void 0:s.is_default_billing),l=o||n,m=a||r;return t(p||(p=g` <div> ${0} <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.in("idle")?"primary "+(this.href?"error":"success"):"",e,this.in({idle:"template"})&&!m||d||l,this.__handleActionClick,this.ns,e,this.lang,this.renderTemplateOrSlot(`${e}:after`))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"x-property-table":r,"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n")}}static get v8n(){return[({address_name:e})=>e&&e.length>0||"address_name_required",({address_name:e})=>!e||e.length<=100||"address_name_too_long",({first_name:e})=>!e||e.length<=50||"first_name_too_long",({last_name:e})=>!e||e.length<=50||"last_name_too_long",({region:e})=>!e||e.length<=50||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({phone:e})=>!e||e.length<=50||"phone_too_long",({company:e})=>!e||e.length<=50||"company_too_long",({address2:e})=>!e||e.length<=100||"address2_too_long",({address1:e})=>e&&e.length>0||"address1_required",({address1:e})=>e&&e.length<=100||"address1_too_long",({postal_code:e})=>!e||e.length<=50||"postal_code_too_long"]}connectedCallback(){super.connectedCallback(),customElements.get("foxy-i18n").i18next.loadNamespaces(["country","region"])}render(){var e,i,s,a;const{hiddenSelector:r,lang:d,ns:o}=this,n=this.href?"delete":"create",c=!!(null===(e=this.form)||void 0===e?void 0:e.is_default_shipping),_=!!(null===(i=this.form)||void 0===i?void 0:i.is_default_billing),f=c||_,p=this.in("busy"),b=this.in("fail");return t(u||(u=g` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="space-y-l font-lumo text-m leading-m text-body relative" aria-busy="${0}" aria-live="polite" data-testid="wrapper"> <div class="grid grid-cols-2 gap-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),d,o,this.__handleConfirmHide,this.in("busy"),this.__maybeRenderTextField({field:"address_name",wide:!0,readonly:f,required:!0}),this.__maybeRenderTextField({field:"first_name"}),this.__maybeRenderTextField({field:"last_name"}),this.__maybeRenderTextField({field:"company"}),this.__maybeRenderTextField({field:"phone"}),this.__maybeRenderTextField({field:"address1",wide:!0,required:!0}),this.__maybeRenderTextField({field:"address2",wide:!0}),this.__maybeRenderComboBox({field:"country",source:m}),this.__maybeRenderComboBox({field:"region",source:h,custom:!0}),this.__maybeRenderTextField({field:"city"}),this.__maybeRenderTextField({field:"postal_code"}),!this.data||r.matches("timestamps",!0)?"":this.__renderTimestamps(),r.matches(n,!0)?"":this.__renderAction(n),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!p&&!b}),b?"error":p?"busy":"empty",d,this.ns,null!==(a=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==a?a:"")}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(t=(e=this.__getValidator.cache).clear)||void 0===t||t.call(e)}__handleKeyDown(e){"Enter"===e.key&&this.submit()}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__handleActionClick(e){if(this.in({idle:"snapshot"})){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}else this.submit()}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}customElements.define("foxy-address-form",y);export{y as AddressForm};
@@ -1 +1 @@
1
- import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import{h as e}from"./shared-84203d52.js";import{C as t}from"./shared-23966eed.js";import{N as s}from"./shared-b13a5ed3.js";import{a as i,T as r}from"./shared-8057ee9c.js";import{c as a}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./foxy-i18n.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let n,o,l,d,m,c,u=e=>e;const p=i(t(r(s)),"attribute-card");class h extends p{constructor(){super(...arguments),this.templates={},this.__renderName=()=>{var t,s;const{data:i}=this;return e(n||(n=u` ${0} <div class="flex items-center space-x-xs text-xxs text-primary"> <div class="truncate uppercase font-semibold tracking-wider" title="${0}" data-testid="name"> ${0} </div> ${0} </div> ${0} `),this.renderTemplateOrSlot("name:before"),null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"",null!==(s=null==i?void 0:i.name)&&void 0!==s?s:e(o||(o=u`&nbsp;`)),i&&"public"!==i.visibility?e(l||(l=u`<iron-icon icon="icons:lock" class="icon-inline"></iron-icon>`)):"",this.renderTemplateOrSlot("name:after"))},this.__renderValue=()=>{var t,s;const{data:i}=this;return e(d||(d=u` ${0} <div class="truncate" title="${0}" data-testid="value"> ${0} </div> ${0} `),this.renderTemplateOrSlot("value:before"),null!==(t=null==i?void 0:i.value)&&void 0!==t?t:"",null!==(s=null==i?void 0:i.value)&&void 0!==s?s:e(m||(m=u`&nbsp;`)),this.renderTemplateOrSlot("value:after"))}}render(){var t,s;const i=this.hiddenSelector,r=this.in({idle:"snapshot"}),n=this.in({idle:"template"});return e(c||(c=u` <div class="relative text-body text-s font-lumo leading-m focus-outline-none" aria-live="polite" aria-busy="${0}"> ${0} ${0} <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),i.matches("name",!0)?"":this.__renderName(),i.matches("value",!0)?"":this.__renderValue(),a({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":r}),this.in("fail")?"error":n?"empty":"busy",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}}customElements.define("foxy-attribute-card",h);export{h as AttributeCard};
1
+ import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import{h as e}from"./shared-84203d52.js";import{C as t}from"./shared-23966eed.js";import{N as s}from"./shared-a110de43.js";import{a as i,T as r}from"./shared-8057ee9c.js";import{c as a}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./foxy-i18n.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let n,o,l,d,m,c,u=e=>e;const p=i(t(r(s)),"attribute-card");class h extends p{constructor(){super(...arguments),this.templates={},this.__renderName=()=>{var t,s;const{data:i}=this;return e(n||(n=u` ${0} <div class="flex items-center space-x-xs text-xxs text-primary"> <div class="truncate uppercase font-semibold tracking-wider" title="${0}" data-testid="name"> ${0} </div> ${0} </div> ${0} `),this.renderTemplateOrSlot("name:before"),null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"",null!==(s=null==i?void 0:i.name)&&void 0!==s?s:e(o||(o=u`&nbsp;`)),i&&"public"!==i.visibility?e(l||(l=u`<iron-icon icon="icons:lock" class="icon-inline"></iron-icon>`)):"",this.renderTemplateOrSlot("name:after"))},this.__renderValue=()=>{var t,s;const{data:i}=this;return e(d||(d=u` ${0} <div class="truncate" title="${0}" data-testid="value"> ${0} </div> ${0} `),this.renderTemplateOrSlot("value:before"),null!==(t=null==i?void 0:i.value)&&void 0!==t?t:"",null!==(s=null==i?void 0:i.value)&&void 0!==s?s:e(m||(m=u`&nbsp;`)),this.renderTemplateOrSlot("value:after"))}}render(){var t,s;const i=this.hiddenSelector,r=this.in({idle:"snapshot"}),n=this.in({idle:"template"});return e(c||(c=u` <div class="relative text-body text-s font-lumo leading-m focus-outline-none" aria-live="polite" aria-busy="${0}"> ${0} ${0} <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),i.matches("name",!0)?"":this.__renderName(),i.matches("value",!0)?"":this.__renderValue(),a({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":r}),this.in("fail")?"error":n?"empty":"busy",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}}customElements.define("foxy-attribute-card",h);export{h as AttributeCard};
@@ -1 +1 @@
1
- import{C as e}from"./shared-bba615b8.js";import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{e as t,h as i}from"./shared-84203d52.js";import{C as s,i as a}from"./shared-23966eed.js";import{a as r,T as l,S as n}from"./shared-8057ee9c.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import{G as d}from"./shared-525dd8c8.js";import{P as o}from"./shared-a7709d26.js";import{c as h}from"./shared-4e709717.js";import{N as m}from"./shared-b13a5ed3.js";import"./shared-747b0842.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-cd700eac.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";let c,p,f,b,y,v,_=e=>e;const u=r(s(l(n(m))),"attribute-form");class $ extends u{constructor(){super(...arguments),this.templates={},this.__getValidator=t((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__bindField=t((e=>t=>{const i=t.target;this.edit({[e]:i.value})})),this.__maybeRenderTextField=({field:e})=>{var t,s;const r=e.replace(/_/,"-");return this.hiddenSelector.matches(r)?"":i(c||(c=_` <div> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.t(e).toString(),a(null===(s=null===(t=this.form)||void 0===t?void 0:t[e])||void 0===s?void 0:s.toString()),this.__getErrorMessage(e),e,this.__getValidator(e),!this.in("idle")||this.disabledSelector.matches(r),this.readonlySelector.matches(r),this.__bindField(e),this.__handleKeyDown,this.renderTemplateOrSlot(`${r}:after`))},this.__renderVisibility=()=>{var e;const{disabledSelector:t,readonlySelector:s,form:a,lang:r,ns:l}=this,n=!this.in("idle"),d=n||t.matches("visibility",!0);return i(p||(p=_` <div> ${0} <x-group frame> <foxy-i18n data-testid="visibility-label" class="${0}" lang="${0}" slot="header" key="visibility" ns="${0}"> </foxy-i18n> <x-choice data-testid="visibility" lang="${0}" ns="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="private-label" lang="${0}" key="visibility_private" ns="${0}"> </foxy-i18n> <foxy-i18n slot="restricted-label" lang="${0}" key="visibility_restricted" ns="${0}"> </foxy-i18n> <foxy-i18n ns="${0}" lang="${0}" slot="public-label" key="visibility_public"> </foxy-i18n> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("visibility:before"),h({"text-disabled":d}),r,l,r,$.defaultNS,$.__visibilityOptions,null!==(e=null==a?void 0:a.visibility)&&void 0!==e?e:"private",n||t.matches("visibility",!0),s.matches("visibility",!0),this.__handleChoiceChange,r,l,r,l,l,r,this.renderTemplateOrSlot("visibility:after"))},this.__renderTimestamps=()=>{const e=["date_modified","date_created"].map((e=>({name:this.t(e),value:this.t("date",{value:new Date(this.data[e])})})));return i(f||(f=_` <div> ${0} <x-property-table .items="${0}" data-testid="timestamps"></x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),e,this.renderTemplateOrSlot("timestamps:after"))},this.__renderDelete=()=>i(b||(b=_` <div> ${0} <vaadin-button class="w-full" data-testid="delete" theme="error primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="delete"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),this.__handleDeleteClick,this.ns,this.lang,this.renderTemplateOrSlot("delete:after")),this.__renderCreate=()=>{const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),s=e||t;return i(y||(y=_` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="success primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="create"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!this.in("idle")||!s||this.disabledSelector.matches("create",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"x-property-table":o,"vaadin-button":customElements.get("vaadin-button"),"x-choice":e,"x-group":d,"foxy-i18n":customElements.get("foxy-i18n"),"foxy-spinner":customElements.get("foxy-spinner")}}static get v8n(){return[({value:e})=>e&&e.length>0||"value_required",({value:e})=>e&&e.length<=1e3||"value_too_long",({name:e})=>e&&e.length>0||"name_required",({name:e})=>e&&e.length<=500||"name_too_long"]}render(){const{hiddenSelector:e,data:t,lang:s,ns:a}=this,r=this.in("busy"),l=this.in("fail");return i(v||(v=_` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="grid grid-cols-1 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </div> `),s,a,this.__handleConfirmHide,this.in("busy"),this.__maybeRenderTextField({field:"name"}),this.__maybeRenderTextField({field:"value"}),e.matches("visibility",!0)?"":this.__renderVisibility(),e.matches("timestamps",!0)||!t?"":this.__renderTimestamps(),e.matches("delete",!0)||!t?"":this.__renderDelete(),e.matches("create",!0)||t?"":this.__renderCreate(),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!r&&!l}),l?"error":r?"busy":"empty",s,a)}disconnectedCallback(){var e,t,i,s;super.disconnectedCallback(),null===(t=(e=this.__bindField.cache).clear)||void 0===t||t.call(e),null===(s=(i=this.__getValidator.cache).clear)||void 0===s||s.call(i)}get __confirmDialog(){return this.renderRoot.querySelector("#confirm")}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__handleKeyDown(e){"Enter"===e.key&&this.submit()}__handleChoiceChange(e){this.edit({visibility:e.detail})}__handleDeleteClick(e){this.__confirmDialog.show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}$.__visibilityOptions=["private","restricted","public"],customElements.define("foxy-attribute-form",$);export{$ as AttributeForm};
1
+ import{C as e}from"./shared-bba615b8.js";import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{e as t,h as i}from"./shared-84203d52.js";import{C as s,i as a}from"./shared-23966eed.js";import{a as r,T as l,S as n}from"./shared-8057ee9c.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import{G as d}from"./shared-525dd8c8.js";import{P as o}from"./shared-a7709d26.js";import{c as h}from"./shared-4e709717.js";import{N as m}from"./shared-a110de43.js";import"./shared-747b0842.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-cd700eac.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";let c,p,f,b,y,v,_=e=>e;const u=r(s(l(n(m))),"attribute-form");class $ extends u{constructor(){super(...arguments),this.templates={},this.__getValidator=t((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__bindField=t((e=>t=>{const i=t.target;this.edit({[e]:i.value})})),this.__maybeRenderTextField=({field:e})=>{var t,s;const r=e.replace(/_/,"-");return this.hiddenSelector.matches(r)?"":i(c||(c=_` <div> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.t(e).toString(),a(null===(s=null===(t=this.form)||void 0===t?void 0:t[e])||void 0===s?void 0:s.toString()),this.__getErrorMessage(e),e,this.__getValidator(e),!this.in("idle")||this.disabledSelector.matches(r),this.readonlySelector.matches(r),this.__bindField(e),this.__handleKeyDown,this.renderTemplateOrSlot(`${r}:after`))},this.__renderVisibility=()=>{var e;const{disabledSelector:t,readonlySelector:s,form:a,lang:r,ns:l}=this,n=!this.in("idle"),d=n||t.matches("visibility",!0);return i(p||(p=_` <div> ${0} <x-group frame> <foxy-i18n data-testid="visibility-label" class="${0}" lang="${0}" slot="header" key="visibility" ns="${0}"> </foxy-i18n> <x-choice data-testid="visibility" lang="${0}" ns="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="private-label" lang="${0}" key="visibility_private" ns="${0}"> </foxy-i18n> <foxy-i18n slot="restricted-label" lang="${0}" key="visibility_restricted" ns="${0}"> </foxy-i18n> <foxy-i18n ns="${0}" lang="${0}" slot="public-label" key="visibility_public"> </foxy-i18n> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("visibility:before"),h({"text-disabled":d}),r,l,r,$.defaultNS,$.__visibilityOptions,null!==(e=null==a?void 0:a.visibility)&&void 0!==e?e:"private",n||t.matches("visibility",!0),s.matches("visibility",!0),this.__handleChoiceChange,r,l,r,l,l,r,this.renderTemplateOrSlot("visibility:after"))},this.__renderTimestamps=()=>{const e=["date_modified","date_created"].map((e=>({name:this.t(e),value:this.t("date",{value:new Date(this.data[e])})})));return i(f||(f=_` <div> ${0} <x-property-table .items="${0}" data-testid="timestamps"></x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),e,this.renderTemplateOrSlot("timestamps:after"))},this.__renderDelete=()=>i(b||(b=_` <div> ${0} <vaadin-button class="w-full" data-testid="delete" theme="error primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="delete"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),this.__handleDeleteClick,this.ns,this.lang,this.renderTemplateOrSlot("delete:after")),this.__renderCreate=()=>{const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),s=e||t;return i(y||(y=_` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="success primary" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="create"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!this.in("idle")||!s||this.disabledSelector.matches("create",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"x-property-table":o,"vaadin-button":customElements.get("vaadin-button"),"x-choice":e,"x-group":d,"foxy-i18n":customElements.get("foxy-i18n"),"foxy-spinner":customElements.get("foxy-spinner")}}static get v8n(){return[({value:e})=>e&&e.length>0||"value_required",({value:e})=>e&&e.length<=1e3||"value_too_long",({name:e})=>e&&e.length>0||"name_required",({name:e})=>e&&e.length<=500||"name_too_long"]}render(){const{hiddenSelector:e,data:t,lang:s,ns:a}=this,r=this.in("busy"),l=this.in("fail");return i(v||(v=_` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="grid grid-cols-1 gap-l"> ${0} ${0} ${0} ${0} ${0} ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </div> `),s,a,this.__handleConfirmHide,this.in("busy"),this.__maybeRenderTextField({field:"name"}),this.__maybeRenderTextField({field:"value"}),e.matches("visibility",!0)?"":this.__renderVisibility(),e.matches("timestamps",!0)||!t?"":this.__renderTimestamps(),e.matches("delete",!0)||!t?"":this.__renderDelete(),e.matches("create",!0)||t?"":this.__renderCreate(),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!r&&!l}),l?"error":r?"busy":"empty",s,a)}disconnectedCallback(){var e,t,i,s;super.disconnectedCallback(),null===(t=(e=this.__bindField.cache).clear)||void 0===t||t.call(e),null===(s=(i=this.__getValidator.cache).clear)||void 0===s||s.call(i)}get __confirmDialog(){return this.renderRoot.querySelector("#confirm")}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__handleKeyDown(e){"Enter"===e.key&&this.submit()}__handleChoiceChange(e){this.edit({visibility:e.detail})}__handleDeleteClick(e){this.__confirmDialog.show(e.currentTarget)}__handleConfirmHide(e){e.detail.cancelled||this.delete()}}$.__visibilityOptions=["private","restricted","public"],customElements.define("foxy-attribute-form",$);export{$ as AttributeForm};
@@ -1 +1 @@
1
- import"./shared-b98f88c9.js";export{C as CancellationForm}from"./shared-77bdf956.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-84203d52.js";import"./shared-8057ee9c.js";import"./shared-4e709717.js";import"./shared-c70d9713.js";import"./shared-e0248713.js";import"./shared-23966eed.js";import"./shared-bba615b8.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-851b97ef.js";import"./shared-497fd63c.js";import"./shared-525dd8c8.js";import"./shared-b13a5ed3.js";import"./shared-7684cb05.js";
1
+ import"./shared-b98f88c9.js";export{C as CancellationForm}from"./shared-1e8cda7a.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-84203d52.js";import"./shared-8057ee9c.js";import"./shared-4e709717.js";import"./shared-c70d9713.js";import"./shared-e0248713.js";import"./shared-23966eed.js";import"./shared-bba615b8.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-851b97ef.js";import"./shared-497fd63c.js";import"./shared-525dd8c8.js";import"./shared-a110de43.js";import"./shared-7684cb05.js";
@@ -1 +1 @@
1
- import"./foxy-spinner.js";export{C as CollectionPage}from"./shared-92d03925.js";import"./shared-45d647e4.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./foxy-i18n.js";import"./shared-84203d52.js";import"./shared-8057ee9c.js";import"./shared-23966eed.js";import"./shared-b13a5ed3.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";
1
+ import"./foxy-spinner.js";export{C as CollectionPage}from"./shared-750035db.js";import"./shared-45d647e4.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./foxy-i18n.js";import"./shared-84203d52.js";import"./shared-8057ee9c.js";import"./shared-23966eed.js";import"./shared-a110de43.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";
@@ -1 +1 @@
1
- import"./shared-b98f88c9.js";import{r as e}from"./shared-92d03925.js";import"./foxy-i18n.js";import{b as t,aq as s,L as r,_ as a,h as n,R as i,F as o,t as l}from"./shared-84203d52.js";import{C as d}from"./shared-23966eed.js";import{N as c}from"./shared-b13a5ed3.js";import{i as h}from"./shared-9f78e096.js";import"./shared-747b0842.js";import"./foxy-spinner.js";import"./shared-45d647e4.js";import"./shared-cd700eac.js";import"./shared-8057ee9c.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";const p=t({manual:(e,t)=>t.data}),u=t({error:(e,t)=>t.data}),_=t({first:(e,t)=>t.data,pages:[],error:null}),g=t({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),m=t({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),f=e=>e.manual,v=s({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:u},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:m},{target:"idle.paused.manual",cond:f,actions:m},{target:"idle.paused.auto",actions:m}]},on:{SET_MANUAL:{actions:p}}},fail:{on:{SET_MANUAL:{actions:p}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:f,actions:p,target:".manual"},{actions:p,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:p}}},end:{on:{SET_MANUAL:{actions:p}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:_},{target:"busy",actions:_}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:g},{target:"idle.paused",actions:g}]}});let y,E,x,b=e=>e;class k extends(d(r)){constructor(){var e;super(),e=this,this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=h(v.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,n=await new c.API(e).fetch(a);if(!n.ok)throw n;const i=await n.json();return e.__stopTrackingRumour(),c.Rumour(e.group).share({source:i._links.self.href,data:i}),e.__trackRumour(),i}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return a(a({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){return this.__service.state.context.first}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){return this.__service.state.context.pages}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){return this.__service.state.context.manual}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){return this.__service.state.matches(e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){const t=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return this.__service.state.matches("busy")?t.push({key:"stalled",href:"foxy://collection-pages/stall"}):this.__service.state.matches("fail")?t.push({key:"failed",href:"foxy://collection-pages/fail"}):this.__service.state.matches({idle:"empty"})&&t.push({key:"empty",href:""}),n(y||(y=b` ${0} ${0} `),e(t,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:n})})),this.manual?this.in({idle:"paused"})?n(E||(E=b` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":n(x||(x=b` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new c.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=c.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof i.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=this.localName;l(this.__service.state.context.pages).forEach((function(){var s,r,a;if((null===(a=null===(r=null===(s=this.node)||void 0===s?void 0:s._links)||void 0===r?void 0:r.self)||void 0===a?void 0:a.href)===e.request.url){console.debug(`%c@foxy.io/elements::${t}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","");const s=JSON.stringify(this.node);e.respondWith(Promise.resolve(new Response(s))),this.stop()}}))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(this.__service.state.context.error))}}customElements.define("foxy-collection-pages",k);export{k as CollectionPages};
1
+ import"./shared-b98f88c9.js";import{r as e}from"./shared-750035db.js";import"./foxy-i18n.js";import{b as t,aq as s,L as r,_ as a,h as n,R as i,F as o}from"./shared-84203d52.js";import{C as l}from"./shared-23966eed.js";import{N as d,s as c}from"./shared-a110de43.js";import{i as h}from"./shared-9f78e096.js";import"./shared-747b0842.js";import"./foxy-spinner.js";import"./shared-45d647e4.js";import"./shared-cd700eac.js";import"./shared-8057ee9c.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";const p=t({manual:(e,t)=>t.data}),u=t({error:(e,t)=>t.data}),_=t({first:(e,t)=>t.data,pages:[],error:null}),g=t({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),m=t({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),f=e=>e.manual,v=s({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:u},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:m},{target:"idle.paused.manual",cond:f,actions:m},{target:"idle.paused.auto",actions:m}]},on:{SET_MANUAL:{actions:p}}},fail:{on:{SET_MANUAL:{actions:p}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:f,actions:p,target:".manual"},{actions:p,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:p}}},end:{on:{SET_MANUAL:{actions:p}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:_},{target:"busy",actions:_}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:g},{target:"idle.paused",actions:g}]}});let y,E,x,b=e=>e;class k extends(l(r)){constructor(){var e;super(),e=this,this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=h(v.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,n=await new d.API(e).fetch(a);if(!n.ok)throw n;const i=await n.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:i._links.self.href,data:i}),e.__trackRumour(),i}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return a(a({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){return this.__service.state.context.first}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){return this.__service.state.context.pages}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){return this.__service.state.context.manual}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){return this.__service.state.matches(e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){const t=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return this.__service.state.matches("busy")?t.push({key:"stalled",href:"foxy://collection-pages/stall"}):this.__service.state.matches("fail")?t.push({key:"failed",href:"foxy://collection-pages/fail"}):this.__service.state.matches({idle:"empty"})&&t.push({key:"empty",href:""}),n(y||(y=b` ${0} ${0} `),e(t,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:n})})),this.manual?this.in({idle:"paused"})?n(E||(E=b` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":n(x||(x=b` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof i.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=c(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(this.__service.state.context.error))}}customElements.define("foxy-collection-pages",k);export{k as CollectionPages};
@@ -1 +1 @@
1
- import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{e,h as t}from"./shared-84203d52.js";import{C as i,i as s}from"./shared-23966eed.js";import"./foxy-nucleon-element.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{R as a,T as r,S as d,a as n}from"./shared-8057ee9c.js";import"./shared-bba615b8.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import{P as o}from"./shared-a7709d26.js";import{c as l}from"./shared-4e709717.js";import{v as m}from"./shared-b738ee96.js";import{N as h}from"./shared-b13a5ed3.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";let c,p,f,u,_=e=>e;const b=a(i(r(d(n(h,"customer-form")))));class v extends b{constructor(){super(...arguments),this.templates={},this.__getValidator=e((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__maybeRenderTextField=({field:e})=>{var i,a;const r=e.replace(/_/,"-"),d=this.errors.find((t=>t.startsWith(e)));return this.hiddenSelector.matches(r,!0)?"":t(c||(c=_` <div> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.t(e).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[e])||void 0===a?void 0:a.toString()),d?this.t(d.replace(e,"v8n")).toString():"",r,this.__getValidator(e),!this.in("idle")||this.disabledSelector.matches(r,!0),this.readonlySelector.matches(r,!0),(t=>this.edit({[e]:t.target.value})),(e=>"Enter"===e.key&&this.submit()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderTimestamps=()=>t(p||(p=_` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""}))),this.renderTemplateOrSlot("timestamps:after")),this.__renderAction=e=>{const{disabledSelector:i,href:s,lang:a,ns:r}=this,d=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),o=!this.in("idle")||i.matches(e,!0),l=d||n;return t(f||(f=_` <div> ${0} <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.in("idle")?"primary "+(s?"error":"success"):"",e,this.in({idle:"template"})&&!l||o,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,a,this.renderTemplateOrSlot(`${e}:after`))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-property-table":o,"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n")}}static get v8n(){return[({first_name:e})=>!e||e.length<=50||"first_name_too_long",({last_name:e})=>!e||e.length<=50||"last_name_too_long",({tax_id:e})=>!e||e.length<=50||"tax_id_too_long",({email:e})=>e&&e.length>0||"email_required",({email:e})=>e&&e.length<=100||"email_too_long",({email:e})=>e&&m(e)||"email_invalid_email"]}render(){var e,i;const{hiddenSelector:s,href:a,lang:r,ns:d}=this,n=a?"delete":"create",o=this.in("busy"),m=this.in("fail");return t(u||(u=_` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="space-y-l relative"> <div class="grid grid-cols-1 sm-grid-cols-2 gap-m"> ${0} ${0} ${0} ${0} </div> ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),r,d,(e=>{e.detail.cancelled||this.delete()}),o,this.__maybeRenderTextField({field:"first_name"}),this.__maybeRenderTextField({field:"last_name"}),this.__maybeRenderTextField({field:"email"}),this.__maybeRenderTextField({field:"tax_id"}),s.matches("timestamps",!0)||!a?"":this.__renderTimestamps(),s.matches(n)?"":this.__renderAction(n),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!o&&!m}),m?"error":o?"busy":"empty",r,d,null!==(i=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==i?i:"")}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(t=(e=this.__getValidator.cache).clear)||void 0===t||t.call(e)}}customElements.define("foxy-customer-form",v);export{v as CustomerForm};
1
+ import"./shared-3ae39e52.js";import"./shared-b98f88c9.js";import"./shared-bf28ab5e.js";import"./shared-090432b4.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{e,h as t}from"./shared-84203d52.js";import{C as i,i as s}from"./shared-23966eed.js";import"./foxy-nucleon-element.js";import"./shared-45d647e4.js";import"./shared-e0248713.js";import{R as a,T as r,S as d,a as n}from"./shared-8057ee9c.js";import"./shared-bba615b8.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import{P as o}from"./shared-a7709d26.js";import{c as l}from"./shared-4e709717.js";import{v as m}from"./shared-b738ee96.js";import{N as h}from"./shared-a110de43.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-87ca7818.js";import"./shared-9f78e096.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";let c,p,f,u,_=e=>e;const v=a(i(r(d(n(h,"customer-form")))));class y extends v{constructor(){super(...arguments),this.templates={},this.__getValidator=e((e=>()=>!this.errors.some((t=>t.startsWith(e))))),this.__maybeRenderTextField=({field:e})=>{var i,a;const r=e.replace(/_/,"-"),d=this.errors.find((t=>t.startsWith(e)));return this.hiddenSelector.matches(r,!0)?"":t(c||(c=_` <div> ${0} <vaadin-text-field class="w-full" label="${0}" value="${0}" error-message="${0}" data-testid="${0}" .checkValidity="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${r}:before`),this.t(e).toString(),s(null===(a=null===(i=this.form)||void 0===i?void 0:i[e])||void 0===a?void 0:a.toString()),d?this.t(d.replace(e,"v8n")).toString():"",r,this.__getValidator(e),!this.in("idle")||this.disabledSelector.matches(r,!0),this.readonlySelector.matches(r,!0),(t=>this.edit({[e]:t.target.value})),(e=>"Enter"===e.key&&this.submit()),this.renderTemplateOrSlot(`${r}:after`))},this.__renderTimestamps=()=>t(p||(p=_` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps:before"),["date_modified","date_created"].map((e=>({name:this.t(e),value:this.data?this.t("date",{value:new Date(this.data[e])}):""}))),this.renderTemplateOrSlot("timestamps:after")),this.__renderAction=e=>{const{disabledSelector:i,href:s,lang:a,ns:r}=this,d=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),o=!this.in("idle")||i.matches(e,!0),l=d||n;return t(f||(f=_` <div> ${0} <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),this.in("idle")?"primary "+(s?"error":"success"):"",e,this.in({idle:"template"})&&!l||o,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,a,this.renderTemplateOrSlot(`${e}:after`))}}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-property-table":o,"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n")}}static get v8n(){return[({first_name:e})=>!e||e.length<=50||"first_name_too_long",({last_name:e})=>!e||e.length<=50||"last_name_too_long",({tax_id:e})=>!e||e.length<=50||"tax_id_too_long",({email:e})=>e&&e.length>0||"email_required",({email:e})=>e&&e.length<=100||"email_too_long",({email:e})=>e&&m(e)||"email_invalid_email"]}render(){var e,i;const{hiddenSelector:s,href:a,lang:r,ns:d}=this,n=a?"delete":"create",o=this.in("busy"),m=this.in("fail");return t(u||(u=_` <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="space-y-l relative"> <div class="grid grid-cols-1 sm-grid-cols-2 gap-m"> ${0} ${0} ${0} ${0} </div> ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),r,d,(e=>{e.detail.cancelled||this.delete()}),o,this.__maybeRenderTextField({field:"first_name"}),this.__maybeRenderTextField({field:"last_name"}),this.__maybeRenderTextField({field:"email"}),this.__maybeRenderTextField({field:"tax_id"}),s.matches("timestamps",!0)||!a?"":this.__renderTimestamps(),s.matches(n)?"":this.__renderAction(n),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!o&&!m}),m?"error":o?"busy":"empty",r,d,null!==(i=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==i?i:"")}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(t=(e=this.__getValidator.cache).clear)||void 0===t||t.call(e)}}customElements.define("foxy-customer-form",y);export{y as CustomerForm};
@@ -969,4 +969,4 @@ This program is available under Apache License Version 2.0, available at https:/
969
969
 
970
970
  <iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}">
971
971
  </iron-media-query>
972
- `}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.1"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),re(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Js.is,Js);class Zs extends $t{}let ei,ti,si,ii,ai=e=>e;class ni extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":Js,"vaadin-button":N,"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-i18n":X,"x-list":Ct}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return E(ei||(ei=ai` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(ti||(ti=ai`<span slot="${0}" class="truncate">${0}</span>`),t,Ms(e,this.lang)):E(si||(si=ai`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?E(ii||(ii=ai` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=$e(this.__endValue),s=$e(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new Zs(this.value))}}class ri extends CustomEvent{constructor(e){super("change",{detail:e})}}let oi,li,di=e=>e;class hi extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":os,"x-choice":Z,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return E(oi||(oi=di` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(li||(li=di` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=xe(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new ri(this.value))}}class ui extends CustomEvent{constructor(e){super("change",{detail:e})}}class ci extends CustomEvent{constructor(){super("remove")}}let pi,_i,mi,vi,gi,fi,yi,bi,xi,wi=e=>e;class $i extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":ni,"x-jsonata-input":ys,"x-offset-input":hi,"x-allowed-days":Rs,"iron-icon":customElements.get("iron-icon"),"x-warning":ke,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,n=e||t,r=s&&s.days.length>0,o=a&&a.length>0,l=this.open?"":"rounded-b-l";return E(pi||(pi=wi` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),l,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",n||r||o?E(_i||(_i=wi` <div> ${0} </div> `),se(n&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,is((()=>this.dispatchEvent(new ci))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?E(mi||(mi=wi` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new ui(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=xe(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return E(vi||(vi=wi` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return E(gi||(gi=wi` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return E(fi||(fi=wi`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return E(yi||(yi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?xe(e):void 0),this.__renderMinMaxContent(t?xe(t):void 0))}__renderAllowedSummary({type:e,days:t}){return E(bi||(bi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>ie(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return E(xi||(xi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Ms(e,this.lang))).join("; "))}}class ki extends CustomEvent{constructor(e){super("change",{detail:e})}}let Di,Si,Ci,Ei=e=>e;class Ii extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":$i,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-switch":Yt,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return E(Di||(Di=Ei` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?E(Si||(Si=Ei` ${0} `),this.__normalizedValue.map(((e,t,s)=>E(Ci||(Ci=Ei` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new ki(this.value))}}class Ai extends $t{}let Mi,Ti,Oi,Vi=e=>e;class ji extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return E(Mi||(Mi=Vi` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?E(Ti||(Ti=Vi` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):E(Oi||(Oi=Vi`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Ai(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}const Fi=ae.assign({error:(e,t)=>t.data.type}),Ri=ae.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Pi=ae.assign({oldResource:e=>e.newResource}),Ni=ae.assign({invalid:[],newResource:({oldResource:e})=>e}),Bi=ae.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:wt(72,(()=>bt(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),zi=ae.assign({newResource:null}),qi=ae.assign({error:"setup_needed"}),Yi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{allowedOrigins:s})}}),Li=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowFrequencyModification:s})})}}),Wi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowNextDateModification:s})})}}),Hi=ae.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{sessionLifespanInMinutes:s})}}),Ui=ae.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{jwtSharedSecret:s})}}),Xi=ae.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),Ki={SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},Qi={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},Gi=A({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:Ki},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:C({on:Ki},Qi),updated:C({on:Ki},Qi),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>M(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Li,setNextDateModification:Wi,setOrigins:Yi,setSession:Hi,setSecret:Ui,setHref:Xi,handleLoadingSuccess:Ri,handleSavingSuccess:Pi,handleError:Fi,create:Bi,reset:Ni,remove:zi,requireSetup:qi}});let Ji,Zi,ea,ta,sa=e=>e;function ia(e){if(!e.ok)throw new Y(401===e.status?"unauthorized":"unknown")}class aa extends CustomEvent{constructor(){super("ready")}}class na extends CustomEvent{constructor(){super("update")}}class ra extends W{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=Gi.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=De(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":As,"x-next-date-modification":Ii,"x-session-duration":Jt,"x-session-secret":ss,"x-loading-screen":Mt,"x-error-screen":q,"x-origins-list":ji,"x-skeleton":G,"x-section":Nt,"x-switch":Yt,"x-i18n":X,"x-page":jt}}static get properties(){return C(C({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a;if(this.__service.state.matches("error"))return E(Ji||(Ji=sa` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:n}=this.__service.state.context,r=this.__service.state.matches("idle.dirty.created"),o=this.__service.state.matches("idle.dirty.deleted"),l=this.__service.state.matches("idle.dirty.updated"),d=this.__service.state.matches("idle.clean.enabled"),h=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return E(Zi||(Zi=sa` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,d||r||l,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==n?void 0:n.allowedOrigins)&&void 0!==e?e:[],!n,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==n?void 0:n.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!n,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==n?void 0:n.subscriptions.allowNextDateModification)&&void 0!==s&&s,!n,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!n||!this._isI18nReady,null!==(i=null==n?void 0:n.sessionLifespanInMinutes)&&void 0!==i?i:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SESSION"},e))}),!n||!this._isI18nReady,null!==(a=null==n?void 0:n.jwtSharedSecret)&&void 0!==a?a:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?E(ea||(ea=sa` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),o?"error":"success",h,(()=>this.__service.send("SAVE")),this.lang,this.ns,r?"create":o?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?E(ta||(ta=sa`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new Y("setup_needed");try{await this.updateComplete;const e=await Wt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await Wt.emit({source:this,init:["/"]});ia(e);const i=(await e.json())._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}else{ia(e),t=await e.json();const i=t._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});ia(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new aa)}}async __save(){try{const e=this.__service.state.context,t=ht(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};ia(await Wt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new na)}}}customElements.define("foxy-customer-portal-settings",ra);export{ra as CustomerPortalSettings};
972
+ `}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.1"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),re(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(Js.is,Js);class Zs extends $t{}let ei,ti,si,ii,ai=e=>e;class ni extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":Js,"vaadin-button":N,"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-i18n":X,"x-list":Ct}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return E(ei||(ei=ai` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?E(ti||(ti=ai`<span slot="${0}" class="truncate">${0}</span>`),t,Ms(e,this.lang)):E(si||(si=ai`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?E(ii||(ii=ai` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,ue({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=$e(this.__endValue),s=$e(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new Zs(this.value))}}class ri extends CustomEvent{constructor(e){super("change",{detail:e})}}let oi,li,di=e=>e;class hi extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":os,"x-choice":Z,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return E(oi||(oi=di` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?E(li||(li=di` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=xe(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new ri(this.value))}}class ui extends CustomEvent{constructor(e){super("change",{detail:e})}}class ci extends CustomEvent{constructor(){super("remove")}}let pi,_i,mi,vi,gi,fi,yi,bi,xi,wi=e=>e;class $i extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":ni,"x-jsonata-input":ys,"x-offset-input":hi,"x-allowed-days":Rs,"iron-icon":customElements.get("iron-icon"),"x-warning":ke,"x-group":be,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,n=e||t,r=s&&s.days.length>0,o=a&&a.length>0,l=this.open?"":"rounded-b-l";return E(pi||(pi=wi` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),ue({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),l,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",n||r||o?E(_i||(_i=wi` <div> ${0} </div> `),se(n&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,is((()=>this.dispatchEvent(new ci))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?E(mi||(mi=wi` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=C(C({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new ui(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=xe(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return E(vi||(vi=wi` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return E(gi||(gi=wi` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return E(fi||(fi=wi`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return E(yi||(yi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?xe(e):void 0),this.__renderMinMaxContent(t?xe(t):void 0))}__renderAllowedSummary({type:e,days:t}){return E(bi||(bi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>ie(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return E(xi||(xi=wi` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>Ms(e,this.lang))).join("; "))}}class ki extends CustomEvent{constructor(e){super("change",{detail:e})}}let Di,Si,Ci,Ei=e=>e;class Ii extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":$i,"vaadin-button":customElements.get("vaadin-button"),"x-section":Nt,"iron-icon":customElements.get("iron-icon"),"x-switch":Yt,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return E(Di||(Di=Ei` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?E(Si||(Si=Ei` ${0} `),this.__normalizedValue.map(((e,t,s)=>E(Ci||(Ci=Ei` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new ki(this.value))}}class Ai extends $t{}let Mi,Ti,Oi,Vi=e=>e;class ji extends W{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":G,"iron-icon":customElements.get("iron-icon"),"x-group":be,"x-list":Ct,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return E(Mi||(Mi=Vi` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?E(Ti||(Ti=Vi` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):E(Oi||(Oi=Vi`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,ue({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Ai(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Fi extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ri,Pi=e=>e;class Ni extends W{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":Nt,"x-switch":Yt,"x-i18n":X}}static get properties(){return C(C({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return E(Ri||(Ri=Pi` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Fi(this.value))}}const Bi=ae.assign({error:(e,t)=>t.data.type}),zi=ae.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),qi=ae.assign({oldResource:e=>e.newResource}),Yi=ae.assign({invalid:[],newResource:({oldResource:e})=>e}),Li=ae.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:wt(72,(()=>bt(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),Wi=ae.assign({newResource:null}),Hi=ae.assign({error:"setup_needed"}),Ui=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{allowedOrigins:s})}}),Xi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowFrequencyModification:s})})}}),Ki=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{subscriptions:C(C({},e.subscriptions),{},{allowNextDateModification:s})})}}),Qi=ae.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{sessionLifespanInMinutes:s})}}),Gi=ae.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{jwtSharedSecret:s})}}),Ji=ae.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),Zi=ae.assign({newResource:({newResource:e},t)=>{const s=t.value;return C(C({},e),{},{sso:s})}}),ea={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ta={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},sa=A({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:ea},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:C({on:ea},ta),updated:C({on:ea},ta),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>M(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:Xi,setNextDateModification:Ki,setOrigins:Ui,setSession:Qi,setSecret:Gi,setHref:Ji,setSSO:Zi,handleLoadingSuccess:zi,handleSavingSuccess:qi,handleError:Bi,create:Li,reset:Yi,remove:Wi,requireSetup:Hi}});let ia,aa,na,ra,oa=e=>e;function la(e){if(!e.ok)throw new Y(401===e.status?"unauthorized":"unknown")}class da extends CustomEvent{constructor(){super("ready")}}class ha extends CustomEvent{constructor(){super("update")}}class ua extends W{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=sa.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=De(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":As,"x-next-date-modification":Ii,"x-session-duration":Jt,"x-session-secret":ss,"x-loading-screen":Mt,"x-error-screen":q,"x-origins-list":ji,"x-sso-switch":Ni,"x-skeleton":G,"x-section":Nt,"x-switch":Yt,"x-i18n":X,"x-page":jt}}static get properties(){return C(C({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,n;if(this.__service.state.matches("error"))return E(ia||(ia=oa` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,o=this.__service.state.matches("idle.dirty.created"),l=this.__service.state.matches("idle.dirty.deleted"),d=this.__service.state.matches("idle.dirty.updated"),h=this.__service.state.matches("idle.clean.enabled"),u=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return E(aa||(aa=oa` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,h||o||d,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(n=null==r?void 0:r.jwtSharedSecret)&&void 0!==n?n:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(C({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?E(na||(na=oa` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),l?"error":"success",u,(()=>this.__service.send("SAVE")),this.lang,this.ns,o?"create":l?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?E(ra||(ra=oa`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new Y("setup_needed");try{await this.updateComplete;const e=await Wt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await Wt.emit({source:this,init:["/"]});la(e);const i=(await e.json())._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});la(a),s=await a.json()}else{la(e),t=await e.json();const i=t._links["fx:store"].href,a=await Wt.emit({source:this,init:[i]});la(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new da)}}async __save(){try{const e=this.__service.state.context,t=ht(e.newResource,5),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};la(await Wt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof Y)throw e;if(e instanceof Lt)throw new Y("setup_needed");throw new Y("unknown")}finally{await this.updateComplete,this.dispatchEvent(new ha)}}}customElements.define("foxy-customer-portal-settings",ua);export{ua as CustomerPortalSettings};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-090432b4.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./shared-92d03925.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,h as t,L as s,c as r,aw as o}from"./shared-84203d52.js";import{A as i}from"./shared-96de56d4.js";import"./shared-aac9fed8.js";import{C as n}from"./shared-f06d08d5.js";import{a,T as l,R as d}from"./shared-8057ee9c.js";import{A as c}from"./shared-497fd63c.js";import{C as m,i as h}from"./shared-23966eed.js";import{N as p}from"./shared-b13a5ed3.js";import{c as u}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./foxy-attribute-card.js";import"./foxy-i18n.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./foxy-attribute-form.js";import"./shared-bba615b8.js";import"./shared-e0248713.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-87ca7818.js";import"./shared-bf28ab5e.js";import"./shared-851b97ef.js";import"./shared-525dd8c8.js";import"./shared-a7709d26.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-1d0ef57d.js";import"./shared-4b33c6d2.js";import"./shared-69d0ca61.js";import"./shared-77bdf956.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-e058cb87.js";import"./shared-8f34ce95.js";import"./shared-5fedf5e4.js";import"./shared-2860a3d3.js";let g,f,$=e=>e;class y extends(a(l(n),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(i.SESSION)?t(g||(g=$` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):t(f||(f=$` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let b,S,v=e=>e;const _=d(l(a(s)));let x,T,w=e=>e;class O extends(l(s)){constructor(){super(...arguments),this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{href:{type:String},icon:{type:String}})}render(){return t(x||(x=w` <a class="flex-auto font-medium tracking-wide cursor-pointer text-s rounded-s hover-text-primary focus-text-primary focus-outline-none focus-ring-2 focus-ring-primary-50 focus-ring-offset-2" href="${0}" rel="nofollow noopener"> ${0} <slot></slot> </a> `),this.href,this.icon?t(T||(T=w`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"")}}let j,k,R,z,E,A,F,I,N,H,U=e=>e;const q=l(m(a(p)));let L,P,C,V,D,J,W,B,G,K,M=e=>e;const Q=l(m(a(s)));const X=["html"],Y=["html"];let Z,ee,te,se,re,oe,ie,ne,ae,le,de,ce,me=e=>e;const he=a(m(l(s)));let pe,ue,ge,fe=e=>e;const $e=m(l(a(s,"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends q{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var s,r,o;const i="customer:header:actions:sign-out",n=this.loggingOutState,a=!!(null===(s=this.__customerElement)||void 0===s?void 0:s.in({idle:"snapshot"}));return t(j||(j=U` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="padding:var(--lumo-space-xs);margin:0;border-radius:100%;display:flex" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),this.t("sign_out").toString(),this.disabledSelector.matches(i)||!a||"idle"!==n,(async function(){try{e.loggingOutState="busy",await new c(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===n?t(k||(k=U`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):t(R||(R=U` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> `),"fail"===n?"error":"busy",this.lang,this.ns,null!==(o=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:""),this.renderTemplateOrSlot(`${i}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(z||(z=U`
1
+ import"./foxy-customer.js";import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import"./shared-090432b4.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./shared-750035db.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,h as t,L as s,c as r,aw as o}from"./shared-84203d52.js";import{A as i}from"./shared-96de56d4.js";import"./shared-aac9fed8.js";import{C as n}from"./shared-f06d08d5.js";import{a,T as l,R as d}from"./shared-8057ee9c.js";import{A as c}from"./shared-497fd63c.js";import{C as m,i as h}from"./shared-23966eed.js";import{N as p}from"./shared-a110de43.js";import{c as u}from"./shared-4e709717.js";import"./shared-747b0842.js";import"./foxy-attribute-card.js";import"./foxy-i18n.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./foxy-attribute-form.js";import"./shared-bba615b8.js";import"./shared-e0248713.js";import"./shared-3ae39e52.js";import"./shared-54c485d2.js";import"./shared-87ca7818.js";import"./shared-bf28ab5e.js";import"./shared-851b97ef.js";import"./shared-525dd8c8.js";import"./shared-a7709d26.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-9ba229fb.js";import"./shared-b0c39c37.js";import"./shared-69d0ca61.js";import"./shared-1e8cda7a.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-e058cb87.js";import"./shared-5ad54678.js";import"./shared-5fedf5e4.js";import"./shared-2860a3d3.js";let g,f,$=e=>e;class y extends(a(l(n),"customer-portal")){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{type:String}})}render(){return this.api.storage.getItem(i.SESSION)?t(g||(g=$` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.templates):t(f||(f=$` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let b,S,v=e=>e;const _=d(l(a(s)));let x,T,w=e=>e;class O extends(l(s)){constructor(){super(...arguments),this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{href:{type:String},icon:{type:String}})}render(){return t(x||(x=w` <a class="flex-auto font-medium tracking-wide cursor-pointer text-s rounded-s hover-text-primary focus-text-primary focus-outline-none focus-ring-2 focus-ring-primary-50 focus-ring-offset-2" href="${0}" rel="nofollow noopener"> ${0} <slot></slot> </a> `),this.href,this.icon?t(T||(T=w`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"")}}let j,k,R,z,E,A,F,I,N,H,U=e=>e;const q=l(m(a(p)));let L,P,C,V,D,J,W,B,G,K,M=e=>e;const Q=l(m(a(s)));const X=["html"],Y=["html"];let Z,ee,te,se,re,oe,ie,ne,ae,le,de,ce,me=e=>e;const he=a(m(l(s)));let pe,ue,ge,fe=e=>e;const $e=m(l(a(s,"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends q{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var s,r,o;const i="customer:header:actions:sign-out",n=this.loggingOutState,a=!!(null===(s=this.__customerElement)||void 0===s?void 0:s.in({idle:"snapshot"}));return t(j||(j=U` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="padding:var(--lumo-space-xs);margin:0;border-radius:100%;display:flex" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${i}:before`),this.t("sign_out").toString(),this.disabledSelector.matches(i)||!a||"idle"!==n,(async function(){try{e.loggingOutState="busy",await new c(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===n?t(k||(k=U`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):t(R||(R=U` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> `),"fail"===n?"error":"busy",this.lang,this.ns,null!==(o=null===(r=customElements.get("foxy-customer"))||void 0===r?void 0:r.defaultNS)&&void 0!==o?o:""),this.renderTemplateOrSlot(`${i}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(z||(z=U`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -1,4 +1,4 @@
1
- import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as t}from"./shared-747b0842.js";import"./shared-b98f88c9.js";import"./shared-090432b4.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./shared-92d03925.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./foxy-i18n.js";import{L as e,h as s,c as r,aw as a}from"./shared-84203d52.js";import{C as o,i as h}from"./shared-23966eed.js";import"./shared-e0248713.js";import{b as i,S as d,T as n,a as l}from"./shared-8057ee9c.js";import{S as m}from"./shared-bba615b8.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import"./shared-3ae39e52.js";import{G as c}from"./shared-525dd8c8.js";import{c as v}from"./shared-4e709717.js";import{N as p}from"./shared-b13a5ed3.js";import{S as z}from"./shared-4b33c6d2.js";import"./shared-bf28ab5e.js";import"./foxy-nucleon-element.js";import"./shared-77bdf956.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-87ca7818.js";import"./shared-e058cb87.js";import"./shared-96de56d4.js";import"./shared-aac9fed8.js";import"./shared-8f34ce95.js";import"./shared-1d0ef57d.js";import"./shared-69d0ca61.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-a7709d26.js";import"./shared-b738ee96.js";let g,f,u,b=t=>t;class $ extends e{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return i.styles}render(){const t=[],e=[];for(let r=0;r<this.size;++r)t.push(s(g||(g=b` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),r,v({"text-m font-semibold px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==r}),r,this.value===r,(()=>this.value=r),this.__handleKeyDown,r)),e.push(s(f||(f=b` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),r,r,v({hidden:this.value!==r}),this.value!==r,r));return s(u||(u=b` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-45d647e4.js";import"./shared-cd700eac.js";import{h as t}from"./shared-747b0842.js";import"./shared-b98f88c9.js";import"./shared-090432b4.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./shared-750035db.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./foxy-i18n.js";import{L as e,h as s,c as r,aw as a}from"./shared-84203d52.js";import{C as o,i as h}from"./shared-23966eed.js";import"./shared-e0248713.js";import{b as i,S as d,T as n,a as l}from"./shared-8057ee9c.js";import{S as m}from"./shared-bba615b8.js";import"./shared-851b97ef.js";import"./shared-54c485d2.js";import"./shared-3ae39e52.js";import{G as c}from"./shared-525dd8c8.js";import{c as v}from"./shared-4e709717.js";import{N as p}from"./shared-a110de43.js";import{S as z}from"./shared-b0c39c37.js";import"./shared-bf28ab5e.js";import"./foxy-nucleon-element.js";import"./shared-1e8cda7a.js";import"./shared-c70d9713.js";import"./shared-6872bf5c.js";import"./shared-87ca7818.js";import"./shared-e058cb87.js";import"./shared-96de56d4.js";import"./shared-aac9fed8.js";import"./shared-5ad54678.js";import"./shared-9ba229fb.js";import"./shared-69d0ca61.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-a7709d26.js";import"./shared-b738ee96.js";let g,f,u,b=t=>t;class $ extends e{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return i.styles}render(){const t=[],e=[];for(let r=0;r<this.size;++r)t.push(s(g||(g=b` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),r,v({"text-m font-semibold px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==r}),r,this.value===r,(()=>this.value=r),this.__handleKeyDown,r)),e.push(s(f||(f=b` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),r,r,v({hidden:this.value!==r}),this.value!==r,r));return s(u||(u=b` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-1d0ef57d.js";import{a as e}from"./shared-8057ee9c.js";import{h as a}from"./shared-84203d52.js";import"./shared-45d647e4.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-23966eed.js";import"./foxy-nucleon-element.js";import"./shared-b13a5ed3.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-4e709717.js";let t,n,o,d,r=s=>s;class l extends(e(s,"customers-table")){constructor(){super(...arguments),this.columns=[l.nameColumn,l.idColumn,l.dateColumn,l.emailColumn]}}l.nameColumn={cell:s=>a(t||(t=r` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},l.idColumn={hideBelow:"md",cell:s=>a(n||(n=r` <span role="presentation" class="text-s text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-s text-secondary font-tnum">${0}</span> `),s.data.id)},l.dateColumn={hideBelow:"md",cell:s=>a(o||(o=r` <span class="text-s text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},l.emailColumn={cell:s=>a(d||(d=r`<span data-testclass="emails" class="text-s text-secondary">${0}</span>`),s.data.email)},l.__ns="customers-table",customElements.define("foxy-customers-table",l);export{l as CustomersTable};
1
+ import"./foxy-spinner.js";import"./foxy-i18n.js";import{T as s}from"./shared-9ba229fb.js";import{a as e}from"./shared-8057ee9c.js";import{h as a}from"./shared-84203d52.js";import"./shared-45d647e4.js";import"./shared-747b0842.js";import"./shared-cd700eac.js";import"./shared-23966eed.js";import"./foxy-nucleon-element.js";import"./shared-a110de43.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";import"./shared-4e709717.js";let t,n,o,d,r=s=>s;class l extends(e(s,"customers-table")){constructor(){super(...arguments),this.columns=[l.nameColumn,l.idColumn,l.dateColumn,l.emailColumn]}}l.nameColumn={cell:s=>a(t||(t=r` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},l.idColumn={hideBelow:"md",cell:s=>a(n||(n=r` <span role="presentation" class="text-s text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-s text-secondary font-tnum">${0}</span> `),s.data.id)},l.dateColumn={hideBelow:"md",cell:s=>a(o||(o=r` <span class="text-s text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},l.emailColumn={cell:s=>a(d||(d=r`<span data-testclass="emails" class="text-s text-secondary">${0}</span>`),s.data.email)},l.__ns="customers-table",customElements.define("foxy-customers-table",l);export{l as CustomersTable};
@@ -1 +1 @@
1
- import{L as e,c as s,h as t,aw as r,_ as a}from"./shared-84203d52.js";import{T as i,a as n,S as o}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import{G as d}from"./shared-525dd8c8.js";import"./foxy-nucleon-element.js";import{N as c}from"./shared-b13a5ed3.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let p,u,m,x=e=>e;class y extends(i(e)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,s(p||(p=x`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return t(u||(u=x` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return t(m||(m=x` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],l({"text-tertiary":!s}),s||"–")})))}}let f,h,g=e=>e;const v=["_links","_embedded"],$=n(i(o(c)));class _ extends ${static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y}}render(){if(this.in({idle:"snapshot"})){const e=this.data,s=r(e,v);return t(f||(f=g` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(s))))}const e=this.in("busy");return t(h||(h=g` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),e,this.in("fail")?"error":e?"busy":"empty",this.lang,this.ns)}}let b,w,j,k,S,E,O,N,T,z=e=>e;const G=n(i(o(c)),"error-entry-card");class J extends G{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":_,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":d}}static get properties(){return a(a({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){const e=this.data,s=this.in("busy");if(e){const{hide_error:r}=e,{open:a}=this;return t(b||(b=z` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),s,a,this.__handleToggle,l({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":r&&!a,"border-primary":!r,"border-error":r&&a,"h-l":!a}),this.__renderSummary(e),a?this.__renderDetails(e):"")}return t(w||(w=z` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,s?"busy":this.in("fail")?"error":"empty",this.lang,this.ns)}__renderGetOrPostValues(e,s){const r=e||s,a=new URLSearchParams(this.__decodeHtml(r));return t(j||(j=z` <div class="relative leading-xs pt-s"> <div class="absolute font-semibold right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(a.entries())))}__renderReferrer(e){return t(k||(k=z` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-semibold text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return t(S||(S=z` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return t(E||(E=z` <div class="space-y-m pt-m"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-semibold">${0}</span> ${0} </p> ${0} </div> </x-group> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-semibold"> ${0} ${0} </span> ${0} </div> </x-group> ${0} </div> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):"",this.lang,this.ns,e.ip_address,e.ip_country?t(O||(O=z`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?t(N||(N=z`<span class="text-secondary">${0}</span>`),e.user_agent):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":t(T||(T=z` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const t=e.target;t.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=t.open}__decodeHtml(e){const s=document.createElement("textarea");return s.innerHTML=e,s.value}}customElements.define("foxy-error-entry-card",J);export{J as ErrorEntryCard};
1
+ import{L as e,c as s,h as t,aw as r,_ as a}from"./shared-84203d52.js";import{T as i,a as n,S as o}from"./shared-8057ee9c.js";import{c as l}from"./shared-4e709717.js";import{G as d}from"./shared-525dd8c8.js";import"./foxy-nucleon-element.js";import{N as c}from"./shared-a110de43.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";let p,u,m,x=e=>e;class y extends(i(e)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,s(p||(p=x`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return t(u||(u=x` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return t(m||(m=x` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],l({"text-tertiary":!s}),s||"–")})))}}let f,h,g=e=>e;const v=["_links","_embedded"],$=n(i(o(c)));class _ extends ${static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y}}render(){if(this.in({idle:"snapshot"})){const e=this.data,s=r(e,v);return t(f||(f=g` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(s))))}const e=this.in("busy");return t(h||(h=g` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),e,this.in("fail")?"error":e?"busy":"empty",this.lang,this.ns)}}let b,w,j,k,S,E,O,N,T,z=e=>e;const G=n(i(o(c)),"error-entry-card");class J extends G{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":_,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":y,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":d}}static get properties(){return a(a({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){const e=this.data,s=this.in("busy");if(e){const{hide_error:r}=e,{open:a}=this;return t(b||(b=z` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),s,a,this.__handleToggle,l({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":r&&!a,"border-primary":!r,"border-error":r&&a,"h-l":!a}),this.__renderSummary(e),a?this.__renderDetails(e):"")}return t(w||(w=z` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,s?"busy":this.in("fail")?"error":"empty",this.lang,this.ns)}__renderGetOrPostValues(e,s){const r=e||s,a=new URLSearchParams(this.__decodeHtml(r));return t(j||(j=z` <div class="relative leading-xs pt-s"> <div class="absolute font-semibold right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(a.entries())))}__renderReferrer(e){return t(k||(k=z` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-semibold text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return t(S||(S=z` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return t(E||(E=z` <div class="space-y-m pt-m"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-semibold">${0}</span> ${0} </p> ${0} </div> </x-group> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-semibold"> ${0} ${0} </span> ${0} </div> </x-group> ${0} </div> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):"",this.lang,this.ns,e.ip_address,e.ip_country?t(O||(O=z`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?t(N||(N=z`<span class="text-secondary">${0}</span>`),e.user_agent):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":t(T||(T=z` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const t=e.target;t.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=t.open}__decodeHtml(e){const s=document.createElement("textarea");return s.innerHTML=e,s.value}}customElements.define("foxy-error-entry-card",J);export{J as ErrorEntryCard};
@@ -1 +1 @@
1
- import{N as e}from"./shared-b13a5ed3.js";export{N as NucleonElement}from"./shared-b13a5ed3.js";import"./shared-84203d52.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";customElements.define("foxy-nucleon",e);
1
+ import{N as e}from"./shared-a110de43.js";export{N as NucleonElement}from"./shared-a110de43.js";import"./shared-84203d52.js";import"./shared-497fd63c.js";import"./shared-7684cb05.js";import"./shared-9f78e096.js";customElements.define("foxy-nucleon",e);