@foxy.io/elements 1.18.0-beta.19 → 1.18.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +86 -5
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +2 -2
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/shared-004f1a77.js +1 -0
- package/dist/cdn/{shared-3aecf4e3.js → shared-034c6aeb.js} +1 -1
- package/dist/cdn/{shared-7a1de87a.js → shared-0d4f9b06.js} +1 -1
- package/dist/cdn/{shared-15effede.js → shared-0f649dc6.js} +5 -5
- package/dist/cdn/{shared-b51997d1.js → shared-11ffd643.js} +1 -1
- package/dist/cdn/{shared-cd6381a5.js → shared-1351c1e3.js} +1 -1
- package/dist/cdn/{shared-9923f00e.js → shared-13982611.js} +1 -1
- package/dist/cdn/{shared-b90ddfc1.js → shared-179ff8af.js} +1 -1
- package/dist/cdn/{shared-7ed14dc8.js → shared-17c1eab2.js} +1 -1
- package/dist/cdn/{shared-c434e6d6.js → shared-1db07286.js} +3 -3
- package/dist/cdn/{shared-00752056.js → shared-1e94e6dd.js} +1 -1
- package/dist/cdn/{shared-862b436d.js → shared-21689ac0.js} +1 -1
- package/dist/cdn/{shared-ab687b1e.js → shared-23bf6ee6.js} +3 -3
- package/dist/cdn/{shared-db61a5e8.js → shared-2b2002ac.js} +1 -1
- package/dist/cdn/{shared-aef0c294.js → shared-2f6e33b6.js} +1 -1
- package/dist/cdn/shared-2f9b7791.js +1 -0
- package/dist/cdn/{shared-50f97405.js → shared-39b184de.js} +1 -1
- package/dist/cdn/{shared-4cf568d8.js → shared-3ca1e8e4.js} +1 -1
- package/dist/cdn/{shared-7df6ee40.js → shared-413415b0.js} +1 -1
- package/dist/cdn/{shared-2afc2d3b.js → shared-5ada1ccb.js} +1 -1
- package/dist/cdn/{shared-9cba1b0e.js → shared-5b3ae513.js} +1 -1
- package/dist/cdn/{shared-124a17c1.js → shared-5c6eb602.js} +1 -1
- package/dist/cdn/{shared-2470973b.js → shared-68e0cf30.js} +1 -1
- package/dist/cdn/{shared-01d2cae6.js → shared-6cc53630.js} +1 -1
- package/dist/cdn/{shared-1936d1d5.js → shared-776f948d.js} +1 -1
- package/dist/cdn/shared-79d6a262.js +1 -0
- package/dist/cdn/shared-7d658c02.js +1 -0
- package/dist/cdn/{shared-d4f80692.js → shared-7fb8ecc5.js} +1 -1
- package/dist/cdn/{shared-cfae0154.js → shared-869df7ed.js} +1 -1
- package/dist/cdn/{shared-2bce9f91.js → shared-888d690a.js} +1 -1
- package/dist/cdn/{shared-a696c602.js → shared-88c7755d.js} +1 -1
- package/dist/cdn/{shared-09c75a01.js → shared-8eb4c8d7.js} +1 -1
- package/dist/cdn/{shared-2c067e88.js → shared-90c7dbdb.js} +1 -1
- package/dist/cdn/{shared-d34586cb.js → shared-9d511d7e.js} +1 -1
- package/dist/cdn/{shared-cef7c63d.js → shared-9d7bbdd8.js} +1 -1
- package/dist/cdn/{shared-4c32f1ad.js → shared-a343ec6b.js} +1 -1
- package/dist/cdn/{shared-d7e653ae.js → shared-a41f2200.js} +1 -1
- package/dist/cdn/{shared-1e9fd9f1.js → shared-a90a5235.js} +1 -1
- package/dist/cdn/{shared-37d6c723.js → shared-ae588315.js} +1 -1
- package/dist/cdn/{shared-bfc37e75.js → shared-b48e5aaf.js} +1 -1
- package/dist/cdn/{shared-436f4187.js → shared-b7636a23.js} +1 -1
- package/dist/cdn/{shared-7cc9cc71.js → shared-bae9da44.js} +1 -1
- package/dist/cdn/{shared-90b8ef49.js → shared-bf47ead0.js} +1 -1
- package/dist/cdn/{shared-3ba49bac.js → shared-c379590f.js} +1 -1
- package/dist/cdn/{shared-54c5d16b.js → shared-cdc183c5.js} +1 -1
- package/dist/cdn/{shared-6a53f85f.js → shared-cf784db1.js} +1 -1
- package/dist/cdn/{shared-17cb43f3.js → shared-d384d6a3.js} +1 -1
- package/dist/cdn/{shared-39549b4e.js → shared-d4a652b7.js} +1 -1
- package/dist/cdn/{shared-a2e9009b.js → shared-dbd4a5e8.js} +1 -1
- package/dist/cdn/{shared-9c3934c8.js → shared-df462496.js} +1 -1
- package/dist/cdn/{shared-cce2fc5a.js → shared-e06b70cc.js} +1 -1
- package/dist/cdn/{shared-7e2ea44c.js → shared-e94165e9.js} +1 -1
- package/dist/cdn/{shared-254ef6a4.js → shared-e99fa3d6.js} +1 -1
- package/dist/cdn/{shared-ddf10c04.js → shared-ea6c8bae.js} +1 -1
- package/dist/cdn/{shared-873b14d1.js → shared-fafafc09.js} +1 -1
- package/dist/cdn/translations/email-template-card/en.json +2 -2
- package/dist/cdn/translations/integration-card/en.json +0 -3
- package/dist/cdn/translations/item-category-card/en.json +7 -0
- package/dist/cdn/translations/payments-api-payment-preset-card/en.json +0 -2
- package/dist/cdn/translations/shipping-method-card/en.json +0 -2
- package/dist/elements/internal/InternalCard/InternalCard.d.ts +1 -1
- package/dist/elements/internal/InternalCard/InternalCard.js +3 -3
- package/dist/elements/internal/InternalCard/InternalCard.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.d.ts +1 -1
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +2 -2
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.d.ts +9 -0
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js +21 -6
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js.map +1 -1
- package/dist/elements/public/CartCard/CartCard.d.ts +1 -1
- package/dist/elements/public/CartCard/CartCard.js +2 -2
- package/dist/elements/public/CartCard/CartCard.js.map +1 -1
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js +1 -1
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.d.ts +16 -3
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js +34 -24
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateCard/index.d.ts +2 -3
- package/dist/elements/public/EmailTemplateCard/index.js +2 -3
- package/dist/elements/public/EmailTemplateCard/index.js.map +1 -1
- package/dist/elements/public/IntegrationCard/IntegrationCard.d.ts +6 -0
- package/dist/elements/public/IntegrationCard/IntegrationCard.js +32 -22
- package/dist/elements/public/IntegrationCard/IntegrationCard.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.d.ts +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +2 -2
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.d.ts +18 -4
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js +22 -13
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/index.d.ts +2 -1
- package/dist/elements/public/ItemCategoryCard/index.js +2 -1
- package/dist/elements/public/ItemCategoryCard/index.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/types.d.ts +1 -1
- package/dist/elements/public/ItemCategoryCard/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.d.ts +20 -3
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js +30 -22
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/index.d.ts +3 -2
- package/dist/elements/public/PaymentsApiPaymentPresetCard/index.js +3 -2
- package/dist/elements/public/PaymentsApiPaymentPresetCard/index.js.map +1 -1
- package/dist/elements/public/ShippingMethodCard/ShippingMethodCard.d.ts +19 -0
- package/dist/elements/public/ShippingMethodCard/ShippingMethodCard.js +55 -37
- package/dist/elements/public/ShippingMethodCard/ShippingMethodCard.js.map +1 -1
- package/dist/elements/public/ShippingMethodCard/index.d.ts +1 -0
- package/dist/elements/public/ShippingMethodCard/index.js +1 -0
- package/dist/elements/public/ShippingMethodCard/index.js.map +1 -1
- package/dist/elements/public/ShippingMethodCard/types.d.ts +1 -1
- package/dist/elements/public/ShippingMethodCard/types.js.map +1 -1
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.d.ts +15 -3
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js +19 -11
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js.map +1 -1
- package/dist/elements/public/TemplateSetCard/index.d.ts +2 -1
- package/dist/elements/public/TemplateSetCard/index.js +2 -1
- package/dist/elements/public/TemplateSetCard/index.js.map +1 -1
- package/dist/elements/public/TemplateSetCard/types.d.ts +1 -1
- package/dist/elements/public/TemplateSetCard/types.js.map +1 -1
- package/dist/elements/public/index.d.ts +0 -1
- package/dist/elements/public/index.defined.d.ts +0 -1
- package/dist/elements/public/index.defined.js +0 -1
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +0 -1
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/responsive.js +5 -3
- package/dist/mixins/responsive.js.map +1 -1
- package/dist/mixins/themeable.js +0 -4
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/foxy-template-card.js +0 -1
- package/dist/cdn/shared-0a52b08c.js +0 -1
- package/dist/cdn/shared-0b17e9a6.js +0 -82
- package/dist/cdn/shared-7b6f4a11.js +0 -1
- package/dist/cdn/shared-875748d8.js +0 -1
- package/dist/cdn/shared-d8b07f4f.js +0 -1
- package/dist/elements/public/TemplateCard/TemplateCard.d.ts +0 -10
- package/dist/elements/public/TemplateCard/TemplateCard.js +0 -18
- package/dist/elements/public/TemplateCard/TemplateCard.js.map +0 -1
- package/dist/elements/public/TemplateCard/index.d.ts +0 -4
- package/dist/elements/public/TemplateCard/index.js +0 -6
- package/dist/elements/public/TemplateCard/index.js.map +0 -1
- package/dist/elements/public/TemplateCard/types.d.ts +0 -3
- package/dist/elements/public/TemplateCard/types.js +0 -2
- package/dist/elements/public/TemplateCard/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,_ as t}from"./shared-a8ced8bf.js";import"./shared-aef0c294.js";import{B as s}from"./shared-bfc37e75.js";import{E as i,F as a}from"./shared-90b8ef49.js";import"./shared-cfae0154.js";import"./shared-1e9fd9f1.js";import{L as n,h as l,c as r}from"./shared-7f33a83a.js";import{z as o,w as d,x as h,A as u}from"./shared-00752056.js";import{D as c,a as _,C as g,b as p}from"./shared-7b6f4a11.js";import"./shared-37d6c723.js";import{a as m,I as v,D as x,S as y,M as $,W as f,c as b,t as w}from"./shared-17cb43f3.js";import"./shared-a696c602.js";import"./shared-50f97405.js";import{I as k}from"./shared-4c32f1ad.js";import{C as E}from"./shared-7ed14dc8.js";import"./shared-9c3934c8.js";import{p as C}from"./shared-2bce9f91.js";import"./shared-9cba1b0e.js";import{c as S}from"./shared-4e709717.js";import"./shared-4cf568d8.js";import{P as R}from"./shared-3aecf4e3.js";import{ae as I,aa as j,ac as V,af as M,ag as q,ah as N}from"./shared-76b3d76a.js";import{G as T}from"./shared-39549b4e.js";import{j as D}from"./shared-75e78c70.js";import{p as A,W as O}from"./shared-875748d8.js";import{D as F}from"./shared-ddf10c04.js";import{c as L}from"./shared-63139d9e.js";import{i as U}from"./shared-2f7dcefa.js";import"./shared-2470973b.js";import"./shared-c434e6d6.js";import"./shared-4f037e43.js";import"./shared-11c2efc8.js";import"./shared-a85afa33.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-254ef6a4.js";import"./shared-ab687b1e.js";import"./shared-839dd3a8.js";function B(e){return e?Infinity===(e=o(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function P(e){return e}var z=Math.floor,Q=Math.random;var J=parseFloat,H=Math.min,W=Math.random;function Y(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?I(i)&&j(s,i.length):"string"==a&&s in i)&&V(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=B(t),void 0===s?(s=t,t=0):s=B(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=W();return H(t+n*(s-t+J("1e-"+((n+"").length-1))),s)}return function(e,t){return e+z(Q()*(t-e+1))}(t,s)}var G=Math.min;function X(e,t){if(e=function(e){var t=B(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=G(e,4294967295);e-=4294967295;for(var n=M(a,t="function"==typeof(s=t)?s:P);++i<e;)t(i);return n}class K extends CustomEvent{constructor(e){super("change",{detail:e})}}let Z,ee,te=e=>e;class se extends n{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return d.styles}render(){return l(Z||(Z=te` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>l(ee||(ee=te` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new K(this.value))}}let ie,ae,ne=e=>e;class le extends n{static get styles(){return[d.styles,r(ie||(ie=ne`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return l(ae||(ae=ne` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let re,oe,de=e=>e;class he extends n{static get styles(){return[d.styles,r(re||(re=de`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return l(oe||(oe=de` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ue,ce,_e=e=>e;class ge extends he{static get styles(){return[super.styles,r(ue||(ue=_e`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return l(ce||(ce=_e` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pe,me=e=>e;class ve extends CustomEvent{constructor(e){super("change",{detail:e})}}class xe extends n{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return d.styles}render(){return l(pe||(pe=me` <label class="${0}"> <span class="text-body font-semibold text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),S({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),S({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),S({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ve(this.checked))}))}}class ye extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class $e extends CustomEvent{static emit(e){return new Promise(((s,i)=>{const a=new $e(t({resolve:s,reject:i},e));e.source.dispatchEvent(a)&&i(new ye)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let fe,be=e=>e;class we extends CustomEvent{constructor(e){super("change",{detail:e})}}class ke extends h{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":k,"vaadin-custom-field":E,"vaadin-select":m,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return l(fe||(fe=be` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),S({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new we({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Ee,Ce=e=>e;class Se extends CustomEvent{constructor(e){super("change",{detail:e})}}class Re extends h{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":R,"vaadin-button":s,"iron-icon":customElements.get("iron-icon"),"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return l(Ee||(Ee=Ce` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=X(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new Se({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Se({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Ie(e){return t=>{t.preventDefault(),e(t)}}class je extends c{}let Ve,Me=e=>e;class qe extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=qe.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":x}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return l(Ve||(Ve=Me` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return C(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return C(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new je(this.value))}}qe.defaultValue="1w";class Ne extends K{}let Te,De,Ae,Oe,Fe=e=>e;class Le extends h{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=qe.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":qe,"x-skeleton":y,"x-list":se,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return l(Te||(Te=Fe` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" 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?l(De||(De=Fe`<span slot="${0}">${0}</span>`),t,this.__getText(e)):l(Ae||(Ae=Fe`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?l(Oe||(Oe=Fe` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,S({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=qe.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ne(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Ue extends _{}let Be,Pe,ze=e=>e;class Qe extends h{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=u((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":g,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return l(Be||(Be=ze` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?l(Pe||(Pe=ze` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Ue(this.value))}}class Je extends CustomEvent{constructor(e){super("change",{detail:e})}}class He extends CustomEvent{constructor(){super("remove")}}let We,Ye,Ge=e=>e;class Xe extends h{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Le,"x-jsonata-input":Qe,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return l(We||(We=Ge` <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 space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </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> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),S({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Ie((()=>{this.dispatchEvent(new He)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=C(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return l(Ye||(Ye=Ge` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=t(t({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Je(this.value))}}class Ke extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ze,et,tt=e=>e;class st extends h{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Xe,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return l(Ze||(Ze=tt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.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="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>l(et||(et=tt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,S({"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}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Ke(this.value))}}function it(e,s){const i=(new Date).getFullYear(),a={month:"long",day:"numeric"};return e.split("..").map((e=>{const n=A(e),l=(null==n?void 0:n.getFullYear())===i?void 0:"numeric";return null==n?void 0:n.toLocaleDateString(s,t({year:l},a))})).join(" – ")}class at extends CustomEvent{constructor(e){super("change",{detail:e})}}let nt,lt,rt,ot=e=>e;class dt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":$,"x-weekday-picker":f,"x-choice":g,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return l(nt||(nt=ot` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?l(lt||(lt=ot` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?l(rt||(rt=ot` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new at(this.value))}}class ht extends K{}let ut,ct,_t,gt,pt=e=>e;class mt extends h{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":F,"vaadin-button":s,"x-skeleton":y,"iron-icon":customElements.get("iron-icon"),"x-i18n":v,"x-list":se}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return l(ut||(ut=pt` <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?l(ct||(ct=pt`<span slot="${0}" class="truncate">${0}</span>`),t,it(e,this.lang)):l(_t||(_t=pt`<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?l(gt||(gt=pt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,S({"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=A(this.__endValue),s=A(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 ht(this.value))}}class vt extends CustomEvent{constructor(e){super("change",{detail:e})}}let xt,yt,$t=e=>e;class ft extends h{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":qe,"x-choice":g,"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return l(xt||(xt=$t` <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]?l(yt||(yt=$t` <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}=C(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 vt(this.value))}}class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class wt extends CustomEvent{constructor(){super("remove")}}let kt,Et,Ct,St,Rt,It,jt,Vt,Mt,qt=e=>e;class Nt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":mt,"x-jsonata-input":Qe,"x-offset-input":ft,"x-allowed-days":dt,"iron-icon":customElements.get("iron-icon"),"x-warning":O,"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:s,allowedDays:i,jsonataQuery:a,disallowedDates:n}=this.value,r=e||s,o=i&&i.days.length>0,d=n&&n.length>0,h=this.open?"":"rounded-b-l";return l(kt||(kt=qt` <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> `),S({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===a?"all":"some"}Title`,"*"!==a?this.__renderJSONataSummary(a):"",r||o||d?l(Et||(Et=qt` <div> ${0} </div> `),b(r&&this.__renderMinMaxSummary(e,s),o&&this.__renderAllowedSummary(i),d&&this.__renderDisallowedSummary(n))):"",this.disabled||!this._isI18nReady,Ie((()=>this.dispatchEvent(new wt))),this.ns,this.lang,this.ns,this.lang,a,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,s)?l(Ct||(Ct=qt` <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,i,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=n?n:[],this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new bt(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=C(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 l(St||(St=qt` <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 l(Rt||(Rt=qt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return l(It||(It=qt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return l(jt||(jt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?C(e):void 0),this.__renderMinMaxContent(t?C(t):void 0))}__renderAllowedSummary({type:e,days:t}){return l(Vt||(Vt=qt` <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=>w(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return l(Mt||(Mt=qt` <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=>it(e,this.lang))).join("; "))}}class Tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Dt,At,Ot,Ft=e=>e;class Lt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Nt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-switch":xe,"x-i18n":v}}static get properties(){return t(t({},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 l(Dt||(Dt=Ft` <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?l(At||(At=Ft` ${0} `),this.__normalizedValue.map(((e,t,s)=>l(Ot||(Ot=Ft` <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,S({"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 Tt(this.value))}}class Ut extends K{}let Bt,Pt,zt,Qt=e=>e;class Jt extends h{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":y,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":se,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return l(Bt||(Bt=Qt` <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?l(Pt||(Pt=Qt` <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):l(zt||(zt=Qt`<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,S({"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 Ut(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 Ht extends CustomEvent{constructor(e){super("change",{detail:e})}}let Wt,Yt=e=>e;class Gt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ge,"x-switch":xe,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return l(Wt||(Wt=Yt` <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 Ht(this.value))}}const Xt=p.assign({error:(e,t)=>t.data.type}),Kt=p.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Zt=p.assign({oldResource:e=>e.newResource}),es=p.assign({invalid:[],newResource:({oldResource:e})=>e}),ts=p.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:X(72,(()=>Y(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"]}})}),ss=p.assign({newResource:null}),is=p.assign({error:"setup_needed"}),as=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{allowedOrigins:i})}}),ns=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowFrequencyModification:i})})}}),ls=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowNextDateModification:i})})}}),rs=p.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sessionLifespanInMinutes:i})}}),os=p.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{jwtSharedSecret:i})}}),ds=p.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),hs=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sso:i})}}),us={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"}},cs={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},_s=q({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:us},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:t({on:us},cs),updated:t({on:us},cs),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>N(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:ns,setNextDateModification:ls,setOrigins:as,setSession:rs,setSecret:os,setHref:ds,setSSO:hs,handleLoadingSuccess:Kt,handleSavingSuccess:Zt,handleError:Xt,create:ts,reset:es,remove:ss,requireSetup:is}});let gs,ps,ms,vs,xs=e=>e;function ys(e){if(!e.ok)throw new a(401===e.status?"unauthorized":"unknown")}class $s extends CustomEvent{constructor(){super("ready")}}class fs extends CustomEvent{constructor(){super("update")}}class bs extends h{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=_s.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=U(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":st,"x-next-date-modification":Lt,"x-session-duration":ke,"x-session-secret":Re,"x-loading-screen":le,"x-error-screen":i,"x-origins-list":Jt,"x-sso-switch":Gt,"x-skeleton":y,"x-section":ge,"x-switch":xe,"x-i18n":v,"x-page":he}}static get properties(){return t(t({},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,s,i,a,n,r;if(this.__service.state.matches("error"))return l(gs||(gs=xs` <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:o}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return l(ps||(ps=xs` <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,c||d||u,(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==o?void 0:o.allowedOrigins)&&void 0!==e?e:[],!o,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(s=null==o?void 0:o.subscriptions.allowFrequencyModification)&&void 0!==s?s:[],!o,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==o?void 0:o.subscriptions.allowNextDateModification)&&void 0!==i&&i,!o,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(a=null==o?void 0:o.sso)&&void 0!==a&&a,!o,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!o||!this._isI18nReady,null!==(n=null==o?void 0:o.sessionLifespanInMinutes)&&void 0!==n?n:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SESSION"},e))}),!o||!this._isI18nReady,null!==(r=null==o?void 0:o.jwtSharedSecret)&&void 0!==r?r:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?l(ms||(ms=xs` <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> `),h?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?l(vs||(vs=xs`<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 a("setup_needed");try{await this.updateComplete;const e=await $e.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await $e.emit({source:this,init:["/"]});ys(e);const i=(await e.json())._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}else{ys(e),t=await e.json();const i=t._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof a)throw e;if(e instanceof ye)throw new a("setup_needed");throw new a("unknown")}finally{await this.updateComplete,this.dispatchEvent(new $s)}}async __save(){try{const e=this.__service.state.context,t=L(e.newResource),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};ys(await $e.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof a)throw e;if(e instanceof ye)throw new a("setup_needed");throw new a("unknown")}finally{await this.updateComplete,this.dispatchEvent(new fs)}}}customElements.define("foxy-customer-portal-settings",bs);export{bs as CustomerPortalSettings};
|
|
1
|
+
import{e,_ as t}from"./shared-a8ced8bf.js";import"./shared-2f6e33b6.js";import{B as s}from"./shared-b48e5aaf.js";import{E as i,F as a}from"./shared-bf47ead0.js";import"./shared-869df7ed.js";import"./shared-a90a5235.js";import{L as n,h as l,c as r}from"./shared-7f33a83a.js";import{z as o,w as d,x as h,A as u}from"./shared-1e94e6dd.js";import{D as c,a as _,C as g,b as p}from"./shared-7d658c02.js";import"./shared-ae588315.js";import{a as m,I as v,D as x,S as y,M as $,W as f,c as b,t as w}from"./shared-d384d6a3.js";import"./shared-88c7755d.js";import"./shared-39b184de.js";import{I as k}from"./shared-a343ec6b.js";import{C as E}from"./shared-17c1eab2.js";import"./shared-df462496.js";import{p as C}from"./shared-888d690a.js";import"./shared-5b3ae513.js";import{c as S}from"./shared-4e709717.js";import"./shared-3ca1e8e4.js";import{P as R}from"./shared-034c6aeb.js";import{ae as I,aa as j,ac as V,af as M,ag as q,ah as N}from"./shared-76b3d76a.js";import{G as T}from"./shared-d4a652b7.js";import{j as D}from"./shared-75e78c70.js";import{p as A,W as O}from"./shared-2f9b7791.js";import{D as F}from"./shared-ea6c8bae.js";import{c as L}from"./shared-63139d9e.js";import{i as U}from"./shared-2f7dcefa.js";import"./shared-68e0cf30.js";import"./shared-1db07286.js";import"./shared-4f037e43.js";import"./shared-11c2efc8.js";import"./shared-a85afa33.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-e99fa3d6.js";import"./shared-23bf6ee6.js";import"./shared-839dd3a8.js";function B(e){return e?Infinity===(e=o(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function P(e){return e}var z=Math.floor,Q=Math.random;var J=parseFloat,H=Math.min,W=Math.random;function Y(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?I(i)&&j(s,i.length):"string"==a&&s in i)&&V(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=B(t),void 0===s?(s=t,t=0):s=B(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=W();return H(t+n*(s-t+J("1e-"+((n+"").length-1))),s)}return function(e,t){return e+z(Q()*(t-e+1))}(t,s)}var G=Math.min;function X(e,t){if(e=function(e){var t=B(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=G(e,4294967295);e-=4294967295;for(var n=M(a,t="function"==typeof(s=t)?s:P);++i<e;)t(i);return n}class K extends CustomEvent{constructor(e){super("change",{detail:e})}}let Z,ee,te=e=>e;class se extends n{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return d.styles}render(){return l(Z||(Z=te` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>l(ee||(ee=te` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new K(this.value))}}let ie,ae,ne=e=>e;class le extends n{static get styles(){return[d.styles,r(ie||(ie=ne`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return l(ae||(ae=ne` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let re,oe,de=e=>e;class he extends n{static get styles(){return[d.styles,r(re||(re=de`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return l(oe||(oe=de` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ue,ce,_e=e=>e;class ge extends he{static get styles(){return[super.styles,r(ue||(ue=_e`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return l(ce||(ce=_e` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pe,me=e=>e;class ve extends CustomEvent{constructor(e){super("change",{detail:e})}}class xe extends n{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return d.styles}render(){return l(pe||(pe=me` <label class="${0}"> <span class="text-body font-semibold text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),S({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),S({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),S({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ve(this.checked))}))}}class ye extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class $e extends CustomEvent{static emit(e){return new Promise(((s,i)=>{const a=new $e(t({resolve:s,reject:i},e));e.source.dispatchEvent(a)&&i(new ye)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let fe,be=e=>e;class we extends CustomEvent{constructor(e){super("change",{detail:e})}}class ke extends h{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":k,"vaadin-custom-field":E,"vaadin-select":m,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return l(fe||(fe=be` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),S({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new we({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Ee,Ce=e=>e;class Se extends CustomEvent{constructor(e){super("change",{detail:e})}}class Re extends h{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":R,"vaadin-button":s,"iron-icon":customElements.get("iron-icon"),"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return l(Ee||(Ee=Ce` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=X(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new Se({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Se({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Ie(e){return t=>{t.preventDefault(),e(t)}}class je extends c{}let Ve,Me=e=>e;class qe extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=qe.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":x}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return l(Ve||(Ve=Me` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return C(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return C(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new je(this.value))}}qe.defaultValue="1w";class Ne extends K{}let Te,De,Ae,Oe,Fe=e=>e;class Le extends h{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=qe.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":qe,"x-skeleton":y,"x-list":se,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return l(Te||(Te=Fe` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" 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?l(De||(De=Fe`<span slot="${0}">${0}</span>`),t,this.__getText(e)):l(Ae||(Ae=Fe`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?l(Oe||(Oe=Fe` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,S({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=qe.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ne(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Ue extends _{}let Be,Pe,ze=e=>e;class Qe extends h{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=u((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":g,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return l(Be||(Be=ze` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?l(Pe||(Pe=ze` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Ue(this.value))}}class Je extends CustomEvent{constructor(e){super("change",{detail:e})}}class He extends CustomEvent{constructor(){super("remove")}}let We,Ye,Ge=e=>e;class Xe extends h{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Le,"x-jsonata-input":Qe,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return l(We||(We=Ge` <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 space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </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> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),S({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Ie((()=>{this.dispatchEvent(new He)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=C(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return l(Ye||(Ye=Ge` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=t(t({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Je(this.value))}}class Ke extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ze,et,tt=e=>e;class st extends h{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Xe,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return l(Ze||(Ze=tt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.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="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>l(et||(et=tt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,S({"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}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Ke(this.value))}}function it(e,s){const i=(new Date).getFullYear(),a={month:"long",day:"numeric"};return e.split("..").map((e=>{const n=A(e),l=(null==n?void 0:n.getFullYear())===i?void 0:"numeric";return null==n?void 0:n.toLocaleDateString(s,t({year:l},a))})).join(" – ")}class at extends CustomEvent{constructor(e){super("change",{detail:e})}}let nt,lt,rt,ot=e=>e;class dt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":$,"x-weekday-picker":f,"x-choice":g,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return l(nt||(nt=ot` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?l(lt||(lt=ot` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?l(rt||(rt=ot` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new at(this.value))}}class ht extends K{}let ut,ct,_t,gt,pt=e=>e;class mt extends h{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":F,"vaadin-button":s,"x-skeleton":y,"iron-icon":customElements.get("iron-icon"),"x-i18n":v,"x-list":se}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return l(ut||(ut=pt` <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?l(ct||(ct=pt`<span slot="${0}" class="truncate">${0}</span>`),t,it(e,this.lang)):l(_t||(_t=pt`<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?l(gt||(gt=pt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,S({"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=A(this.__endValue),s=A(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 ht(this.value))}}class vt extends CustomEvent{constructor(e){super("change",{detail:e})}}let xt,yt,$t=e=>e;class ft extends h{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":qe,"x-choice":g,"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return l(xt||(xt=$t` <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]?l(yt||(yt=$t` <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}=C(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 vt(this.value))}}class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class wt extends CustomEvent{constructor(){super("remove")}}let kt,Et,Ct,St,Rt,It,jt,Vt,Mt,qt=e=>e;class Nt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":mt,"x-jsonata-input":Qe,"x-offset-input":ft,"x-allowed-days":dt,"iron-icon":customElements.get("iron-icon"),"x-warning":O,"x-group":T,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:s,allowedDays:i,jsonataQuery:a,disallowedDates:n}=this.value,r=e||s,o=i&&i.days.length>0,d=n&&n.length>0,h=this.open?"":"rounded-b-l";return l(kt||(kt=qt` <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> `),S({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===a?"all":"some"}Title`,"*"!==a?this.__renderJSONataSummary(a):"",r||o||d?l(Et||(Et=qt` <div> ${0} </div> `),b(r&&this.__renderMinMaxSummary(e,s),o&&this.__renderAllowedSummary(i),d&&this.__renderDisallowedSummary(n))):"",this.disabled||!this._isI18nReady,Ie((()=>this.dispatchEvent(new wt))),this.ns,this.lang,this.ns,this.lang,a,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,s)?l(Ct||(Ct=qt` <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,i,this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=n?n:[],this.disabled||!this._isI18nReady,(e=>{this.value=t(t({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new bt(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=C(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 l(St||(St=qt` <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 l(Rt||(Rt=qt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return l(It||(It=qt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return l(jt||(jt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} — ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?C(e):void 0),this.__renderMinMaxContent(t?C(t):void 0))}__renderAllowedSummary({type:e,days:t}){return l(Vt||(Vt=qt` <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=>w(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return l(Mt||(Mt=qt` <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=>it(e,this.lang))).join("; "))}}class Tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Dt,At,Ot,Ft=e=>e;class Lt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Nt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-switch":xe,"x-i18n":v}}static get properties(){return t(t({},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 l(Dt||(Dt=Ft` <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?l(At||(At=Ft` ${0} `),this.__normalizedValue.map(((e,t,s)=>l(Ot||(Ot=Ft` <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,S({"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 Tt(this.value))}}class Ut extends K{}let Bt,Pt,zt,Qt=e=>e;class Jt extends h{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":y,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":se,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return l(Bt||(Bt=Qt` <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?l(Pt||(Pt=Qt` <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):l(zt||(zt=Qt`<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,S({"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 Ut(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 Ht extends CustomEvent{constructor(e){super("change",{detail:e})}}let Wt,Yt=e=>e;class Gt extends h{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ge,"x-switch":xe,"x-i18n":v}}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return l(Wt||(Wt=Yt` <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 Ht(this.value))}}const Xt=p.assign({error:(e,t)=>t.data.type}),Kt=p.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Zt=p.assign({oldResource:e=>e.newResource}),es=p.assign({invalid:[],newResource:({oldResource:e})=>e}),ts=p.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:X(72,(()=>Y(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"]}})}),ss=p.assign({newResource:null}),is=p.assign({error:"setup_needed"}),as=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{allowedOrigins:i})}}),ns=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowFrequencyModification:i})})}}),ls=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{subscriptions:t(t({},e.subscriptions),{},{allowNextDateModification:i})})}}),rs=p.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sessionLifespanInMinutes:i})}}),os=p.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{jwtSharedSecret:i})}}),ds=p.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),hs=p.assign({newResource:({newResource:e},s)=>{const i=s.value;return t(t({},e),{},{sso:i})}}),us={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"}},cs={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},_s=q({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:us},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:t({on:us},cs),updated:t({on:us},cs),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>N(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:ns,setNextDateModification:ls,setOrigins:as,setSession:rs,setSecret:os,setHref:ds,setSSO:hs,handleLoadingSuccess:Kt,handleSavingSuccess:Zt,handleError:Xt,create:ts,reset:es,remove:ss,requireSetup:is}});let gs,ps,ms,vs,xs=e=>e;function ys(e){if(!e.ok)throw new a(401===e.status?"unauthorized":"unknown")}class $s extends CustomEvent{constructor(){super("ready")}}class fs extends CustomEvent{constructor(){super("update")}}class bs extends h{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=_s.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=U(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":st,"x-next-date-modification":Lt,"x-session-duration":ke,"x-session-secret":Re,"x-loading-screen":le,"x-error-screen":i,"x-origins-list":Jt,"x-sso-switch":Gt,"x-skeleton":y,"x-section":ge,"x-switch":xe,"x-i18n":v,"x-page":he}}static get properties(){return t(t({},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,s,i,a,n,r;if(this.__service.state.matches("error"))return l(gs||(gs=xs` <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:o}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return l(ps||(ps=xs` <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,c||d||u,(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==o?void 0:o.allowedOrigins)&&void 0!==e?e:[],!o,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(s=null==o?void 0:o.subscriptions.allowFrequencyModification)&&void 0!==s?s:[],!o,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==o?void 0:o.subscriptions.allowNextDateModification)&&void 0!==i&&i,!o,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(a=null==o?void 0:o.sso)&&void 0!==a&&a,!o,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!o||!this._isI18nReady,null!==(n=null==o?void 0:o.sessionLifespanInMinutes)&&void 0!==n?n:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SESSION"},e))}),!o||!this._isI18nReady,null!==(r=null==o?void 0:o.jwtSharedSecret)&&void 0!==r?r:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(t({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?l(ms||(ms=xs` <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> `),h?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?l(vs||(vs=xs`<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 a("setup_needed");try{await this.updateComplete;const e=await $e.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await $e.emit({source:this,init:["/"]});ys(e);const i=(await e.json())._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}else{ys(e),t=await e.json();const i=t._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof a)throw e;if(e instanceof ye)throw new a("setup_needed");throw new a("unknown")}finally{await this.updateComplete,this.dispatchEvent(new $s)}}async __save(){try{const e=this.__service.state.context,t=L(e.newResource),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};ys(await $e.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof a)throw e;if(e instanceof ye)throw new a("setup_needed");throw new a("unknown")}finally{await this.updateComplete,this.dispatchEvent(new fs)}}}customElements.define("foxy-customer-portal-settings",bs);export{bs as CustomerPortalSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./
|
|
1
|
+
import"./foxy-customer.js";import"./shared-b48e5aaf.js";import"./shared-3ca1e8e4.js";import"./shared-2f6e33b6.js";import"./shared-0479553e.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"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as e,k as t}from"./shared-a8ced8bf.js";import{h as s,L as r,c as o}from"./shared-7f33a83a.js";import{A as i}from"./shared-ea67b3f3.js";import"./shared-75e78c70.js";import{C as n}from"./shared-8b6addec.js";import{a,T as l,R as d}from"./shared-1e94e6dd.js";import{A as c}from"./shared-a85afa33.js";import{I as m}from"./shared-4f037e43.js";import{c as h}from"./shared-4e709717.js";import{C as u}from"./shared-43bcce74.js";import{N as p}from"./shared-181f51bd.js";import{B as f}from"./shared-76b3d76a.js";import{i as g}from"./shared-d3bf9ac0.js";import"./shared-68e0cf30.js";import"./foxy-attribute-card.js";import"./shared-888d690a.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./foxy-attribute-form.js";import"./shared-1db07286.js";import"./shared-869df7ed.js";import"./shared-39b184de.js";import"./shared-5b3ae513.js";import"./shared-cf784db1.js";import"./shared-ae588315.js";import"./shared-a90a5235.js";import"./shared-7d658c02.js";import"./shared-88c7755d.js";import"./shared-a343ec6b.js";import"./shared-17c1eab2.js";import"./shared-df462496.js";import"./shared-23bf6ee6.js";import"./shared-11c2efc8.js";import"./shared-d384d6a3.js";import"./shared-e99fa3d6.js";import"./shared-d4a652b7.js";import"./shared-413415b0.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./shared-90c7dbdb.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-8eb4c8d7.js";import"./shared-0f649dc6.js";import"./shared-004f1a77.js";import"./shared-99065f2a.js";import"./shared-21689ac0.js";import"./shared-c379590f.js";import"./shared-11ffd643.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-0d4f9b06.js";import"./shared-7fb8ecc5.js";import"./foxy-cancellation-form.js";import"./shared-2f9b7791.js";import"./shared-bc7f58ef.js";import"./foxy-transaction-card.js";import"./foxy-item-card.js";import"./shared-b7636a23.js";import"./shared-d519a301.js";import"./shared-179ff8af.js";import"./shared-034c6aeb.js";import"./shared-2b2002ac.js";let $,y,b=e=>e;class v 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)?s($||($=b` <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):s(y||(y=b` <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 S,x,_=e=>e;const j=d(l(a(m(r))));let w,T,O,k,E=e=>e;class R extends(l(r)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return e(e({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=h({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=s(w||(w=E` ${0} <slot></slot> `),this.icon?s(T||(T=E`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?s(O||(O=E`<button class="${0}" disabled="disabled">${0}</button>`),e,t):s(k||(k=E` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let z,N,A,F,I,H,U,q,L,P,C=e=>e;const D=l(u(a(p)));let V,B,J,W,G,K,M,Q,X,Y,Z=e=>e;const ee=l(u(a(m(r))));const te=["html"],se=["html"];let re,oe,ie,ne,ae,le,de,ce,me,he,ue,pe,fe=e=>e;const ge=a(u(l(m(r))));let $e,ye,be,ve=e=>e;const Se=u(l(a(m(r),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends D{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,r,o,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==l,m={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return s(z||(z=C` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(m).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(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"===l?s(N||(N=C`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):s(A||(A=C` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"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:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(F||(F=C`
|
|
2
2
|
${0}
|
|
3
3
|
|
|
4
4
|
<foxy-internal-customer-portal-subscriptions
|