@webority/ui-elements 0.61.2 → 0.63.0
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/WuiConsentBanner-C2jOIeQK.js +1 -0
- package/dist/{WuiDatePicker-B4E_NvAh.js → WuiDatePicker-DONFTIvZ.js} +2 -2
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements.global.js +31 -6
- package/dist/ui-elements.js +1 -1
- package/package.json +1 -1
- package/dist/WuiConsentBanner-BM1kjiHj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./tourOpenMark-nPeAJFSo.js";var n={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},r=e=>`var(${e}, ${n[e]})`,i=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${r(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${r(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${r(`--color-surface`)}; border: 1px solid ${r(`--color-border`)}; border-radius: ${r(`--wui-radius-lg`)}; box-shadow: ${r(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${r(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${r(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${r(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${r(`--color-border`)}; border-bottom: 1px solid ${r(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${r(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${r(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${r(`--color-primary`)}; background: ${r(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${r(`--color-primary`)}; border-color: ${r(`--color-primary`)}; color: ${r(`--color-primary-text`)}; } .btn-primary:hover { background: ${r(`--color-primary-hover`)}; border-color: ${r(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${r(`--color-text-muted`)}; color: ${r(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${r(`--color-bg-muted`)}; color: ${r(`--color-text`)}; } .btn-link { font-weight: 400; color: ${r(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${r(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 575.98px) { :host, :host([position="bottom-right"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } .wui-consent-banner-panel { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } /* Hidden on phones, but it stays the dialog's accessible name. */ .wui-consent-banner-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .wui-consent-banner-description { margin: 0 0 8px; font-size: 13px; line-height: 1.4; } .wui-consent-banner-actions { gap: 6px; } } `,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u={analytics:{label:c.analyticsLabel,description:`analyticsDescription`},functional:{label:c.functionalLabel,description:`functionalDescription`},marketing:{label:c.marketingLabel,description:`marketingDescription`}},d=new Set;function f(e){d.has(e)||(d.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${l.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var p=0,m=class extends e{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),p+=1,this._uid=`wui-consent-${p}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...l];let t=e.split(/\s+/).filter(Boolean);for(let e of t)l.includes(e)||f(e);let n=l.filter(e=>t.includes(e));return n.length?n:[...l]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(l.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[t]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(t))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,n=this.policyHref?` <a class="wui-consent-banner-policy" href="${_(this.policyHref)}">${g(this.policyLabel)}</a>`:``,r=this._root();r.innerHTML=`${r===this?``:`<style>${i}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${g(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${g(this.description)}${n}</p> <div class="wui-consent-banner-settings" hidden> ${h(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${this.categories.map(e=>h(t,e,u[e].label,this[u[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(l.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function h(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${g(n)}</label> </div> <p class="wui-consent-banner-category-description">${g(r)}</p> </div>`}var g=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),_=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);export{m as t};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";import{t as i}from"./formMirror-BgY7zkC3.js";import{t as a}from"./iconGlyphs.g-CUm_mfze.js";import{n as o}from"./optionLabel-BBaur8Bs.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./calendarMath-BC2wGCD-.js";var h=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&(e===`value`?(this._value=n||``,this._syncFormValue(),this._syncTrigger()):e===`display-format`?this._syncTrigger():e===`first-day`?this.querySelector(`.datepicker-pop`)?.hidden||this._renderView():this.render())}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,i(this,this._value),this._syncTrigger()}_firstDay(){return s(this)}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`
|
|
1
|
+
import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";import{t as i}from"./formMirror-BgY7zkC3.js";import{t as a}from"./iconGlyphs.g-CUm_mfze.js";import{n as o}from"./optionLabel-BBaur8Bs.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./calendarMath-BC2wGCD-.js";var h=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&(e===`value`?(this._value=n||``,this._syncFormValue(),this._syncTrigger()):e===`display-format`?this._syncTrigger():e===`first-day`?this.querySelector(`.datepicker-pop`)?.hidden||this._renderView():this.render())}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,i(this,this._value),this._syncTrigger()}_firstDay(){return s(this)}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`Choose a date`,t=p(this._value);t&&(this._viewY=t.y,this._viewM=t.m);let n=this.getAttribute(`size`),r=n===`sm`?` input-sm`:n===`lg`?` input-lg`:``,s=this.getAttribute(`aria-label`),c=this.getAttribute(`aria-describedby`);this.innerHTML=`
|
|
2
2
|
<div class="datepicker">
|
|
3
3
|
<button type="button" class="input datepicker-trigger${r}${t?` has-value`:``}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${s?` aria-label="${o(s)}"`:``}${c?` aria-describedby="${o(c)}"`:``}>
|
|
4
4
|
<span data-trigger-label class="${t?``:`search-select-placeholder`}">${o(t?d(this._value,this.getAttribute(`display-format`)):e)}</span>
|
|
5
5
|
${a(`calendar-dots`)}
|
|
6
6
|
</button>
|
|
7
7
|
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
8
|
-
</div>`,this._rendered=!0,i(this,this._value),this._wire()}_syncFormValue(){i(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!t)return;let n=p(this._value);t.textContent=n?d(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`
|
|
8
|
+
</div>`,this._rendered=!0,i(this,this._value),this._wire()}_syncFormValue(){i(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!t)return;let n=p(this._value);t.textContent=n?d(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`Choose a date`,t.classList.toggle(`search-select-placeholder`,!n),e?.classList.toggle(`has-value`,!!n)}_limits(){let e=p(this.getAttribute(`min`)),t=p(this.getAttribute(`max`)),n=e?new Date(e.y,e.m,e.d).getTime():-1/0,r=t?new Date(t.y,t.m,t.d).getTime():1/0,i=new Set;for(let e of(this.getAttribute(`disabled-weekdays`)||``).split(`,`)){let t=e.trim();/^[0-6]$/.test(t)&&i.add(Number(t))}return{dayDisabled:(e,t,a)=>{let o=new Date(e,t,a),s=o.getTime();return s<n||s>r||i.has(o.getDay())},monthDisabled:(e,t)=>{let i=new Date(e,t,1).getTime();return new Date(e,t,l(e,t)).getTime()<n||i>r},yearDisabled:e=>{let t=new Date(e,0,1).getTime();return new Date(e,11,31).getTime()<n||t>r}}}_renderView(){let e=this.querySelector(`.datepicker-pop`);e&&(this._mode===`months`?e.innerHTML=this._monthsHtml():this._mode===`years`?e.innerHTML=this._yearsHtml():e.innerHTML=this._daysHtml(),this._focusActive())}_daysHtml(){let e=this._firstDay(),t=(new Date(this._viewY,this._viewM,1).getDay()-e+7)%7,n=l(this._viewY,this._viewM),r=p(this._value),i=new Date,{dayDisabled:o}=this._limits(),s=this._focus||r||{y:this._viewY,m:this._viewM,d:1},d=(e,t,n,a)=>{let l=c(e,t,n),u=r&&r.y===e&&r.m===t&&r.d===n,d=i.getFullYear()===e&&i.getMonth()===t&&i.getDate()===n,f=s.y===e&&s.m===t&&s.d===n,p=o(e,t,n);return`<button type="button" class="${[`datepicker-day`,a?`is-outside`:``,d?`is-today`:``,u?`is-selected`:``].filter(Boolean).join(` `)}" data-iso="${l}" role="gridcell" tabindex="${f&&!p?`0`:`-1`}"${u?` aria-selected="true"`:``}${p?` disabled aria-disabled="true"`:``}>${n}</button>`},h=``,g=f(this._viewY,this._viewM-1),_=l(g.y,g.m);for(let e=t-1;e>=0;e--)h+=d(g.y,g.m,_-e,!0);for(let e=1;e<=n;e++)h+=d(this._viewY,this._viewM,e,!1);let v=f(this._viewY,this._viewM+1),y=(7-(t+n)%7)%7;for(let e=1;e<=y;e++)h+=d(v.y,v.m,e,!0);let b=o(i.getFullYear(),i.getMonth(),i.getDate()),x=u.map((t,n)=>u[(n+e)%7]).map(e=>`<span>${e}</span>`).join(``);return`
|
|
9
9
|
<div class="datepicker-head">
|
|
10
10
|
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${a(`chevron-left`)}</button>
|
|
11
11
|
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${m[this._viewM]} ${this._viewY}</button>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiConsentBanner-
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiConsentBanner-C2jOIeQK.js";e(`wui-consent-banner`,t);export{t as WuiConsentBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiDatePicker-DONFTIvZ.js";e(`wui-datepicker`,t);export{t as WuiDatePicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var e={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},t=t=>`var(${t}, ${e[t]})`,n=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${t(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${t(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${t(`--color-surface`)}; border: 1px solid ${t(`--color-border`)}; border-radius: ${t(`--wui-radius-lg`)}; box-shadow: ${t(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${t(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${t(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${t(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${t(`--color-border`)}; border-bottom: 1px solid ${t(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${t(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${t(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${t(`--color-primary`)}; background: ${t(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${t(`--color-primary`)}; border-color: ${t(`--color-primary`)}; color: ${t(`--color-primary-text`)}; } .btn-primary:hover { background: ${t(`--color-primary-hover`)}; border-color: ${t(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${t(`--color-text-muted`)}; color: ${t(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${t(`--color-bg-muted`)}; color: ${t(`--color-text`)}; } .btn-link { font-weight: 400; color: ${t(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${t(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 480px) { :host, :host([position="bottom-right"]) { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; } } `,r=typeof HTMLElement>`u`?class{}:HTMLElement,i=`data-wui-tour-open`,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u={analytics:{label:c.analyticsLabel,description:`analyticsDescription`},functional:{label:c.functionalLabel,description:`functionalDescription`},marketing:{label:c.marketingLabel,description:`marketingDescription`}},d=new Set;function f(e){d.has(e)||(d.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${l.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var p=0,m=class extends r{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),p+=1,this._uid=`wui-consent-${p}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...l];let t=e.split(/\s+/).filter(Boolean);for(let e of t)l.includes(e)||f(e);let n=l.filter(e=>t.includes(e));return n.length?n:[...l]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(l.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[i]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(i))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,r=this.policyHref?` <a class="wui-consent-banner-policy" href="${_(this.policyHref)}">${g(this.policyLabel)}</a>`:``,i=this._root();i.innerHTML=`${i===this?``:`<style>${n}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${g(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${g(this.description)}${r}</p> <div class="wui-consent-banner-settings" hidden> ${h(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${this.categories.map(e=>h(t,e,u[e].label,this[u[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(l.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function h(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${g(n)}</label> </div> <p class="wui-consent-banner-category-description">${g(r)}</p> </div>`}var g=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),_=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);typeof customElements<`u`&&!customElements.get(`wui-consent-banner`)&&customElements.define(`wui-consent-banner`,m)})();
|
|
1
|
+
(function(){var e={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},t=t=>`var(${t}, ${e[t]})`,n=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${t(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${t(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${t(`--color-surface`)}; border: 1px solid ${t(`--color-border`)}; border-radius: ${t(`--wui-radius-lg`)}; box-shadow: ${t(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${t(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${t(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${t(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${t(`--color-border`)}; border-bottom: 1px solid ${t(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${t(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${t(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${t(`--color-primary`)}; background: ${t(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${t(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${t(`--color-primary`)}; border-color: ${t(`--color-primary`)}; color: ${t(`--color-primary-text`)}; } .btn-primary:hover { background: ${t(`--color-primary-hover`)}; border-color: ${t(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${t(`--color-text-muted`)}; color: ${t(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${t(`--color-bg-muted`)}; color: ${t(`--color-text`)}; } .btn-link { font-weight: 400; color: ${t(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${t(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 575.98px) { :host, :host([position="bottom-right"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } .wui-consent-banner-panel { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } /* Hidden on phones, but it stays the dialog's accessible name. */ .wui-consent-banner-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .wui-consent-banner-description { margin: 0 0 8px; font-size: 13px; line-height: 1.4; } .wui-consent-banner-actions { gap: 6px; } } `,r=typeof HTMLElement>`u`?class{}:HTMLElement,i=`data-wui-tour-open`,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u={analytics:{label:c.analyticsLabel,description:`analyticsDescription`},functional:{label:c.functionalLabel,description:`functionalDescription`},marketing:{label:c.marketingLabel,description:`marketingDescription`}},d=new Set;function f(e){d.has(e)||(d.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${l.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var p=0,m=class extends r{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),p+=1,this._uid=`wui-consent-${p}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...l];let t=e.split(/\s+/).filter(Boolean);for(let e of t)l.includes(e)||f(e);let n=l.filter(e=>t.includes(e));return n.length?n:[...l]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(l.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[i]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(i))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,r=this.policyHref?` <a class="wui-consent-banner-policy" href="${_(this.policyHref)}">${g(this.policyLabel)}</a>`:``,i=this._root();i.innerHTML=`${i===this?``:`<style>${n}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${g(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${g(this.description)}${r}</p> <div class="wui-consent-banner-settings" hidden> ${h(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${this.categories.map(e=>h(t,e,u[e].label,this[u[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(l.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function h(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${g(n)}</label> </div> <p class="wui-consent-banner-category-description">${g(r)}</p> </div>`}var g=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),_=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);typeof customElements<`u`&&!customElements.get(`wui-consent-banner`)&&customElements.define(`wui-consent-banner`,m)})();
|
|
@@ -191,15 +191,40 @@ var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{
|
|
|
191
191
|
flex: 1 1 100%;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
@media (max-width:
|
|
194
|
+
@media (max-width: 575.98px) {
|
|
195
195
|
:host,
|
|
196
196
|
:host([position="bottom-right"]) {
|
|
197
|
-
left:
|
|
198
|
-
right:
|
|
199
|
-
bottom:
|
|
197
|
+
left: 0;
|
|
198
|
+
right: 0;
|
|
199
|
+
bottom: 0;
|
|
200
200
|
width: auto;
|
|
201
201
|
max-width: none;
|
|
202
202
|
}
|
|
203
|
+
.wui-consent-banner-panel {
|
|
204
|
+
padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
|
|
205
|
+
border-width: 1px 0 0;
|
|
206
|
+
border-radius: 0;
|
|
207
|
+
}
|
|
208
|
+
/* Hidden on phones, but it stays the dialog's accessible name. */
|
|
209
|
+
.wui-consent-banner-heading {
|
|
210
|
+
position: absolute;
|
|
211
|
+
width: 1px;
|
|
212
|
+
height: 1px;
|
|
213
|
+
margin: -1px;
|
|
214
|
+
padding: 0;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
clip: rect(0, 0, 0, 0);
|
|
217
|
+
white-space: nowrap;
|
|
218
|
+
border: 0;
|
|
219
|
+
}
|
|
220
|
+
.wui-consent-banner-description {
|
|
221
|
+
margin: 0 0 8px;
|
|
222
|
+
font-size: 13px;
|
|
223
|
+
line-height: 1.4;
|
|
224
|
+
}
|
|
225
|
+
.wui-consent-banner-actions {
|
|
226
|
+
gap: 6px;
|
|
227
|
+
}
|
|
203
228
|
}
|
|
204
229
|
`,pr=`data-wui-tour-open`,mr=`wui-consent-save`,hr=`[data-consent-settings]`,gr=`tour-open`,U={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},_r=[`analytics`,`functional`,`marketing`],vr={analytics:{label:U.analyticsLabel,description:`analyticsDescription`},functional:{label:U.functionalLabel,description:`functionalDescription`},marketing:{label:U.marketingLabel,description:`marketingDescription`}},yr=new Set;function br(e){yr.has(e)||(yr.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${_r.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var xr=0,Sr=class extends n{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),xr+=1,this._uid=`wui-consent-${xr}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(hr)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||U.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||U.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||U.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||U.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||U.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||U.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[..._r];let t=e.split(/\s+/).filter(Boolean);for(let e of t)_r.includes(e)||br(e);let n=_r.filter(e=>t.includes(e));return n.length?n:[..._r]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(_r.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[pr]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(gr,document.documentElement.hasAttribute(pr))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,n=this.policyHref?` <a class="wui-consent-banner-policy" href="${Tr(this.policyHref)}">${wr(this.policyLabel)}</a>`:``,r=this._root();r.innerHTML=`${r===this?``:`<style>${fr}</style>`}
|
|
205
230
|
<div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden>
|
|
@@ -235,14 +260,14 @@ var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{
|
|
|
235
260
|
${t?`<div class="search-select-search">${z(`search`)}<input class="search-select-input" placeholder="${Vr(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${z(`x`)}</button></div>`:``}
|
|
236
261
|
<div class="search-select-options">${d}<div class="search-select-empty" hidden>No matches</div></div>
|
|
237
262
|
</div>
|
|
238
|
-
</div>`,this._rendered=!0,R(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?mn(t):B(this.getAttribute(`placeholder`)||`Select...`),e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){this._teardown();let e=this._refs();if(!e.control||!e.menu)return;let t=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,F(e.control,e.menu)}else F(e.control,e.menu,{matchWidth:!0})},n=(t,{reveal:n=!0}={})=>{let r=this._visible();this._active=t,cn(e.optionsWrap,t>=0&&r[t]||null),t>=0&&r[t]?(n&&r[t].scrollIntoView({block:`nearest`}),e.control.setAttribute(`aria-activedescendant`,r[t].id)):e.control.removeAttribute(`aria-activedescendant`)},r=n=>{let r=n.trim().toLowerCase(),i=0;for(let e of this._optionEls()){let t=!r||e.textContent.toLowerCase().includes(r);e.hidden=!t,t&&(i+=1)}e.empty&&(e.empty.hidden=i>0),e.clear&&(e.clear.hidden=!r),e.menu.hidden||t()},i=()=>!e.menu.hidden,a=()=>{i()&&t()},o=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),t(),I(this,a),e.search&&(e.search.value=``,r(``),e.search.focus()),n(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},s=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),n(-1),L(this)},c=t=>{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0})),s(),e.control.focus()};this._navHandler=sn({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>n(e),onEnter:e=>{e&&c(e)},onEscape:()=>{this._navHandler.clearTypeahead(),s(),e.control.focus()}});let l=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),this._navHandler.handler(e)};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),e.control.focus()}),e.control.addEventListener(`click`,()=>i()?s():o()),e.control.addEventListener(`keydown`,e=>{if(i()){l(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&c(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&!t.classList.contains(`is-active`)&&n(this._visible().indexOf(t),{reveal:!1})}),e.optionsWrap.addEventListener(`mouseleave`,()=>n(-1)),e.search?.addEventListener(`input`,()=>{r(e.search.value),n(-1)}),e.clear?.addEventListener(`click`,()=>{e.search.value=``,r(``),e.search.focus()}),e.menu.addEventListener(`keydown`,l),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{i()&&!this.contains(e.target)&&s()},document.addEventListener(`click`,this._onDocClick),i()&&I(this,a)},this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),L(this),this._navHandler?.teardown()}disconnectedCallback(){this._teardown()}},Vr=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`),Hr=e=>{if(e==null)return null;let t=String(e).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean);return t.length?new Set(t):null},Ur=e=>{let t=Hr(e);return Rr.filter(([e])=>!t||t.has(e)).map(([e,t])=>({value:e,label:t,flag:e}))},Wr=class extends Br{static get observedAttributes(){return[...Br.observedAttributes,`countries`]}_readOptions(){let e=this.getAttribute(`countries`);return this._countryCache?.attr!==e&&(this._countryCache={attr:e,options:Ur(e)}),this._countryCache.options}},Gr=48,Kr=1200,qr=10,Jr=50,Yr=[`start`,`end`],Xr=8,Zr={comfortable:54,cozy:48,compact:40},W={resize:e=>e?`Resize ${e} column`:`Resize column`,width:e=>`${e} pixels`,rows:e=>`${C(e,{decimals:0})} ${e===1?`row`:`rows`}`,saved:e=>e?`${e} saved.`:`Row saved.`,savedMany:e=>`${C(e,{decimals:0})} rows saved.`,notSaved:(e,t)=>`${e?`${e} was not saved.`:`Row was not saved.`}${t?` ${t}`:``}`},Qr=e=>C(e,{decimals:0}),$r=e=>Math.min(Kr,Math.max(48,Math.round(Number(e)||0)));function ei(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n);r.has(i)||r.set(i,[]),r.get(i).push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function ti({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:Zr.comfortable,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var ni=e=>`wui-widths:${e}`;function ri(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(ni(e))||`{}`),n={};for(let[e,r]of Object.entries(t||{}))Number.isFinite(r)&&(n[e]=$r(r));return n}catch{return{}}}function ii(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(ni(e),JSON.stringify(t)):window.localStorage.removeItem(ni(e))}catch{}}var ai=(e,t)=>`--wui-pin-${e}-${t}`,oi=`--wui-pin-at`,si=(e,t)=>`var(${ai(e,t)}, 0px)`;function ci(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});n>=0&&(t[n].edge=!0);let i=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},i=n);return i>=0&&(t[i].edge=!0),t}var li=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,ui=200,di=220,fi=`cubic-bezier(0.22, 1, 0.36, 1)`,pi=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,mi=e=>e.getAttribute(`data-row-key`)??e;function hi(e){let t=[...e];if(t.length>200)return null;let n=new Map;for(let e of t)e.hidden||n.set(mi(e),e.offsetTop);return n}function gi(e,t){let n=[...e];if(!t||n.length>200||pi())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(mi(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:fi}),r++)}return r}function _i(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var vi=[`saving`,`error`],yi=`data-wui-save-state`,bi=`wui-row-save-error`,xi=e=>e.querySelector(`:scope > .wui-name-cell`)??[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null;function Si(e){let t=xi(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return n.textContent.trim();let r=``;for(let e of t.childNodes)e.nodeType===1&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent);return r.replace(/\s+/g,` `).trim()}function Ci(e,t,n=``){if(t!==null&&!vi.includes(t))throw Error(`A row's save state is ${vi.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${bi}`)?.remove(),t===null?e.removeAttribute(yi):e.setAttribute(yi,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?xi(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=bi,t.textContent=n,r.append(t)}}function wi(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state!==`saving`||!e||e.state===`saving`||n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function Ti(e){let t=e.filter(e=>e.ok),n=[];t.length===1?n.push(W.saved(t[0].label)):t.length>1&&n.push(W.savedMany(t.length));for(let t of e)t.ok||n.push(W.notSaved(t.label,t.message));return n.join(` `)}var Ei=`.wui-col-resize`,Di=`.wui-group-row, .wui-virtual-spacer`,Oi=`.wui-select-cell, .wui-expand-cell`,ki=`<svg class="wui-icon" data-icon="chevron-down" width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true" style="vertical-align:-.125em"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path></svg>`,Ai=e=>e.hasAttribute(`data-wui-skeleton`)||!!e.querySelector(`:scope > td > .skeleton`),ji=class extends n{constructor(){super(),this._frame=0,this._headDirty=!0,this._rowsDirty=!0,this._frozenSig=null,this._natural=[],this._widths={},this._collapsed=new Set,this._groupOrder=[],this._items=[],this._range=null,this._drag=null,this._userSized=!1,this._swallowClick=!1,this._mo=null,this._ro=null,this._fonts=null,this._onPointerDown=e=>this._startDrag(e),this._onKeyDown=e=>this._key(e),this._onClick=e=>this._click(e),this._onDblClick=e=>{let t=e.target.closest?.(Ei);t&&this.contains(t)&&this._reset(t.closest(`th`))},this._onScroll=()=>{this.hasAttribute(`virtual`)&&this._schedule()},this._onFonts=()=>{this._userSized||this._drag||this._frozenSig===null||!this.hasAttribute(`resizable`)||(this._frozenSig=null,this._schedule())}}connectedCallback(){this._widths=ri(this.getAttribute(`view-key`)),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick,!0),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._fonts=this.ownerDocument.fonts??null,this._fonts?.addEventListener(`loadingdone`,this._onFonts),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(e=>this._mutated(e)),this._mo.observe(this,{childList:!0,subtree:!0})),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this._schedule()),this._ro.observe(this)),this._headDirty=!0,this._rowsDirty=!0,this._schedule()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick,!0),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`scroll`,this._onScroll),this._fonts?.removeEventListener(`loadingdone`,this._onFonts),this._fonts=null,this._mo?.disconnect(),this._ro?.disconnect(),this._mo=null,this._ro=null,this._frame&&cancelAnimationFrame(this._frame),this._frame=0,this._drag=null}refresh(){this._headDirty=!0,this._rowsDirty=!0,this._run()}get _table(){return this.querySelector(`:scope > table`)}_headCells(e){let t=e.tHead?.rows[0];return t?[...t.cells]:[]}_schedule(){this._frame||=requestAnimationFrame(()=>{this._frame=0,this._run()})}_mutated(e){for(let t of e){let e=t.target.nodeType===1?t.target:t.target.parentElement;e&&((e.closest(`thead`)||e===this._table||e===this)&&(this._headDirty=!0),(e.closest(`tbody, tfoot`)||e===this._table||e===this)&&(this._rowsDirty=!0))}this._schedule()}_run(){let e=this._table;if(!e)return;let t=this._headDirty,n=this._rowsDirty;this._headDirty=!1,this._rowsDirty=!1,n&&this.hasAttribute(`group-by`)&&this._group(e),this._pins(e,t||n),this.hasAttribute(`resizable`)&&(t&&this._handles(e),this._layout(e)),this.hasAttribute(`virtual`)&&this._virtual(e,t||n),this._mo?.takeRecords()}_pins(e,t){let n=this._headCells(e),r=n.map(e=>{let t=e.dataset.pin;return t===`start`||t===`end`?t:e.matches(Oi)?`lead`:null});if(!r.some(e=>e===`start`||e===`end`))return;let i=ci(r);i.forEach((e,t)=>{e&&this._ro?.observe(n[t])});let a=e=>n[e].getBoundingClientRect().width,o=0;i.forEach((t,n)=>{t?.side===`start`&&(this._setVar(e,ai(`start`,t.ordinal),o),o+=a(n))}),o=0;for(let t=i.length-1;t>=0;t--){let n=i[t];n?.side===`end`&&(this._setVar(e,ai(`end`,n.ordinal),o),o+=a(t))}if(t)for(let t of e.rows)t.matches(`${Di}, .wui-row-expanded`)||t.cells.length!==n.length||i.forEach((e,n)=>{if(!e)return;let r=t.cells[n];r.classList.contains(`wui-pin-${e.side}`)||r.classList.add(`wui-pin-${e.side}`),e.edge&&!r.classList.contains(`wui-pin-${e.side}-edge`)&&r.classList.add(`wui-pin-${e.side}-edge`);let i=si(e.side,e.ordinal);r.style.getPropertyValue(`--wui-pin-at`)!==i&&r.style.setProperty(oi,i)})}_setVar(e,t,n){let r=`${Math.round(n*100)/100}px`;e.style.getPropertyValue(t)!==r&&e.style.setProperty(t,r)}_resizable(e){return e.map((t,n)=>n<e.length-1&&!t.matches(Oi))}_handles(e){let t=this._headCells(e),n=this._resizable(t);t.forEach((e,t)=>{if(!n[t]||e.querySelector(Ei))return;let r=e.ownerDocument.createElement(`span`);r.className=`wui-col-resize`,r.setAttribute(`role`,`separator`),r.setAttribute(`aria-orientation`,`vertical`),r.setAttribute(`aria-valuemin`,`48`),r.setAttribute(`aria-valuemax`,String(Kr)),r.setAttribute(`tabindex`,`0`);let i=e.textContent.trim();r.setAttribute(`aria-label`,W.resize(i)),i&&!e.hasAttribute(`aria-label`)&&e.setAttribute(`aria-label`,i),e.classList.add(`wui-col-resizable`),e.appendChild(r)})}_hasRows(e){for(let t of e.tBodies)for(let e of t.rows)if(!e.matches(Di)&&!Ai(e))return!0;return!1}_signature(e){return e.map(e=>e.dataset.key||e.textContent.trim()).join(``)}_layout(e){let t=this._headCells(e),n=this._signature(t);!t.length||n===this._frozenSig||(this._hasRows(e)?this._freeze(e,t,n):this._applyRemembered(t))}_applyRemembered(e){for(let t of e){let e=t.dataset.key&&this._widths[t.dataset.key];e&&(t.style.width=`${e}px`);let n=t.querySelector(Ei);n&&this._handleValue(n,$r(e||t.getBoundingClientRect().width))}}_freeze(e,t,n){e.style.tableLayout=``,e.style.width=``,e.removeAttribute(`data-wui-fixed`);for(let e of t)e.hasAttribute(`data-wui-width`)&&(e.style.width=``,e.removeAttribute(`data-wui-width`));this._natural=t.map(e=>e.getBoundingClientRect().width),t.forEach((e,n)=>{if(n===t.length-1||e.matches(Oi))return;let r=e.dataset.key&&this._widths[e.dataset.key];this._setWidth(e,r||this._natural[n])}),e.style.tableLayout=`fixed`,e.setAttribute(`data-wui-fixed`,``),this._frozenSig=n,this._fitTable(e,t)}_setWidth(e,t){let n=$r(t);e.style.width=`${n}px`,e.setAttribute(`data-wui-width`,``);let r=e.querySelector(Ei);return r&&this._handleValue(r,n),n}_handleValue(e,t){e.setAttribute(`aria-valuenow`,String(t)),e.setAttribute(`aria-valuetext`,W.width(t))}_fitTable(e,t){let n=t.length-1,r=this._natural[n]||0;for(let e=0;e<n;e++)r+=Number.parseFloat(t[e].style.width)||this._natural[e]||0;e.style.width=`max(100%, ${Math.round(r)}px)`}_ensureFrozen(e){let t=this._headCells(e),n=this._signature(t);return n!==this._frozenSig&&this._freeze(e,t,n),t}_resizeTo(e,t,n){let r=this._table;if(!r)return;let i=this._ensureFrozen(r);this._userSized=!0,this._setWidth(e,t),this._fitTable(r,i),n&&this._remember(e),this._pins(r,!1)}_remember(e){let t=e.dataset.key;t&&(this._widths={...this._widths,[t]:Number.parseFloat(e.style.width)},ii(this.getAttribute(`view-key`),this._widths))}_reset(e){let t=this._table;if(!e||!t)return;let n=this._ensureFrozen(t);this._userSized=!0;let r=e.dataset.key;if(r&&r in this._widths){let{[r]:e,...t}=this._widths;this._widths=t,ii(this.getAttribute(`view-key`),this._widths)}this._setWidth(e,this._natural[n.indexOf(e)]||0),this._fitTable(t,n),this._pins(t,!1)}_rtl(){return getComputedStyle(this).direction===`rtl`}_startDrag(e){let t=e.target.closest?.(Ei);if(!t||!this.contains(t)||e.button!==0)return;e.preventDefault(),e.stopPropagation();let n=t.closest(`th`),r=this._table;if(!n||!r)return;this._ensureFrozen(r);let i={th:n,x:e.clientX,from:n.getBoundingClientRect().width,dir:this._rtl()?-1:1,moved:!1};this._drag=i,t.setPointerCapture?.(e.pointerId),t.classList.add(`is-dragging`);let a=e=>{let t=(e.clientX-i.x)*i.dir;Math.abs(t)>1&&(i.moved=!0),this._resizeTo(n,i.from+t,!1)},o=e=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o),t.classList.remove(`is-dragging`),this._drag=null,e.type===`pointercancel`?this._resizeTo(n,i.from,!1):i.moved&&this._remember(n),this._swallowClick=!0,setTimeout(()=>{this._swallowClick=!1},0)};t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}_key(e){let t=e.target.closest?.(Ei);if(!t||!this.contains(t))return;let n=t.closest(`th`);if(e.key===`Enter`||e.key===` `){e.preventDefault(),e.stopPropagation();return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),this._reset(n);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),e.stopPropagation();let r=this._table;if(!r)return;this._ensureFrozen(r);let i=e.shiftKey?50:10,a=e.key===`ArrowRight`!==this._rtl(),o=Number.parseFloat(n.style.width)||n.getBoundingClientRect().width;this._resizeTo(n,o+(a?i:-i),!0)}_click(e){let t=!!e.target.closest?.(Ei);if(this._swallowClick||t){e.stopPropagation(),(t||this._swallowClick)&&e.preventDefault(),this._swallowClick=!1;return}if(!this.hasAttribute(`group-by`))return;let n=(e.target.closest?.(`.wui-group-toggle`))?.closest(`.wui-group-row`);if(!n||!this.contains(n))return;let r=n.dataset.groupKey;this._collapsed.has(r)?this._collapsed.delete(r):this._collapsed.add(r),this._showGroup(n,!this._collapsed.has(r));let i=this._table;i&&this.hasAttribute(`virtual`)&&(this._virtual(i,!0),this._mo?.takeRecords())}_group(e){let t=this.getAttribute(`group-by`),n=this._headCells(e),r=n.findIndex(e=>e.dataset.key===t);if(r<0)throw Error(`<wui-data-table group-by="${t}"> needs a header cell with data-key="${t}".`);let i=e.tBodies[0];if(!i)return;let a=[...i.rows].filter(e=>!e.matches(Di));if(a.some(Ai))return;let o=this.ownerDocument,s=new Map([...i.querySelectorAll(`:scope > tr.wui-group-row`)].map(e=>[e.dataset.groupKey,e])),c=ei(a,e=>e.dataset.group??e.cells[r]?.textContent.trim()??``,this._groupOrder);this._groupOrder=c.map(e=>e.key);let l=o.createDocumentFragment(),u=c.map(e=>{let t=s.get(e.key)??this._groupRow(o,e.key);return s.delete(e.key),t.querySelector(`.wui-group-cell`).colSpan=n.length,t.querySelector(`.wui-group-count`).textContent=Qr(e.items.length),t.querySelector(`.wui-group-rows`).textContent=`, ${W.rows(e.items.length)}`,l.append(t,...e.items),[t,e.key]});for(let e of s.values())e.remove();i.insertBefore(l,this._bottom?.parentNode===i?this._bottom:null);for(let[e,t]of u)this._showGroup(e,!this._collapsed.has(t))}_groupRow(e,t){let n=e.createElement(`tr`);n.className=`wui-group-row`,n.dataset.groupKey=t;let r=e.createElement(`th`);r.className=`wui-group-cell`,r.scope=`rowgroup`;let i=e.createElement(`button`);i.type=`button`,i.className=`wui-group-toggle`,i.innerHTML=ki;let a=e.createElement(`span`);a.className=`wui-group-label`,a.textContent=t;let o=e.createElement(`span`);o.className=`wui-group-count`,o.setAttribute(`aria-hidden`,`true`);let s=e.createElement(`span`);return s.className=`visually-hidden wui-group-rows`,i.append(a,o,s),r.append(i),n.append(r),n}_showGroup(e,t){if(e){e.querySelector(`.wui-group-toggle`)?.setAttribute(`aria-expanded`,String(t));for(let n=e.nextElementSibling;n&&!n.matches(Di);n=n.nextElementSibling)n.hidden=!t}}_spacer(e,t){if(t?.parentNode===e)return t;let n=e.ownerDocument,r=n.createElement(`tr`);return r.className=`wui-virtual-spacer`,r.setAttribute(`aria-hidden`,`true`),r.append(n.createElement(`td`)),r}_virtual(e,t){let n=e.tBodies[0];if(!n)return;if(t){this._top=this._spacer(n,this._top),this._bottom=this._spacer(n,this._bottom),n.firstElementChild!==this._top&&n.insertBefore(this._top,n.firstChild),n.lastElementChild!==this._bottom&&n.append(this._bottom);let t=Math.max(1,this._headCells(e).length);this._top.cells[0].colSpan=t,this._bottom.cells[0].colSpan=t,this._items=[...n.rows].filter(e=>!e.classList.contains(`wui-virtual-spacer`)&&!e.hidden),this._range=null,e.setAttribute(`aria-rowcount`,String(this._items.length+1)),e.tHead?.rows[0]?.setAttribute(`aria-rowindex`,`1`),this._items.forEach((e,t)=>e.setAttribute(`aria-rowindex`,String(t+2))),this._rowHeight>0||(this._rowHeight=this._measureRow(e))}let r=e.tHead?.getBoundingClientRect().height||0,i=ti({scrollTop:this.scrollTop-r,viewport:this.clientHeight,rowHeight:this._rowHeight,count:this._items.length}),a=this._range;if(a&&a.start===i.start&&a.end===i.end)return;let o=a?Math.min(a.start,i.start):0,s=a?Math.max(a.end,i.end):this._items.length;for(let e=o;e<s;e++){let t=e<i.start||e>=i.end,n=this._items[e];n.classList.contains(`wui-virtual-off`)!==t&&n.classList.toggle(`wui-virtual-off`,t)}this._range=i,this._top.hidden=i.before===0,this._bottom.hidden=i.after===0,this._top.cells[0].style.height=`${i.before}px`,this._bottom.cells[0].style.height=`${i.after}px`}_measureRow(e){let t=this._items.find(e=>!e.classList.contains(`wui-group-row`)&&!e.classList.contains(`wui-virtual-off`))?.getBoundingClientRect().height;return t>0?t:e.classList.contains(`wui-table-compact`)?Zr.compact:e.classList.contains(`wui-table-cozy`)?Zr.cozy:Zr.comfortable}},Mi=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ni=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],Pi=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},Fi=e=>Pi(e.getAttribute(`first-day`))??Pi(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,Ii=e=>String(e).padStart(2,`0`),Li=(e,t,n)=>`${e}-${Ii(t+1)}-${Ii(n)}`,G=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);return t?{y:+t[1],m:t[2]-1,d:+t[3]}:null},Ri=`dd-MMM-yyyy`,zi=(e,t=Ri)=>{let n=G(e);if(!n)return``;let r={yyyy:n.y,MMMM:Mi[n.m],MMM:Mi[n.m].slice(0,3),MM:Ii(n.m+1),dd:Ii(n.d),d:n.d};return(t||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>r[e])},Bi=(e,t)=>new Date(e,t+1,0).getDate(),K=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}},Vi=class extends n{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&(e===`value`?(this._value=n||``,this._syncFormValue(),this._syncTrigger()):e===`display-format`?this._syncTrigger():e===`first-day`?this.querySelector(`.datepicker-pop`)?.hidden||this._renderView():this.render())}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,R(this,this._value),this._syncTrigger()}_firstDay(){return Fi(this)}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`Enter Date`,t=G(this._value);t&&(this._viewY=t.y,this._viewM=t.m);let n=this.getAttribute(`size`),r=n===`sm`?` input-sm`:n===`lg`?` input-lg`:``,i=this.getAttribute(`aria-label`),a=this.getAttribute(`aria-describedby`);this.innerHTML=`
|
|
263
|
+
</div>`,this._rendered=!0,R(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?mn(t):B(this.getAttribute(`placeholder`)||`Select...`),e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){this._teardown();let e=this._refs();if(!e.control||!e.menu)return;let t=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,F(e.control,e.menu)}else F(e.control,e.menu,{matchWidth:!0})},n=(t,{reveal:n=!0}={})=>{let r=this._visible();this._active=t,cn(e.optionsWrap,t>=0&&r[t]||null),t>=0&&r[t]?(n&&r[t].scrollIntoView({block:`nearest`}),e.control.setAttribute(`aria-activedescendant`,r[t].id)):e.control.removeAttribute(`aria-activedescendant`)},r=n=>{let r=n.trim().toLowerCase(),i=0;for(let e of this._optionEls()){let t=!r||e.textContent.toLowerCase().includes(r);e.hidden=!t,t&&(i+=1)}e.empty&&(e.empty.hidden=i>0),e.clear&&(e.clear.hidden=!r),e.menu.hidden||t()},i=()=>!e.menu.hidden,a=()=>{i()&&t()},o=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),t(),I(this,a),e.search&&(e.search.value=``,r(``),e.search.focus()),n(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},s=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),n(-1),L(this)},c=t=>{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0})),s(),e.control.focus()};this._navHandler=sn({getVisibleOptions:()=>this._visible(),getActive:()=>this._active,setActive:e=>n(e),onEnter:e=>{e&&c(e)},onEscape:()=>{this._navHandler.clearTypeahead(),s(),e.control.focus()}});let l=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation()),this._navHandler.handler(e)};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),e.control.focus()}),e.control.addEventListener(`click`,()=>i()?s():o()),e.control.addEventListener(`keydown`,e=>{if(i()){l(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&c(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&!t.classList.contains(`is-active`)&&n(this._visible().indexOf(t),{reveal:!1})}),e.optionsWrap.addEventListener(`mouseleave`,()=>n(-1)),e.search?.addEventListener(`input`,()=>{r(e.search.value),n(-1)}),e.clear?.addEventListener(`click`,()=>{e.search.value=``,r(``),e.search.focus()}),e.menu.addEventListener(`keydown`,l),this._bindGlobal=()=>{this._teardown(),this._onDocClick=e=>{i()&&!this.contains(e.target)&&s()},document.addEventListener(`click`,this._onDocClick),i()&&I(this,a)},this._bindGlobal()}_teardown(){this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),L(this),this._navHandler?.teardown()}disconnectedCallback(){this._teardown()}},Vr=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`),Hr=e=>{if(e==null)return null;let t=String(e).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean);return t.length?new Set(t):null},Ur=e=>{let t=Hr(e);return Rr.filter(([e])=>!t||t.has(e)).map(([e,t])=>({value:e,label:t,flag:e}))},Wr=class extends Br{static get observedAttributes(){return[...Br.observedAttributes,`countries`]}_readOptions(){let e=this.getAttribute(`countries`);return this._countryCache?.attr!==e&&(this._countryCache={attr:e,options:Ur(e)}),this._countryCache.options}},Gr=48,Kr=1200,qr=10,Jr=50,Yr=[`start`,`end`],Xr=8,Zr={comfortable:54,cozy:48,compact:40},W={resize:e=>e?`Resize ${e} column`:`Resize column`,width:e=>`${e} pixels`,rows:e=>`${C(e,{decimals:0})} ${e===1?`row`:`rows`}`,saved:e=>e?`${e} saved.`:`Row saved.`,savedMany:e=>`${C(e,{decimals:0})} rows saved.`,notSaved:(e,t)=>`${e?`${e} was not saved.`:`Row was not saved.`}${t?` ${t}`:``}`},Qr=e=>C(e,{decimals:0}),$r=e=>Math.min(Kr,Math.max(48,Math.round(Number(e)||0)));function ei(e,t,n=[]){let r=new Map(n.map(e=>[e,[]]));return e.forEach((e,n)=>{let i=t(e,n);r.has(i)||r.set(i,[]),r.get(i).push(e)}),[...r].filter(([,e])=>e.length>0).map(([e,t])=>({key:e,items:t}))}function ti({scrollTop:e,viewport:t,rowHeight:n,count:r,overscan:i=8}){let a=n>0?n:Zr.comfortable,o=Math.floor(Math.max(0,e)/a),s=Math.max(0,o-i);s-=s%2;let c=Math.min(r,o+Math.ceil(Math.max(0,t)/a)+i),l=Math.min(s,c);return{start:l,end:c,before:l*a,after:Math.max(0,r-c)*a}}var ni=e=>`wui-widths:${e}`;function ri(e){if(!e)return{};try{let t=JSON.parse(window.localStorage.getItem(ni(e))||`{}`),n={};for(let[e,r]of Object.entries(t||{}))Number.isFinite(r)&&(n[e]=$r(r));return n}catch{return{}}}function ii(e,t){if(e)try{Object.keys(t).length?window.localStorage.setItem(ni(e),JSON.stringify(t)):window.localStorage.removeItem(ni(e))}catch{}}var ai=(e,t)=>`--wui-pin-${e}-${t}`,oi=`--wui-pin-at`,si=(e,t)=>`var(${ai(e,t)}, 0px)`;function ci(e){let t=e.map(()=>null),n=-1;e.forEach((e,t)=>{e===`start`&&(n=t)});let r=0;for(let i=0;i<=n;i++)(e[i]===`start`||e[i]===`lead`)&&(t[i]={side:`start`,ordinal:r++,edge:!1});n>=0&&(t[n].edge=!0);let i=-1;r=0;for(let n=e.length-1;n>=0;n--)e[n]===`end`&&(t[n]={side:`end`,ordinal:r++,edge:!1},i=n);return i>=0&&(t[i].edge=!0),t}var li=e=>e?`wui-pin-${e.side}${e.edge?` wui-pin-${e.side}-edge`:``}`:``,ui=200,di=220,fi=`cubic-bezier(0.22, 1, 0.36, 1)`,pi=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,mi=e=>e.getAttribute(`data-row-key`)??e;function hi(e){let t=[...e];if(t.length>200)return null;let n=new Map;for(let e of t)e.hidden||n.set(mi(e),e.offsetTop);return n}function gi(e,t){let n=[...e];if(!t||n.length>200||pi())return 0;let r=0;for(let e of n){if(e.hidden||typeof e.animate!=`function`)continue;let n=t.get(mi(e));if(n===void 0)continue;let i=n-e.offsetTop;Math.abs(i)<1||(e.animate([{transform:`translateY(${i}px)`},{transform:`translateY(0)`}],{duration:220,easing:fi}),r++)}return r}function _i(e,t){if(!e||!t)return!1;let n=new Set(t),r=new Set(e),i=e.filter(e=>n.has(e)),a=t.filter(e=>r.has(e));return i.some((e,t)=>e!==a[t])}var vi=[`saving`,`error`],yi=`data-wui-save-state`,bi=`wui-row-save-error`,xi=e=>e.querySelector(`:scope > .wui-name-cell`)??[...e.cells].find(e=>!e.matches(`.wui-select-cell, .wui-expand-cell`))??null;function Si(e){let t=xi(e);if(!t)return``;let n=t.querySelector(`.u-name`);if(n)return n.textContent.trim();let r=``;for(let e of t.childNodes)e.nodeType===1&&e.classList.contains(`wui-row-save-error`)||(r+=e.textContent);return r.replace(/\s+/g,` `).trim()}function Ci(e,t,n=``){if(t!==null&&!vi.includes(t))throw Error(`A row's save state is ${vi.join(` or `)} (or null to clear it), not "${t}".`);e.querySelector(`:scope > * > .${bi}`)?.remove(),t===null?e.removeAttribute(yi):e.setAttribute(yi,t),t===`saving`?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`);let r=t===`error`&&n?xi(e):null;if(r){let t=e.ownerDocument.createElement(`span`);t.className=bi,t.textContent=n,r.append(t)}}function wi(e,t){let n=[];if(!e)return n;for(let[r,i]of e){let e=t.get(r);i.state!==`saving`||!e||e.state===`saving`||n.push({label:e.label,ok:e.state!==`error`,message:e.message||``})}return n}function Ti(e){let t=e.filter(e=>e.ok),n=[];t.length===1?n.push(W.saved(t[0].label)):t.length>1&&n.push(W.savedMany(t.length));for(let t of e)t.ok||n.push(W.notSaved(t.label,t.message));return n.join(` `)}var Ei=`.wui-col-resize`,Di=`.wui-group-row, .wui-virtual-spacer`,Oi=`.wui-select-cell, .wui-expand-cell`,ki=`<svg class="wui-icon" data-icon="chevron-down" width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true" style="vertical-align:-.125em"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.5" d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"></path></svg>`,Ai=e=>e.hasAttribute(`data-wui-skeleton`)||!!e.querySelector(`:scope > td > .skeleton`),ji=class extends n{constructor(){super(),this._frame=0,this._headDirty=!0,this._rowsDirty=!0,this._frozenSig=null,this._natural=[],this._widths={},this._collapsed=new Set,this._groupOrder=[],this._items=[],this._range=null,this._drag=null,this._userSized=!1,this._swallowClick=!1,this._mo=null,this._ro=null,this._fonts=null,this._onPointerDown=e=>this._startDrag(e),this._onKeyDown=e=>this._key(e),this._onClick=e=>this._click(e),this._onDblClick=e=>{let t=e.target.closest?.(Ei);t&&this.contains(t)&&this._reset(t.closest(`th`))},this._onScroll=()=>{this.hasAttribute(`virtual`)&&this._schedule()},this._onFonts=()=>{this._userSized||this._drag||this._frozenSig===null||!this.hasAttribute(`resizable`)||(this._frozenSig=null,this._schedule())}}connectedCallback(){this._widths=ri(this.getAttribute(`view-key`)),this.addEventListener(`pointerdown`,this._onPointerDown,!0),this.addEventListener(`keydown`,this._onKeyDown,!0),this.addEventListener(`click`,this._onClick,!0),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._fonts=this.ownerDocument.fonts??null,this._fonts?.addEventListener(`loadingdone`,this._onFonts),typeof MutationObserver<`u`&&(this._mo=new MutationObserver(e=>this._mutated(e)),this._mo.observe(this,{childList:!0,subtree:!0})),typeof ResizeObserver<`u`&&(this._ro=new ResizeObserver(()=>this._schedule()),this._ro.observe(this)),this._headDirty=!0,this._rowsDirty=!0,this._schedule()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.removeEventListener(`keydown`,this._onKeyDown,!0),this.removeEventListener(`click`,this._onClick,!0),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`scroll`,this._onScroll),this._fonts?.removeEventListener(`loadingdone`,this._onFonts),this._fonts=null,this._mo?.disconnect(),this._ro?.disconnect(),this._mo=null,this._ro=null,this._frame&&cancelAnimationFrame(this._frame),this._frame=0,this._drag=null}refresh(){this._headDirty=!0,this._rowsDirty=!0,this._run()}get _table(){return this.querySelector(`:scope > table`)}_headCells(e){let t=e.tHead?.rows[0];return t?[...t.cells]:[]}_schedule(){this._frame||=requestAnimationFrame(()=>{this._frame=0,this._run()})}_mutated(e){for(let t of e){let e=t.target.nodeType===1?t.target:t.target.parentElement;e&&((e.closest(`thead`)||e===this._table||e===this)&&(this._headDirty=!0),(e.closest(`tbody, tfoot`)||e===this._table||e===this)&&(this._rowsDirty=!0))}this._schedule()}_run(){let e=this._table;if(!e)return;let t=this._headDirty,n=this._rowsDirty;this._headDirty=!1,this._rowsDirty=!1,n&&this.hasAttribute(`group-by`)&&this._group(e),this._pins(e,t||n),this.hasAttribute(`resizable`)&&(t&&this._handles(e),this._layout(e)),this.hasAttribute(`virtual`)&&this._virtual(e,t||n),this._mo?.takeRecords()}_pins(e,t){let n=this._headCells(e),r=n.map(e=>{let t=e.dataset.pin;return t===`start`||t===`end`?t:e.matches(Oi)?`lead`:null});if(!r.some(e=>e===`start`||e===`end`))return;let i=ci(r);i.forEach((e,t)=>{e&&this._ro?.observe(n[t])});let a=e=>n[e].getBoundingClientRect().width,o=0;i.forEach((t,n)=>{t?.side===`start`&&(this._setVar(e,ai(`start`,t.ordinal),o),o+=a(n))}),o=0;for(let t=i.length-1;t>=0;t--){let n=i[t];n?.side===`end`&&(this._setVar(e,ai(`end`,n.ordinal),o),o+=a(t))}if(t)for(let t of e.rows)t.matches(`${Di}, .wui-row-expanded`)||t.cells.length!==n.length||i.forEach((e,n)=>{if(!e)return;let r=t.cells[n];r.classList.contains(`wui-pin-${e.side}`)||r.classList.add(`wui-pin-${e.side}`),e.edge&&!r.classList.contains(`wui-pin-${e.side}-edge`)&&r.classList.add(`wui-pin-${e.side}-edge`);let i=si(e.side,e.ordinal);r.style.getPropertyValue(`--wui-pin-at`)!==i&&r.style.setProperty(oi,i)})}_setVar(e,t,n){let r=`${Math.round(n*100)/100}px`;e.style.getPropertyValue(t)!==r&&e.style.setProperty(t,r)}_resizable(e){return e.map((t,n)=>n<e.length-1&&!t.matches(Oi))}_handles(e){let t=this._headCells(e),n=this._resizable(t);t.forEach((e,t)=>{if(!n[t]||e.querySelector(Ei))return;let r=e.ownerDocument.createElement(`span`);r.className=`wui-col-resize`,r.setAttribute(`role`,`separator`),r.setAttribute(`aria-orientation`,`vertical`),r.setAttribute(`aria-valuemin`,`48`),r.setAttribute(`aria-valuemax`,String(Kr)),r.setAttribute(`tabindex`,`0`);let i=e.textContent.trim();r.setAttribute(`aria-label`,W.resize(i)),i&&!e.hasAttribute(`aria-label`)&&e.setAttribute(`aria-label`,i),e.classList.add(`wui-col-resizable`),e.appendChild(r)})}_hasRows(e){for(let t of e.tBodies)for(let e of t.rows)if(!e.matches(Di)&&!Ai(e))return!0;return!1}_signature(e){return e.map(e=>e.dataset.key||e.textContent.trim()).join(``)}_layout(e){let t=this._headCells(e),n=this._signature(t);!t.length||n===this._frozenSig||(this._hasRows(e)?this._freeze(e,t,n):this._applyRemembered(t))}_applyRemembered(e){for(let t of e){let e=t.dataset.key&&this._widths[t.dataset.key];e&&(t.style.width=`${e}px`);let n=t.querySelector(Ei);n&&this._handleValue(n,$r(e||t.getBoundingClientRect().width))}}_freeze(e,t,n){e.style.tableLayout=``,e.style.width=``,e.removeAttribute(`data-wui-fixed`);for(let e of t)e.hasAttribute(`data-wui-width`)&&(e.style.width=``,e.removeAttribute(`data-wui-width`));this._natural=t.map(e=>e.getBoundingClientRect().width),t.forEach((e,n)=>{if(n===t.length-1||e.matches(Oi))return;let r=e.dataset.key&&this._widths[e.dataset.key];this._setWidth(e,r||this._natural[n])}),e.style.tableLayout=`fixed`,e.setAttribute(`data-wui-fixed`,``),this._frozenSig=n,this._fitTable(e,t)}_setWidth(e,t){let n=$r(t);e.style.width=`${n}px`,e.setAttribute(`data-wui-width`,``);let r=e.querySelector(Ei);return r&&this._handleValue(r,n),n}_handleValue(e,t){e.setAttribute(`aria-valuenow`,String(t)),e.setAttribute(`aria-valuetext`,W.width(t))}_fitTable(e,t){let n=t.length-1,r=this._natural[n]||0;for(let e=0;e<n;e++)r+=Number.parseFloat(t[e].style.width)||this._natural[e]||0;e.style.width=`max(100%, ${Math.round(r)}px)`}_ensureFrozen(e){let t=this._headCells(e),n=this._signature(t);return n!==this._frozenSig&&this._freeze(e,t,n),t}_resizeTo(e,t,n){let r=this._table;if(!r)return;let i=this._ensureFrozen(r);this._userSized=!0,this._setWidth(e,t),this._fitTable(r,i),n&&this._remember(e),this._pins(r,!1)}_remember(e){let t=e.dataset.key;t&&(this._widths={...this._widths,[t]:Number.parseFloat(e.style.width)},ii(this.getAttribute(`view-key`),this._widths))}_reset(e){let t=this._table;if(!e||!t)return;let n=this._ensureFrozen(t);this._userSized=!0;let r=e.dataset.key;if(r&&r in this._widths){let{[r]:e,...t}=this._widths;this._widths=t,ii(this.getAttribute(`view-key`),this._widths)}this._setWidth(e,this._natural[n.indexOf(e)]||0),this._fitTable(t,n),this._pins(t,!1)}_rtl(){return getComputedStyle(this).direction===`rtl`}_startDrag(e){let t=e.target.closest?.(Ei);if(!t||!this.contains(t)||e.button!==0)return;e.preventDefault(),e.stopPropagation();let n=t.closest(`th`),r=this._table;if(!n||!r)return;this._ensureFrozen(r);let i={th:n,x:e.clientX,from:n.getBoundingClientRect().width,dir:this._rtl()?-1:1,moved:!1};this._drag=i,t.setPointerCapture?.(e.pointerId),t.classList.add(`is-dragging`);let a=e=>{let t=(e.clientX-i.x)*i.dir;Math.abs(t)>1&&(i.moved=!0),this._resizeTo(n,i.from+t,!1)},o=e=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,o),t.classList.remove(`is-dragging`),this._drag=null,e.type===`pointercancel`?this._resizeTo(n,i.from,!1):i.moved&&this._remember(n),this._swallowClick=!0,setTimeout(()=>{this._swallowClick=!1},0)};t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,o)}_key(e){let t=e.target.closest?.(Ei);if(!t||!this.contains(t))return;let n=t.closest(`th`);if(e.key===`Enter`||e.key===` `){e.preventDefault(),e.stopPropagation();return}if(e.key===`Home`){e.preventDefault(),e.stopPropagation(),this._reset(n);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),e.stopPropagation();let r=this._table;if(!r)return;this._ensureFrozen(r);let i=e.shiftKey?50:10,a=e.key===`ArrowRight`!==this._rtl(),o=Number.parseFloat(n.style.width)||n.getBoundingClientRect().width;this._resizeTo(n,o+(a?i:-i),!0)}_click(e){let t=!!e.target.closest?.(Ei);if(this._swallowClick||t){e.stopPropagation(),(t||this._swallowClick)&&e.preventDefault(),this._swallowClick=!1;return}if(!this.hasAttribute(`group-by`))return;let n=(e.target.closest?.(`.wui-group-toggle`))?.closest(`.wui-group-row`);if(!n||!this.contains(n))return;let r=n.dataset.groupKey;this._collapsed.has(r)?this._collapsed.delete(r):this._collapsed.add(r),this._showGroup(n,!this._collapsed.has(r));let i=this._table;i&&this.hasAttribute(`virtual`)&&(this._virtual(i,!0),this._mo?.takeRecords())}_group(e){let t=this.getAttribute(`group-by`),n=this._headCells(e),r=n.findIndex(e=>e.dataset.key===t);if(r<0)throw Error(`<wui-data-table group-by="${t}"> needs a header cell with data-key="${t}".`);let i=e.tBodies[0];if(!i)return;let a=[...i.rows].filter(e=>!e.matches(Di));if(a.some(Ai))return;let o=this.ownerDocument,s=new Map([...i.querySelectorAll(`:scope > tr.wui-group-row`)].map(e=>[e.dataset.groupKey,e])),c=ei(a,e=>e.dataset.group??e.cells[r]?.textContent.trim()??``,this._groupOrder);this._groupOrder=c.map(e=>e.key);let l=o.createDocumentFragment(),u=c.map(e=>{let t=s.get(e.key)??this._groupRow(o,e.key);return s.delete(e.key),t.querySelector(`.wui-group-cell`).colSpan=n.length,t.querySelector(`.wui-group-count`).textContent=Qr(e.items.length),t.querySelector(`.wui-group-rows`).textContent=`, ${W.rows(e.items.length)}`,l.append(t,...e.items),[t,e.key]});for(let e of s.values())e.remove();i.insertBefore(l,this._bottom?.parentNode===i?this._bottom:null);for(let[e,t]of u)this._showGroup(e,!this._collapsed.has(t))}_groupRow(e,t){let n=e.createElement(`tr`);n.className=`wui-group-row`,n.dataset.groupKey=t;let r=e.createElement(`th`);r.className=`wui-group-cell`,r.scope=`rowgroup`;let i=e.createElement(`button`);i.type=`button`,i.className=`wui-group-toggle`,i.innerHTML=ki;let a=e.createElement(`span`);a.className=`wui-group-label`,a.textContent=t;let o=e.createElement(`span`);o.className=`wui-group-count`,o.setAttribute(`aria-hidden`,`true`);let s=e.createElement(`span`);return s.className=`visually-hidden wui-group-rows`,i.append(a,o,s),r.append(i),n.append(r),n}_showGroup(e,t){if(e){e.querySelector(`.wui-group-toggle`)?.setAttribute(`aria-expanded`,String(t));for(let n=e.nextElementSibling;n&&!n.matches(Di);n=n.nextElementSibling)n.hidden=!t}}_spacer(e,t){if(t?.parentNode===e)return t;let n=e.ownerDocument,r=n.createElement(`tr`);return r.className=`wui-virtual-spacer`,r.setAttribute(`aria-hidden`,`true`),r.append(n.createElement(`td`)),r}_virtual(e,t){let n=e.tBodies[0];if(!n)return;if(t){this._top=this._spacer(n,this._top),this._bottom=this._spacer(n,this._bottom),n.firstElementChild!==this._top&&n.insertBefore(this._top,n.firstChild),n.lastElementChild!==this._bottom&&n.append(this._bottom);let t=Math.max(1,this._headCells(e).length);this._top.cells[0].colSpan=t,this._bottom.cells[0].colSpan=t,this._items=[...n.rows].filter(e=>!e.classList.contains(`wui-virtual-spacer`)&&!e.hidden),this._range=null,e.setAttribute(`aria-rowcount`,String(this._items.length+1)),e.tHead?.rows[0]?.setAttribute(`aria-rowindex`,`1`),this._items.forEach((e,t)=>e.setAttribute(`aria-rowindex`,String(t+2))),this._rowHeight>0||(this._rowHeight=this._measureRow(e))}let r=e.tHead?.getBoundingClientRect().height||0,i=ti({scrollTop:this.scrollTop-r,viewport:this.clientHeight,rowHeight:this._rowHeight,count:this._items.length}),a=this._range;if(a&&a.start===i.start&&a.end===i.end)return;let o=a?Math.min(a.start,i.start):0,s=a?Math.max(a.end,i.end):this._items.length;for(let e=o;e<s;e++){let t=e<i.start||e>=i.end,n=this._items[e];n.classList.contains(`wui-virtual-off`)!==t&&n.classList.toggle(`wui-virtual-off`,t)}this._range=i,this._top.hidden=i.before===0,this._bottom.hidden=i.after===0,this._top.cells[0].style.height=`${i.before}px`,this._bottom.cells[0].style.height=`${i.after}px`}_measureRow(e){let t=this._items.find(e=>!e.classList.contains(`wui-group-row`)&&!e.classList.contains(`wui-virtual-off`))?.getBoundingClientRect().height;return t>0?t:e.classList.contains(`wui-table-compact`)?Zr.compact:e.classList.contains(`wui-table-cozy`)?Zr.cozy:Zr.comfortable}},Mi=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ni=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],Pi=e=>{let t=String(e??``).trim();return/^[0-6]$/.test(t)?Number(t):null},Fi=e=>Pi(e.getAttribute(`first-day`))??Pi(getComputedStyle(e).getPropertyValue(`--wui-first-day`))??1,Ii=e=>String(e).padStart(2,`0`),Li=(e,t,n)=>`${e}-${Ii(t+1)}-${Ii(n)}`,G=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e||``);return t?{y:+t[1],m:t[2]-1,d:+t[3]}:null},Ri=`dd-MMM-yyyy`,zi=(e,t=Ri)=>{let n=G(e);if(!n)return``;let r={yyyy:n.y,MMMM:Mi[n.m],MMM:Mi[n.m].slice(0,3),MM:Ii(n.m+1),dd:Ii(n.d),d:n.d};return(t||`dd-MMM-yyyy`).replace(/yyyy|MMMM|MMM|MM|dd|d/g,e=>r[e])},Bi=(e,t)=>new Date(e,t+1,0).getDate(),K=(e,t)=>{for(;t<0;)t+=12,--e;for(;t>11;)t-=12,e+=1;return{y:e,m:t}},Vi=class extends n{static formAssociated=!0;static get observedAttributes(){return[`value`,`min`,`max`,`placeholder`,`disabled`,`first-day`,`disabled-weekdays`,`display-format`,`size`,`aria-label`,`aria-describedby`,`aria-invalid`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._value=``;let e=new Date(2e3,0,1);this._viewY=e.getFullYear(),this._viewM=e.getMonth(),this._mode=`days`,this._focus=null,this._slide=``}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`aria-invalid`){this._syncInvalid();return}this._rendered&&(e===`value`?(this._value=n||``,this._syncFormValue(),this._syncTrigger()):e===`display-format`?this._syncTrigger():e===`first-day`?this.querySelector(`.datepicker-pop`)?.hidden||this._renderView():this.render())}_syncInvalid(){let e=this.querySelector(`.datepicker-trigger`);e&&(this.hasAttribute(`aria-invalid`)?e.setAttribute(`aria-invalid`,`true`):e.removeAttribute(`aria-invalid`))}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._value}set value(e){this._value=e||``,R(this,this._value),this._syncTrigger()}_firstDay(){return Fi(this)}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``,this._value=this._defaultValue||this._value);let e=this.getAttribute(`placeholder`)||`Choose a date`,t=G(this._value);t&&(this._viewY=t.y,this._viewM=t.m);let n=this.getAttribute(`size`),r=n===`sm`?` input-sm`:n===`lg`?` input-lg`:``,i=this.getAttribute(`aria-label`),a=this.getAttribute(`aria-describedby`);this.innerHTML=`
|
|
239
264
|
<div class="datepicker">
|
|
240
265
|
<button type="button" class="input datepicker-trigger${r}${t?` has-value`:``}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute(`aria-invalid`)?` aria-invalid="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${i?` aria-label="${B(i)}"`:``}${a?` aria-describedby="${B(a)}"`:``}>
|
|
241
266
|
<span data-trigger-label class="${t?``:`search-select-placeholder`}">${B(t?zi(this._value,this.getAttribute(`display-format`)):e)}</span>
|
|
242
267
|
${z(`calendar-dots`)}
|
|
243
268
|
</button>
|
|
244
269
|
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
245
|
-
</div>`,this._rendered=!0,R(this,this._value),this._wire()}_syncFormValue(){R(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!t)return;let n=G(this._value);t.textContent=n?zi(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`
|
|
270
|
+
</div>`,this._rendered=!0,R(this,this._value),this._wire()}_syncFormValue(){R(this,this._value)}_syncTrigger(){let e=this.querySelector(`.datepicker-trigger`),t=this.querySelector(`[data-trigger-label]`);if(!t)return;let n=G(this._value);t.textContent=n?zi(this._value,this.getAttribute(`display-format`)):this.getAttribute(`placeholder`)||`Choose a date`,t.classList.toggle(`search-select-placeholder`,!n),e?.classList.toggle(`has-value`,!!n)}_limits(){let e=G(this.getAttribute(`min`)),t=G(this.getAttribute(`max`)),n=e?new Date(e.y,e.m,e.d).getTime():-1/0,r=t?new Date(t.y,t.m,t.d).getTime():1/0,i=new Set;for(let e of(this.getAttribute(`disabled-weekdays`)||``).split(`,`)){let t=e.trim();/^[0-6]$/.test(t)&&i.add(Number(t))}return{dayDisabled:(e,t,a)=>{let o=new Date(e,t,a),s=o.getTime();return s<n||s>r||i.has(o.getDay())},monthDisabled:(e,t)=>{let i=new Date(e,t,1).getTime();return new Date(e,t,Bi(e,t)).getTime()<n||i>r},yearDisabled:e=>{let t=new Date(e,0,1).getTime();return new Date(e,11,31).getTime()<n||t>r}}}_renderView(){let e=this.querySelector(`.datepicker-pop`);e&&(this._mode===`months`?e.innerHTML=this._monthsHtml():this._mode===`years`?e.innerHTML=this._yearsHtml():e.innerHTML=this._daysHtml(),this._focusActive())}_daysHtml(){let e=this._firstDay(),t=(new Date(this._viewY,this._viewM,1).getDay()-e+7)%7,n=Bi(this._viewY,this._viewM),r=G(this._value),i=new Date,{dayDisabled:a}=this._limits(),o=this._focus||r||{y:this._viewY,m:this._viewM,d:1},s=(e,t,n,s)=>{let c=Li(e,t,n),l=r&&r.y===e&&r.m===t&&r.d===n,u=i.getFullYear()===e&&i.getMonth()===t&&i.getDate()===n,d=o.y===e&&o.m===t&&o.d===n,f=a(e,t,n);return`<button type="button" class="${[`datepicker-day`,s?`is-outside`:``,u?`is-today`:``,l?`is-selected`:``].filter(Boolean).join(` `)}" data-iso="${c}" role="gridcell" tabindex="${d&&!f?`0`:`-1`}"${l?` aria-selected="true"`:``}${f?` disabled aria-disabled="true"`:``}>${n}</button>`},c=``,l=K(this._viewY,this._viewM-1),u=Bi(l.y,l.m);for(let e=t-1;e>=0;e--)c+=s(l.y,l.m,u-e,!0);for(let e=1;e<=n;e++)c+=s(this._viewY,this._viewM,e,!1);let d=K(this._viewY,this._viewM+1),f=(7-(t+n)%7)%7;for(let e=1;e<=f;e++)c+=s(d.y,d.m,e,!0);let p=a(i.getFullYear(),i.getMonth(),i.getDate()),m=Ni.map((t,n)=>Ni[(n+e)%7]).map(e=>`<span>${e}</span>`).join(``);return`
|
|
246
271
|
<div class="datepicker-head">
|
|
247
272
|
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${z(`chevron-left`)}</button>
|
|
248
273
|
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${Mi[this._viewM]} ${this._viewY}</button>
|
package/dist/ui-elements.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./formatters-BAE__8ye.js";import{a as g,c as _,i as v,n as y,o as ee,r as b,s as x,t as S}from"./wuiHttp-BC8co934.js";import{_ as C,a as te,c as w,d as T,f as E,g as D,h as ne,i as re,l as ie,m as ae,n as oe,o as se,p as ce,r as O,s as le,t as ue,u as de,v as fe,y as pe}from"./kanban-29Pv2HU9.js";import{n as k,t as me}from"./statusIcons-2X4iGkKL.js";import{t as he}from"./iconGlyphs.g-CUm_mfze.js";import{o as ge}from"./optionLabel-BBaur8Bs.js";import{t as A}from"./WuiAutocomplete-B2SKLPOV.js";import{t as j}from"./WuiCarousel-C33Z8FBt.js";import{t as _e}from"./WuiCodeBlock-BcLJhLBJ.js";import{n as ve,t as ye}from"./copyText-DM5HhXjf.js";import{t as M}from"./textMatch-wdY7XLIc.js";import{t as N}from"./WuiCommandPalette-CcmFOWNc.js";import{i as P,n as be,r as xe,t as Se}from"./WuiCommentThread-Bww7P_cu.js";import{t as F}from"./WuiConsentBanner-BM1kjiHj.js";import{t as I}from"./WuiContextMenu-CBy0O4HT.js";import{t as L}from"./WuiSelect-U5Owq3wT.js";import{t as R}from"./WuiCountrySelect-D-K0dm77.js";import{A as z,C as B,D as V,E as Ce,M as we,N as Te,O as Ee,S as De,T as Oe,_ as ke,a as Ae,b as je,c as Me,d as Ne,f as Pe,g as Fe,h as Ie,i as H,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./WuiDataTable-tR8Lp4XZ.js";import{t as Qe}from"./WuiDatePicker-B4E_NvAh.js";import{t as $e}from"./WuiDateRange-BuVA1MK5.js";import{t as et}from"./WuiDock-BD2HgMmP.js";import{t as tt}from"./WuiDrawer-D6K2eRlW.js";import{t as nt}from"./WuiHoverCard-BsYAwmbA.js";import{t as rt}from"./WuiImageCrop-Cr3D2iPo.js";import{a as it,i as at,n as ot,r as st,t as ct}from"./WuiInlineEdit-CI-3C7yP.js";import{t as lt}from"./WuiLightbox-hluak_-q.js";import{a as ut,c as dt,i as ft,l as pt,n as mt,o as ht,r as gt,s as _t,t as vt,u as yt}from"./WuiMentionInput-DW7N1Zne.js";import{t as bt}from"./WuiMenubar-D2tb_3eU.js";import{t as xt}from"./WuiMultiSelect-BGZOG93I.js";import{t as St}from"./WuiNavigationMenu-BsLnvz2Y.js";import{a as Ct,c as wt,i as Tt,n as Et,o as Dt,r as Ot,s as kt,t as At}from"./notificationDays-pYmoU0g6.js";import{t as jt}from"./WuiNotificationCenter-BZwVMUSV.js";import{t as Mt}from"./WuiOnboardingChecklist-s2DG6PZ0.js";import{t as Nt}from"./WuiOtp-BbO_75RB.js";import{t as Pt}from"./WuiOverflow-CB3j6q6n.js";import{t as Ft}from"./WuiPhone-BoLywT_W.js";import{t as It}from"./WuiRating-BzeW6iDC.js";import{a as Lt,c as Rt,d as zt,f as Bt,i as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,u as Xt}from"./shortcutKeys-BQiDpsTJ.js";import{t as Zt}from"./WuiRecordPager-yXv4g2ZR.js";import{n as Qt,r as $t,t as en}from"./WuiRelativeTime-Cfc8TMd8.js";import{t as tn}from"./WuiResizable-m2Ypa-zD.js";import{t as nn}from"./WuiRollingNumber-DBgi_3l7.js";import{t as rn}from"./WuiShortcuts-CMibF1XM.js";import{t as an}from"./WuiShowMore-Bu7IQcXS.js";import{t as on}from"./WuiSlider-Br6V2amU.js";import{t as sn}from"./WuiSortable-Bd7Fz5Ox.js";import{t as cn}from"./WuiTagInput-DzEZooIn.js";import{t as ln}from"./WuiTimePicker-UjvUcDrS.js";import{n as un,t as dn}from"./WuiTour-DW3kPaR9.js";import{t as fn}from"./WuiTree-SA0QU9AF.js";import{t as pn}from"./WuiTruncate-BLl2u3b-.js";import{n as mn,t as hn}from"./WuiWhatsNew-BO78119Z.js";import{n as gn,t as _n}from"./WuiWizardStep-DIHxrXn9.js";import{$ as vn,A as yn,B as bn,C as xn,D as Sn,E as Cn,F as wn,G as Tn,H as En,I as Dn,J as On,K as kn,L as An,M as jn,N as Mn,O as Nn,P as Pn,Q as Fn,R as In,S as Ln,T as Rn,U as zn,V as Bn,W as Vn,X as Hn,Y as Un,Z as Wn,_ as Gn,a as Kn,b as qn,c as Jn,d as Yn,f as Xn,g as Zn,h as Qn,i as $n,j as er,k as tr,l as nr,m as rr,n as ir,o as ar,p as or,q as sr,r as cr,s as lr,t as ur,u as dr,v as fr,w as pr,x as mr,y as hr,z as gr}from"./themeTransition-DO95LPdz.js";var _r=`Select all rows`,vr=`Select row`,U=`wui-select-cell`,yr=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function br(e=document){let t=e.createElement(`th`);return t.className=U,t.appendChild(yr(e,_r)),t}function xr(e=document){let t=e.createElement(`td`);return t.className=U,t.appendChild(yr(e,vr)),t}function Sr(e=document){let t=e.createElement(`td`);return t.className=U,t}var Cr=e=>e.firstElementChild?.classList.contains(U),wr=e=>e.matches(`.wui-group-row, .wui-virtual-spacer`);function Tr(e){for(let t of e)!Cr(t)&&!wr(t)&&t.insertBefore(xr(t.ownerDocument),t.firstChild)}function Er(e){let t=e.querySelector(`thead tr`);if(!t)return null;Cr(t)||t.insertBefore(br(e.ownerDocument),t.firstChild),Tr(e.querySelectorAll(`tbody tr`));for(let t of e.querySelectorAll(`tfoot tr`))Cr(t)||t.insertBefore(Sr(e.ownerDocument),t.firstChild);return t.querySelector(`.${U} .wui-check`)}function Dr(e){let t=e.querySelector(`thead .${U} .wui-check`),n=[...e.querySelectorAll(`tbody tr .wui-check`)],r=n.length,i=n.filter(e=>e.checked).length;t&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of e.querySelectorAll(`tbody tr`))t.classList.toggle(`is-selected`,!!t.querySelector(`.wui-check`)?.checked);return{selected:i,total:r}}var Or=`tbody .${U} .wui-check`;function kr(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=[...e.querySelectorAll(Or)],i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t===a||t.checked===a.checked||(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var Ar=Object.freeze([`page`,`pageSize`,`sortBy`,`sortOrder`]),W=`search`,G=Object.freeze({loading:`Loading rows`,error:`These rows did not load. Try again.`,network:`The connection dropped before the rows loaded. Check it and try again.`,forbidden:`You do not have access to these rows.`,retry:`Retry`,actionFailed:`That did not work. Try again.`,actionForbidden:`You do not have permission to do that.`,empty:`No rows`}),jr=5,Mr=new WeakMap,Nr=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},Pr=e=>({total:Nr(e.dataset.total,0),page:Nr(e.dataset.page,1),pageSize:Nr(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`}),Fr=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})};function Ir(e=document){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-server]`)]:[];e instanceof Element&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t)Mr.has(e)||Mr.set(e,Rr(e))}function Lr(e){let t=e instanceof Element?e.closest(`[data-wui-server]`):null;return t&&Mr.get(t)||null}function Rr(e){let t=e.querySelector(`.table-wrap`),n=t?.querySelector(`:scope > table`),r=e.dataset.src;if(!n||!r)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let i=t.querySelector(`:scope > [data-wui-table-state]`),a=e.querySelector(`[data-wui-table-pager]`),o=e.querySelector(`[data-wui-table-status]`),s={urlState:e.dataset.urlState!==`false`,refreshOnSuccess:e.dataset.refreshOnSuccess!==`false`,filtersForm:e.dataset.filtersForm||null,filtersRegion:e.dataset.filtersRegion||null,searchInput:e.dataset.searchInput||null,loadingText:e.dataset.loadingText||G.loading,errorText:e.dataset.errorText||G.error},c=new URL(r,window.location.href),l=new Set(c.searchParams.keys()),u=n.hasAttribute(`data-app-datatable-selectable`),d=new Set,f=!1,p=ee(),m=new AbortController,h={signal:m.signal},g=n.querySelector(`:scope > tbody[data-wui-rows]`);if(!g)throw Error(`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`);let v=Pr(g),y=null,b=null,x=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))l.has(n)||t.append(n,r);return t},S=e=>x(new URL(e,window.location.href).search),C=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},te=e=>{let t=new URL(c.href);for(let[n,r]of e)l.has(n)||t.searchParams.append(n,r);return t.origin===window.location.origin?`${t.pathname}${t.search}`:t.href},w=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},T=w(s.urlState?x(window.location.search):new URLSearchParams,v);s.urlState&&C(T)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,C(T));let E=(e,n)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n})),D=e=>{o&&(o.textContent=e)},ne=e=>{if(e.total===0)return G.empty;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1;return`Page ${e.page} of ${t}, ${e.total} ${e.total===1?`row`:`rows`}`},re=()=>[...n.querySelectorAll(`:scope > thead > tr:first-child > th`)],ie=e=>{if(u&&[...e.querySelectorAll(`:scope > tr`)].some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},ae=t=>{let n=e.dataset.activeRowKey;if(n!==void 0)for(let e of t){let t=e.classList.contains(`wui-row-active`),r=n!==``&&e.dataset.rowKey===n;e.classList.toggle(`wui-row-active`,r),r?e.setAttribute(`aria-current`,`true`):t&&e.removeAttribute(`aria-current`)}},oe=e=>{if(u){Tr(e);for(let t of e){let e=t.querySelector(`.${U} .wui-check`);e&&(f&&d.add(t.dataset.rowKey),e.checked=d.has(t.dataset.rowKey))}Dr(n)}ae(e);let t=re();if(n.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},se=e=>oe([...e.querySelectorAll(`:scope > tr`)]),ce=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},O=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),le=(e,t)=>{if(!i)return;let n=e.querySelector(`:scope > template[data-wui-empty]`);O(i),t.total===0&&n?(i.replaceChildren(n.content.cloneNode(!0)),i.hidden=!1):(i.replaceChildren(),i.hidden=!0)},ue=e=>{let r=Pr(e),i=r.sortBy!==v.sortBy||r.sortOrder!==v.sortOrder?je(g.rows):null;if(a){let t=e.querySelector(`:scope > template[data-wui-pager]`);O(a),a.replaceChildren(...t?[t.content.cloneNode(!0)]:[]),a.hidden=!1}le(e,r);let o=e.querySelector(`:scope > template[data-wui-filters]`),c=s.filtersRegion&&o?document.querySelector(s.filtersRegion):null;c&&(O(c),c.replaceChildren(o.content.cloneNode(!0))),ce(e),O(g),n.replaceChild(e,g),g=e;let l=f&&r.total!==v.total;v=r,l&&(f=!1),t.removeAttribute(`data-wui-table-error`),se(e),ve(),Oe(e.rows,i),l&&M()},de=e=>{let t=document.createElement(`template`);t.innerHTML=`<table>${e}</table>`;let n=t.content.querySelector(`tbody[data-wui-rows]`);return n&&ie(n),n?document.importNode(n,!0):null},fe=e=>{let t=document.createElement(`tr`);for(let n=0;n<e;n++){let e=document.createElement(`td`),r=document.createElement(`span`);r.className=`skeleton`,r.setAttribute(`aria-hidden`,`true`),r.style.cssText=`display:block;width:${n===0?70:50}%;height:12px;border-radius:6px`,e.append(r),t.append(e)}return t},pe=()=>{if(g.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,re().length);g.replaceChildren(...Array.from({length:jr},()=>{let t=fe(e);return t.setAttribute(`data-wui-skeleton`,``),t})),t.removeAttribute(`data-wui-table-error`),i&&(i.hidden=!0)},k=e=>{e?(t.setAttribute(`aria-busy`,`true`),pe()):t.removeAttribute(`aria-busy`)},me=e=>e===`forbidden`?G.forbidden:e===`network`?G.network:s.errorText,ge=e=>{let n=me(e);if(t.setAttribute(`data-wui-table-error`,e),a&&(a.hidden=!0),i){let t=document.createElement(`div`);t.className=`tbl-empty wui-table-error`,t.setAttribute(`role`,`alert`);let r=document.createElement(`span`);r.className=`tbl-empty-icon`,r.innerHTML=he(e===`forbidden`?`lock`:`alert-circle`,{size:24});let a=document.createElement(`div`);a.className=`tbl-empty-title`,a.textContent=n;let o=document.createElement(`div`);o.className=`tbl-empty-action`;let s=document.createElement(`button`);s.type=`button`,s.className=`btn btn-outline-primary btn-sm`,s.setAttribute(`data-wui-table-retry`,``),s.textContent=G.retry,o.append(s),t.append(r,a,o),O(i),i.replaceChildren(t),i.hidden=!1}D(n)},A=async(e,t=`none`)=>{let n=new URLSearchParams(e);y={query:n,mode:t},k(!0),D(s.loadingText),E(`wui:table:loading`,{query:n.toString()});let r=await p.run(te(n));if(r.kind===`aborted`||r.kind===`stale`||r.kind===`session`)return r;k(!1);let i=null,a=r.ok?null:r.kind;if(r.ok){try{i=de(r.html)}catch(e){console.error(e)}i||(a=`server`)}return a?(ge(a),E(`wui:table:error`,{status:r.status,kind:a,message:me(a)}),r):(ue(i),T=w(n,v),s.urlState&&t===`push`?window.history.pushState(window.history.state,``,C(T)):s.urlState&&t===`replace`&&window.history.replaceState(window.history.state,``,C(T)),D(ne(v)),window.WUI?.refresh?.(),E(`wui:table:loaded`,{...v,query:T.toString()}),r)},j=e=>(e.delete(`page`),e),_e=()=>[...n.querySelectorAll(`:scope > thead th[data-sort-key]`)],ve=()=>{for(let e of _e()){let t=e.dataset.sortKey===v.sortBy;e.setAttribute(`aria-sort`,t?v.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of _e())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`,n.innerHTML=he(`chevrons-up-down`,{size:14}),t?e.prepend(n):e.append(n)}let ye=e=>{let t=j(new URLSearchParams(T)),n=v.sortBy===e&&v.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),A(t,`push`)};n.addEventListener(`click`,e=>{let t=e.target.closest(`th[data-sort-key]`);t&&n.tHead?.contains(t)&&ye(t.dataset.sortKey)}),n.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest?.(`th[data-sort-key]`);!t||!n.tHead?.contains(t)||(e.preventDefault(),ye(t.dataset.sortKey))});let M=()=>{Dr(n);let e=f?{selected:v.total,total:v.total,allMatching:f}:{selected:d.size,total:v.total};n.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};u&&(kr(n,(e,t)=>{for(let n of e){let e=n.closest(`tr`)?.dataset.rowKey;e&&(t?d.add(e):d.delete(e))}t||(f=!1)}),n.addEventListener(`change`,e=>{let t=e.target;if(t.matches?.(`.wui-select-cell .wui-check`)){if(t.checked||(f=!1),n.tHead?.contains(t))for(let e of g.querySelectorAll(`:scope > tr`)){let n=e.querySelector(`.${U} .wui-check`);n&&(n.checked=t.checked,t.checked?d.add(e.dataset.rowKey):d.delete(e.dataset.rowKey))}else{let e=t.closest(`tr`)?.dataset.rowKey;if(!e)return;t.checked?d.add(e):d.delete(e)}M()}})),a&&(a.addEventListener(`click`,e=>{let t=e.target.closest(`a[href]`);!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),A(S(t.getAttribute(`href`)),`push`))}),a.addEventListener(`change`,e=>{!e.target.classList?.contains(`tpg-select`)||!e.target.value||(e.stopPropagation(),A(S(e.target.value),`push`))}));let N=()=>{if(!s.searchInput)return null;let e=document.querySelector(s.searchInput);return e&&(e.matches(`input, textarea`)?e:e.querySelector(`input`))},P=()=>e.isConnected?!0:(m.abort(),clearTimeout(b),!1),be=(e,t)=>{let n=t?.name?new FormData(e,t):new FormData(e),r=new Set([...e.querySelectorAll(`[name]`)].map(e=>e.getAttribute(`name`))),i=new URLSearchParams;for(let[e,t]of T)e!==`page`&&(Ar.includes(e)||!r.has(e))&&i.append(e,t);for(let[e,t]of n)typeof t!=`string`||t===``||Ar.includes(e)||l.has(e)||i.append(e,t);let a=N();if(a){i.delete(W);let e=a.value.trim();e&&i.set(W,e)}return A(i,`push`)},xe=e=>s.filtersForm&&e.closest?.(s.filtersForm)||s.filtersRegion&&e.closest?.(s.filtersRegion)||null;document.addEventListener(`submit`,e=>{!P()||!s.filtersForm||!(e.target instanceof HTMLFormElement)||!e.target.matches(s.filtersForm)||(e.preventDefault(),be(e.target,e.submitter))},h),document.addEventListener(`change`,e=>{if(!P()||!s.filtersForm)return;let t=e.target.closest?.(s.filtersForm);!t||e.target===N()||be(t)},h);let Se=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of e.querySelectorAll(`input[name]:not([type=hidden])`))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of e.querySelectorAll(`select[name]`))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let t of e.querySelectorAll(`wui-select[name]`))t.value=n(t.getAttribute(`name`));for(let n of e.querySelectorAll(`wui-multiselect[name]`))n.values=t.getAll(n.getAttribute(`name`));for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!P())return;let t=e.target.closest?.(`a[href]`);if(!t||!xe(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`),window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=j(S(n.href));Se(t.closest(`form`),r),A(r,`push`)},h),document.addEventListener(`input`,e=>{if(!P())return;let t=N();!t||e.target!==t||(clearTimeout(b),b=setTimeout(()=>{let e=j(new URLSearchParams(T)),n=t.value.trim();n?e.set(W,n):e.delete(W),e.toString()!==T.toString()&&A(e,`replace`)},300))},h),s.urlState&&window.addEventListener(`popstate`,()=>{if(!P())return;let e=x(window.location.search),t=N();t&&(t.value=e.get(`search`)??``),A(e,`none`)},h),document.addEventListener(`wui:modal:success`,()=>{P()&&s.refreshOnSuccess&&A(T,`none`)},h),i?.addEventListener(`click`,e=>{e.target.closest(`[data-wui-table-retry]`)&&y&&A(y.query,y.mode)});let F=e=>[...g.rows].find(t=>t.dataset.rowKey===e)??null,I=e=>{if(!e?.trim())return null;let t=document.createElement(`template`);if(t.innerHTML=`<table><tbody>${e}</tbody></table>`,t.content.querySelector(`tbody[data-wui-rows]`))return null;let n=[...t.content.querySelectorAll(`table > tbody > tr[data-row-key]`)];return n.length?n.map(e=>document.importNode(e,!0)):null},L=(e,t,n)=>{let r=n?e[0]:e.find(e=>e.dataset.rowKey===t.dataset.rowKey);if(!r)return null;let i=[];for(let n of e){let e=n===r?t:F(n.dataset.rowKey);e&&(O(e),e.replaceWith(n),i.push(n))}return oe(i),window.WUI?.refresh?.(),r},R=e=>e.message||(e.kind===`forbidden`?G.actionForbidden:G.actionFailed),B=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&z(e,null)},Ce=e=>{if(e instanceof HTMLTableRowElement)return e;let t=document.createElement(`template`);t.innerHTML=`<table><tbody>${String(e)}</tbody></table>`;let n=t.content.querySelector(`table > tbody > tr`);if(!n)throw Error("saveRow's `row` is the row as it will read: a <tr> element or its HTML.");return document.importNode(n,!0)},we=async({url:e,method:n=`POST`,body:r,key:a,row:o}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let s=a==null,c=s?null:F(String(a));if(!s&&!c)throw Error(`saveRow found no row with data-row-key="${a}" on this page.`);let l=re().filter(e=>!e.classList.contains(U)).length,u=o?Ce(o):c??fe(Math.max(1,l));c&&u!==c?c.replaceWith(u):c||g.insertBefore(u,g.firstChild),u!==c&&oe([u]),i&&!t.hasAttribute(`data-wui-table-error`)&&(i.hidden=!0),z(u,`saving`);let d=V(u),f=await _(e,{method:n.toUpperCase(),body:r});if(f.kind===`session`)return!1;if(f.ok){let e=I(f.html),t=e&&u.isConnected?L(e,u,s):null;return t?D(H.saved(V(t)||d)):(await A(T,`none`),B(u)),Fr(f.message,f.toastVariant||`success`),E(`wui:table:saved`,{key:t?.dataset.rowKey??(s?null:String(a)),added:s,status:f.status}),!0}let p=R(f),m=u;return c&&u!==c&&u.isConnected?(u.replaceWith(c),m=c):s&&!o&&(u.remove(),m=null,i?.childElementCount&&!g.querySelector(`:scope > tr`)&&(i.hidden=!1)),m?.isConnected&&z(m,`error`,p),f.kind!==`aborted`&&Fr(p,`danger`),D(H.notSaved(d,p)),E(`wui:table:failed`,{key:s?null:String(a),added:s,status:f.status,kind:f.kind,message:p}),!1},Te=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=e.closest(`tr`),r=n?.dataset.rowKey??null,i=e.dataset.wuiRowAction||``,a=n?V(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&z(n,`saving`);let o=await _(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),o.kind===`session`||o.kind===`aborted`){B(n);return}if(o.ok){Fr(o.message,o.toastVariant||`success`);let e=n?.isConnected?I(o.html):null,t=e?L(e,n,!1):null;t?D(H.saved(V(t)||a)):(await A(T,`none`),B(n))}else{let e=R(o);Fr(e,`danger`),n?.isConnected&&z(n,`error`,e),D(H.notSaved(a,e))}E(`wui:table:action`,{action:i,key:r,ok:o.ok,status:o.status})};return n.addEventListener(`click`,e=>{let t=e.target.closest(`[data-wui-row-action]`);!t||!g.contains(t)||t.disabled||(e.preventDefault(),Te(t))}),ie(g),ce(g),u&&Er(n),se(g),ve(),{el:e,reload:()=>A(T,`none`),query:()=>new URLSearchParams(T),setQuery:e=>{let t=new URLSearchParams(T);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return(!e||!(`page`in e))&&t.delete(`page`),A(t,`push`)},saveRow:we,setActiveRow:t=>{e.dataset.activeRowKey=t==null?``:String(t),ae([...g.querySelectorAll(`:scope > tr`)])},selection:{keys:()=>[...d],count:()=>f?v.total:d.size,allMatching:()=>f,selectAllMatching:()=>{f=!0;for(let e of g.querySelectorAll(`:scope > tr`)){let t=e.querySelector(`.${U} .wui-check`);t&&(t.checked=!0),e.dataset.rowKey&&d.add(e.dataset.rowKey)}M()},clear:()=>{f=!1,d.clear();for(let e of g.querySelectorAll(`:scope > tr > .${U} .wui-check`))e.checked=!1;M()}}}}var K=`wuiConfirm`,zr=Object.freeze([`danger`]),Br=Object.freeze([`success`,`info`,`warning`,`danger`]),Vr=`wui.flash`,q=Object.freeze({confirmTitle:`Are you sure?`,confirmLabel:`Confirm`,cancelLabel:`Cancel`,failed:`That did not work. Try again.`,forbidden:`You do not have permission to do that.`,network:`Could not reach the server. Check your connection and try again.`}),Hr=new WeakSet,Ur=new WeakSet,J=null,Wr=null,Gr=!1,Kr=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},qr=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},Jr=()=>{let e=window.bootstrap?.Modal;if(!e)throw Error(`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return e};function Yr(){let e=document.getElementById(K);return e||(e=document.createElement(`div`),e.id=K,e.className=`modal fade wui-modal-shell`,e.tabIndex=-1,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.style.setProperty(`--wui-modal-max-width`,`${C.md}px`),e.innerHTML=`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1" data-autofocus></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${Kr(q.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Xr(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!zr.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Zr({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function Zr({title:e,message:t,label:n,danger:r},i){let a=Jr(),o=Yr(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${K} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${K}"> without confirm-href, or leave the dialog to the library.`);let l=o.querySelector(`.wui-confirm-msg`);l||(l=document.createElement(`p`),l.className=`wui-confirm-msg`,s.after(l)),s.textContent=e||q.confirmTitle,l.textContent=t,c.textContent=n||q.confirmLabel,c.classList.toggle(`btn-danger`,r),c.classList.toggle(`btn-primary`,!r),o.querySelector(`wui-status-icon`)?.setAttribute(`tone`,r?`delete`:`info`),o.setAttribute(`aria-label`,s.textContent),Wr=i,Gr=!1,a.getOrCreateInstance(o).show()}var Qr=(e,t)=>{J=e;try{t()}finally{J=null}};function $r(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!zr.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);fi(e.ownerDocument),Zr({title:t,message:n,label:r,danger:i===`danger`},()=>Qr(e,a))}var ei=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function ti(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===J||ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Xr(t,()=>Qr(t,()=>t.click())))}function ni(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===J||e.submitter&&e.submitter===J)return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Xr(t,()=>Qr(t,()=>t.requestSubmit(n)))}function ri(e){let t=e.target.closest?.(`#${K} [data-app-confirm]`);!t||t.disabled||!Wr||(Gr=!0,Jr().getOrCreateInstance(t.closest(`#${K}`)).hide())}function ii(e){if(e.target.id!==`wuiConfirm`)return;let t=Gr?Wr:null;Wr=null,Gr=!1,t?.()}var ai=(e,t)=>{e&&window.sessionStorage.setItem(Vr,JSON.stringify({message:e,variant:t}))},oi=e=>e===`forbidden`?q.forbidden:e===`network`?q.network:q.failed;function si(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&Lr(e)?.reload()}async function ci(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);let n=e.getAttribute(`data-wui-post-reload`);if(n!==null&&n!==`page`)throw TypeError(`data-wui-post-reload="${n}" is not supported. Use page, or leave it off to reload the server tables.`);e.disabled=!0,e.setAttribute(`aria-busy`,`true`);let r=await _(t,{method:`POST`});if(r.kind===`session`||r.kind===`aborted`)return;let i=r.toastVariant||`success`;if(r.ok&&(r.redirect||n===`page`)){ai(r.message,i),r.redirect?window.location.assign(r.redirect):window.location.reload();return}if(e.disabled=!1,e.removeAttribute(`aria-busy`),r.ok){qr(r.message,i),si();return}qr(r.message||oi(r.kind),`danger`)}function li(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(ei(t)||t.getAttribute(`aria-busy`)===`true`)&&ci(t).catch(e=>console.error(e)))}function ui(){let e=window.sessionStorage.getItem(Vr);if(!e)return;window.sessionStorage.removeItem(Vr);let{message:t,variant:n}=JSON.parse(e);qr(t,n)}function di(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!Br.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${Br.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),qr(n,t)}}function fi(e){Ur.has(e)||(Ur.add(e),e.addEventListener(`click`,ri),e.addEventListener(`hidden.bs.modal`,ii))}function pi(e=document){let t=e.ownerDocument||e;Hr.has(t)||(Hr.add(t),t.addEventListener(`click`,ti,!0),t.addEventListener(`submit`,ni,!0),fi(t),t.addEventListener(`click`,li),ui()),di(e)}var mi=31536e3,Y=new WeakMap,hi=e=>e>99?`99+`:String(e);function gi(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${mi}; SameSite=Lax`}var _i=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},vi=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function yi(e,t){let n=e.querySelector(`.wui-bell-trigger`),r=e.querySelector(`.wui-bell-count`),i=e.querySelector(`[data-wui-bell-live]`),a=e.querySelector(`[data-wui-bell-list]`),o=e.querySelector(`.wui-bell-menu`),{src:s,readAction:c}=e.dataset,l=e.dataset.label||`Notifications`,u=e.dataset.emptyText||`You are all caught up.`,d=Number(e.dataset.pollSeconds??60),f=ee(),p=Number(e.dataset.unread)||0,m=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==p;p=o,e.dataset.unread=String(o),r&&(r.textContent=hi(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${hi(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${hi(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=vi(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),a.replaceChildren(e)},v=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren(vi(`wui-bell-state`,`Loading…`)));let n=await f.run(s);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(a.removeAttribute(`aria-busy`),!n.ok){t&&g();return}let r=_i(n.html),i=r.querySelector(`[data-wui-unread]`),o=i?Number(i.getAttribute(`data-wui-unread`)):p;m(o),(t||h())&&(r.querySelector(`.wui-bell-item`)?a.replaceChildren(r):a.replaceChildren(vi(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>v(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){v(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await _(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),v(!0))});let y=null,b=()=>{d>0&&y===null&&(y=setInterval(()=>v(h()),d*1e3))},x=()=>{y!==null&&clearInterval(y),y=null},S=()=>{document.hidden?x():(v(h()),b())};return d>0&&(document.addEventListener(`visibilitychange`,S),document.hidden||b()),t.push(()=>{x(),f.abort(),document.removeEventListener(`visibilitychange`,S)}),{setUnread:e=>m(e),refresh:()=>v(h())}}var bi=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),xi=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Si(e,t){let n=e.querySelector(`input.search-input`),r=e.querySelector(`.wui-topsearch-results`),i=e.querySelector(`.wui-topsearch-open`),a=e.querySelector(`[data-wui-topsearch-live]`),{src:o,param:s=`q`,resultsHref:c}=e.dataset,l=Number(e.dataset.minChars??2),u=Number(e.dataset.debounceMs??250),d=ee(),f=null,p=-1,m=()=>[...r.querySelectorAll(`.wui-topsearch-hit`)],h=e=>{let t=m();p=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===p;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)}),p>=0?(n.setAttribute(`aria-activedescendant`,t[p].id),t[p].scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},g=()=>{r.hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),p=-1},_=()=>{r.hidden=!1,n.setAttribute(`aria-expanded`,`true`)},v=t=>{e.classList.toggle(`is-open`,t),i?.setAttribute(`aria-expanded`,t?`true`:`false`)},y=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},b=async t=>{e.classList.add(`is-loading`);let n=await d.run(xi(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=_i(n.html),t=e.querySelector(`[data-wui-count]`);r.replaceChildren(e),m().forEach((e,t)=>{e.id=`${r.id}-opt-${t}`});let i=t?Number(t.getAttribute(`data-wui-count`)):m().length;a&&(a.textContent=i===0?`No results`:`${i} ${i===1?`result`:`results`}`)}else r.replaceChildren(vi(`wui-topsearch-empty`,`Search is unavailable right now.`));p=-1,_()}};n.addEventListener(`input`,()=>{clearTimeout(f);let t=n.value.trim();if(t.length<l){d.abort(),e.classList.remove(`is-loading`),r.replaceChildren(),g();return}f=setTimeout(()=>b(t),u)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(r.hidden||m().length===0)return;t.preventDefault(),h(p+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=m();!r.hidden&&p>=0&&e[p]?(t.preventDefault(),y(e[p].getAttribute(`href`))):c&&n.value.trim()!==``&&(t.preventDefault(),y(xi(c,s,n.value.trim())))}else t.key===`Escape`&&(r.hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),v(!1),i?.focus()):(t.preventDefault(),t.stopPropagation(),g()))}),r.addEventListener(`click`,e=>{let t=e.target.closest(`.wui-topsearch-hit`);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),y(t.getAttribute(`href`)))}),i?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);v(t),t&&n.focus()});let x=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||bi(e.target)||(e.preventDefault(),v(!0),n.focus())},S=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,S),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,S)})}function Ci(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>gi(n,!!e.detail?.collapsed)),e.addEventListener(`click`,t=>{t.target.closest(`[data-wui-tabbar-more]`)&&e.querySelector(`[data-app-shell-menu]`)?.click()});let r=e.querySelector(`[data-wui-bell]`),i=r?yi(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Si(a,t);let o={el:e,setUnread(e){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);i.setUnread(e)},refreshNotifications(){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);return i.refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=e.querySelector(`[data-app-shell-collapse]`);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Y.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Y.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function wi(e=document){let t=[];e instanceof Element&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...e.querySelectorAll(`[data-app-shell]`));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Ci(e))}function Ti(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Y.has(t)||wi(t),Y.get(t)??null):null}var X=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),Z=`form[data-wui-unsaved]`,Ei=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Di=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Oi=new Set([`submit`,`button`,`reset`,`image`]),Q=new WeakMap,ki=new WeakSet,Ai=e=>`${e.name}:${e.size}:${e.lastModified}`;function $(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Oi.has(n.type)||(n.type===`checkbox`||n.type===`radio`?t.push([n.name,n.value,n.checked]):n.type===`file`?t.push([n.name,[...n.files||[]].map(Ai)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}var ji=e=>({saved:e.querySelector(Ei)?null:$(e),engaged:!1,discarded:!1});function Mi(e){let t=Q.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&$(e)!==t.saved}var Ni=(e,t)=>[...e.querySelectorAll(Z)].filter(e=>e!==t&&Mi(e)),Pi=()=>!!window.bootstrap?.Modal;function Fi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||X.message;$r(e,{title:X.title,message:r,label:X.leaveLabel,tone:`danger`},()=>{for(let e of t)Q.get(e).discarded=!0;n()})}function Ii(e){if(e.matches(Di))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=new URL(e.getAttribute(`href`),window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=window.location;return!(n.hash&&n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search)}function Li(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function Ri(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target.closest?.(`a[href]`);if(!t||!Ii(t))return;let n=Ni(t.ownerDocument,null);!n.length||!Pi()||(e.preventDefault(),Fi(t,n,()=>t.click()))}function zi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Li(t,e.submitter))return;let n=Ni(t.ownerDocument,t);if(n.length&&Pi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Fi(t,n,()=>t.requestSubmit(r));return}let r=Q.get(t);r&&(r.saved=$(t),r.discarded=!1)}function Bi(e){Ni(document,null).length&&(e.preventDefault(),e.returnValue=``)}function Vi(e){let t=e.target.closest?.(Z),n=t&&Q.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=$(t)),n.engaged=!0)}function Hi(e){let t=e.target.closest?.(Z),n=t&&Q.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function Ui(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(Z))Gi(e)}function Wi(e=document){let t=e.ownerDocument||e;if(!ki.has(t)){ki.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,Vi,!0);for(let e of[`input`,`change`])t.addEventListener(e,Hi,!0);t.addEventListener(`click`,Ri),t.addEventListener(`submit`,zi),t.addEventListener(`wui:modal:success`,Ui),t.defaultView.addEventListener(`beforeunload`,Bi)}let n=[...e.querySelectorAll?.(Z)||[]];e.matches?.(Z)&&n.unshift(e);for(let e of n)Q.has(e)||Q.set(e,ji(e))}function Gi(e){if(!(e instanceof HTMLFormElement)||!e.matches(Z))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);Q.set(e,{saved:$(e),engaged:!1,discarded:!1})}function Ki(){e(`wui-select`,L),e(`wui-country-select`,R),e(`wui-phone`,Ft),e(`wui-datepicker`,Qe),e(`wui-date-range`,$e),e(`wui-dock`,et),e(`wui-image-crop`,rt),e(`wui-kanban`,w),e(`wui-inline-edit`,at),e(`wui-consent-banner`,F),e(`wui-slider`,on),e(`wui-sortable`,sn),e(`wui-timepicker`,ln),e(`wui-tour`,dn),e(`wui-tree`,fn),e(`wui-autocomplete`,A),e(`wui-command-palette`,N),e(`wui-context-menu`,I),e(`wui-multiselect`,xt),e(`wui-taginput`,cn),e(`wui-otp`,Nt),e(`wui-status-icon`,k),e(`wui-shortcuts`,rn),e(`wui-record-pager`,Zt),e(`wui-carousel`,j),e(`wui-code-block`,_e),e(`wui-data-table`,Ke),e(`wui-drawer`,tt),e(`wui-hover-card`,nt),e(`wui-lightbox`,lt),e(`wui-menubar`,bt),e(`wui-navigation-menu`,St),e(`wui-notification-center`,jt),e(`wui-onboarding-checklist`,Mt),e(`wui-overflow`,Pt),e(`wui-rating`,It),e(`wui-relative-time`,en),e(`wui-resizable`,tn),e(`wui-rolling-number`,nn),e(`wui-show-more`,an),e(`wui-truncate`,pn),e(`wui-whats-new`,mn),e(`wui-mention-input`,ft),e(`wui-comment-thread`,P),e(`wui-wizard-step`,_n),e(`wui-wizard`,gn)}Ki();export{Tn as AVATAR_ACCEPT,kn as AVATAR_MAX_SIZE_MB,sr as AVATAR_OUTPUT_SIZE,On as AVATAR_OUTPUT_TYPE,Un as AVATAR_PREVIEW_SIZES,Hn as AVATAR_TEXT,Ve as COLUMN_MAX_WIDTH,We as COLUMN_MIN_WIDTH,Se as COMMENT_INTENTS,be as COMMENT_REACTIONS,xe as COMMENT_TEXT,K as CONFIRM_DIALOG_ID,zr as CONFIRM_TONES,ye as COPY_FEEDBACK_MS,S as CSRF_META_NAME,m as CURRENCIES,H as DATA_TABLE_TEXT,l as DATE_PATTERNS,y as DEFAULT_CSRF_HEADER,An as DEFAULT_IMAGE_ACCEPT,In as DEFAULT_MAX_SIZE_MB,Ln as DEFAULT_PASSWORD_RULES,xn as DEFAULT_REQUIREMENTS_TITLE,ur as DEFAULT_THEME_EFFECT,ir as DEFAULT_THEME_STORAGE_KEY,f as DURATION_UNITS,o as EMPTY_VALUE,Vr as FLASH_STORAGE_KEY,Br as FLASH_VARIANTS,t as FORMAT_STYLES,b as HTTP_KINDS,ct as INLINE_EDIT_SAVED_MS,ot as INLINE_EDIT_TEXT,st as INLINE_EDIT_TYPES,u as IST_TIME_ZONE,ue as KANBAN_DRAG_THRESHOLD_PX,oe as KANBAN_LONG_PRESS_MS,O as KANBAN_PHONE_QUERY,re as KANBAN_STORAGE_PREFIX,te as KANBAN_SUMMARY_FORMATS,se as KANBAN_TEXT,le as KANBAN_TONES,Yt as LIST_KEYS,Sn as MASK_INPUT_TYPES,Nn as MASK_NAMES,ut as MENTION_ID_PATTERN,vt as MENTION_MAX_QUERY,mt as MENTION_MAX_RESULTS,gt as MENTION_TEXT,p as MONEY_UNITS,At as NOTIFICATION_COUNT_CAP,Et as NOTIFICATION_TEXT,Ae as PIN_AT_VAR,He as PIN_SIDES,Ge as RESIZE_STEP,Me as RESIZE_STEP_LARGE,ze as ROW_HEIGHTS,qe as ROW_MOVE_LIMIT,Ne as ROW_MOVE_MS,Pe as ROW_SAVE_ATTR,Ue as ROW_SAVE_ERROR_CLASS,Be as ROW_SAVE_STATES,hr as SCROLL_EDGE_SELECTOR,_r as SELECT_ALL_LABEL,U as SELECT_CELL_CLASS,Wt as SELECT_KEY,vr as SELECT_ROW_LABEL,q as SERVER_ACTION_TEXT,qt as SHORTCUTS_OFF_ATTRIBUTE,Vt as SHORTCUT_EVENT,Lt as SHORTCUT_SCOPE_ATTRIBUTE,Gt as SHORTCUT_TEXT,me as STATUS_TONES,cr as THEME_BOOT_SCRIPT_BODY,$n as THEME_CHANGE_EVENT,Kn as THEME_EFFECTS,ar as THEME_EFFECT_DURATION,lr as THEME_LIVE_NAME,Jn as THEME_MODES,nr as THEME_SWITCHING_CLASS,X as UNSAVED_TEXT,Ie as VIRTUAL_OVERSCAN,hn as WHATS_NEW_READ_EVENT,v as WUI_HEADERS,A as WuiAutocomplete,j as WuiCarousel,_e as WuiCodeBlock,N as WuiCommandPalette,P as WuiCommentThread,F as WuiConsentBanner,I as WuiContextMenu,R as WuiCountrySelect,Ke as WuiDataTable,Qe as WuiDatePicker,$e as WuiDateRange,et as WuiDock,tt as WuiDrawer,nt as WuiHoverCard,rt as WuiImageCrop,at as WuiInlineEdit,w as WuiKanban,lt as WuiLightbox,ft as WuiMentionInput,bt as WuiMenubar,xt as WuiMultiSelect,St as WuiNavigationMenu,jt as WuiNotificationCenter,Mt as WuiOnboardingChecklist,Nt as WuiOtp,Pt as WuiOverflow,Ft as WuiPhone,It as WuiRating,Zt as WuiRecordPager,en as WuiRelativeTime,tn as WuiResizable,nn as WuiRollingNumber,L as WuiSelect,rn as WuiShortcuts,an as WuiShowMore,on as WuiSlider,sn as WuiSortable,k as WuiStatusIcon,cn as WuiTagInput,ln as WuiTimePicker,dn as WuiTour,fn as WuiTree,pn as WuiTruncate,mn as WuiWhatsNew,gn as WuiWizard,_n as WuiWizardStep,gr as acceptLabel,Tr as addRowSelectCells,Er as addSelectColumn,dr as applyTheme,Jt as ariaKeyShortcuts,tr as attachInputMask,qn as attachScrollEdges,kr as attachShiftRange,Wn as avatarCropOptions,Fn as avatarUnreadableMessage,pr as buildPasswordRules,Fe as clampColumnWidth,g as classifyStatus,$r as confirmAction,ve as copyTextToClipboard,un as createLocalSeenStore,ee as createRequestQueue,br as createSelectHeaderCell,xr as createSelectRowCell,Sr as createSelectSpacerCell,Ki as defineWeborityElements,Rn as evaluatePassword,n as formatCompact,s as formatCurrency,h as formatDate,r as formatDuration,yn as formatMasked,i as formatNumber,d as formatPercent,Qt as formatRelativeTime,c as formatValue,Lr as getServerTable,Ti as getShell,he as glyphSvg,ke as groupCount,Je as groupItems,Ot as groupNotificationsByDay,Ze as identityCell,Rt as inShortcutScope,er as initInputMasks,fe as initRemoteModals,mr as initScrollEdges,pi as initServerActions,Ir as initServerTables,wi as initShellParts,Wi as initUnsavedChanges,it as inlineEditText,vn as isHeicFile,bn as isImageFile,Bn as isImageOnlyAccept,jn as isMaskPattern,En as isPdfFile,Ht as isTypingTarget,ie as kanbanCardLabel,de as kanbanOverflow,T as kanbanStorageKey,E as kanbanSummaryFormat,ce as kanbanVisibleLimit,pe as loadRemoteModal,Mn as maskedPostValue,M as matchSegments,zn as matchesAccept,je as measureRows,ht as mentionLabel,_t as mentionTextFromValue,dt as mentionValueFromText,pt as mentionedIds,Xt as moveFocus,Yn as nextTheme,Tt as notificationCountText,Ct as notificationDayHeading,Dt as notificationTime,kt as notificationTriggerLabel,wt as notificationUnreadAnnouncement,yt as parseMentionValue,Cn as passwordSatisfies,Xe as pinAtValue,De as pinClasses,B as pinOffsetVar,Ye as planPins,Oe as playRowMoves,Pn as postedMasked,wn as rawMasked,Ce as readColumnWidths,x as readCsrf,ae as readKanbanCollapsed,Xn as readStoredTheme,$t as relativeTimeTitle,Gi as resetUnsavedChanges,Dn as resolveMask,or as resolveTheme,V as rowLabel,Ee as rowOrderChanged,zt as runShortcut,Re as saveOutcomeText,z as setRowSaveState,Le as settledRows,Bt as shortcutKey,Kt as shortcutName,Ut as shortcutsOff,rr as storeTheme,ne as sumKanbanValues,Dr as syncSelectAll,Qn as themeBootScript,Zn as themeKeyframes,a as toInstant,Gn as transitionTheme,Vn as validateFile,we as virtualRange,fr as watchSystemTheme,ge as withTrustedLabel,Te as writeColumnWidths,D as writeKanbanCollapsed,_ as wuiFetch};
|
|
1
|
+
import{n as e}from"./elementBase-BlsR4tqa.js";import{a as t,c as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./formatters-BAE__8ye.js";import{a as g,c as _,i as v,n as y,o as ee,r as b,s as x,t as S}from"./wuiHttp-BC8co934.js";import{_ as C,a as te,c as w,d as T,f as E,g as D,h as ne,i as re,l as ie,m as ae,n as oe,o as se,p as ce,r as O,s as le,t as ue,u as de,v as fe,y as pe}from"./kanban-29Pv2HU9.js";import{n as k,t as me}from"./statusIcons-2X4iGkKL.js";import{t as he}from"./iconGlyphs.g-CUm_mfze.js";import{o as ge}from"./optionLabel-BBaur8Bs.js";import{t as A}from"./WuiAutocomplete-B2SKLPOV.js";import{t as j}from"./WuiCarousel-C33Z8FBt.js";import{t as _e}from"./WuiCodeBlock-BcLJhLBJ.js";import{n as ve,t as ye}from"./copyText-DM5HhXjf.js";import{t as M}from"./textMatch-wdY7XLIc.js";import{t as N}from"./WuiCommandPalette-CcmFOWNc.js";import{i as P,n as be,r as xe,t as Se}from"./WuiCommentThread-Bww7P_cu.js";import{t as F}from"./WuiConsentBanner-C2jOIeQK.js";import{t as I}from"./WuiContextMenu-CBy0O4HT.js";import{t as L}from"./WuiSelect-U5Owq3wT.js";import{t as R}from"./WuiCountrySelect-D-K0dm77.js";import{A as z,C as B,D as V,E as Ce,M as we,N as Te,O as Ee,S as De,T as Oe,_ as ke,a as Ae,b as je,c as Me,d as Ne,f as Pe,g as Fe,h as Ie,i as H,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./WuiDataTable-tR8Lp4XZ.js";import{t as Qe}from"./WuiDatePicker-DONFTIvZ.js";import{t as $e}from"./WuiDateRange-BuVA1MK5.js";import{t as et}from"./WuiDock-BD2HgMmP.js";import{t as tt}from"./WuiDrawer-D6K2eRlW.js";import{t as nt}from"./WuiHoverCard-BsYAwmbA.js";import{t as rt}from"./WuiImageCrop-Cr3D2iPo.js";import{a as it,i as at,n as ot,r as st,t as ct}from"./WuiInlineEdit-CI-3C7yP.js";import{t as lt}from"./WuiLightbox-hluak_-q.js";import{a as ut,c as dt,i as ft,l as pt,n as mt,o as ht,r as gt,s as _t,t as vt,u as yt}from"./WuiMentionInput-DW7N1Zne.js";import{t as bt}from"./WuiMenubar-D2tb_3eU.js";import{t as xt}from"./WuiMultiSelect-BGZOG93I.js";import{t as St}from"./WuiNavigationMenu-BsLnvz2Y.js";import{a as Ct,c as wt,i as Tt,n as Et,o as Dt,r as Ot,s as kt,t as At}from"./notificationDays-pYmoU0g6.js";import{t as jt}from"./WuiNotificationCenter-BZwVMUSV.js";import{t as Mt}from"./WuiOnboardingChecklist-s2DG6PZ0.js";import{t as Nt}from"./WuiOtp-BbO_75RB.js";import{t as Pt}from"./WuiOverflow-CB3j6q6n.js";import{t as Ft}from"./WuiPhone-BoLywT_W.js";import{t as It}from"./WuiRating-BzeW6iDC.js";import{a as Lt,c as Rt,d as zt,f as Bt,i as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,u as Xt}from"./shortcutKeys-BQiDpsTJ.js";import{t as Zt}from"./WuiRecordPager-yXv4g2ZR.js";import{n as Qt,r as $t,t as en}from"./WuiRelativeTime-Cfc8TMd8.js";import{t as tn}from"./WuiResizable-m2Ypa-zD.js";import{t as nn}from"./WuiRollingNumber-DBgi_3l7.js";import{t as rn}from"./WuiShortcuts-CMibF1XM.js";import{t as an}from"./WuiShowMore-Bu7IQcXS.js";import{t as on}from"./WuiSlider-Br6V2amU.js";import{t as sn}from"./WuiSortable-Bd7Fz5Ox.js";import{t as cn}from"./WuiTagInput-DzEZooIn.js";import{t as ln}from"./WuiTimePicker-UjvUcDrS.js";import{n as un,t as dn}from"./WuiTour-DW3kPaR9.js";import{t as fn}from"./WuiTree-SA0QU9AF.js";import{t as pn}from"./WuiTruncate-BLl2u3b-.js";import{n as mn,t as hn}from"./WuiWhatsNew-BO78119Z.js";import{n as gn,t as _n}from"./WuiWizardStep-DIHxrXn9.js";import{$ as vn,A as yn,B as bn,C as xn,D as Sn,E as Cn,F as wn,G as Tn,H as En,I as Dn,J as On,K as kn,L as An,M as jn,N as Mn,O as Nn,P as Pn,Q as Fn,R as In,S as Ln,T as Rn,U as zn,V as Bn,W as Vn,X as Hn,Y as Un,Z as Wn,_ as Gn,a as Kn,b as qn,c as Jn,d as Yn,f as Xn,g as Zn,h as Qn,i as $n,j as er,k as tr,l as nr,m as rr,n as ir,o as ar,p as or,q as sr,r as cr,s as lr,t as ur,u as dr,v as fr,w as pr,x as mr,y as hr,z as gr}from"./themeTransition-DO95LPdz.js";var _r=`Select all rows`,vr=`Select row`,U=`wui-select-cell`,yr=(e,t)=>{let n=e.createElement(`input`);return n.type=`checkbox`,n.className=`wui-check`,n.setAttribute(`aria-label`,t),n};function br(e=document){let t=e.createElement(`th`);return t.className=U,t.appendChild(yr(e,_r)),t}function xr(e=document){let t=e.createElement(`td`);return t.className=U,t.appendChild(yr(e,vr)),t}function Sr(e=document){let t=e.createElement(`td`);return t.className=U,t}var Cr=e=>e.firstElementChild?.classList.contains(U),wr=e=>e.matches(`.wui-group-row, .wui-virtual-spacer`);function Tr(e){for(let t of e)!Cr(t)&&!wr(t)&&t.insertBefore(xr(t.ownerDocument),t.firstChild)}function Er(e){let t=e.querySelector(`thead tr`);if(!t)return null;Cr(t)||t.insertBefore(br(e.ownerDocument),t.firstChild),Tr(e.querySelectorAll(`tbody tr`));for(let t of e.querySelectorAll(`tfoot tr`))Cr(t)||t.insertBefore(Sr(e.ownerDocument),t.firstChild);return t.querySelector(`.${U} .wui-check`)}function Dr(e){let t=e.querySelector(`thead .${U} .wui-check`),n=[...e.querySelectorAll(`tbody tr .wui-check`)],r=n.length,i=n.filter(e=>e.checked).length;t&&(t.checked=r>0&&i===r,t.indeterminate=i>0&&i<r);for(let t of e.querySelectorAll(`tbody tr`))t.classList.toggle(`is-selected`,!!t.querySelector(`.wui-check`)?.checked);return{selected:i,total:r}}var Or=`tbody .${U} .wui-check`;function kr(e,t){let n=null,r=e=>e instanceof Element&&e.matches(`.wui-select-cell .wui-check`)&&!!e.closest(`tbody`);e.addEventListener(`mousedown`,e=>{e.shiftKey&&r(e.target)&&e.preventDefault()}),e.addEventListener(`click`,i=>{let a=i.target;if(r(a)){if(i.shiftKey&&n?.isConnected&&n!==a){let r=[...e.querySelectorAll(Or)],i=r.indexOf(n),o=r.indexOf(a);if(i>=0&&o>=0){let e=[];for(let t of r.slice(Math.min(i,o),Math.max(i,o)+1))t===a||t.checked===a.checked||(t.checked=a.checked,e.push(t));e.length&&t?.(e,a.checked)}}n=a}})}var Ar=Object.freeze([`page`,`pageSize`,`sortBy`,`sortOrder`]),W=`search`,G=Object.freeze({loading:`Loading rows`,error:`These rows did not load. Try again.`,network:`The connection dropped before the rows loaded. Check it and try again.`,forbidden:`You do not have access to these rows.`,retry:`Retry`,actionFailed:`That did not work. Try again.`,actionForbidden:`You do not have permission to do that.`,empty:`No rows`}),jr=5,Mr=new WeakMap,Nr=(e,t)=>{let n=Number(e);return Number.isInteger(n)?n:t},Pr=e=>({total:Nr(e.dataset.total,0),page:Nr(e.dataset.page,1),pageSize:Nr(e.dataset.pageSize,0),sortBy:e.dataset.sortBy||``,sortOrder:e.dataset.sortOrder===`desc`?`desc`:`asc`}),Fr=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})};function Ir(e=document){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-server]`)]:[];e instanceof Element&&e.matches(`[data-wui-server]`)&&t.unshift(e);for(let e of t)Mr.has(e)||Mr.set(e,Rr(e))}function Lr(e){let t=e instanceof Element?e.closest(`[data-wui-server]`):null;return t&&Mr.get(t)||null}function Rr(e){let t=e.querySelector(`.table-wrap`),n=t?.querySelector(`:scope > table`),r=e.dataset.src;if(!n||!r)throw Error(`A server-paged table needs data-src and a .table-wrap > table: render it with <app-data-table src>.`);let i=t.querySelector(`:scope > [data-wui-table-state]`),a=e.querySelector(`[data-wui-table-pager]`),o=e.querySelector(`[data-wui-table-status]`),s={urlState:e.dataset.urlState!==`false`,refreshOnSuccess:e.dataset.refreshOnSuccess!==`false`,filtersForm:e.dataset.filtersForm||null,filtersRegion:e.dataset.filtersRegion||null,searchInput:e.dataset.searchInput||null,loadingText:e.dataset.loadingText||G.loading,errorText:e.dataset.errorText||G.error},c=new URL(r,window.location.href),l=new Set(c.searchParams.keys()),u=n.hasAttribute(`data-app-datatable-selectable`),d=new Set,f=!1,p=ee(),m=new AbortController,h={signal:m.signal},g=n.querySelector(`:scope > tbody[data-wui-rows]`);if(!g)throw Error(`A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).`);let v=Pr(g),y=null,b=null,x=e=>{let t=new URLSearchParams;for(let[n,r]of new URLSearchParams(e))l.has(n)||t.append(n,r);return t},S=e=>x(new URL(e,window.location.href).search),C=e=>{let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`},te=e=>{let t=new URL(c.href);for(let[n,r]of e)l.has(n)||t.searchParams.append(n,r);return t.origin===window.location.origin?`${t.pathname}${t.search}`:t.href},w=(e,t)=>{let n=new URLSearchParams(e);return n.has(`page`)&&n.set(`page`,String(t.page)),n.has(`pageSize`)&&n.set(`pageSize`,String(t.pageSize)),n.has(`sortBy`)?t.sortBy?(n.set(`sortBy`,t.sortBy),n.set(`sortOrder`,t.sortOrder)):(n.delete(`sortBy`),n.delete(`sortOrder`)):n.delete(`sortOrder`),n},T=w(s.urlState?x(window.location.search):new URLSearchParams,v);s.urlState&&C(T)!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.replaceState(window.history.state,``,C(T));let E=(e,n)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n})),D=e=>{o&&(o.textContent=e)},ne=e=>{if(e.total===0)return G.empty;let t=e.pageSize>0?Math.max(1,Math.ceil(e.total/e.pageSize)):1;return`Page ${e.page} of ${t}, ${e.total} ${e.total===1?`row`:`rows`}`},re=()=>[...n.querySelectorAll(`:scope > thead > tr:first-child > th`)],ie=e=>{if(u&&[...e.querySelectorAll(`:scope > tr`)].some(e=>!e.dataset.rowKey))throw Error(`A selectable server-paged table needs data-row-key on every row, so a selection can span pages.`)},ae=t=>{let n=e.dataset.activeRowKey;if(n!==void 0)for(let e of t){let t=e.classList.contains(`wui-row-active`),r=n!==``&&e.dataset.rowKey===n;e.classList.toggle(`wui-row-active`,r),r?e.setAttribute(`aria-current`,`true`):t&&e.removeAttribute(`aria-current`)}},oe=e=>{if(u){Tr(e);for(let t of e){let e=t.querySelector(`.${U} .wui-check`);e&&(f&&d.add(t.dataset.rowKey),e.checked=d.has(t.dataset.rowKey))}Dr(n)}ae(e);let t=re();if(n.classList.contains(`wui-table-stack`))for(let n of e)[...n.cells].forEach((e,n)=>{let r=t[n]?.textContent.trim();r&&!e.hasAttribute(`data-label`)&&e.setAttribute(`data-label`,r)});t.forEach((t,n)=>{if(t.classList.contains(`wui-col-hidden`))for(let t of e)t.cells[n]?.classList.add(`wui-col-hidden`)})},se=e=>oe([...e.querySelectorAll(`:scope > tr`)]),ce=e=>{for(let t of e.querySelectorAll(`:scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]`))t.remove()},O=e=>e?.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),le=(e,t)=>{if(!i)return;let n=e.querySelector(`:scope > template[data-wui-empty]`);O(i),t.total===0&&n?(i.replaceChildren(n.content.cloneNode(!0)),i.hidden=!1):(i.replaceChildren(),i.hidden=!0)},ue=e=>{let r=Pr(e),i=r.sortBy!==v.sortBy||r.sortOrder!==v.sortOrder?je(g.rows):null;if(a){let t=e.querySelector(`:scope > template[data-wui-pager]`);O(a),a.replaceChildren(...t?[t.content.cloneNode(!0)]:[]),a.hidden=!1}le(e,r);let o=e.querySelector(`:scope > template[data-wui-filters]`),c=s.filtersRegion&&o?document.querySelector(s.filtersRegion):null;c&&(O(c),c.replaceChildren(o.content.cloneNode(!0))),ce(e),O(g),n.replaceChild(e,g),g=e;let l=f&&r.total!==v.total;v=r,l&&(f=!1),t.removeAttribute(`data-wui-table-error`),se(e),ve(),Oe(e.rows,i),l&&M()},de=e=>{let t=document.createElement(`template`);t.innerHTML=`<table>${e}</table>`;let n=t.content.querySelector(`tbody[data-wui-rows]`);return n&&ie(n),n?document.importNode(n,!0):null},fe=e=>{let t=document.createElement(`tr`);for(let n=0;n<e;n++){let e=document.createElement(`td`),r=document.createElement(`span`);r.className=`skeleton`,r.setAttribute(`aria-hidden`,`true`),r.style.cssText=`display:block;width:${n===0?70:50}%;height:12px;border-radius:6px`,e.append(r),t.append(e)}return t},pe=()=>{if(g.querySelector(`:scope > tr:not([data-wui-skeleton])`))return;let e=Math.max(1,re().length);g.replaceChildren(...Array.from({length:jr},()=>{let t=fe(e);return t.setAttribute(`data-wui-skeleton`,``),t})),t.removeAttribute(`data-wui-table-error`),i&&(i.hidden=!0)},k=e=>{e?(t.setAttribute(`aria-busy`,`true`),pe()):t.removeAttribute(`aria-busy`)},me=e=>e===`forbidden`?G.forbidden:e===`network`?G.network:s.errorText,ge=e=>{let n=me(e);if(t.setAttribute(`data-wui-table-error`,e),a&&(a.hidden=!0),i){let t=document.createElement(`div`);t.className=`tbl-empty wui-table-error`,t.setAttribute(`role`,`alert`);let r=document.createElement(`span`);r.className=`tbl-empty-icon`,r.innerHTML=he(e===`forbidden`?`lock`:`alert-circle`,{size:24});let a=document.createElement(`div`);a.className=`tbl-empty-title`,a.textContent=n;let o=document.createElement(`div`);o.className=`tbl-empty-action`;let s=document.createElement(`button`);s.type=`button`,s.className=`btn btn-outline-primary btn-sm`,s.setAttribute(`data-wui-table-retry`,``),s.textContent=G.retry,o.append(s),t.append(r,a,o),O(i),i.replaceChildren(t),i.hidden=!1}D(n)},A=async(e,t=`none`)=>{let n=new URLSearchParams(e);y={query:n,mode:t},k(!0),D(s.loadingText),E(`wui:table:loading`,{query:n.toString()});let r=await p.run(te(n));if(r.kind===`aborted`||r.kind===`stale`||r.kind===`session`)return r;k(!1);let i=null,a=r.ok?null:r.kind;if(r.ok){try{i=de(r.html)}catch(e){console.error(e)}i||(a=`server`)}return a?(ge(a),E(`wui:table:error`,{status:r.status,kind:a,message:me(a)}),r):(ue(i),T=w(n,v),s.urlState&&t===`push`?window.history.pushState(window.history.state,``,C(T)):s.urlState&&t===`replace`&&window.history.replaceState(window.history.state,``,C(T)),D(ne(v)),window.WUI?.refresh?.(),E(`wui:table:loaded`,{...v,query:T.toString()}),r)},j=e=>(e.delete(`page`),e),_e=()=>[...n.querySelectorAll(`:scope > thead th[data-sort-key]`)],ve=()=>{for(let e of _e()){let t=e.dataset.sortKey===v.sortBy;e.setAttribute(`aria-sort`,t?v.sortOrder===`desc`?`descending`:`ascending`:`none`)}};for(let e of _e())if(e.classList.add(`sortable`),e.tabIndex=0,!e.querySelector(`.sort-icon`)){let t=e.classList.contains(`num`)||e.classList.contains(`text-end`),n=document.createElement(`span`);n.className=t?`sort-icon wui-sort-lead`:`sort-icon`,n.innerHTML=he(`chevrons-up-down`,{size:14}),t?e.prepend(n):e.append(n)}let ye=e=>{let t=j(new URLSearchParams(T)),n=v.sortBy===e&&v.sortOrder===`asc`?`desc`:`asc`;return t.set(`sortBy`,e),t.set(`sortOrder`,n),A(t,`push`)};n.addEventListener(`click`,e=>{let t=e.target.closest(`th[data-sort-key]`);t&&n.tHead?.contains(t)&&ye(t.dataset.sortKey)}),n.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest?.(`th[data-sort-key]`);!t||!n.tHead?.contains(t)||(e.preventDefault(),ye(t.dataset.sortKey))});let M=()=>{Dr(n);let e=f?{selected:v.total,total:v.total,allMatching:f}:{selected:d.size,total:v.total};n.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:e}))};u&&(kr(n,(e,t)=>{for(let n of e){let e=n.closest(`tr`)?.dataset.rowKey;e&&(t?d.add(e):d.delete(e))}t||(f=!1)}),n.addEventListener(`change`,e=>{let t=e.target;if(t.matches?.(`.wui-select-cell .wui-check`)){if(t.checked||(f=!1),n.tHead?.contains(t))for(let e of g.querySelectorAll(`:scope > tr`)){let n=e.querySelector(`.${U} .wui-check`);n&&(n.checked=t.checked,t.checked?d.add(e.dataset.rowKey):d.delete(e.dataset.rowKey))}else{let e=t.closest(`tr`)?.dataset.rowKey;if(!e)return;t.checked?d.add(e):d.delete(e)}M()}})),a&&(a.addEventListener(`click`,e=>{let t=e.target.closest(`a[href]`);!t||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),A(S(t.getAttribute(`href`)),`push`))}),a.addEventListener(`change`,e=>{!e.target.classList?.contains(`tpg-select`)||!e.target.value||(e.stopPropagation(),A(S(e.target.value),`push`))}));let N=()=>{if(!s.searchInput)return null;let e=document.querySelector(s.searchInput);return e&&(e.matches(`input, textarea`)?e:e.querySelector(`input`))},P=()=>e.isConnected?!0:(m.abort(),clearTimeout(b),!1),be=(e,t)=>{let n=t?.name?new FormData(e,t):new FormData(e),r=new Set([...e.querySelectorAll(`[name]`)].map(e=>e.getAttribute(`name`))),i=new URLSearchParams;for(let[e,t]of T)e!==`page`&&(Ar.includes(e)||!r.has(e))&&i.append(e,t);for(let[e,t]of n)typeof t!=`string`||t===``||Ar.includes(e)||l.has(e)||i.append(e,t);let a=N();if(a){i.delete(W);let e=a.value.trim();e&&i.set(W,e)}return A(i,`push`)},xe=e=>s.filtersForm&&e.closest?.(s.filtersForm)||s.filtersRegion&&e.closest?.(s.filtersRegion)||null;document.addEventListener(`submit`,e=>{!P()||!s.filtersForm||!(e.target instanceof HTMLFormElement)||!e.target.matches(s.filtersForm)||(e.preventDefault(),be(e.target,e.submitter))},h),document.addEventListener(`change`,e=>{if(!P()||!s.filtersForm)return;let t=e.target.closest?.(s.filtersForm);!t||e.target===N()||be(t)},h);let Se=(e,t)=>{if(!e)return;let n=e=>t.get(e)??``;for(let r of e.querySelectorAll(`input[name]:not([type=hidden])`))if(r.type===`checkbox`)r.checked=t.getAll(r.name).includes(r.value);else if(r.type===`radio`){let e=n(r.name)===r.value;if(r.checked===e)continue;r.checked=e,e&&r.dispatchEvent(new Event(`change`))}else r.value!==n(r.name)&&(r.value=n(r.name),r.dispatchEvent(new Event(`input`,{bubbles:!0})));for(let r of e.querySelectorAll(`select[name]`))if(!r.multiple)r.value=n(r.name);else for(let e of r.options)e.selected=t.getAll(r.name).includes(e.value);for(let t of e.querySelectorAll(`wui-select[name]`))t.value=n(t.getAttribute(`name`));for(let n of e.querySelectorAll(`wui-multiselect[name]`))n.values=t.getAll(n.getAttribute(`name`));for(let t of e.querySelectorAll(`wui-date-range`)){let e=t.getAttribute(`start-name`)||t.getAttribute(`name`),r=t.getAttribute(`end-name`);t.value={start:e?n(e):``,end:r?n(r):``}}};document.addEventListener(`click`,e=>{if(!P())return;let t=e.target.closest?.(`a[href]`);if(!t||!xe(t)||e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=new URL(t.getAttribute(`href`),window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname)return;e.preventDefault();let r=j(S(n.href));Se(t.closest(`form`),r),A(r,`push`)},h),document.addEventListener(`input`,e=>{if(!P())return;let t=N();!t||e.target!==t||(clearTimeout(b),b=setTimeout(()=>{let e=j(new URLSearchParams(T)),n=t.value.trim();n?e.set(W,n):e.delete(W),e.toString()!==T.toString()&&A(e,`replace`)},300))},h),s.urlState&&window.addEventListener(`popstate`,()=>{if(!P())return;let e=x(window.location.search),t=N();t&&(t.value=e.get(`search`)??``),A(e,`none`)},h),document.addEventListener(`wui:modal:success`,()=>{P()&&s.refreshOnSuccess&&A(T,`none`)},h),i?.addEventListener(`click`,e=>{e.target.closest(`[data-wui-table-retry]`)&&y&&A(y.query,y.mode)});let F=e=>[...g.rows].find(t=>t.dataset.rowKey===e)??null,I=e=>{if(!e?.trim())return null;let t=document.createElement(`template`);if(t.innerHTML=`<table><tbody>${e}</tbody></table>`,t.content.querySelector(`tbody[data-wui-rows]`))return null;let n=[...t.content.querySelectorAll(`table > tbody > tr[data-row-key]`)];return n.length?n.map(e=>document.importNode(e,!0)):null},L=(e,t,n)=>{let r=n?e[0]:e.find(e=>e.dataset.rowKey===t.dataset.rowKey);if(!r)return null;let i=[];for(let n of e){let e=n===r?t:F(n.dataset.rowKey);e&&(O(e),e.replaceWith(n),i.push(n))}return oe(i),window.WUI?.refresh?.(),r},R=e=>e.message||(e.kind===`forbidden`?G.actionForbidden:G.actionFailed),B=e=>{e?.isConnected&&e.getAttribute(`data-wui-save-state`)===`saving`&&z(e,null)},Ce=e=>{if(e instanceof HTMLTableRowElement)return e;let t=document.createElement(`template`);t.innerHTML=`<table><tbody>${String(e)}</tbody></table>`;let n=t.content.querySelector(`table > tbody > tr`);if(!n)throw Error("saveRow's `row` is the row as it will read: a <tr> element or its HTML.");return document.importNode(n,!0)},we=async({url:e,method:n=`POST`,body:r,key:a,row:o}={})=>{if(!e)throw Error("saveRow needs `url`: the handler that saves the row.");let s=a==null,c=s?null:F(String(a));if(!s&&!c)throw Error(`saveRow found no row with data-row-key="${a}" on this page.`);let l=re().filter(e=>!e.classList.contains(U)).length,u=o?Ce(o):c??fe(Math.max(1,l));c&&u!==c?c.replaceWith(u):c||g.insertBefore(u,g.firstChild),u!==c&&oe([u]),i&&!t.hasAttribute(`data-wui-table-error`)&&(i.hidden=!0),z(u,`saving`);let d=V(u),f=await _(e,{method:n.toUpperCase(),body:r});if(f.kind===`session`)return!1;if(f.ok){let e=I(f.html),t=e&&u.isConnected?L(e,u,s):null;return t?D(H.saved(V(t)||d)):(await A(T,`none`),B(u)),Fr(f.message,f.toastVariant||`success`),E(`wui:table:saved`,{key:t?.dataset.rowKey??(s?null:String(a)),added:s,status:f.status}),!0}let p=R(f),m=u;return c&&u!==c&&u.isConnected?(u.replaceWith(c),m=c):s&&!o&&(u.remove(),m=null,i?.childElementCount&&!g.querySelector(`:scope > tr`)&&(i.hidden=!1)),m?.isConnected&&z(m,`error`,p),f.kind!==`aborted`&&Fr(p,`danger`),D(H.notSaved(d,p)),E(`wui:table:failed`,{key:s?null:String(a),added:s,status:f.status,kind:f.kind,message:p}),!1},Te=async e=>{let t=e.dataset.url;if(!t)throw Error(`A data-wui-row-action button needs data-url: the handler the action posts to.`);let n=e.closest(`tr`),r=n?.dataset.rowKey??null,i=e.dataset.wuiRowAction||``,a=n?V(n):``;e.disabled=!0,e.setAttribute(`aria-busy`,`true`),n&&z(n,`saving`);let o=await _(t,{method:(e.dataset.method||`post`).toUpperCase()});if(e.disabled=!1,e.removeAttribute(`aria-busy`),o.kind===`session`||o.kind===`aborted`){B(n);return}if(o.ok){Fr(o.message,o.toastVariant||`success`);let e=n?.isConnected?I(o.html):null,t=e?L(e,n,!1):null;t?D(H.saved(V(t)||a)):(await A(T,`none`),B(n))}else{let e=R(o);Fr(e,`danger`),n?.isConnected&&z(n,`error`,e),D(H.notSaved(a,e))}E(`wui:table:action`,{action:i,key:r,ok:o.ok,status:o.status})};return n.addEventListener(`click`,e=>{let t=e.target.closest(`[data-wui-row-action]`);!t||!g.contains(t)||t.disabled||(e.preventDefault(),Te(t))}),ie(g),ce(g),u&&Er(n),se(g),ve(),{el:e,reload:()=>A(T,`none`),query:()=>new URLSearchParams(T),setQuery:e=>{let t=new URLSearchParams(T);for(let[n,r]of Object.entries(e??{})){t.delete(n);for(let e of Array.isArray(r)?r:[r])e!=null&&e!==``&&t.append(n,String(e))}return(!e||!(`page`in e))&&t.delete(`page`),A(t,`push`)},saveRow:we,setActiveRow:t=>{e.dataset.activeRowKey=t==null?``:String(t),ae([...g.querySelectorAll(`:scope > tr`)])},selection:{keys:()=>[...d],count:()=>f?v.total:d.size,allMatching:()=>f,selectAllMatching:()=>{f=!0;for(let e of g.querySelectorAll(`:scope > tr`)){let t=e.querySelector(`.${U} .wui-check`);t&&(t.checked=!0),e.dataset.rowKey&&d.add(e.dataset.rowKey)}M()},clear:()=>{f=!1,d.clear();for(let e of g.querySelectorAll(`:scope > tr > .${U} .wui-check`))e.checked=!1;M()}}}}var K=`wuiConfirm`,zr=Object.freeze([`danger`]),Br=Object.freeze([`success`,`info`,`warning`,`danger`]),Vr=`wui.flash`,q=Object.freeze({confirmTitle:`Are you sure?`,confirmLabel:`Confirm`,cancelLabel:`Cancel`,failed:`That did not work. Try again.`,forbidden:`You do not have permission to do that.`,network:`Could not reach the server. Check your connection and try again.`}),Hr=new WeakSet,Ur=new WeakSet,J=null,Wr=null,Gr=!1,Kr=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},qr=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},Jr=()=>{let e=window.bootstrap?.Modal;if(!e)throw Error(`data-wui-confirm: Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);return e};function Yr(){let e=document.getElementById(K);return e||(e=document.createElement(`div`),e.id=K,e.className=`modal fade wui-modal-shell`,e.tabIndex=-1,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.style.setProperty(`--wui-modal-max-width`,`${C.md}px`),e.innerHTML=`<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1" data-autofocus></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${Kr(q.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Xr(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!zr.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);Zr({title:e.getAttribute(`data-wui-confirm-title`),message:e.getAttribute(`data-wui-confirm`),label:e.getAttribute(`data-wui-confirm-label`),danger:n===`danger`},t)}function Zr({title:e,message:t,label:n,danger:r},i){let a=Jr(),o=Yr(),s=o.querySelector(`.wui-confirm-title`),c=o.querySelector(`[data-app-confirm]`);if(!s||!c)throw Error(`#${K} is not a confirm dialog with a confirm button. Render <app-confirm-dialog id="${K}"> without confirm-href, or leave the dialog to the library.`);let l=o.querySelector(`.wui-confirm-msg`);l||(l=document.createElement(`p`),l.className=`wui-confirm-msg`,s.after(l)),s.textContent=e||q.confirmTitle,l.textContent=t,c.textContent=n||q.confirmLabel,c.classList.toggle(`btn-danger`,r),c.classList.toggle(`btn-primary`,!r),o.querySelector(`wui-status-icon`)?.setAttribute(`tone`,r?`delete`:`info`),o.setAttribute(`aria-label`,s.textContent),Wr=i,Gr=!1,a.getOrCreateInstance(o).show()}var Qr=(e,t)=>{J=e;try{t()}finally{J=null}};function $r(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!zr.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);fi(e.ownerDocument),Zr({title:t,message:n,label:r,danger:i===`danger`},()=>Qr(e,a))}var ei=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function ti(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===J||ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Xr(t,()=>Qr(t,()=>t.click())))}function ni(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===J||e.submitter&&e.submitter===J)return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Xr(t,()=>Qr(t,()=>t.requestSubmit(n)))}function ri(e){let t=e.target.closest?.(`#${K} [data-app-confirm]`);!t||t.disabled||!Wr||(Gr=!0,Jr().getOrCreateInstance(t.closest(`#${K}`)).hide())}function ii(e){if(e.target.id!==`wuiConfirm`)return;let t=Gr?Wr:null;Wr=null,Gr=!1,t?.()}var ai=(e,t)=>{e&&window.sessionStorage.setItem(Vr,JSON.stringify({message:e,variant:t}))},oi=e=>e===`forbidden`?q.forbidden:e===`network`?q.network:q.failed;function si(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&Lr(e)?.reload()}async function ci(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);let n=e.getAttribute(`data-wui-post-reload`);if(n!==null&&n!==`page`)throw TypeError(`data-wui-post-reload="${n}" is not supported. Use page, or leave it off to reload the server tables.`);e.disabled=!0,e.setAttribute(`aria-busy`,`true`);let r=await _(t,{method:`POST`});if(r.kind===`session`||r.kind===`aborted`)return;let i=r.toastVariant||`success`;if(r.ok&&(r.redirect||n===`page`)){ai(r.message,i),r.redirect?window.location.assign(r.redirect):window.location.reload();return}if(e.disabled=!1,e.removeAttribute(`aria-busy`),r.ok){qr(r.message,i),si();return}qr(r.message||oi(r.kind),`danger`)}function li(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(ei(t)||t.getAttribute(`aria-busy`)===`true`)&&ci(t).catch(e=>console.error(e)))}function ui(){let e=window.sessionStorage.getItem(Vr);if(!e)return;window.sessionStorage.removeItem(Vr);let{message:t,variant:n}=JSON.parse(e);qr(t,n)}function di(e){let t=e.querySelectorAll?[...e.querySelectorAll(`[data-wui-flash]`)]:[];e instanceof Element&&e.matches(`[data-wui-flash]`)&&t.unshift(e);for(let e of t){let t=e.getAttribute(`data-wui-flash-variant`)||`success`;if(!Br.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${Br.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),qr(n,t)}}function fi(e){Ur.has(e)||(Ur.add(e),e.addEventListener(`click`,ri),e.addEventListener(`hidden.bs.modal`,ii))}function pi(e=document){let t=e.ownerDocument||e;Hr.has(t)||(Hr.add(t),t.addEventListener(`click`,ti,!0),t.addEventListener(`submit`,ni,!0),fi(t),t.addEventListener(`click`,li),ui()),di(e)}var mi=31536e3,Y=new WeakMap,hi=e=>e>99?`99+`:String(e);function gi(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${mi}; SameSite=Lax`}var _i=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},vi=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function yi(e,t){let n=e.querySelector(`.wui-bell-trigger`),r=e.querySelector(`.wui-bell-count`),i=e.querySelector(`[data-wui-bell-live]`),a=e.querySelector(`[data-wui-bell-list]`),o=e.querySelector(`.wui-bell-menu`),{src:s,readAction:c}=e.dataset,l=e.dataset.label||`Notifications`,u=e.dataset.emptyText||`You are all caught up.`,d=Number(e.dataset.pollSeconds??60),f=ee(),p=Number(e.dataset.unread)||0,m=(t,a=!0)=>{let o=Math.max(0,Number(t)||0),s=o!==p;p=o,e.dataset.unread=String(o),r&&(r.textContent=hi(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${hi(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${hi(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=vi(`wui-bell-state`,`Could not load notifications. `),t=document.createElement(`button`);t.type=`button`,t.className=`btn btn-link btn-sm`,t.dataset.wuiBellRetry=``,t.textContent=`Retry`,e.append(t),a.replaceChildren(e)},v=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren(vi(`wui-bell-state`,`Loading…`)));let n=await f.run(s);if(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)return;if(a.removeAttribute(`aria-busy`),!n.ok){t&&g();return}let r=_i(n.html),i=r.querySelector(`[data-wui-unread]`),o=i?Number(i.getAttribute(`data-wui-unread`)):p;m(o),(t||h())&&(r.querySelector(`.wui-bell-item`)?a.replaceChildren(r):a.replaceChildren(vi(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>v(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){v(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await _(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),v(!0))});let y=null,b=()=>{d>0&&y===null&&(y=setInterval(()=>v(h()),d*1e3))},x=()=>{y!==null&&clearInterval(y),y=null},S=()=>{document.hidden?x():(v(h()),b())};return d>0&&(document.addEventListener(`visibilitychange`,S),document.hidden||b()),t.push(()=>{x(),f.abort(),document.removeEventListener(`visibilitychange`,S)}),{setUnread:e=>m(e),refresh:()=>v(h())}}var bi=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),xi=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Si(e,t){let n=e.querySelector(`input.search-input`),r=e.querySelector(`.wui-topsearch-results`),i=e.querySelector(`.wui-topsearch-open`),a=e.querySelector(`[data-wui-topsearch-live]`),{src:o,param:s=`q`,resultsHref:c}=e.dataset,l=Number(e.dataset.minChars??2),u=Number(e.dataset.debounceMs??250),d=ee(),f=null,p=-1,m=()=>[...r.querySelectorAll(`.wui-topsearch-hit`)],h=e=>{let t=m();p=t.length===0?-1:(e+t.length)%t.length,t.forEach((e,t)=>{let n=t===p;e.classList.toggle(`is-active`,n),e.setAttribute(`aria-selected`,n?`true`:`false`)}),p>=0?(n.setAttribute(`aria-activedescendant`,t[p].id),t[p].scrollIntoView?.({block:`nearest`})):n.removeAttribute(`aria-activedescendant`)},g=()=>{r.hidden=!0,n.setAttribute(`aria-expanded`,`false`),n.removeAttribute(`aria-activedescendant`),p=-1},_=()=>{r.hidden=!1,n.setAttribute(`aria-expanded`,`true`)},v=t=>{e.classList.toggle(`is-open`,t),i?.setAttribute(`aria-expanded`,t?`true`:`false`)},y=t=>{let n=new CustomEvent(`wui:search:select`,{bubbles:!0,cancelable:!0,detail:{href:t}});e.dispatchEvent(n)&&window.location.assign(t)},b=async t=>{e.classList.add(`is-loading`);let n=await d.run(xi(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=_i(n.html),t=e.querySelector(`[data-wui-count]`);r.replaceChildren(e),m().forEach((e,t)=>{e.id=`${r.id}-opt-${t}`});let i=t?Number(t.getAttribute(`data-wui-count`)):m().length;a&&(a.textContent=i===0?`No results`:`${i} ${i===1?`result`:`results`}`)}else r.replaceChildren(vi(`wui-topsearch-empty`,`Search is unavailable right now.`));p=-1,_()}};n.addEventListener(`input`,()=>{clearTimeout(f);let t=n.value.trim();if(t.length<l){d.abort(),e.classList.remove(`is-loading`),r.replaceChildren(),g();return}f=setTimeout(()=>b(t),u)}),n.addEventListener(`keydown`,t=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(r.hidden||m().length===0)return;t.preventDefault(),h(p+(t.key===`ArrowDown`?1:-1))}else if(t.key===`Enter`){let e=m();!r.hidden&&p>=0&&e[p]?(t.preventDefault(),y(e[p].getAttribute(`href`))):c&&n.value.trim()!==``&&(t.preventDefault(),y(xi(c,s,n.value.trim())))}else t.key===`Escape`&&(r.hidden?e.classList.contains(`is-open`)&&(t.preventDefault(),t.stopPropagation(),v(!1),i?.focus()):(t.preventDefault(),t.stopPropagation(),g()))}),r.addEventListener(`click`,e=>{let t=e.target.closest(`.wui-topsearch-hit`);!t||e.ctrlKey||e.metaKey||e.shiftKey||e.button===1||(e.preventDefault(),y(t.getAttribute(`href`)))}),i?.addEventListener(`click`,()=>{let t=!e.classList.contains(`is-open`);v(t),t&&n.focus()});let x=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||bi(e.target)||(e.preventDefault(),v(!0),n.focus())},S=t=>{e.contains(t.target)||(g(),e.classList.contains(`is-open`)&&v(!1))};document.addEventListener(`keydown`,x),document.addEventListener(`pointerdown`,S),t.push(()=>{clearTimeout(f),d.abort(),document.removeEventListener(`keydown`,x),document.removeEventListener(`pointerdown`,S)})}function Ci(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>gi(n,!!e.detail?.collapsed)),e.addEventListener(`click`,t=>{t.target.closest(`[data-wui-tabbar-more]`)&&e.querySelector(`[data-app-shell-menu]`)?.click()});let r=e.querySelector(`[data-wui-bell]`),i=r?yi(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Si(a,t);let o={el:e,setUnread(e){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);i.setUnread(e)},refreshNotifications(){if(!i)throw Error(`WUI.shell: this <app-shell> has no <app-shell-notifications>.`);return i.refresh()},get collapsed(){return e.classList.contains(`collapsed`)},set collapsed(t){if(!!t===e.classList.contains(`collapsed`))return;let n=e.querySelector(`[data-app-shell-collapse]`);n?n.click():e.classList.toggle(`collapsed`,!!t)}};Y.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Y.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function wi(e=document){let t=[];e instanceof Element&&e.matches(`[data-app-shell]`)&&t.push(e),t.push(...e.querySelectorAll(`[data-app-shell]`));for(let e of t)e.dataset.wuiPartsWired||(e.dataset.wuiPartsWired=`1`,Ci(e))}function Ti(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Y.has(t)||wi(t),Y.get(t)??null):null}var X=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),Z=`form[data-wui-unsaved]`,Ei=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Di=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Oi=new Set([`submit`,`button`,`reset`,`image`]),Q=new WeakMap,ki=new WeakSet,Ai=e=>`${e.name}:${e.size}:${e.lastModified}`;function $(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Oi.has(n.type)||(n.type===`checkbox`||n.type===`radio`?t.push([n.name,n.value,n.checked]):n.type===`file`?t.push([n.name,[...n.files||[]].map(Ai)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}var ji=e=>({saved:e.querySelector(Ei)?null:$(e),engaged:!1,discarded:!1});function Mi(e){let t=Q.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&$(e)!==t.saved}var Ni=(e,t)=>[...e.querySelectorAll(Z)].filter(e=>e!==t&&Mi(e)),Pi=()=>!!window.bootstrap?.Modal;function Fi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||X.message;$r(e,{title:X.title,message:r,label:X.leaveLabel,tone:`danger`},()=>{for(let e of t)Q.get(e).discarded=!0;n()})}function Ii(e){if(e.matches(Di))return!1;let t=e.getAttribute(`target`);if(t&&t.toLowerCase()!==`_self`)return!1;let n=new URL(e.getAttribute(`href`),window.location.href);if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;let r=window.location;return!(n.hash&&n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search)}function Li(e,t){if((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||`get`).toLowerCase()===`dialog`)return!1;let n=t?.getAttribute(`formtarget`)||e.getAttribute(`target`);return!n||n.toLowerCase()===`_self`}function Ri(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target.closest?.(`a[href]`);if(!t||!Ii(t))return;let n=Ni(t.ownerDocument,null);!n.length||!Pi()||(e.preventDefault(),Fi(t,n,()=>t.click()))}function zi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!Li(t,e.submitter))return;let n=Ni(t.ownerDocument,t);if(n.length&&Pi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Fi(t,n,()=>t.requestSubmit(r));return}let r=Q.get(t);r&&(r.saved=$(t),r.discarded=!1)}function Bi(e){Ni(document,null).length&&(e.preventDefault(),e.returnValue=``)}function Vi(e){let t=e.target.closest?.(Z),n=t&&Q.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=$(t)),n.engaged=!0)}function Hi(e){let t=e.target.closest?.(Z),n=t&&Q.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function Ui(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(Z))Gi(e)}function Wi(e=document){let t=e.ownerDocument||e;if(!ki.has(t)){ki.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,Vi,!0);for(let e of[`input`,`change`])t.addEventListener(e,Hi,!0);t.addEventListener(`click`,Ri),t.addEventListener(`submit`,zi),t.addEventListener(`wui:modal:success`,Ui),t.defaultView.addEventListener(`beforeunload`,Bi)}let n=[...e.querySelectorAll?.(Z)||[]];e.matches?.(Z)&&n.unshift(e);for(let e of n)Q.has(e)||Q.set(e,ji(e))}function Gi(e){if(!(e instanceof HTMLFormElement)||!e.matches(Z))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);Q.set(e,{saved:$(e),engaged:!1,discarded:!1})}function Ki(){e(`wui-select`,L),e(`wui-country-select`,R),e(`wui-phone`,Ft),e(`wui-datepicker`,Qe),e(`wui-date-range`,$e),e(`wui-dock`,et),e(`wui-image-crop`,rt),e(`wui-kanban`,w),e(`wui-inline-edit`,at),e(`wui-consent-banner`,F),e(`wui-slider`,on),e(`wui-sortable`,sn),e(`wui-timepicker`,ln),e(`wui-tour`,dn),e(`wui-tree`,fn),e(`wui-autocomplete`,A),e(`wui-command-palette`,N),e(`wui-context-menu`,I),e(`wui-multiselect`,xt),e(`wui-taginput`,cn),e(`wui-otp`,Nt),e(`wui-status-icon`,k),e(`wui-shortcuts`,rn),e(`wui-record-pager`,Zt),e(`wui-carousel`,j),e(`wui-code-block`,_e),e(`wui-data-table`,Ke),e(`wui-drawer`,tt),e(`wui-hover-card`,nt),e(`wui-lightbox`,lt),e(`wui-menubar`,bt),e(`wui-navigation-menu`,St),e(`wui-notification-center`,jt),e(`wui-onboarding-checklist`,Mt),e(`wui-overflow`,Pt),e(`wui-rating`,It),e(`wui-relative-time`,en),e(`wui-resizable`,tn),e(`wui-rolling-number`,nn),e(`wui-show-more`,an),e(`wui-truncate`,pn),e(`wui-whats-new`,mn),e(`wui-mention-input`,ft),e(`wui-comment-thread`,P),e(`wui-wizard-step`,_n),e(`wui-wizard`,gn)}Ki();export{Tn as AVATAR_ACCEPT,kn as AVATAR_MAX_SIZE_MB,sr as AVATAR_OUTPUT_SIZE,On as AVATAR_OUTPUT_TYPE,Un as AVATAR_PREVIEW_SIZES,Hn as AVATAR_TEXT,Ve as COLUMN_MAX_WIDTH,We as COLUMN_MIN_WIDTH,Se as COMMENT_INTENTS,be as COMMENT_REACTIONS,xe as COMMENT_TEXT,K as CONFIRM_DIALOG_ID,zr as CONFIRM_TONES,ye as COPY_FEEDBACK_MS,S as CSRF_META_NAME,m as CURRENCIES,H as DATA_TABLE_TEXT,l as DATE_PATTERNS,y as DEFAULT_CSRF_HEADER,An as DEFAULT_IMAGE_ACCEPT,In as DEFAULT_MAX_SIZE_MB,Ln as DEFAULT_PASSWORD_RULES,xn as DEFAULT_REQUIREMENTS_TITLE,ur as DEFAULT_THEME_EFFECT,ir as DEFAULT_THEME_STORAGE_KEY,f as DURATION_UNITS,o as EMPTY_VALUE,Vr as FLASH_STORAGE_KEY,Br as FLASH_VARIANTS,t as FORMAT_STYLES,b as HTTP_KINDS,ct as INLINE_EDIT_SAVED_MS,ot as INLINE_EDIT_TEXT,st as INLINE_EDIT_TYPES,u as IST_TIME_ZONE,ue as KANBAN_DRAG_THRESHOLD_PX,oe as KANBAN_LONG_PRESS_MS,O as KANBAN_PHONE_QUERY,re as KANBAN_STORAGE_PREFIX,te as KANBAN_SUMMARY_FORMATS,se as KANBAN_TEXT,le as KANBAN_TONES,Yt as LIST_KEYS,Sn as MASK_INPUT_TYPES,Nn as MASK_NAMES,ut as MENTION_ID_PATTERN,vt as MENTION_MAX_QUERY,mt as MENTION_MAX_RESULTS,gt as MENTION_TEXT,p as MONEY_UNITS,At as NOTIFICATION_COUNT_CAP,Et as NOTIFICATION_TEXT,Ae as PIN_AT_VAR,He as PIN_SIDES,Ge as RESIZE_STEP,Me as RESIZE_STEP_LARGE,ze as ROW_HEIGHTS,qe as ROW_MOVE_LIMIT,Ne as ROW_MOVE_MS,Pe as ROW_SAVE_ATTR,Ue as ROW_SAVE_ERROR_CLASS,Be as ROW_SAVE_STATES,hr as SCROLL_EDGE_SELECTOR,_r as SELECT_ALL_LABEL,U as SELECT_CELL_CLASS,Wt as SELECT_KEY,vr as SELECT_ROW_LABEL,q as SERVER_ACTION_TEXT,qt as SHORTCUTS_OFF_ATTRIBUTE,Vt as SHORTCUT_EVENT,Lt as SHORTCUT_SCOPE_ATTRIBUTE,Gt as SHORTCUT_TEXT,me as STATUS_TONES,cr as THEME_BOOT_SCRIPT_BODY,$n as THEME_CHANGE_EVENT,Kn as THEME_EFFECTS,ar as THEME_EFFECT_DURATION,lr as THEME_LIVE_NAME,Jn as THEME_MODES,nr as THEME_SWITCHING_CLASS,X as UNSAVED_TEXT,Ie as VIRTUAL_OVERSCAN,hn as WHATS_NEW_READ_EVENT,v as WUI_HEADERS,A as WuiAutocomplete,j as WuiCarousel,_e as WuiCodeBlock,N as WuiCommandPalette,P as WuiCommentThread,F as WuiConsentBanner,I as WuiContextMenu,R as WuiCountrySelect,Ke as WuiDataTable,Qe as WuiDatePicker,$e as WuiDateRange,et as WuiDock,tt as WuiDrawer,nt as WuiHoverCard,rt as WuiImageCrop,at as WuiInlineEdit,w as WuiKanban,lt as WuiLightbox,ft as WuiMentionInput,bt as WuiMenubar,xt as WuiMultiSelect,St as WuiNavigationMenu,jt as WuiNotificationCenter,Mt as WuiOnboardingChecklist,Nt as WuiOtp,Pt as WuiOverflow,Ft as WuiPhone,It as WuiRating,Zt as WuiRecordPager,en as WuiRelativeTime,tn as WuiResizable,nn as WuiRollingNumber,L as WuiSelect,rn as WuiShortcuts,an as WuiShowMore,on as WuiSlider,sn as WuiSortable,k as WuiStatusIcon,cn as WuiTagInput,ln as WuiTimePicker,dn as WuiTour,fn as WuiTree,pn as WuiTruncate,mn as WuiWhatsNew,gn as WuiWizard,_n as WuiWizardStep,gr as acceptLabel,Tr as addRowSelectCells,Er as addSelectColumn,dr as applyTheme,Jt as ariaKeyShortcuts,tr as attachInputMask,qn as attachScrollEdges,kr as attachShiftRange,Wn as avatarCropOptions,Fn as avatarUnreadableMessage,pr as buildPasswordRules,Fe as clampColumnWidth,g as classifyStatus,$r as confirmAction,ve as copyTextToClipboard,un as createLocalSeenStore,ee as createRequestQueue,br as createSelectHeaderCell,xr as createSelectRowCell,Sr as createSelectSpacerCell,Ki as defineWeborityElements,Rn as evaluatePassword,n as formatCompact,s as formatCurrency,h as formatDate,r as formatDuration,yn as formatMasked,i as formatNumber,d as formatPercent,Qt as formatRelativeTime,c as formatValue,Lr as getServerTable,Ti as getShell,he as glyphSvg,ke as groupCount,Je as groupItems,Ot as groupNotificationsByDay,Ze as identityCell,Rt as inShortcutScope,er as initInputMasks,fe as initRemoteModals,mr as initScrollEdges,pi as initServerActions,Ir as initServerTables,wi as initShellParts,Wi as initUnsavedChanges,it as inlineEditText,vn as isHeicFile,bn as isImageFile,Bn as isImageOnlyAccept,jn as isMaskPattern,En as isPdfFile,Ht as isTypingTarget,ie as kanbanCardLabel,de as kanbanOverflow,T as kanbanStorageKey,E as kanbanSummaryFormat,ce as kanbanVisibleLimit,pe as loadRemoteModal,Mn as maskedPostValue,M as matchSegments,zn as matchesAccept,je as measureRows,ht as mentionLabel,_t as mentionTextFromValue,dt as mentionValueFromText,pt as mentionedIds,Xt as moveFocus,Yn as nextTheme,Tt as notificationCountText,Ct as notificationDayHeading,Dt as notificationTime,kt as notificationTriggerLabel,wt as notificationUnreadAnnouncement,yt as parseMentionValue,Cn as passwordSatisfies,Xe as pinAtValue,De as pinClasses,B as pinOffsetVar,Ye as planPins,Oe as playRowMoves,Pn as postedMasked,wn as rawMasked,Ce as readColumnWidths,x as readCsrf,ae as readKanbanCollapsed,Xn as readStoredTheme,$t as relativeTimeTitle,Gi as resetUnsavedChanges,Dn as resolveMask,or as resolveTheme,V as rowLabel,Ee as rowOrderChanged,zt as runShortcut,Re as saveOutcomeText,z as setRowSaveState,Le as settledRows,Bt as shortcutKey,Kt as shortcutName,Ut as shortcutsOff,rr as storeTheme,ne as sumKanbanValues,Dr as syncSelectAll,Qn as themeBootScript,Zn as themeKeyframes,a as toInstant,Gn as transitionTheme,Vn as validateFile,we as virtualRange,fr as watchSystemTheme,ge as withTrustedLabel,Te as writeColumnWidths,D as writeKanbanCollapsed,_ as wuiFetch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"description": "Webority framework-agnostic UI custom elements (<wui-*>) — the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-BlsR4tqa.js";import{t}from"./tourOpenMark-nPeAJFSo.js";var n={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-surface":`#FFFFFF`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay-lg":`0 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-fixed":`1030`},r=e=>`var(${e}, ${n[e]})`,i=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${r(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${r(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host(:not([open])) { pointer-events: none; } :host([tour-open]) { visibility: hidden; } *, *::before, *::after { box-sizing: border-box; } [hidden] { display: none !important; } .wui-consent-banner-panel { padding: 20px; background: ${r(`--color-surface`)}; border: 1px solid ${r(`--color-border`)}; border-radius: ${r(`--wui-radius-lg`)}; box-shadow: ${r(`--wui-shadow-overlay-lg`)}; text-align: start; pointer-events: auto; } .wui-consent-banner-heading { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: ${r(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${r(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${r(`--color-primary-ink`)}; font-weight: 500; } .wui-consent-banner-settings { display: grid; gap: 12px; max-height: 50vh; margin: 0 0 16px; padding: 12px 0; overflow-y: auto; border-top: 1px solid ${r(`--color-border`)}; border-bottom: 1px solid ${r(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${r(`--color-text-muted`)}; } .form-check { display: flex; align-items: center; gap: 0.5em; margin: 0; font-size: 14px; } .form-check-input { appearance: none; flex: none; width: 2em; height: 1em; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2em; background: ${r(`--color-surface`)} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat; cursor: pointer; transition: background-position 0.15s ease-in-out; } .form-check-input:checked { border-color: ${r(`--color-primary`)}; background: ${r(`--color-primary`)} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat; } .form-check-input:disabled { opacity: 0.5; cursor: default; } .form-check-input:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .form-check-label { cursor: pointer; } .wui-consent-banner-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .btn { display: inline-block; padding: 0.25rem 0.5rem; border: 1px solid transparent; border-radius: 0.375rem; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap; cursor: pointer; } .btn:focus-visible { outline: 2px solid ${r(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${r(`--color-primary`)}; border-color: ${r(`--color-primary`)}; color: ${r(`--color-primary-text`)}; } .btn-primary:hover { background: ${r(`--color-primary-hover`)}; border-color: ${r(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${r(`--color-text-muted`)}; color: ${r(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${r(`--color-bg-muted`)}; color: ${r(`--color-text`)}; } .btn-link { font-weight: 400; color: ${r(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${r(`--color-primary-hover`)}; } .wui-consent-banner-settings-toggle { margin-inline-end: auto; padding-inline: 0; } .wui-consent-banner-save { flex: 1 1 100%; } @media (max-width: 480px) { :host, :host([position="bottom-right"]) { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; } } `,a=`wui-consent-save`,o=`[data-consent-settings]`,s=`tour-open`,c={heading:`Cookies on this site`,description:`We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.`,policyLabel:`Cookie policy`,essentialLabel:`Essential cookies`,essentialDescription:`Required for the site to work and stay secure. Always on.`,analyticsLabel:`Analytics cookies`,analyticsDescription:`Help us understand how visitors use the site.`,functionalLabel:`Functional cookies`,functionalDescription:`Remember choices you make, such as your preferences.`,marketingLabel:`Marketing cookies`,marketingDescription:`Measure how well our campaigns work.`,settingsLabel:`Cookie settings`,rejectLabel:`Reject all`,acceptLabel:`Accept all`,saveLabel:`Save preferences`},l=[`analytics`,`functional`,`marketing`],u={analytics:{label:c.analyticsLabel,description:`analyticsDescription`},functional:{label:c.functionalLabel,description:`functionalDescription`},marketing:{label:c.marketingLabel,description:`marketingDescription`}},d=new Set;function f(e){d.has(e)||(d.add(e),console.warn(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${l.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var p=0,m=class extends e{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),p+=1,this._uid=`wui-consent-${p}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(o)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null}get position(){return this.getAttribute(`position`)===`bottom-right`?`bottom-right`:`bottom-left`}set position(e){this.setAttribute(`position`,String(e??`bottom-left`))}get standalone(){return this.hasAttribute(`standalone`)}set standalone(e){this.toggleAttribute(`standalone`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||c.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||c.description}set description(e){this.setAttribute(`description`,String(e??``))}get policyHref(){return this.getAttribute(`policy-href`)||``}set policyHref(e){this.setAttribute(`policy-href`,String(e??``))}get policyLabel(){return this.getAttribute(`policy-label`)||c.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||c.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||c.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||c.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...l];let t=e.split(/\s+/).filter(Boolean);for(let e of t)l.includes(e)||f(e);let n=l.filter(e=>t.includes(e));return n.length?n:[...l]}set categories(e){e==null?this.removeAttribute(`categories`):this.setAttribute(`categories`,Array.isArray(e)?e.join(` `):String(e))}get preferences(){let e=this.categories;return Object.fromEntries(l.map(t=>[t,e.includes(t)&&this._preferences[t]]))}set preferences(e){this._preferences={analytics:e?.analytics===!0,functional:e?.functional===!0,marketing:e?.marketing===!0},this._applyPreferences()}get isOpen(){return this.hasAttribute(`open`)}connectedCallback(){this._rendered||this.render(),document.addEventListener(`click`,this._onDocumentClick),this._syncTour(),this._tourWatch??=new MutationObserver(()=>this._syncTour()),this._tourWatch.observe(document.documentElement,{attributes:!0,attributeFilter:[t]})}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect()}_syncTour(){this.toggleAttribute(s,document.documentElement.hasAttribute(t))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,n=this.policyHref?` <a class="wui-consent-banner-policy" href="${_(this.policyHref)}">${g(this.policyLabel)}</a>`:``,r=this._root();r.innerHTML=`${r===this?``:`<style>${i}</style>`} <div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden> <h2 class="wui-consent-banner-heading" id="${t}-heading">${g(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${g(this.description)}${n}</p> <div class="wui-consent-banner-settings" hidden> ${h(t,`essential`,c.essentialLabel,c.essentialDescription,!0)} ${this.categories.map(e=>h(t,e,u[e].label,this[u[e].description],!1)).join(` `)} </div> <div class="wui-consent-banner-actions"> <button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${c.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${c.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${c.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${c.saveLabel}</button> </div> </div>`,this._rendered=!0,this._wire(),this._applyPreferences(),this._showSettings(this._settings),e&&(this._panel().hidden=!1)}open({settings:e=!1,focus:t=!1}={}){this._rendered||this.render(),this._applyPreferences(),this._showSettings(e),this._panel().hidden=!1,this.setAttribute(`open`,``),t&&(e?this._root().querySelector(`.wui-consent-banner-category input:not([disabled])`):this._root().querySelector(`.wui-consent-banner-accept`))?.focus()}close(){let e=this._panel();e&&(e.hidden=!0),this.removeAttribute(`open`),this._showSettings(!1)}_root(){return this.shadowRoot?this.shadowRoot:this.standalone?this.attachShadow({mode:`open`}):this}_panel(){return this._root().querySelector(`.wui-consent-banner-panel`)}_wire(){let e=this._root();e.querySelector(`.wui-consent-banner-accept`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!0))),e.querySelector(`.wui-consent-banner-reject`)?.addEventListener(`click`,()=>this._save(this._choiceForShown(!1))),e.querySelector(`.wui-consent-banner-save`)?.addEventListener(`click`,()=>this._save(this._switchValues())),e.querySelector(`.wui-consent-banner-settings-toggle`)?.addEventListener(`click`,()=>this._showSettings(!this._settings))}_save(e){this._preferences={...e},this.dispatchEvent(new CustomEvent(a,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(l.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of l)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of l){let t=this._root().querySelector(`input[data-category="${e}"]`);t&&(t.checked=this._preferences[e])}}_showSettings(e){this._settings=e;let t=this._root(),n=t.querySelector(`.wui-consent-banner-settings`);if(!n)return;n.hidden=!e,t.querySelector(`.wui-consent-banner-settings-toggle`)?.setAttribute(`aria-expanded`,e?`true`:`false`);let r=t.querySelector(`.wui-consent-banner-save`);r&&(r.hidden=!e);for(let n of[`.wui-consent-banner-reject`,`.wui-consent-banner-accept`]){let r=t.querySelector(n);r&&(r.hidden=e)}}};function h(e,t,n,r,i){let a=`${e}-${t}`;return`<div class="wui-consent-banner-category"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i?` checked disabled`:``} /> <label class="form-check-label" for="${a}">${g(n)}</label> </div> <p class="wui-consent-banner-category-description">${g(r)}</p> </div>`}var g=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),_=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);export{m as t};
|