@webority/ui-elements 0.87.0 → 0.87.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WuiConsentBanner-D3rxcVUX.js +1 -0
- package/dist/elements/consent-banner.js +1 -1
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements/autocomplete.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +1 -1
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +1 -1
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/image-crop.global.js +1 -1
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +1 -1
- package/dist/ui-elements/menubar.global.js +1 -1
- package/dist/ui-elements/multiselect.global.js +1 -1
- package/dist/ui-elements/phone.global.js +1 -1
- package/dist/ui-elements/resizable.global.js +1 -1
- package/dist/ui-elements/slider.global.js +1 -1
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +1 -1
- package/dist/ui-elements/taginput.global.js +1 -1
- package/dist/ui-elements/timepicker.global.js +1 -1
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +1 -1
- package/dist/ui-elements.js +1 -1
- package/package.json +1 -1
- package/dist/WuiConsentBanner-DMWHSFsl.js +0 -1
package/dist/ui-elements.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./elementBase-DV9IZZCu.js";import{a as t,c as n,d as r,f as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./shortcutKeys-BQiDpsTJ.js";import{n as h,t as g}from"./filterPopover-QL0Pa875.js";import{t as _}from"./devWarn-DXdRWZs3.js";import{a as v,c as y,d as b,f as x,h as S,i as ee,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le}from"./formatters-BAE__8ye.js";import{A as ue,C as de,D as fe,E as pe,M as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,j as De,k as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,w as ze,x as Be,y as Ve}from"./dataTable-Cd_IJQcs.js";import{t as He}from"./iconGlyphs.g-BNrdQ7It.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as C,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,o as w,p as rt,r as it,s as at,t as ot,u as st,v as ct,w as lt,x as ut,y as dt}from"./wuiHttp-DJ1oIvtB.js";import{_ as ft,a as pt,b as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,o as wt,p as Tt,r as Et,s as Dt,t as Ot,u as kt,v as At,y as jt}from"./kanban-DRF61Mib.js";import{n as Mt,t as Nt}from"./statusIcons-Dt2ZVJyk.js";import{o as Pt}from"./optionLabel-Bul5mgul.js";import{t as Ft}from"./WuiAutocomplete-DFeJuO7U.js";import{t as It}from"./WuiCarousel-BbO8AoM6.js";import{t as Lt}from"./WuiCodeBlock-DsSayJ8U.js";import{n as Rt,t as zt}from"./copyText-DM5HhXjf.js";import{t as Bt}from"./textMatch-wdY7XLIc.js";import{t as Vt}from"./WuiCommandPalette-CBg6i4WJ.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-CfOeJvxg.js";import{t as Kt}from"./WuiConsentBanner-DMWHSFsl.js";import{t as qt}from"./WuiContextMenu-BrHXfA-X.js";import{t as Jt}from"./WuiSelect-BV-tKr69.js";import{t as Yt}from"./WuiCountrySelect-B9dBPME5.js";import{t as Xt}from"./WuiDataTable-YzxEQGIO.js";import{t as Zt}from"./WuiDatePicker-BQn1d_RD.js";import{t as Qt}from"./WuiDateRange-la8pKreY.js";import{t as $t}from"./WuiDock-Bd2ijOaJ.js";import{t as en}from"./WuiDrawer-DnHsXG4q.js";import{t as tn}from"./WuiHoverCard-BjPDXlhV.js";import{t as nn}from"./WuiImageCrop-CvXh791S.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-CpyX_apm.js";import{t as ln}from"./WuiLightbox-B4dopmSI.js";import{t as un}from"./WuiMarkdown-C2flvSIt.js";import{a as dn,c as fn,i as pn,l as mn,n as hn,o as gn,r as _n,s as vn,t as yn,u as bn}from"./WuiMentionInput-ix9Wljhc.js";import{t as xn}from"./WuiMenubar-BC48Kv8o.js";import{t as Sn}from"./WuiMultiSelect-D9PgSeYk.js";import{t as Cn}from"./WuiNavigationMenu-CGqTADvr.js";import{a as wn,c as Tn,i as En,n as Dn,o as On,r as kn,s as An,t as jn}from"./notificationDays-BUoh4mG6.js";import{t as Mn}from"./WuiNotificationCenter-DDSPUlD7.js";import{t as Nn}from"./WuiOnboardingChecklist-DXUETu1h.js";import{t as Pn}from"./WuiOtp-DfhXc829.js";import{t as Fn}from"./WuiOverflow-blOepYs6.js";import{t as In}from"./WuiPhone-CUwTgWQV.js";import{t as Ln}from"./WuiRating-DhhqYj5Z.js";import{t as Rn}from"./WuiRecordPager-BFqaMK8g.js";import{n as zn,r as Bn,t as Vn}from"./WuiRelativeTime-D6hPHWXX.js";import{t as Hn}from"./WuiResizable-CtwCQUWR.js";import{t as Un}from"./WuiRollingNumber-C85kOshZ.js";import{t as Wn}from"./WuiShortcuts-Xa7eq9-J.js";import{t as Gn}from"./WuiShowMore-D3VHRZJg.js";import{t as Kn}from"./WuiSlider-IOqadOtK.js";import{t as qn}from"./WuiSortable-CugtxycN.js";import{t as Jn}from"./WuiTagInput-Dh7bbhJr.js";import{t as Yn}from"./WuiTimePicker-Ct7kghAZ.js";import{n as Xn,t as Zn}from"./WuiTour-BZQVityh.js";import{t as Qn}from"./WuiTree-y0l3zwAg.js";import{t as $n}from"./WuiTruncate-Cxujs1Xt.js";import{n as er,t as tr}from"./WuiWhatsNew-bOkXSofq.js";import{n as nr,t as rr}from"./WuiWizardStep-C9fh4xOu.js";import{$ as ir,A as ar,B as or,C as sr,D as cr,E as lr,F as ur,G as dr,H as fr,I as pr,J as mr,K as hr,L as gr,M as _r,N as vr,O as yr,P as br,Q as xr,R as Sr,S as Cr,T as wr,U as Tr,V as Er,W as Dr,X as Or,Y as kr,Z as Ar,_ as jr,a as Mr,at as Nr,b as Pr,c as Fr,d as Ir,et as Lr,f as Rr,g as zr,h as Br,i as Vr,it as Hr,j as Ur,k as Wr,l as Gr,m as Kr,n as qr,nt as Jr,o as Yr,ot as Xr,p as Zr,q as Qr,r as $r,rt as ei,s as ti,t as ni,tt as ri,u as ii,v as ai,w as oi,x as si,y as ci,z as li}from"./themeTransition-BSTpUIVI.js";var ui=`/`,di=`.search-wrap.wui-search-collapsible`,fi=`.wui-topsearch-panel`,pi=`.modal, wui-drawer[open]`,mi=new WeakSet,T=e=>e.querySelector(`.wui-search-toggle`),E=e=>e.querySelector(`.search-input`);function D(e){e.classList.remove(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`true`),E(e)?.focus()}function O(e){E(e)?.value||(e.classList.add(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`false`))}function hi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=T(e),n=E(e);t?.addEventListener(`click`,()=>D(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),O(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||O(e)})}function gi(e){mi.has(e)||(mi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(pi)||e.querySelector(fi))return;let n=[...e.querySelectorAll(di)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),D(n))}))}function _i(e=document){for(let t of e.querySelectorAll(di))hi(t);gi(e.ownerDocument??e)}var k=`wuiConfirm`,A=Object.freeze([`danger`]),j=Object.freeze([`success`,`info`,`warning`,`danger`]),M=`wui.flash`,N=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.`}),vi=new WeakSet,yi=new WeakSet,P=null,F=null,I=!1,bi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},L=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},xi=()=>{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 Si(){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`,`${ft.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">${bi(N.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Ci(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!A.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);wi({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 wi({title:e,message:t,label:n,danger:r},i){let a=xi(),o=Si(),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||N.confirmTitle,l.textContent=t,c.textContent=n||N.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),F=i,I=!1,a.getOrCreateInstance(o).show()}var R=(e,t)=>{P=e;try{t()}finally{P=null}};function Ti(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!A.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);Bi(e.ownerDocument),wi({title:t,message:n,label:r,danger:i===`danger`},()=>R(e,a))}var Ei=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function Di(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===P||Ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Ci(t,()=>R(t,()=>t.click())))}function Oi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===P||e.submitter&&e.submitter===P||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Ci(t,()=>R(t,()=>t.requestSubmit(n)))}function ki(e){let t=e.target.closest?.(`#${k} [data-app-confirm]`);!t||t.disabled||!F||(I=!0,xi().getOrCreateInstance(t.closest(`#${k}`)).hide())}function Ai(e){if(e.target.id!==`wuiConfirm`)return;let t=I?F:null;F=null,I=!1,t?.()}var ji=(e,t)=>{e&&window.sessionStorage.setItem(M,JSON.stringify({message:e,variant:t}))},Mi=e=>e===`forbidden`?N.forbidden:e===`network`?N.network:N.failed;function Ni(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&tt(e)?.reload()}async function Pi(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return Fi(t,e)}async function Fi(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);t.disabled=!0,t.setAttribute(`aria-busy`,`true`);let i=await C(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;if(i.ok&&(i.redirect||r===`page`)){ji(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload();return}if(t.disabled=!1,t.removeAttribute(`aria-busy`),i.ok){rt(i,a),Ni();return}L(i.message||Mi(i.kind),`danger`)}function Ii(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(Ei(t)||t.getAttribute(`aria-busy`)===`true`)&&Pi(t).catch(e=>_(e)))}function Li(e){let t=e.target.closest?.(`form[data-wui-post-form]`);if(!t||e.defaultPrevented)return;e.preventDefault();let n=e.submitter||t.querySelector(`button`);n.getAttribute(`aria-busy`)!==`true`&&(Fi(t.getAttribute(`action`),n,new FormData(t)).catch(e=>_(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Ri(){let e=window.sessionStorage.getItem(M);if(!e)return;window.sessionStorage.removeItem(M);let{message:t,variant:n}=JSON.parse(e);L(t,n)}function zi(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(!j.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${j.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),L(n,t)}}function Bi(e){yi.has(e)||(yi.add(e),e.addEventListener(`click`,ki),e.addEventListener(`hidden.bs.modal`,Ai))}function Vi(e=document){let t=e.ownerDocument||e;vi.has(t)||(vi.add(t),t.addEventListener(`click`,Di,!0),t.addEventListener(`submit`,Oi,!0),Bi(t),t.addEventListener(`click`,Ii),t.addEventListener(`submit`,Li),Ri()),zi(e)}var z=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),B=`form[data-wui-unsaved]`,Hi=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Ui=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Wi=new Set([`submit`,`button`,`reset`,`image`]),Gi=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),V=new WeakMap,Ki=new WeakSet,qi=e=>`${e.name}:${e.size}:${e.lastModified}`;function H(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Wi.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(qi)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}function U(e){return H(e)}function Ji(e){for(let t of e.elements)if(!(!t.name||t.disabled)){if(t.tagName===`TEXTAREA`||t.tagName===`INPUT`&&!Gi.has(t.type)){if(t.value.trim()!==``)return!0}else if(t.tagName===`INPUT`&&t.type===`file`&&t.files?.length>0)return!0}return!1}var Yi=e=>({saved:e.querySelector(Hi)&&Ji(e)?null:H(e),engaged:!1,discarded:!1});function Xi(e){let t=V.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&H(e)!==t.saved}var W=(e,t)=>[...e.querySelectorAll(B)].filter(e=>e!==t&&Xi(e)),Zi=()=>!!window.bootstrap?.Modal;function Qi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||z.message;Ti(e,{title:z.title,message:r,label:z.leaveLabel,tone:`danger`},()=>{for(let e of t)V.get(e).discarded=!0;n()})}function $i(e){if(e.matches(Ui))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 ea(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 ta(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||!$i(t))return;let n=W(t.ownerDocument,null);!n.length||!Zi()||(e.preventDefault(),Qi(t,n,()=>t.click()))}function na(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!ea(t,e.submitter))return;let n=W(t.ownerDocument,t);if(n.length&&Zi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Qi(t,n,()=>t.requestSubmit(r));return}let r=V.get(t);r&&(r.saved=H(t),r.discarded=!1)}function ra(e){W(document,null).length&&(e.preventDefault(),e.returnValue=``)}function ia(e){let t=e.target.closest?.(B),n=t&&V.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=H(t)),n.engaged=!0)}function aa(e){let t=e.target.closest?.(B),n=t&&V.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function oa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(B))ca(e)}function sa(e=document){let t=e.ownerDocument||e;if(!Ki.has(t)){Ki.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,ia,!0);for(let e of[`input`,`change`])t.addEventListener(e,aa,!0);t.addEventListener(`click`,ta),t.addEventListener(`submit`,na),t.addEventListener(`wui:modal:success`,oa),t.defaultView.addEventListener(`beforeunload`,ra)}let n=[...e.querySelectorAll?.(B)||[]];e.matches?.(B)&&n.unshift(e);for(let e of n)V.has(e)||V.set(e,Yi(e))}function ca(e){if(!(e instanceof HTMLFormElement)||!e.matches(B))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);V.set(e,{saved:H(e),engaged:!1,discarded:!1})}var G=Object.freeze({discard:`Discard`,keep:`Keep editing`}),la=`wui:drawer:discard`,K=`wui-drawer[confirm-discard]`,q=`.wui-modal-shell`,ua=`form[data-wui-confirm-discard]`,J=`.wui-drawer-discard`,da=`input, select, textarea`,Y=new WeakMap,fa=new WeakSet,pa=new WeakSet;function ma(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function ha(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,ma(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,G.discard),ma(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,G.keep)),n}function ga(e){let t=e.closest?.(K);if(t)return t;let n=e.closest?.(q);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(ua))?n:null}function _a(e){return e.closest(K)??e.closest(q)}function X(e){return e.matches(K)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(ua)}function va(e){let t=Y.get(e);return t!=null&&U(e)!==t}function ya(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),pa.add(t),t}function ba(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),pa.add(t),t}function xa(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function Sa(e,t){let n=e.querySelector(J);if(n){xa(n);return}let r=ha(e.ownerDocument,t),i;if(e.matches(K))i=e.querySelector(`.wui-drawer-footer`)??ya(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??ba(e),i.prepend(r);else{let t=e.querySelector(ua);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),xa(r)}function Ca(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),pa.has(t)&&t.remove()}function wa(e){for(let t of X(e)){let e=[...t.querySelectorAll(da)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function Ta(e){let t=ga(e.target);if(t)for(let e of X(t))Y.get(e)??Y.set(e,U(e))}function Ea(e){let t=e.target;!(t instanceof HTMLFormElement)||!ga(t)||Y.set(t,U(t))}function Da(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))Y.delete(e)}function Oa(e){let t=e.target;!(t instanceof Element)||!t.matches(K)||[...X(t)].some(va)&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)))}function ka(e){let t=e.target;if(!(t instanceof Element)||!t.matches(q))return;let n=[...X(t)].find(va);n&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function Aa(e){let t=e.closest(`wui-drawer`);if(t){t.dispatchEvent(new CustomEvent(`wui-drawer-close`,{bubbles:!0,cancelable:!0}))&&t.hide();return}let n=e.closest(q);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function ja(e){let t=e.closest(J),n=_a(t);Ca(t);for(let e of X(n))Y.set(e,U(e));n.dispatchEvent(new CustomEvent(la,{bubbles:!0})),n.matches(K)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Ma(e){let t=e.closest(J),n=_a(t);Ca(t),wa(n)}function Na(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){ja(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Ma(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&Aa(i)}function Pa(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(J);if(!t)return;e.preventDefault(),e.stopPropagation();let n=_a(t);Ca(t),wa(n)}function Fa(e=document){let t=e.ownerDocument||e;fa.has(t)||(fa.add(t),t.addEventListener(`focusin`,Ta),t.addEventListener(`pointerdown`,Ta),t.addEventListener(`submit`,Ea),t.addEventListener(`wui:modal:success`,Da),t.addEventListener(`wui:modal:loaded`,Da),t.addEventListener(`wui-drawer-close`,Oa,!0),t.addEventListener(`hide.bs.modal`,ka),t.addEventListener(`click`,Na),t.addEventListener(`keydown`,Pa,!0))}var Ia=`data-wui-bulk-in-bar`,La=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ra=new WeakSet;function za(e){return`${x(e,{decimals:0})} selected`}function Ba(e,t){for(let n of e.querySelectorAll(`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);n&&(n.hidden=t===0,n.querySelector(`.page-header-bar-bulk-count`).textContent=t>0?za(t):``)}function Va(e=document){for(let t of e.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Ia,``);Ra.has(document)||(Ra.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Ba(t,e.detail.selected)}))}var Ha=31536e3,Z=new WeakMap,Q=e=>e>99?`99+`:String(e);function Ua(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ha}; SameSite=Lax`}var Wa=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Ga(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=w(),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=Q(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${Q(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${Q(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=$(`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)},_=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren($(`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=Wa(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($(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>_(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){_(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await C(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),_(!0))});let v=null,y=()=>{d>0&&v===null&&(v=setInterval(()=>_(h()),d*1e3))},b=()=>{v!==null&&clearInterval(v),v=null},x=()=>{document.hidden?b():(_(h()),y())};return d>0&&(document.addEventListener(`visibilitychange`,x),document.hidden||y()),t.push(()=>{b(),f.abort(),document.removeEventListener(`visibilitychange`,x)}),{setUnread:e=>m(e),refresh:()=>_(h())}}var Ka=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),qa=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Ja(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=w(),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(qa(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=Wa(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($(`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(qa(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||Ka(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 Ya(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ua(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?Ga(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Ja(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)}};Z.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Z.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function Xa(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`,Ya(e))}function Za(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Z.has(t)||Xa(t),Z.get(t)??null):null}function Qa(){h(),e(`wui-select`,Jt),e(`wui-country-select`,Yt),e(`wui-phone`,In),e(`wui-datepicker`,Zt),e(`wui-date-range`,Qt),e(`wui-dock`,$t),e(`wui-image-crop`,nn),e(`wui-kanban`,ht),e(`wui-inline-edit`,an),e(`wui-consent-banner`,Kt),e(`wui-slider`,Kn),e(`wui-sortable`,qn),e(`wui-timepicker`,Yn),e(`wui-tour`,Zn),e(`wui-tree`,Qn),e(`wui-autocomplete`,Ft),e(`wui-command-palette`,Vt),e(`wui-context-menu`,qt),e(`wui-multiselect`,Sn),e(`wui-taginput`,Jn),e(`wui-otp`,Pn),e(`wui-status-icon`,Mt),e(`wui-shortcuts`,Wn),e(`wui-record-pager`,Rn),e(`wui-carousel`,It),e(`wui-code-block`,Lt),e(`wui-markdown`,un),e(`wui-data-table`,Xt),e(`wui-drawer`,en),e(`wui-hover-card`,tn),e(`wui-lightbox`,ln),e(`wui-menubar`,xn),e(`wui-navigation-menu`,Cn),e(`wui-notification-center`,Mn),e(`wui-onboarding-checklist`,Nn),e(`wui-overflow`,Fn),e(`wui-rating`,Ln),e(`wui-relative-time`,Vn),e(`wui-resizable`,Hn),e(`wui-rolling-number`,Un),e(`wui-show-more`,Gn),e(`wui-truncate`,$n),e(`wui-whats-new`,er),e(`wui-mention-input`,pn),e(`wui-comment-thread`,Ht),e(`wui-wizard-step`,rr),e(`wui-wizard`,nr)}Qa();export{xr as AVATAR_ACCEPT,ir as AVATAR_MAX_SIZE_MB,Lr as AVATAR_OUTPUT_SIZE,ri as AVATAR_OUTPUT_TYPE,Jr as AVATAR_PREVIEW_SIZES,ei as AVATAR_TEXT,Ia as BAR_BULK_IN_BAR_ATTRIBUTE,Ie as COLUMN_MAX_WIDTH,je as COLUMN_MIN_WIDTH,Gt as COMMENT_INTENTS,Ut as COMMENT_REACTIONS,Wt as COMMENT_TEXT,k as CONFIRM_DIALOG_ID,A as CONFIRM_TONES,zt as COPY_FEEDBACK_MS,ot as CSRF_META_NAME,ce as CURRENCIES,Pe as DATA_TABLE_TEXT,re as DATE_PATTERNS,nt as DEFAULT_CSRF_HEADER,Tr as DEFAULT_IMAGE_ACCEPT,Dr as DEFAULT_MAX_SIZE_MB,yr as DEFAULT_PASSWORD_RULES,Wr as DEFAULT_REQUIREMENTS_TITLE,ni as DEFAULT_THEME_EFFECT,qr as DEFAULT_THEME_STORAGE_KEY,la as DISCARD_EVENT,G as DISCARD_TEXT,si as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,M as FLASH_STORAGE_KEY,j as FLASH_VARIANTS,v as FORMAT_STYLES,it as HTTP_KINDS,cn as INLINE_EDIT_SAVED_MS,on as INLINE_EDIT_TEXT,sn as INLINE_EDIT_TYPES,ie as IST_TIME_ZONE,Ot as KANBAN_DRAG_THRESHOLD_PX,Ct as KANBAN_LONG_PRESS_MS,Et as KANBAN_PHONE_QUERY,bt as KANBAN_STORAGE_PREFIX,pt as KANBAN_SUMMARY_FORMATS,wt as KANBAN_TEXT,Dt as KANBAN_TONES,p as LIST_KEYS,vr as MASK_INPUT_TYPES,br as MASK_NAMES,dn as MENTION_ID_PATTERN,yn as MENTION_MAX_QUERY,hn as MENTION_MAX_RESULTS,_n as MENTION_TEXT,se as MONEY_UNITS,jn as NOTIFICATION_COUNT_CAP,Dn as NOTIFICATION_TEXT,Ee as PIN_AT_VAR,ye as PIN_SIDES,Me as RESIZE_STEP,Fe as RESIZE_STEP_LARGE,Cr as ROW_DRAG_TYPE,sr as ROW_DROP_EVENT,xe as ROW_HEIGHTS,ke as ROW_MOVE_LIMIT,Le as ROW_MOVE_MS,Se as ROW_SAVE_ATTR,Ce as ROW_SAVE_ERROR_CLASS,Ne as ROW_SAVE_STATES,ai as SCROLL_EDGE_SELECTOR,ui as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,N as SERVER_ACTION_TEXT,d as SHORTCUTS_OFF_ATTRIBUTE,a as SHORTCUT_EVENT,t as SHORTCUT_SCOPE_ATTRIBUTE,l as SHORTCUT_TEXT,Nt as STATUS_TONES,$r as THEME_BOOT_SCRIPT_BODY,Vr as THEME_CHANGE_EVENT,Mr as THEME_EFFECTS,Yr as THEME_EFFECT_DURATION,ti as THEME_MODES,Fr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,z as UNSAVED_TEXT,Ae as VIRTUAL_OVERSCAN,tr as WHATS_NEW_READ_EVENT,$e as WUI_HEADERS,Ft as WuiAutocomplete,It as WuiCarousel,Lt as WuiCodeBlock,Vt as WuiCommandPalette,Ht as WuiCommentThread,Kt as WuiConsentBanner,qt as WuiContextMenu,Yt as WuiCountrySelect,Xt as WuiDataTable,Zt as WuiDatePicker,Qt as WuiDateRange,$t as WuiDock,en as WuiDrawer,tn as WuiHoverCard,nn as WuiImageCrop,an as WuiInlineEdit,ht as WuiKanban,ln as WuiLightbox,un as WuiMarkdown,pn as WuiMentionInput,xn as WuiMenubar,Sn as WuiMultiSelect,Cn as WuiNavigationMenu,Mn as WuiNotificationCenter,Nn as WuiOnboardingChecklist,Pn as WuiOtp,Fn as WuiOverflow,In as WuiPhone,Ln as WuiRating,Rn as WuiRecordPager,Vn as WuiRelativeTime,Hn as WuiResizable,Un as WuiRollingNumber,Jt as WuiSelect,Wn as WuiShortcuts,Gn as WuiShowMore,Kn as WuiSlider,qn as WuiSortable,Mt as WuiStatusIcon,Jn as WuiTagInput,Yn as WuiTimePicker,Zn as WuiTour,Qn as WuiTree,$n as WuiTruncate,er as WuiWhatsNew,nr as WuiWizard,rr as WuiWizardStep,dr as acceptLabel,dt as addRowSelectCells,Je as addSelectColumn,Ba as applyBarBulk,Gr as applyTheme,f as ariaKeyShortcuts,ur as attachInputMask,oi as attachRowDrag,ci as attachScrollEdges,ut as attachShiftRange,Hr as avatarCropOptions,Nr as avatarUnreadableMessage,za as barBulkCountText,ar as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,O as collapseSearch,Ti as confirmAction,Rt as copyTextToClipboard,ha as createDiscardPrompt,Xn as createLocalSeenStore,w as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,Qa as defineWeborityElements,Ur as evaluatePassword,U as formValues,y as formatCompact,te as formatCurrency,le as formatDate,b as formatDuration,hr as formatFileSize,pr as formatMasked,x as formatNumber,ae as formatPercent,zn as formatRelativeTime,ne as formatValue,tt as getServerTable,Za as getShell,He as glyphSvg,we as groupCount,ve as groupItems,kn as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,_i as initCollapsibleSearch,Fa as initDrawerDiscard,gr as initInputMasks,Va as initPageBarBulk,At as initRemoteModals,wr as initRowDrag,Pr as initScrollEdges,Vi as initServerActions,Qe as initServerTables,Xa as initShellParts,sa as initUnsavedChanges,rn as inlineEditText,Xr as isHeicFile,Qr as isImageFile,mr as isImageOnlyAccept,Sr as isMaskPattern,kr as isPdfFile,o as isTypingTarget,xt as kanbanCardLabel,kt as kanbanOverflow,gt as kanbanStorageKey,_t as kanbanSummaryFormat,Tt as kanbanVisibleLimit,jt as loadRemoteDrawer,mt as loadRemoteModal,li as maskedPostValue,Bt as matchSegments,Or as matchesAccept,Ve as measureRows,gn as mentionLabel,vn as mentionTextFromValue,fn as mentionValueFromText,mn as mentionedIds,m as moveFocus,ii as nextTheme,En as notificationCountText,wn as notificationDayHeading,On as notificationTime,An as notificationTriggerLabel,Tn as notificationUnreadAnnouncement,D as openSearch,bn as parseMentionValue,Ye as parseToastAction,_r as passwordSatisfies,be as pinAtValue,Be as pinClasses,ge as pinOffsetVar,de as planPins,ze as playRowMoves,or as postedMasked,Er as rawMasked,_e as readColumnWidths,at as readCsrf,St as readKanbanCollapsed,Ir as readStoredTheme,Bn as relativeTimeTitle,ca as resetUnsavedChanges,fr as resolveMask,Rr as resolveTheme,pe as rowLabel,fe as rowOrderChanged,r as runShortcut,Xe as runToastAction,he as saveOutcomeText,Oe as setRowSaveState,ue as settledRows,i as shortcutKey,u as shortcutName,s as shortcutsOff,rt as showResultToast,Zr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,lr as syncTargets,Kr as themeBootScript,Br as themeKeyframes,cr as tickedKeys,S as toInstant,zr as transitionTheme,Ar as validateFile,De as virtualRange,jr as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,C as wuiFetch};
|
|
1
|
+
import{n as e}from"./elementBase-DV9IZZCu.js";import{a as t,c as n,d as r,f as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./shortcutKeys-BQiDpsTJ.js";import{n as h,t as g}from"./filterPopover-QL0Pa875.js";import{t as _}from"./devWarn-DXdRWZs3.js";import{a as v,c as y,d as b,f as x,h as S,i as ee,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le}from"./formatters-BAE__8ye.js";import{A as ue,C as de,D as fe,E as pe,M as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,d as Se,f as Ce,g as we,h as Te,i as Ee,j as De,k as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le,v as Re,w as ze,x as Be,y as Ve}from"./dataTable-Cd_IJQcs.js";import{t as He}from"./iconGlyphs.g-BNrdQ7It.js";import{C as Ue,S as We,T as Ge,_ as Ke,a as qe,b as Je,c as C,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,o as w,p as rt,r as it,s as at,t as ot,u as st,v as ct,w as lt,x as ut,y as dt}from"./wuiHttp-DJ1oIvtB.js";import{_ as ft,a as pt,b as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,o as wt,p as Tt,r as Et,s as Dt,t as Ot,u as kt,v as At,y as jt}from"./kanban-DRF61Mib.js";import{n as Mt,t as Nt}from"./statusIcons-Dt2ZVJyk.js";import{o as Pt}from"./optionLabel-Bul5mgul.js";import{t as Ft}from"./WuiAutocomplete-DFeJuO7U.js";import{t as It}from"./WuiCarousel-BbO8AoM6.js";import{t as Lt}from"./WuiCodeBlock-DsSayJ8U.js";import{n as Rt,t as zt}from"./copyText-DM5HhXjf.js";import{t as Bt}from"./textMatch-wdY7XLIc.js";import{t as Vt}from"./WuiCommandPalette-CBg6i4WJ.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./WuiCommentThread-CfOeJvxg.js";import{t as Kt}from"./WuiConsentBanner-D3rxcVUX.js";import{t as qt}from"./WuiContextMenu-BrHXfA-X.js";import{t as Jt}from"./WuiSelect-BV-tKr69.js";import{t as Yt}from"./WuiCountrySelect-B9dBPME5.js";import{t as Xt}from"./WuiDataTable-YzxEQGIO.js";import{t as Zt}from"./WuiDatePicker-BQn1d_RD.js";import{t as Qt}from"./WuiDateRange-la8pKreY.js";import{t as $t}from"./WuiDock-Bd2ijOaJ.js";import{t as en}from"./WuiDrawer-DnHsXG4q.js";import{t as tn}from"./WuiHoverCard-BjPDXlhV.js";import{t as nn}from"./WuiImageCrop-CvXh791S.js";import{a as rn,i as an,n as on,r as sn,t as cn}from"./WuiInlineEdit-CpyX_apm.js";import{t as ln}from"./WuiLightbox-B4dopmSI.js";import{t as un}from"./WuiMarkdown-C2flvSIt.js";import{a as dn,c as fn,i as pn,l as mn,n as hn,o as gn,r as _n,s as vn,t as yn,u as bn}from"./WuiMentionInput-ix9Wljhc.js";import{t as xn}from"./WuiMenubar-BC48Kv8o.js";import{t as Sn}from"./WuiMultiSelect-D9PgSeYk.js";import{t as Cn}from"./WuiNavigationMenu-CGqTADvr.js";import{a as wn,c as Tn,i as En,n as Dn,o as On,r as kn,s as An,t as jn}from"./notificationDays-BUoh4mG6.js";import{t as Mn}from"./WuiNotificationCenter-DDSPUlD7.js";import{t as Nn}from"./WuiOnboardingChecklist-DXUETu1h.js";import{t as Pn}from"./WuiOtp-DfhXc829.js";import{t as Fn}from"./WuiOverflow-blOepYs6.js";import{t as In}from"./WuiPhone-CUwTgWQV.js";import{t as Ln}from"./WuiRating-DhhqYj5Z.js";import{t as Rn}from"./WuiRecordPager-BFqaMK8g.js";import{n as zn,r as Bn,t as Vn}from"./WuiRelativeTime-D6hPHWXX.js";import{t as Hn}from"./WuiResizable-CtwCQUWR.js";import{t as Un}from"./WuiRollingNumber-C85kOshZ.js";import{t as Wn}from"./WuiShortcuts-Xa7eq9-J.js";import{t as Gn}from"./WuiShowMore-D3VHRZJg.js";import{t as Kn}from"./WuiSlider-IOqadOtK.js";import{t as qn}from"./WuiSortable-CugtxycN.js";import{t as Jn}from"./WuiTagInput-Dh7bbhJr.js";import{t as Yn}from"./WuiTimePicker-Ct7kghAZ.js";import{n as Xn,t as Zn}from"./WuiTour-BZQVityh.js";import{t as Qn}from"./WuiTree-y0l3zwAg.js";import{t as $n}from"./WuiTruncate-Cxujs1Xt.js";import{n as er,t as tr}from"./WuiWhatsNew-bOkXSofq.js";import{n as nr,t as rr}from"./WuiWizardStep-C9fh4xOu.js";import{$ as ir,A as ar,B as or,C as sr,D as cr,E as lr,F as ur,G as dr,H as fr,I as pr,J as mr,K as hr,L as gr,M as _r,N as vr,O as yr,P as br,Q as xr,R as Sr,S as Cr,T as wr,U as Tr,V as Er,W as Dr,X as Or,Y as kr,Z as Ar,_ as jr,a as Mr,at as Nr,b as Pr,c as Fr,d as Ir,et as Lr,f as Rr,g as zr,h as Br,i as Vr,it as Hr,j as Ur,k as Wr,l as Gr,m as Kr,n as qr,nt as Jr,o as Yr,ot as Xr,p as Zr,q as Qr,r as $r,rt as ei,s as ti,t as ni,tt as ri,u as ii,v as ai,w as oi,x as si,y as ci,z as li}from"./themeTransition-BSTpUIVI.js";var ui=`/`,di=`.search-wrap.wui-search-collapsible`,fi=`.wui-topsearch-panel`,pi=`.modal, wui-drawer[open]`,mi=new WeakSet,T=e=>e.querySelector(`.wui-search-toggle`),E=e=>e.querySelector(`.search-input`);function D(e){e.classList.remove(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`true`),E(e)?.focus()}function O(e){E(e)?.value||(e.classList.add(`is-collapsed`),T(e)?.setAttribute(`aria-expanded`,`false`))}function hi(e){if(e.dataset.wuiCollapseWired)return;e.dataset.wuiCollapseWired=`1`;let t=T(e),n=E(e);t?.addEventListener(`click`,()=>D(e)),n?.addEventListener(`keydown`,r=>{r.key!==`Escape`||n.value||(r.preventDefault(),O(e),t?.focus())}),e.addEventListener(`focusout`,t=>{e.contains(t.relatedTarget)||O(e)})}function gi(e){mi.has(e)||(mi.add(e),e.addEventListener(`keydown`,t=>{if(t.key!==`/`||t.ctrlKey||t.altKey||t.metaKey||t.defaultPrevented||o(t.target)||t.target?.closest?.(pi)||e.querySelector(fi))return;let n=[...e.querySelectorAll(di)].find(e=>e.offsetParent!==null);n&&(t.preventDefault(),D(n))}))}function _i(e=document){for(let t of e.querySelectorAll(di))hi(t);gi(e.ownerDocument??e)}var k=`wuiConfirm`,A=Object.freeze([`danger`]),j=Object.freeze([`success`,`info`,`warning`,`danger`]),M=`wui.flash`,N=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.`}),vi=new WeakSet,yi=new WeakSet,P=null,F=null,I=!1,bi=e=>{let t=document.createElement(`span`);return t.textContent=e??``,t.innerHTML},L=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},xi=()=>{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 Si(){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`,`${ft.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">${bi(N.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`,document.body.appendChild(e),e)}function Ci(e,t){let n=e.getAttribute(`data-wui-confirm-tone`);if(n!==null&&!A.includes(n))throw TypeError(`data-wui-confirm-tone="${n}" is not supported. Use danger, or leave it off.`);wi({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 wi({title:e,message:t,label:n,danger:r},i){let a=xi(),o=Si(),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||N.confirmTitle,l.textContent=t,c.textContent=n||N.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),F=i,I=!1,a.getOrCreateInstance(o).show()}var R=(e,t)=>{P=e;try{t()}finally{P=null}};function Ti(e,{title:t,message:n,label:r,tone:i},a){if(i!=null&&!A.includes(i))throw TypeError(`confirmAction: tone "${i}" is not supported. Use danger, or leave it off.`);Bi(e.ownerDocument),wi({title:t,message:n,label:r,danger:i===`danger`},()=>R(e,a))}var Ei=e=>e.disabled===!0||e.getAttribute(`aria-disabled`)===`true`;function Di(e){let t=e.target.closest?.(`[data-wui-confirm]:not(form)`);!t||t===P||Ei(t)||(e.preventDefault(),e.stopImmediatePropagation(),Ci(t,()=>R(t,()=>t.click())))}function Oi(e){let t=e.target;if(!(t instanceof HTMLFormElement)||!t.hasAttribute(`data-wui-confirm`)||t===P||e.submitter&&e.submitter===P||t.querySelector(`input[data-app-repeater-hidden]`))return;e.preventDefault(),e.stopImmediatePropagation();let n=e.submitter?.form===t?e.submitter:void 0;Ci(t,()=>R(t,()=>t.requestSubmit(n)))}function ki(e){let t=e.target.closest?.(`#${k} [data-app-confirm]`);!t||t.disabled||!F||(I=!0,xi().getOrCreateInstance(t.closest(`#${k}`)).hide())}function Ai(e){if(e.target.id!==`wuiConfirm`)return;let t=I?F:null;F=null,I=!1,t?.()}var ji=(e,t)=>{e&&window.sessionStorage.setItem(M,JSON.stringify({message:e,variant:t}))},Mi=e=>e===`forbidden`?N.forbidden:e===`network`?N.network:N.failed;function Ni(){for(let e of document.querySelectorAll(`[data-wui-server]`))e.dataset.refreshOnSuccess!==`false`&&tt(e)?.reload()}async function Pi(e){let t=e.getAttribute(`data-wui-post`);if(!t)throw Error(`A data-wui-post button needs the URL the action posts to.`);return Fi(t,e)}async function Fi(e,t,n){let r=t.getAttribute(`data-wui-post-reload`);if(r!==null&&r!==`page`)throw TypeError(`data-wui-post-reload="${r}" is not supported. Use page, or leave it off to reload the server tables.`);t.disabled=!0,t.setAttribute(`aria-busy`,`true`);let i=await C(e,{method:`POST`,body:n});if(i.kind===`session`||i.kind===`aborted`)return;let a=i.toastVariant||`success`;if(i.ok&&(i.redirect||r===`page`)){ji(i.message,a),i.redirect?window.location.assign(i.redirect):window.location.reload();return}if(t.disabled=!1,t.removeAttribute(`aria-busy`),i.ok){rt(i,a),Ni();return}L(i.message||Mi(i.kind),`danger`)}function Ii(e){let t=e.target.closest?.(`[data-wui-post]`);t&&(e.preventDefault(),!(Ei(t)||t.getAttribute(`aria-busy`)===`true`)&&Pi(t).catch(e=>_(e)))}function Li(e){let t=e.target.closest?.(`form[data-wui-post-form]`);if(!t||e.defaultPrevented)return;e.preventDefault();let n=e.submitter||t.querySelector(`button`);n.getAttribute(`aria-busy`)!==`true`&&(Fi(t.getAttribute(`action`),n,new FormData(t)).catch(e=>_(e)),window.bootstrap?.Dropdown?.getInstance(t.closest(`.dropdown`)?.querySelector(`[data-bs-toggle='dropdown']`))?.hide())}function Ri(){let e=window.sessionStorage.getItem(M);if(!e)return;window.sessionStorage.removeItem(M);let{message:t,variant:n}=JSON.parse(e);L(t,n)}function zi(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(!j.includes(t))throw TypeError(`data-wui-flash-variant="${t}" is not supported. Use ${j.join(`, `)}.`);let n=e.getAttribute(`data-wui-flash`)||e.textContent.trim();e.remove(),L(n,t)}}function Bi(e){yi.has(e)||(yi.add(e),e.addEventListener(`click`,ki),e.addEventListener(`hidden.bs.modal`,Ai))}function Vi(e=document){let t=e.ownerDocument||e;vi.has(t)||(vi.add(t),t.addEventListener(`click`,Di,!0),t.addEventListener(`submit`,Oi,!0),Bi(t),t.addEventListener(`click`,Ii),t.addEventListener(`submit`,Li),Ri()),zi(e)}var z=Object.freeze({title:`Leave without saving?`,message:`Your changes on this page are not saved. If you leave now, they are lost.`,leaveLabel:`Leave`}),B=`form[data-wui-unsaved]`,Hi=`[aria-invalid="true"], .field-error:not(:empty), .field-validation-error, .validation-summary-errors, .wui-error-summary`,Ui=`[download], [data-wui-modal], [data-wui-post], [data-bs-toggle]`,Wi=new Set([`submit`,`button`,`reset`,`image`]),Gi=new Set([`hidden`,`checkbox`,`radio`,`file`,`submit`,`button`,`reset`,`image`,`range`,`color`]),V=new WeakMap,Ki=new WeakSet,qi=e=>`${e.name}:${e.size}:${e.lastModified}`;function H(e){let t=[];for(let n of e.elements)!n.name||n.disabled||Wi.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(qi)]):n.type===`select-multiple`?t.push([n.name,[...n.selectedOptions].map(e=>e.value)]):t.push([n.name,n.value]));return JSON.stringify(t)}function U(e){return H(e)}function Ji(e){for(let t of e.elements)if(!(!t.name||t.disabled)){if(t.tagName===`TEXTAREA`||t.tagName===`INPUT`&&!Gi.has(t.type)){if(t.value.trim()!==``)return!0}else if(t.tagName===`INPUT`&&t.type===`file`&&t.files?.length>0)return!0}return!1}var Yi=e=>({saved:e.querySelector(Hi)&&Ji(e)?null:H(e),engaged:!1,discarded:!1});function Xi(e){let t=V.get(e);return!t||t.discarded||!e.isConnected?!1:t.saved===null||t.engaged&&H(e)!==t.saved}var W=(e,t)=>[...e.querySelectorAll(B)].filter(e=>e!==t&&Xi(e)),Zi=()=>!!window.bootstrap?.Modal;function Qi(e,t,n){let r=t.map(e=>e.getAttribute(`data-wui-unsaved`)).find(Boolean)||z.message;Ti(e,{title:z.title,message:r,label:z.leaveLabel,tone:`danger`},()=>{for(let e of t)V.get(e).discarded=!0;n()})}function $i(e){if(e.matches(Ui))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 ea(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 ta(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||!$i(t))return;let n=W(t.ownerDocument,null);!n.length||!Zi()||(e.preventDefault(),Qi(t,n,()=>t.click()))}function na(e){let t=e.target;if(!(t instanceof HTMLFormElement)||e.defaultPrevented||!ea(t,e.submitter))return;let n=W(t.ownerDocument,t);if(n.length&&Zi()){e.preventDefault();let r=e.submitter?.form===t?e.submitter:void 0;Qi(t,n,()=>t.requestSubmit(r));return}let r=V.get(t);r&&(r.saved=H(t),r.discarded=!1)}function ra(e){W(document,null).length&&(e.preventDefault(),e.returnValue=``)}function ia(e){let t=e.target.closest?.(B),n=t&&V.get(t);!n||n.engaged||(n.saved!==null&&(n.saved=H(t)),n.engaged=!0)}function aa(e){let t=e.target.closest?.(B),n=t&&V.get(t);n&&(n.discarded=!1,e.isTrusted&&(n.engaged=!0))}function oa(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(B))ca(e)}function sa(e=document){let t=e.ownerDocument||e;if(!Ki.has(t)){Ki.add(t);for(let e of[`focusin`,`pointerdown`,`drop`])t.addEventListener(e,ia,!0);for(let e of[`input`,`change`])t.addEventListener(e,aa,!0);t.addEventListener(`click`,ta),t.addEventListener(`submit`,na),t.addEventListener(`wui:modal:success`,oa),t.defaultView.addEventListener(`beforeunload`,ra)}let n=[...e.querySelectorAll?.(B)||[]];e.matches?.(B)&&n.unshift(e);for(let e of n)V.has(e)||V.set(e,Yi(e))}function ca(e){if(!(e instanceof HTMLFormElement)||!e.matches(B))throw TypeError(`resetUnsavedChanges: ${String(e)} is not a <form data-wui-unsaved>.`);V.set(e,{saved:H(e),engaged:!1,discarded:!1})}var G=Object.freeze({discard:`Discard`,keep:`Keep editing`}),la=`wui:drawer:discard`,K=`wui-drawer[confirm-discard]`,q=`.wui-modal-shell`,ua=`form[data-wui-confirm-discard]`,J=`.wui-drawer-discard`,da=`input, select, textarea`,Y=new WeakMap,fa=new WeakSet,pa=new WeakSet;function ma(e,t,n,r){let i=e.createElement(`button`);return i.type=`button`,i.className=t,i.setAttribute(n,``),i.textContent=r,i}function ha(e,t){let n=e.createElement(`div`);n.className=`wui-drawer-discard`,n.setAttribute(`role`,`alert`);let r=e.createElement(`span`);return r.className=`wui-drawer-discard-text`,r.textContent=t,n.append(r,ma(e,`btn btn-danger btn-sm`,`data-wui-discard-confirm`,G.discard),ma(e,`btn btn-secondary btn-sm`,`data-wui-discard-keep`,G.keep)),n}function ga(e){let t=e.closest?.(K);if(t)return t;let n=e.closest?.(q);return n&&(n.hasAttribute(`confirm-discard`)||n.querySelector(ua))?n:null}function _a(e){return e.closest(K)??e.closest(q)}function X(e){return e.matches(K)||e.hasAttribute(`confirm-discard`)?e.querySelectorAll(`form`):e.querySelectorAll(ua)}function va(e){let t=Y.get(e);return t!=null&&U(e)!==t}function ya(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-drawer-footer`,e.querySelector(`.wui-drawer-panel`).append(t),pa.add(t),t}function ba(e){let t=e.ownerDocument.createElement(`div`);return t.className=`wui-modal-footer`,(e.querySelector(`.wui-modal-body`)?.parentElement??e.querySelector(`.modal-content`)??e).append(t),pa.add(t),t}function xa(e){e.querySelector(`[data-wui-discard-confirm]`).focus()}function Sa(e,t){let n=e.querySelector(J);if(n){xa(n);return}let r=ha(e.ownerDocument,t),i;if(e.matches(K))i=e.querySelector(`.wui-drawer-footer`)??ya(e),i.prepend(r);else if(e.hasAttribute(`confirm-discard`))i=e.querySelector(`.wui-modal-footer`)??ba(e),i.prepend(r);else{let t=e.querySelector(ua);i=t.querySelector(`.modal-footer`),i?i.prepend(r):(i=t,t.append(r))}i.classList.add(`wui-drawer-discarding`),xa(r)}function Ca(e){let t=e.parentElement;e.remove(),t.classList.remove(`wui-drawer-discarding`),pa.has(t)&&t.remove()}function wa(e){for(let t of X(e)){let e=[...t.querySelectorAll(da)].find(e=>e.type!==`hidden`&&!e.disabled);if(e){e.focus();return}}}function Ta(e){let t=ga(e.target);if(t)for(let e of X(t))Y.get(e)??Y.set(e,U(e))}function Ea(e){let t=e.target;!(t instanceof HTMLFormElement)||!ga(t)||Y.set(t,U(t))}function Da(e){let t=e.detail?.handle?.el;if(t instanceof Element)for(let e of t.querySelectorAll(`form`))Y.delete(e)}function Oa(e){let t=e.target;!(t instanceof Element)||!t.matches(K)||[...X(t)].some(va)&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)))}function ka(e){let t=e.target;if(!(t instanceof Element)||!t.matches(q))return;let n=[...X(t)].find(va);n&&(e.preventDefault(),Sa(t,t.getAttribute(`confirm-discard`)??n.getAttribute(`data-wui-confirm-discard`)))}function Aa(e){let t=e.closest(`wui-drawer`);if(t){t.dispatchEvent(new CustomEvent(`wui-drawer-close`,{bubbles:!0,cancelable:!0}))&&t.hide();return}let n=e.closest(q);n&&window.bootstrap?.Modal?.getInstance(n)?.hide()}function ja(e){let t=e.closest(J),n=_a(t);Ca(t);for(let e of X(n))Y.set(e,U(e));n.dispatchEvent(new CustomEvent(la,{bubbles:!0})),n.matches(K)?n.hide():window.bootstrap.Modal.getInstance(n).hide()}function Ma(e){let t=e.closest(J),n=_a(t);Ca(t),wa(n)}function Na(e){let t=e.target,n=t.closest?.(`[data-wui-discard-confirm]`);if(n){ja(n);return}let r=t.closest?.(`[data-wui-discard-keep]`);if(r){Ma(r);return}let i=t.closest?.(`[data-wui-dismiss]`);i&&Aa(i)}function Pa(e){if(e.key!==`Escape`)return;let t=e.currentTarget.querySelector(J);if(!t)return;e.preventDefault(),e.stopPropagation();let n=_a(t);Ca(t),wa(n)}function Fa(e=document){let t=e.ownerDocument||e;fa.has(t)||(fa.add(t),t.addEventListener(`focusin`,Ta),t.addEventListener(`pointerdown`,Ta),t.addEventListener(`submit`,Ea),t.addEventListener(`wui:modal:success`,Da),t.addEventListener(`wui:modal:loaded`,Da),t.addEventListener(`wui-drawer-close`,Oa,!0),t.addEventListener(`hide.bs.modal`,ka),t.addEventListener(`click`,Na),t.addEventListener(`keydown`,Pa,!0))}var Ia=`data-wui-bulk-in-bar`,La=`[data-wui-page-header-bar][data-wui-bulk-for]`,Ra=new WeakSet;function za(e){return`${x(e,{decimals:0})} selected`}function Ba(e,t){for(let n of e.querySelectorAll(`[data-wui-bar-swap]`))n.hidden=t>0;let n=e.querySelector(`[data-wui-bar-bulk]`);n&&(n.hidden=t===0,n.querySelector(`.page-header-bar-bulk-count`).textContent=t>0?za(t):``)}function Va(e=document){for(let t of e.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.setAttribute(Ia,``);Ra.has(document)||(Ra.add(document),document.addEventListener(`selectionchange`,e=>{if(typeof e.detail?.selected==`number`)for(let t of document.querySelectorAll(La))document.getElementById(t.dataset.wuiBulkFor)?.contains(e.target)&&Ba(t,e.detail.selected)}))}var Ha=31536e3,Z=new WeakMap,Q=e=>e>99?`99+`:String(e);function Ua(e,t,n=document){n.cookie=`${e}=${t?`1`:`0`}; Path=/; Max-Age=${Ha}; SameSite=Lax`}var Wa=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t.content},$=(e,t)=>{let n=document.createElement(`div`);return n.className=e,n.textContent=t,n};function Ga(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=w(),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=Q(o),r.hidden=o===0),n?.setAttribute(`aria-label`,o===0?l:`${l}, ${Q(o)} unread`),a&&s&&i&&(i.textContent=o===0?`No unread notifications`:`${Q(o)} unread notifications`)},h=()=>o?.classList.contains(`show`)??!1,g=()=>{let e=$(`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)},_=async t=>{t&&(a.setAttribute(`aria-busy`,`true`),a.querySelector(`.wui-bell-item`)||a.replaceChildren($(`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=Wa(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($(`wui-bell-state`,u))),e.dispatchEvent(new CustomEvent(`wui:notifications:loaded`,{bubbles:!0,detail:{unread:o}}))};e.addEventListener(`show.bs.dropdown`,()=>_(!0)),e.addEventListener(`click`,async e=>{if(e.target.closest(`[data-wui-bell-retry]`)){_(!0);return}let t=e.target.closest(`[data-wui-bell-read]`);if(!t||!c)return;t.disabled=!0;let n=await C(c,{method:`POST`});t.disabled=!1,n.ok&&(m(0),_(!0))});let v=null,y=()=>{d>0&&v===null&&(v=setInterval(()=>_(h()),d*1e3))},b=()=>{v!==null&&clearInterval(v),v=null},x=()=>{document.hidden?b():(_(h()),y())};return d>0&&(document.addEventListener(`visibilitychange`,x),document.hidden||y()),t.push(()=>{b(),f.abort(),document.removeEventListener(`visibilitychange`,x)}),{setUnread:e=>m(e),refresh:()=>_(h())}}var Ka=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),qa=(e,t,n)=>`${e}${e.includes(`?`)?`&`:`?`}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;function Ja(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=w(),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(qa(o,s,t));if(!(n.kind===`aborted`||n.kind===`stale`||n.kind===`session`)){if(e.classList.remove(`is-loading`),n.ok){let e=Wa(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($(`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(qa(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||Ka(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 Ya(e){let t=[],n=e.dataset.wuiCollapsedCookie;n&&e.addEventListener(`wui:shell:collapse`,e=>Ua(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?Ga(r,t):null,a=e.querySelector(`[data-wui-topsearch]`);a&&Ja(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)}};Z.set(e,o);let s=n=>{if(n.target===e||n.target.contains?.(e)){for(let e of t)e();Z.delete(e),delete e.dataset.wuiPartsWired,document.removeEventListener(`wui:teardown`,s)}};return document.addEventListener(`wui:teardown`,s),o}function Xa(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`,Ya(e))}function Za(e){let t=e?.closest?.(`[data-app-shell]`)??null;return t?(Z.has(t)||Xa(t),Z.get(t)??null):null}function Qa(){h(),e(`wui-select`,Jt),e(`wui-country-select`,Yt),e(`wui-phone`,In),e(`wui-datepicker`,Zt),e(`wui-date-range`,Qt),e(`wui-dock`,$t),e(`wui-image-crop`,nn),e(`wui-kanban`,ht),e(`wui-inline-edit`,an),e(`wui-consent-banner`,Kt),e(`wui-slider`,Kn),e(`wui-sortable`,qn),e(`wui-timepicker`,Yn),e(`wui-tour`,Zn),e(`wui-tree`,Qn),e(`wui-autocomplete`,Ft),e(`wui-command-palette`,Vt),e(`wui-context-menu`,qt),e(`wui-multiselect`,Sn),e(`wui-taginput`,Jn),e(`wui-otp`,Pn),e(`wui-status-icon`,Mt),e(`wui-shortcuts`,Wn),e(`wui-record-pager`,Rn),e(`wui-carousel`,It),e(`wui-code-block`,Lt),e(`wui-markdown`,un),e(`wui-data-table`,Xt),e(`wui-drawer`,en),e(`wui-hover-card`,tn),e(`wui-lightbox`,ln),e(`wui-menubar`,xn),e(`wui-navigation-menu`,Cn),e(`wui-notification-center`,Mn),e(`wui-onboarding-checklist`,Nn),e(`wui-overflow`,Fn),e(`wui-rating`,Ln),e(`wui-relative-time`,Vn),e(`wui-resizable`,Hn),e(`wui-rolling-number`,Un),e(`wui-show-more`,Gn),e(`wui-truncate`,$n),e(`wui-whats-new`,er),e(`wui-mention-input`,pn),e(`wui-comment-thread`,Ht),e(`wui-wizard-step`,rr),e(`wui-wizard`,nr)}Qa();export{xr as AVATAR_ACCEPT,ir as AVATAR_MAX_SIZE_MB,Lr as AVATAR_OUTPUT_SIZE,ri as AVATAR_OUTPUT_TYPE,Jr as AVATAR_PREVIEW_SIZES,ei as AVATAR_TEXT,Ia as BAR_BULK_IN_BAR_ATTRIBUTE,Ie as COLUMN_MAX_WIDTH,je as COLUMN_MIN_WIDTH,Gt as COMMENT_INTENTS,Ut as COMMENT_REACTIONS,Wt as COMMENT_TEXT,k as CONFIRM_DIALOG_ID,A as CONFIRM_TONES,zt as COPY_FEEDBACK_MS,ot as CSRF_META_NAME,ce as CURRENCIES,Pe as DATA_TABLE_TEXT,re as DATE_PATTERNS,nt as DEFAULT_CSRF_HEADER,Tr as DEFAULT_IMAGE_ACCEPT,Dr as DEFAULT_MAX_SIZE_MB,yr as DEFAULT_PASSWORD_RULES,Wr as DEFAULT_REQUIREMENTS_TITLE,ni as DEFAULT_THEME_EFFECT,qr as DEFAULT_THEME_STORAGE_KEY,la as DISCARD_EVENT,G as DISCARD_TEXT,si as DROP_OVER_CLASS,oe as DURATION_UNITS,ee as EMPTY_VALUE,g as FILTER_POPOVER_MAX_CHIPS,M as FLASH_STORAGE_KEY,j as FLASH_VARIANTS,v as FORMAT_STYLES,it as HTTP_KINDS,cn as INLINE_EDIT_SAVED_MS,on as INLINE_EDIT_TEXT,sn as INLINE_EDIT_TYPES,ie as IST_TIME_ZONE,Ot as KANBAN_DRAG_THRESHOLD_PX,Ct as KANBAN_LONG_PRESS_MS,Et as KANBAN_PHONE_QUERY,bt as KANBAN_STORAGE_PREFIX,pt as KANBAN_SUMMARY_FORMATS,wt as KANBAN_TEXT,Dt as KANBAN_TONES,p as LIST_KEYS,vr as MASK_INPUT_TYPES,br as MASK_NAMES,dn as MENTION_ID_PATTERN,yn as MENTION_MAX_QUERY,hn as MENTION_MAX_RESULTS,_n as MENTION_TEXT,se as MONEY_UNITS,jn as NOTIFICATION_COUNT_CAP,Dn as NOTIFICATION_TEXT,Ee as PIN_AT_VAR,ye as PIN_SIDES,Me as RESIZE_STEP,Fe as RESIZE_STEP_LARGE,Cr as ROW_DRAG_TYPE,sr as ROW_DROP_EVENT,xe as ROW_HEIGHTS,ke as ROW_MOVE_LIMIT,Le as ROW_MOVE_MS,Se as ROW_SAVE_ATTR,Ce as ROW_SAVE_ERROR_CLASS,Ne as ROW_SAVE_STATES,ai as SCROLL_EDGE_SELECTOR,ui as SEARCH_OPEN_KEY,Ze as SELECT_ALL_LABEL,Ke as SELECT_CELL_CLASS,c as SELECT_KEY,ct as SELECT_ROW_LABEL,N as SERVER_ACTION_TEXT,d as SHORTCUTS_OFF_ATTRIBUTE,a as SHORTCUT_EVENT,t as SHORTCUT_SCOPE_ATTRIBUTE,l as SHORTCUT_TEXT,Nt as STATUS_TONES,$r as THEME_BOOT_SCRIPT_BODY,Vr as THEME_CHANGE_EVENT,Mr as THEME_EFFECTS,Yr as THEME_EFFECT_DURATION,ti as THEME_MODES,Fr as THEME_SWITCHING_CLASS,et as TOAST_ACTION_METHODS,st as TOAST_ACTION_MS,z as UNSAVED_TEXT,Ae as VIRTUAL_OVERSCAN,tr as WHATS_NEW_READ_EVENT,$e as WUI_HEADERS,Ft as WuiAutocomplete,It as WuiCarousel,Lt as WuiCodeBlock,Vt as WuiCommandPalette,Ht as WuiCommentThread,Kt as WuiConsentBanner,qt as WuiContextMenu,Yt as WuiCountrySelect,Xt as WuiDataTable,Zt as WuiDatePicker,Qt as WuiDateRange,$t as WuiDock,en as WuiDrawer,tn as WuiHoverCard,nn as WuiImageCrop,an as WuiInlineEdit,ht as WuiKanban,ln as WuiLightbox,un as WuiMarkdown,pn as WuiMentionInput,xn as WuiMenubar,Sn as WuiMultiSelect,Cn as WuiNavigationMenu,Mn as WuiNotificationCenter,Nn as WuiOnboardingChecklist,Pn as WuiOtp,Fn as WuiOverflow,In as WuiPhone,Ln as WuiRating,Rn as WuiRecordPager,Vn as WuiRelativeTime,Hn as WuiResizable,Un as WuiRollingNumber,Jt as WuiSelect,Wn as WuiShortcuts,Gn as WuiShowMore,Kn as WuiSlider,qn as WuiSortable,Mt as WuiStatusIcon,Jn as WuiTagInput,Yn as WuiTimePicker,Zn as WuiTour,Qn as WuiTree,$n as WuiTruncate,er as WuiWhatsNew,nr as WuiWizard,rr as WuiWizardStep,dr as acceptLabel,dt as addRowSelectCells,Je as addSelectColumn,Ba as applyBarBulk,Gr as applyTheme,f as ariaKeyShortcuts,ur as attachInputMask,oi as attachRowDrag,ci as attachScrollEdges,ut as attachShiftRange,Hr as avatarCropOptions,Nr as avatarUnreadableMessage,za as barBulkCountText,ar as buildPasswordRules,Te as clampColumnWidth,qe as classifyStatus,O as collapseSearch,Ti as confirmAction,Rt as copyTextToClipboard,ha as createDiscardPrompt,Xn as createLocalSeenStore,w as createRequestQueue,We as createSelectHeaderCell,Ue as createSelectRowCell,lt as createSelectSpacerCell,Qa as defineWeborityElements,Ur as evaluatePassword,U as formValues,y as formatCompact,te as formatCurrency,le as formatDate,b as formatDuration,hr as formatFileSize,pr as formatMasked,x as formatNumber,ae as formatPercent,zn as formatRelativeTime,ne as formatValue,tt as getServerTable,Za as getShell,He as glyphSvg,we as groupCount,ve as groupItems,kn as groupNotificationsByDay,Re as identityCell,n as inShortcutScope,_i as initCollapsibleSearch,Fa as initDrawerDiscard,gr as initInputMasks,Va as initPageBarBulk,At as initRemoteModals,wr as initRowDrag,Pr as initScrollEdges,Vi as initServerActions,Qe as initServerTables,Xa as initShellParts,sa as initUnsavedChanges,rn as inlineEditText,Xr as isHeicFile,Qr as isImageFile,mr as isImageOnlyAccept,Sr as isMaskPattern,kr as isPdfFile,o as isTypingTarget,xt as kanbanCardLabel,kt as kanbanOverflow,gt as kanbanStorageKey,_t as kanbanSummaryFormat,Tt as kanbanVisibleLimit,jt as loadRemoteDrawer,mt as loadRemoteModal,li as maskedPostValue,Bt as matchSegments,Or as matchesAccept,Ve as measureRows,gn as mentionLabel,vn as mentionTextFromValue,fn as mentionValueFromText,mn as mentionedIds,m as moveFocus,ii as nextTheme,En as notificationCountText,wn as notificationDayHeading,On as notificationTime,An as notificationTriggerLabel,Tn as notificationUnreadAnnouncement,D as openSearch,bn as parseMentionValue,Ye as parseToastAction,_r as passwordSatisfies,be as pinAtValue,Be as pinClasses,ge as pinOffsetVar,de as planPins,ze as playRowMoves,or as postedMasked,Er as rawMasked,_e as readColumnWidths,at as readCsrf,St as readKanbanCollapsed,Ir as readStoredTheme,Bn as relativeTimeTitle,ca as resetUnsavedChanges,fr as resolveMask,Rr as resolveTheme,pe as rowLabel,fe as rowOrderChanged,r as runShortcut,Xe as runToastAction,he as saveOutcomeText,Oe as setRowSaveState,ue as settledRows,i as shortcutKey,u as shortcutName,s as shortcutsOff,rt as showResultToast,Zr as storeTheme,yt as sumKanbanValues,Ge as syncSelectAll,lr as syncTargets,Kr as themeBootScript,Br as themeKeyframes,cr as tickedKeys,S as toInstant,zr as transitionTheme,Ar as validateFile,De as virtualRange,jr as watchSystemTheme,Pt as withTrustedLabel,me as writeColumnWidths,vt as writeKanbanCollapsed,C as wuiFetch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-elements",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.2",
|
|
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-DV9IZZCu.js";import{n as t}from"./devWarn-DXdRWZs3.js";import{t as n}from"./tourOpenMark-nPeAJFSo.js";var r={"--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`},i=e=>`var(${e}, ${r[e]})`,a=` :host { all: initial; position: fixed; bottom: 20px; left: 20px; right: auto; z-index: ${i(`--wui-z-fixed`)}; display: block; width: 420px; max-width: calc(100vw - 40px); font-family: inherit; font-size: 16px; line-height: 1.5; color: ${i(`--color-text`)}; } :host([position="bottom-right"]) { right: 20px; left: auto; } :host([position="bar"]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; } :host([position="bar"]) .wui-consent-banner-panel { padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0; } :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: ${i(`--color-surface`)}; border: 1px solid ${i(`--color-border`)}; border-radius: ${i(`--wui-radius-lg`)}; box-shadow: ${i(`--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: ${i(`--color-text`)}; } .wui-consent-banner-description { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: ${i(`--color-text-muted`)}; } .wui-consent-banner-policy { color: ${i(`--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 ${i(`--color-border`)}; border-bottom: 1px solid ${i(`--color-border`)}; } .wui-consent-banner-category-description { margin: 2px 0 0; padding-inline-start: 2.5em; font-size: 12px; line-height: 1.4; color: ${i(`--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: ${i(`--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: ${i(`--color-primary`)}; background: ${i(`--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 ${i(`--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 ${i(`--color-primary`)}; outline-offset: 2px; } .btn-primary { background: ${i(`--color-primary`)}; border-color: ${i(`--color-primary`)}; color: ${i(`--color-primary-text`)}; } .btn-primary:hover { background: ${i(`--color-primary-hover`)}; border-color: ${i(`--color-primary-hover`)}; } .btn-outline-secondary { border-color: ${i(`--color-text-muted`)}; color: ${i(`--color-text-muted`)}; } .btn-outline-secondary:hover { background: ${i(`--color-bg-muted`)}; color: ${i(`--color-text`)}; } .btn-link { font-weight: 400; color: ${i(`--color-primary-ink`)}; text-decoration: underline; } .btn-link:hover { color: ${i(`--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; } } @media (min-width: 576px) { :host([position="bar"]) .wui-consent-banner-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; } /* Hidden on the bar, but it stays the dialog's accessible name. */ :host([position="bar"]) .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; } :host([position="bar"]) .wui-consent-banner-description { margin: 0; flex: 1 1 320px; } :host([position="bar"]) .wui-consent-banner-actions { flex: none; } :host([position="bar"]) .wui-consent-banner-settings { flex-basis: 100%; margin: 0; } } `,o=`wui-consent-save`,s=`[data-consent-settings]`,c=`tour-open`,l=`--wui-consent-banner-block`,u=`--wui-consent-banner-inline`,d={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`},f=[`analytics`,`functional`,`marketing`],p={analytics:{label:d.analyticsLabel,description:`analyticsDescription`},functional:{label:d.functionalLabel,description:`functionalDescription`},marketing:{label:d.marketingLabel,description:`marketingDescription`}},m=new Set;function h(e){m.has(e)||(m.add(e),t(`[@webority/ui-elements] <wui-consent-banner> received categories containing "${e}", which is not one of ${f.map(e=>`"${e}"`).join(` | `)}. It is ignored.`))}var g=0,_=null;function v(e){_||(_=new CSSStyleSheet,_.replaceSync(a)),e.adoptedStyleSheets=[_]}var y=class extends e{static get observedAttributes(){return[`heading`,`description`,`policy-href`,`policy-label`,`analytics-description`,`functional-description`,`marketing-description`,`categories`]}constructor(){super(),g+=1,this._uid=`wui-consent-${g}`,this._preferences={analytics:!1,functional:!1,marketing:!1},this._settings=!1,this._onDocumentClick=e=>{e.target instanceof Element&&e.target.closest(s)&&(e.preventDefault(),this.open({settings:!0,focus:!0}))},this._tourWatch=null,this._roomObserver=null,this._onWindowResize=()=>this._reserveRoom()}get position(){let e=this.getAttribute(`position`);return e===`bottom-right`||e===`bar`?e:`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 preview(){return this.hasAttribute(`preview`)}set preview(e){this.toggleAttribute(`preview`,e===!0||e===``||e===`true`)}get heading(){return this.getAttribute(`heading`)||d.heading}set heading(e){this.setAttribute(`heading`,String(e??``))}get description(){return this.getAttribute(`description`)||d.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`)||d.policyLabel}set policyLabel(e){this.setAttribute(`policy-label`,String(e??``))}get analyticsDescription(){return this.getAttribute(`analytics-description`)||d.analyticsDescription}set analyticsDescription(e){this.setAttribute(`analytics-description`,String(e??``))}get functionalDescription(){return this.getAttribute(`functional-description`)||d.functionalDescription}set functionalDescription(e){this.setAttribute(`functional-description`,String(e??``))}get marketingDescription(){return this.getAttribute(`marketing-description`)||d.marketingDescription}set marketingDescription(e){this.setAttribute(`marketing-description`,String(e??``))}get categories(){let e=this.getAttribute(`categories`);if(!e?.trim())return[...f];let t=e.split(/\s+/).filter(Boolean);for(let e of t)f.includes(e)||h(e);let n=f.filter(e=>t.includes(e));return n.length?n:[...f]}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(f.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:[n]}),this.preview&&!this.isOpen&&this.open(),this.isOpen&&this._trackRoom()}disconnectedCallback(){document.removeEventListener(`click`,this._onDocumentClick),this._tourWatch?.disconnect(),this._untrackRoom()}_syncTour(){this.toggleAttribute(c,document.documentElement.hasAttribute(n))}attributeChangedCallback(){this._rendered&&this.render()}render(){let e=this.isOpen,t=this._uid,n=this.policyHref?` <a class="wui-consent-banner-policy" href="${S(this.policyHref)}">${x(this.policyLabel)}</a>`:``,r=this._root();r!==this&&v(r),r.innerHTML=` <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">${x(this.heading)}</h2> <p class="wui-consent-banner-description" id="${t}-description">${x(this.description)}${n}</p> <div class="wui-consent-banner-settings" hidden> ${b(t,`essential`,d.essentialLabel,d.essentialDescription,!0)} ${this.categories.map(e=>b(t,e,p[e].label,this[p[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">${d.settingsLabel}</button> <button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${d.rejectLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${d.acceptLabel}</button> <button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${d.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`,``),this._trackRoom(),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),this._untrackRoom()}_trackRoom(){!this.isConnected||this.preview||(typeof ResizeObserver<`u`&&(this._roomObserver??=new ResizeObserver(()=>this._reserveRoom()),this._roomObserver.observe(this)),window.addEventListener(`resize`,this._onWindowResize),this._reserveRoom())}_untrackRoom(){this._roomObserver?.disconnect(),window.removeEventListener(`resize`,this._onWindowResize),document.documentElement.style.removeProperty(l),document.documentElement.style.removeProperty(u)}_reserveRoom(){let e=this.getBoundingClientRect(),t=this.position===`bar`?0:this.position===`bottom-right`?window.innerWidth-e.left:e.right,n=document.documentElement.style;n.setProperty(l,`${Math.ceil(window.innerHeight-e.top)}px`),n.setProperty(u,`${Math.ceil(t)}px`)}_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(o,{bubbles:!0,composed:!0,detail:{...e}})),this.close()}_choiceForShown(e){let t=this.categories;return Object.fromEntries(f.map(n=>[n,e&&t.includes(n)]))}_switchValues(){let e={};for(let t of f)e[t]=this._root().querySelector(`input[data-category="${t}"]`)?.checked===!0;return e}_applyPreferences(){for(let e of f){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 b(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}">${x(n)}</label> </div> <p class="wui-consent-banner-category-description">${x(r)}</p> </div>`}var x=e=>String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),S=e=>String(e??``).replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`);export{y as t};
|