@zazz-ui/core 0.9.0 → 0.9.1

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/zazz.js CHANGED
@@ -1 +1 @@
1
- import e from"embla-carousel";import t from"embla-carousel-autoplay";import n from"embla-carousel-auto-scroll";import r from"embla-carousel-class-names";import{Signal as i}from"signal-polyfill";function a(e){if(e===`true`)return!0;if(e===`false`)return!1;if(!Number.isNaN(Number(e))&&e.trim()!==``)return Number(e);if(e.startsWith(`[`)&&e.endsWith(`]`))try{return JSON.parse(e)}catch{return e}return e}const o={parseValue:a,parseDataAttributes:(e,t)=>{let n={};for(let r of e.attributes)if(r.name.startsWith(t)){let e=r.name.replace(t,``).replace(/-([a-z])/g,(e,t)=>t.toUpperCase());n[e]=a(r.value)}return n}};typeof window<`u`&&(window.Utils=o);var s=class extends HTMLElement{#e=null;connectedCallback(){this.#e||(this.#e=new AbortController,this.setup(this.#e.signal))}connectedMoveCallback(){}disconnectedCallback(){this.#e?.abort(),this.#e=null,this.teardown?.()}};function c(e,t){typeof window<`u`&&(customElements.get(e)||customElements.define(e,t))}const l=[];function u(e){l.push(e)}function d(e){for(let t of l)t(e)}function f(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}const p=typeof CSS<`u`&&CSS.supports(`top`,`calc(sibling-index() * 1px)`);function m(e){let t=e.trim();return t?/^-?\d*\.?\d+ms$/.test(t)?parseFloat(t):/^-?\d*\.?\d+s$/.test(t)?parseFloat(t)*1e3:parseInt(t,10)||0:0}var h=class e{static#e(){return{margin:`0px`,threshold:.2,duration:f(`--ui-reveal-global-duration`)||`1000ms`,ease:f(`--ui-reveal-global-timing-function`)||`cubic-bezier(0.4, 0, 0.2, 1)`,wait:m(f(`--ui-reveal-global-wait`)),distance:f(`--ui-reveal-global-distance`)||`2rem`,step:f(`--ui-reveal-global-stagger-step`)||`120ms`,grow:parseFloat(f(`--ui-reveal-global-grow`))||.97,shrink:parseFloat(f(`--ui-reveal-global-shrink`))||1.03}}static get defaultConfig(){return e.#e()}#t=/* @__PURE__ */ new Map;config;constructor(t={}){this.config={...e.defaultConfig,...t.config},this.init()}#n(e){let t=JSON.stringify(e),n=this.#t.get(t);return n||(n=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(e.target.setAttribute(`data-reveal-state`,`in-view`),t.unobserve(e.target))})},e),this.#t.set(t,n)),n}#r(e){let t=e.dataset.revealMargin||this.config.margin,n=parseFloat(e.dataset.revealThreshold||this.config.threshold.toString());return{rootMargin:t,threshold:Math.min(Math.max(n,0),1)}}#i(e){let t=e.toString().trim();return/^-?\d*\.?\d+(ms|s)$/.test(t)?t:`${Math.max(0,parseInt(t,10)||0)}ms`}#a(e,t){Object.entries(t).forEach(([t,n])=>{n!=null&&e.style.setProperty(t,n.toString())})}#o(e){let t=e.dataset,n=this.#r(e),r=this.#n(n),i=t.revealStep?Math.max(0,m(t.revealStep)):null,a=t.revealWait?Math.max(0,m(t.revealWait)):null,o={duration:t.revealDuration?Math.max(0,parseInt(t.revealDuration,10)||0):this.config.duration,ease:t.revealEase||this.config.ease,distance:t.revealDistance||this.config.distance,order:t.revealOrder},s=Array.from(e.children),c=o.order===`reversed`?s.reverse():s;this.#a(e,{"--ui-reveal-stagger-base":a===null?null:`${a}ms`,"--ui-reveal-stagger-step":i===null?null:`${i}ms`});let l=0,u=0;if(!p){let t=getComputedStyle(e),n=(e,n)=>Math.max(0,m(t.getPropertyValue(e)||t.getPropertyValue(n)));l=n(`--ui-reveal-stagger-base`,`--ui-reveal-global-wait`),u=n(`--ui-reveal-stagger-step`,`--ui-reveal-global-stagger-step`)}c.forEach((e,n)=>{e instanceof HTMLElement&&(this.#a(e,{"--ui-reveal-duration":this.#i(o.duration),"--ui-reveal-ease":o.ease,"--ui-reveal-wait":p?null:`${l+u*n}ms`,"--ui-reveal-distance":o.distance,"--ui-reveal-scale":t.revealScale||null}),r.observe(e))})}#s(e){let t=e.dataset,n=this.#r(e),r=this.#n(n),i=t.revealDuration?Math.max(0,parseInt(t.revealDuration,10)||0):null,a=t.revealWait?Math.max(0,parseInt(t.revealWait,10)||0):null;this.#a(e,{"--ui-reveal-duration":i===null?null:this.#i(i),"--ui-reveal-wait":a===null?null:this.#i(a),"--ui-reveal-ease":t.revealEase||null,"--ui-reveal-distance":t.revealDistance||null,"--ui-reveal-scale":t.revealScale||null}),r.observe(e)}init(){this.#t.forEach(e=>e.disconnect()),this.#t.clear();let e=document.documentElement.style;e.setProperty(`--ui-reveal-global-duration`,this.#i(this.config.duration)),e.setProperty(`--ui-reveal-global-timing-function`,this.config.ease),e.setProperty(`--ui-reveal-global-wait`,this.#i(this.config.wait)),e.setProperty(`--ui-reveal-global-distance`,this.config.distance),e.setProperty(`--ui-reveal-global-grow`,this.config.grow.toString()),e.setProperty(`--ui-reveal-global-shrink`,this.config.shrink.toString()),e.setProperty(`--ui-reveal-global-stagger-step`,this.#i(this.config.step)),document.querySelectorAll(`[data-reveal]`).forEach(e=>{e instanceof HTMLElement&&this.#s(e)}),document.querySelectorAll(`[data-reveal-each]`).forEach(e=>{e instanceof HTMLElement&&this.#o(e)})}refresh(){this.init()}};if(typeof window<`u`&&typeof document<`u`){let e=null,t=()=>{e||=new h};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t(),u(()=>h.getAutoInstance()?.refresh()),h.disableAutoInit=()=>{e=`disabled`},h.getAutoInstance=()=>e===`disabled`?null:e}typeof window<`u`&&(window.Reveal=h);function g(e,t){e.dispatchEvent(new Event(t,{bubbles:!0}))}function ee(){if(typeof HTMLDialogElement>`u`||!(`closedBy`in HTMLDialogElement.prototype))return!1;let e=document.createElement(`dialog`);return e.setAttribute(`closedby`,`any`),e.closedBy===`any`}function te(e){let t=e.target;if(!(t instanceof HTMLDialogElement)||!t.open||t.getAttribute(`closedby`)!==`any`)return null;let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom?t:null}function ne(){let e=null;document.addEventListener(`pointerdown`,t=>{e=te(t)},!0),document.addEventListener(`pointerup`,t=>{let n=te(t);n&&n===e&&(typeof n.requestClose==`function`?n.requestClose():n.close()),e=null},!0)}const _=function(){_._bound||(_._bound=!0,new MutationObserver(function(e){for(let t of e)t.type===`attributes`&&t.attributeName===`open`&&t.target instanceof HTMLDialogElement&&t.target.hasAttribute(`open`)&&g(t.target,`zazz:dialog-open`)}).observe(document.body,{attributes:!0,attributeFilter:[`open`],subtree:!0}),document.addEventListener(`close`,function(e){e.target instanceof HTMLDialogElement&&g(e.target,`zazz:dialog-close`)},!0),ee()||ne())};typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,_):_());function re(e){return e?e.trim().split(/\s+/).filter(Boolean):[]}const ie={autoplay:e=>t(v(e,`data-carousel-autoplay-`)),"auto-scroll":e=>n(v(e,`data-carousel-auto-scroll-`)),"class-names":e=>r(v(e,`data-carousel-class-names-`))};function v(e,t){return o.parseDataAttributes(e,t)}function y(e){let{autoplay:t,autoScroll:n}=e.plugins();for(let e of[t,n])e&&(e.options.stopOnInteraction===!1?e.reset():e.stop())}function b(e,t,n){let r=(e.getAttribute(`data-carousel-state`)??``).split(/\s+/).filter(Boolean),i=n?[.../* @__PURE__ */ new Set([...r,t])]:r.filter(e=>e!==t);i.length?e.setAttribute(`data-carousel-state`,i.join(` `)):e.removeAttribute(`data-carousel-state`)}function ae(e){let t=()=>{let t=e.slideNodes(),n=new Set(e.slidesInView()),r=new Set(e.internalEngine().slideRegistry[e.selectedScrollSnap()]??[]);t.forEach((e,t)=>{b(e,`in-view`,n.has(t)),b(e,`snapped`,r.has(t))})};e.on(`init`,t).on(`reInit`,t).on(`select`,t).on(`slidesInView`,t)}function x(e,t,n={}){e.forEach((e,r)=>{let i=r===t;b(e,`active`,i),n.ariaCurrent&&(i?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`))})}const oe=(e,t,n)=>{if(!t)return;let r=t.querySelector(`[data-carousel-slot~="dot"]`);if(!r)return;let i=[],a=()=>{let a=e.scrollSnapList().length;if(t.innerHTML=``,a<=1)i=[];else{i=[];for(let o=0;o<a;o++){let a=r.cloneNode(!0);i.push(a),t.appendChild(a),a.addEventListener(`click`,()=>{y(e),e.scrollTo(o)},{signal:n})}}},o=()=>{i.length&&x(i,e.selectedScrollSnap())};return e.on(`init`,a).on(`reInit`,a).on(`init`,o).on(`reInit`,o).on(`select`,o),()=>{t.innerHTML=``}},se=(e,t,n)=>{t.slideNodes().forEach((t,r)=>{t.addEventListener(`click`,()=>{y(e),e.scrollTo(r)},{signal:n})})},S=(e,t)=>{let n=t.slideNodes(),r=()=>{let r=e.selectedScrollSnap();t.scrollTo(r),x(n,r,{ariaCurrent:!0})};e.on(`select`,r),r()};let C=0;function w(e,t,n,r={},i){let a=r.dragThresholdPx??6,o=n.includes(`commandfor`),s=!1,c=!1,l=0,u=0,d=0,f=0,p=0,m=0,h=()=>Math.hypot(d-l,f-u);e.addEventListener(`pointerdown`,e=>{e instanceof PointerEvent&&(e.pointerType!==`mouse`||e.button===0)&&(s=!0,c=!1,l=e.clientX,u=e.clientY,d=e.clientX,f=e.clientY,p=t.selectedScrollSnap())},{passive:!0,signal:i}),e.addEventListener(`pointermove`,e=>{s&&e instanceof PointerEvent&&(d=e.clientX,f=e.clientY,!c&&h()>=a&&(c=!0))},{passive:!0,signal:i});let g=()=>{s&&c&&(m=performance.now()+250,o&&(C=m)),s=!1,c=!1};e.addEventListener(`pointerup`,g,{passive:!0,signal:i}),e.addEventListener(`pointercancel`,g,{passive:!0,signal:i}),t.on(`pointerUp`,g),t.on(`scroll`,()=>{s&&(o?(h()>=a||t.selectedScrollSnap()!==p)&&(c=!0):c=!0)}),e.addEventListener(`click`,t=>{if(performance.now()>m)return;let r=t.target instanceof Element?t.target.closest(n):null;r&&e.contains(r)&&(t.preventDefault(),t.stopImmediatePropagation())},{capture:!0,signal:i})}let T=!1;function E(){T||(T=!0,document.addEventListener(`command`,e=>{e.cancelable&&performance.now()<=C&&e.preventDefault()},!0))}function D(t){if(t.hasAttribute(`data-carousel-init`)||t.closest(`dialog:not([open])`))return;t.setAttribute(`data-carousel-init`,``);let n=t.querySelector(`[data-carousel-slot~="thumbs"]`),r=n?t.querySelector(`[data-carousel-slot~="viewport"]:not([data-carousel-slot~="thumbs"] *)`):t.querySelector(`[data-carousel-slot~="viewport"]`),i=t.querySelector(`[data-carousel-slot~="prev"]`),a=t.querySelector(`[data-carousel-slot~="next"]`),o=t.querySelector(`[data-carousel-slot~="dots"]`);if(!r)return;r.hasAttribute(`tabindex`)||r.setAttribute(`tabindex`,`0`);let s=v(t,`data-carousel-`);Object.keys(s).forEach(function(e){(e===`name`||e===`keyboard`||e===`plugins`||e.startsWith(`autoplay`)||e.startsWith(`autoScroll`)||e.startsWith(`classNames`))&&delete s[e]}),`watchDrag`in s||(s.watchDrag=e=>e.canScrollPrev()||e.canScrollNext());let c=[];for(let e of re(t.getAttribute(`data-carousel-plugins`))){let n=ie[e];n&&c.push(n(t))}let l=e(r,s,c),u=t.ownerDocument.documentElement;l.on(`pointerDown`,()=>{r&&b(r,`dragging`,!0),u.setAttribute(`data-ui-dragging`,``)}),l.on(`pointerUp`,()=>{r&&b(r,`dragging`,!1),u.removeAttribute(`data-ui-dragging`)}),ae(l),t._emblaApi=l;let d=new AbortController,{signal:f}=d;if(t._emblaController=d,i&&i.addEventListener(`click`,()=>{y(l),l.scrollPrev()},{signal:f}),a&&a.addEventListener(`click`,()=>{y(l),l.scrollNext()},{signal:f}),o&&oe(l,o,f),t.querySelector(`[data-carousel-slot~="slide"][commandfor]`)&&w(t,l,`[data-carousel-slot~="slide"][commandfor]`,{dragThresholdPx:14},f),n){let r=n.querySelector(`[data-carousel-slot~="viewport"]`);if(r){let i={containScroll:`keepSnaps`,dragFree:!0},a=v(n,`data-carousel-thumbs-`),o=e(r,{...i,...a});t._emblaApiThumb=o,se(l,o,f),S(l,o),w(n,o,`[data-carousel-slot~="slide"]`,{},f)}}}function O(e){(e||document).querySelectorAll(`:is(ui-carousel, [data-ui~="carousel"])`).forEach(function(e){e.closest(`ui-carousel`)||D(e)})}function ce(){document.addEventListener(`zazz:dialog-open`,function(e){if(!(e.target instanceof HTMLDialogElement))return;let t=e.target;O(t),t.querySelectorAll(`:is(ui-carousel, [data-ui~="carousel"])`).forEach(function(e){let t=e.getAttribute(`data-carousel-start-index`);t!=null&&e._emblaApi&&(e._emblaApi.scrollTo(Number(t),!0),e.removeAttribute(`data-carousel-start-index`));let n=e.querySelector(`[data-carousel-slot~="viewport"]`);n instanceof HTMLElement&&n.focus({preventScroll:!0})})})}function le(){let e=document.querySelector(`dialog[open]`);if(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])[data-carousel-init]`);if(t?._emblaApi&&t.getAttribute(`data-carousel-keyboard`)!==`false`)return t}let t=document.activeElement?.closest(`:is(ui-carousel, [data-ui~="carousel"])[data-carousel-init]`);return t?._emblaApi&&t.getAttribute(`data-carousel-keyboard`)!==`false`?t:null}const k=function(){k._bound||(k._bound=!0,document.addEventListener(`keydown`,function(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.defaultPrevented)return;let t=e.target;if(!(t instanceof HTMLElement)||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t.isContentEditable)return;let n=le();n&&(e.preventDefault(),y(n._emblaApi),e.key===`ArrowLeft`?n._emblaApi.scrollPrev():n._emblaApi.scrollNext())}))},ue={init:O,initRoot:D,addDotBtnsAndClickHandlers:oe,addThumbClickHandlers:se,addTogglethumbsActive:S};function de(){document.addEventListener(`click`,function(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`[data-carousel-start], [data-carousel-slot~='slide'][commandfor]`);if(!t)return;let n=t.getAttribute(`data-carousel-start`);if(n==null&&t.hasAttribute(`commandfor`)){let e=t.closest(`:is(ui-carousel, [data-ui~="carousel"])`);e?._emblaApi&&(n=String(e._emblaApi.selectedScrollSnap()))}let r=t.getAttribute(`commandfor`);if(!r)return;let i=document.getElementById(r);if(!i)return;let a=i.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`);a&&(a._emblaApi?a._emblaApi.scrollTo(Number(n),!0):n!=null&&a.setAttribute(`data-carousel-start-index`,n))})}typeof window<`u`&&typeof document<`u`&&(u(e=>O(e)),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,function(){O(),ce(),de(),k(),E()}):(O(),ce(),de(),k(),E())),typeof window<`u`&&(window.EmblaInit=ue);const A=.1,j=.999,fe=/[\\/_+.#"@[({&]/,pe=/[\\/_+.#"@[({&]/g,me=/[\s-]/,M=/[\s-]/g;function N(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?1:.99;let s=`${i},${a}`,c=o[s];if(c!==void 0)return c;let l=r.charAt(a),u=n.indexOf(l,i),d=0;for(;u>=0;){let s=N(e,t,n,r,u+1,a+1,o);if(s>d){if(u===i)s*=1;else if(fe.test(e.charAt(u-1))){s*=.8;let t=e.slice(i,u-1).match(pe);t&&i>0&&(s*=j**t.length)}else if(me.test(e.charAt(u-1))){s*=.9;let t=e.slice(i,u-1).match(M);t&&i>0&&(s*=j**t.length)}else s*=.17,i>0&&(s*=j**(u-i));e.charAt(u)!==t.charAt(a)&&(s*=.9999)}if(s<A&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a)){let i=N(e,t,n,r,u+1,a+2,o);i*A>s&&(s=i*A)}s>d&&(d=s),u=n.indexOf(l,u+1)}return o[s]=d,d}function P(e){return e.toLowerCase().replace(M,` `)}function he(e,t,n=[]){let r=n.length>0?`${e} ${n.join(` `)}`:e;return N(r,t,P(r),P(t),0,0,{})}Symbol.dispose??=Symbol(`Symbol.dispose`);function F(e,t){return new i.State(e,t)}function I(e,t){return new i.Computed(e,t)}let L=!0;const R=new i.subtle.Watcher(()=>{L&&(L=!1,queueMicrotask(ge))});function ge(){L=!0;for(let e of R.getPending())e.get();R.watch()}function z(e,t={}){let n,r=!1,a=new i.Computed(()=>{typeof n==`function`&&n(),n=e()});R.watch(a),a.get();let o=()=>{r||(r=!0,R.unwatch(a),typeof n==`function`&&n(),n=void 0)};return t.signal?.addEventListener(`abort`,o,{once:!0}),Object.assign(o,{[Symbol.dispose]:o})}typeof window<`u`&&(window.Signals={state:F,computed:I,effect:z});function _e(e,t){let n=e.trim();return t.map((e,t)=>{let r=n===``?1:he(e.value,n,e.keywords);return{index:t,score:r,hidden:r<=0}})}function ve(e,t,n){if(n===0)return-1;switch(t){case`ArrowDown`:return e<0?0:(e+1)%n;case`ArrowUp`:return e<0?n-1:(e-1+n)%n;case`Home`:return 0;case`End`:return n-1;default:return e}}let B=0;var V=class extends s{partSelector(e){return`[data-${this.slotPrefix}-slot~="${e}"]`}config(e){return this.getAttribute(`data-${this.slotPrefix}-${e}`)}managesPanel=!0;openOnFocus=!0;get sortByScore(){return this.config(`sort`)===`score`}autoHighlight=!1;get filtersItems(){return this.config(`filter`)!==`none`}get ordersByScore(){return this.sortByScore&&this.filtersItems}searchInput=null;panel=null;query=F(``);open=F(!1);activeIndex=F(-1);itemsVersion=F(0);setup(e){let t=this.slotPrefix,n=this.querySelector(this.partSelector(`panel`)),r=this.querySelector(`input[role="combobox"]`)??this.querySelector(this.partSelector(`input`));if(!(n instanceof HTMLElement)||!(r instanceof HTMLInputElement))return;this.panel=n,this.searchInput=r;let i=n.querySelector(this.partSelector(`list`));i instanceof HTMLElement&&(i.id||=`ui-${t}-list-${++B}`,r.setAttribute(`aria-controls`,i.id));let a=this.partSelector(`item`),o=e=>e instanceof Element&&(e.matches(a)||e.querySelector(a)!==null),s=new MutationObserver(e=>{e.some(e=>[...e.addedNodes,...e.removedNodes].some(o))&&(this.itemsVersion.set(this.itemsVersion.get()+1),this.autoHighlight&&this.activeIndex.set(0))});s.observe(i??n,{childList:!0,subtree:!0}),e.addEventListener(`abort`,()=>s.disconnect(),{once:!0}),r.addEventListener(`input`,()=>{this.query.set(r.value),this.activeIndex.set(this.autoHighlight?0:-1),this.managesPanel&&!this.#n()&&this.open.set(r.value.length>=this.#t())},{signal:e}),r.addEventListener(`keydown`,e=>this.#i(e),{signal:e}),this.#n()?(this.open.set(!0),r.setAttribute(`aria-expanded`,`true`)):this.managesPanel?(this.openOnFocus&&r.addEventListener(`focus`,()=>{r.value.length>=this.#t()&&this.open.set(!0)},{signal:e}),document.addEventListener(`pointerdown`,e=>{e.target instanceof Node&&(this.contains(e.target)||this.open.set(!1))},{signal:e}),this.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||this.open.set(!1)},{signal:e})):n instanceof HTMLDialogElement?(this.addEventListener(`zazz:dialog-open`,e=>{e.target===n&&(this.open.set(!0),r.focus())},{signal:e}),this.addEventListener(`zazz:dialog-close`,e=>{e.target===n&&this.open.set(!1)},{signal:e})):n.addEventListener(`toggle`,e=>{let t=e.newState===`open`;this.open.set(t),t&&r.focus()},{signal:e}),n.addEventListener(`mousedown`,e=>{e.target instanceof Element&&(e.target.closest(`input, textarea, select, [contenteditable]`)||e.target.closest(this.partSelector(`list`))&&e.preventDefault())},{signal:e}),n.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(this.partSelector(`item`));t&&!t.hidden&&this.commit(t,`pointer`)},{signal:e}),this.#n()||(this.managesPanel?z(()=>{let e=this.open.get();r.setAttribute(`aria-expanded`,String(e)),e&&!this.#r()?n.showPopover():!e&&this.#r()&&n.hidePopover(),e||this.activeIndex.set(-1)},{signal:e}):z(()=>{r.setAttribute(`aria-expanded`,String(this.open.get()))},{signal:e})),z(()=>{let e=this.open.get(),n=this.query.get(),i=this.activeIndex.get();if(!e&&this.managesPanel&&!this.#n()){r.removeAttribute(`aria-activedescendant`);return}let{items:a,ranked:o,visible:s}=this.#e(n),c=this.ordersByScore;for(let e of o){let t=a[e.index];t.hidden=e.hidden,c?t.style.order=String(-Math.round(e.score*1e3)):t.style.order&&t.style.removeProperty(`order`)}s.forEach((e,n)=>{e.id||=`ui-${t}-item-${++B}`,n===i?e.setAttribute(`data-${this.slotPrefix}-state`,`highlighted`):e.removeAttribute(`data-${this.slotPrefix}-state`)});let l=i>=0?s[i]:void 0;l?(r.setAttribute(`aria-activedescendant`,l.id),l.scrollIntoView({block:`nearest`})):r.removeAttribute(`aria-activedescendant`)},{signal:e})}items(){let e=this.panel;return e?Array.from(e.querySelectorAll(this.partSelector(`item`))).filter(e=>e instanceof HTMLElement):[]}visibleItems(e,t){let n=t.filter(e=>!e.hidden);return this.ordersByScore&&n.sort((e,t)=>t.score-e.score||e.index-t.index),n.map(t=>e[t.index])}#e(e){this.itemsVersion.get();let t=this.items(),n=_e(this.filtersItems?e:``,t.map(e=>({value:this.itemValue(e),keywords:(e.getAttribute(`data-${this.slotPrefix}-keywords`)??``).split(/\s+/).filter(Boolean)})));return{items:t,ranked:n,visible:this.visibleItems(t,n)}}itemValue(e){let t=e.getAttribute(`data-${this.slotPrefix}-value`);if(t!==null)return t;if(!e.querySelector(`kbd, ui-kbd-group`))return e.textContent?.trim()??``;let n=e.cloneNode(!0);for(let e of n.querySelectorAll(`kbd, ui-kbd-group`))e.remove();return n.textContent?.trim()??``}clearQuery(){let e=this.searchInput;e&&(e.value=``,this.query.set(``))}#t(){let e=Number(this.config(`min-length`));return Number.isFinite(e)&&e>0?e:0}#n(){return this.managesPanel&&this.panel!==null&&!this.panel.hasAttribute(`popover`)}#r(){return this.panel?.matches(`:popover-open`)??!1}#i(e){let t=this.searchInput;if(t){if(e.key===`Escape`&&this.managesPanel)this.open.get()&&!this.#n()?(e.preventDefault(),this.open.set(!1)):t.value&&(e.preventDefault(),this.clearQuery());else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){if((e.key===`Home`||e.key===`End`)&&this.activeIndex.get()<0)return;e.preventDefault(),this.managesPanel&&!this.open.get()&&this.open.set(!0);let t=this.#e(this.query.get()).visible.length;this.activeIndex.set(ve(this.activeIndex.get(),e.key,t))}else if(e.key===`Enter`){let t=this.activeIndex.get(),n=t>=0?this.#e(this.query.get()).visible[t]:void 0;n&&(e.preventDefault(),this.commit(n,`keyboard`))}}}};c(`ui-autocomplete`,class extends V{slotPrefix=`autocomplete`;commit(e,t){let n=this.searchInput;n&&(n.value=this.itemValue(e),this.query.set(n.value),this.open.set(!1),n.focus(),n.dispatchEvent(new Event(`change`,{bubbles:!0})))}});const H=`data-checkbox-controls`;function ye(e){let t=e.filter(Boolean).length;return t===0?`none`:t===e.length?`all`:`some`}function U(e){let t=e.getAttribute(H);if(!t)return[];let n=(e.form??e.ownerDocument).querySelectorAll(`input[type="checkbox"]`);return Array.from(n).filter(n=>n.name===t&&n!==e)}function be(e){if(!e.name)return null;let t=(e.form??e.ownerDocument).querySelectorAll(`input[type="checkbox"][${H}]`);for(let n of t)if(n.getAttribute(H)===e.name&&n!==e)return n;return null}const W=/* @__PURE__ */ new Map;function G(e){W.get(e)?.members.set(U(e).map(e=>e.checked))}function K(e){let t=F(U(e).map(e=>e.checked)),n=I(()=>ye(t.get())),r=z(()=>{let r=n.get(),i=t.get();e.checked=r===`all`,e.indeterminate=r===`some`,U(e).forEach((e,t)=>{let n=e.closest(`tr`);n&&(i[t]?n.setAttribute(`data-table-state`,`selected`):n.getAttribute(`data-table-state`)===`selected`&&n.removeAttribute(`data-table-state`))})});W.set(e,{members:t,dispose:r})}function xe(e){let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return;if(t.hasAttribute(H)){W.has(t)||K(t);for(let e of U(t))e.checked=t.checked;G(t);return}let n=be(t);n&&(W.has(n)||K(n),G(n))}function q(e=document){for(let[e,t]of W)e.isConnected||(t.dispose(),W.delete(e));let t=e.querySelectorAll(`input[type="checkbox"][${H}]`);for(let e of t)W.has(e)?G(e):K(e)}typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>q()):q(),document.addEventListener(`change`,xe),u(q));let J=null;function Se(){return J||(J=document.createElement(`template`),J.innerHTML=`<span data-ui="badge" data-combobox-slot="tag"><span data-combobox-slot="tag-label"></span><button type="button" tabindex="-1" data-combobox-slot="tag-remove"></button></span>`),J}function Ce(e,t,n){return n?{value:``,clear:!1}:e===``?{value:``,clear:!0}:{value:t,clear:!1}}function we(e,t){return e.replace(`{label}`,t)}c(`ui-combobox`,class extends V{slotPrefix=`combobox`;openOnFocus=!1;#e=``;#t=``;#n=[];#r=``;setup(e){super.setup(e);let t=this.searchInput;if(!t)return;let n=this.#i();this.#t=t.getAttribute(`placeholder`)??``,n&&this.querySelector(`[data-combobox-slot~="list"]`)?.setAttribute(`aria-multiselectable`,`true`);let r=this.#u();if(r!==null&&r.value!==``&&this.#o().length===0&&this.items().find(e=>this.#c(e)===r.value)?.setAttribute(`aria-selected`,`true`),n)for(let e of this.items())e.getAttribute(`aria-selected`)!==`true`&&e.setAttribute(`aria-selected`,`false`);this.#n=this.#o().map(e=>this.#c(e)),this.#e=n?``:this.#s()??``,t.value=this.#e,this.#d(!1);let i=t.closest(`[data-combobox-slot~="control"]`);t.addEventListener(`click`,()=>this.#a(),{signal:e}),i?.addEventListener(`mousedown`,e=>{e.target instanceof Element&&e.target!==t&&(e.preventDefault(),t.focus(),e.target.closest(`[data-combobox-slot~="trigger"], [data-combobox-slot~="tag"]`)||this.#a())},{signal:e}),i?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-combobox-slot~="tag-remove"]`);if(!n)return;e.preventDefault();let r=n.closest(`[data-combobox-slot~="tag"]`)?.getAttribute(`data-combobox-value`);this.#l(this.items().find(e=>this.#c(e)===r)),t.focus()},{signal:e});let a=this.querySelector(`[data-combobox-slot~="trigger"]`);a instanceof HTMLElement&&a.addEventListener(`click`,()=>{this.open.get()?this.open.set(!1):this.#a()},{signal:e}),n&&t.addEventListener(`keydown`,e=>{if(e.key!==`Backspace`||t.value!==``)return;let n=this.#o().at(-1);n&&(e.preventDefault(),this.#l(n))},{signal:e}),this.addEventListener(`focusout`,e=>{let n=e.relatedTarget;if(n instanceof Node&&this.contains(n))return;let r=Ce(t.value,this.#e,this.#i());t.value=r.value,this.query.set(``),r.clear&&this.#m()},{signal:e}),(r??t).form?.addEventListener(`reset`,()=>queueMicrotask(()=>this.#h()),{signal:e})}teardown(){for(let e of this.querySelectorAll(`[data-combobox-slot~="tag"], [data-combobox-state~="stamped"]`))e.remove();this.searchInput&&(this.searchInput.placeholder=this.#t)}itemValue(e){return e.textContent?.trim()??``}clearQuery(){let e=this.searchInput;e&&(e.value=this.#i()?``:this.#e,this.query.set(``))}commit(e,t){let n=this.searchInput;if(n){if(this.#i())e.setAttribute(`aria-selected`,String(e.getAttribute(`aria-selected`)!==`true`)),n.value=``,this.query.set(``),this.activeIndex.set(this.items().indexOf(e)),this.#d(!0),n.focus();else{this.#e=this.itemValue(e),n.value=this.#e,this.query.set(``);for(let e of this.items())e.removeAttribute(`aria-selected`);e.setAttribute(`aria-selected`,`true`),this.#d(!0),n.focus(),this.panel?.hasAttribute(`popover`)?this.open.set(!1):n.select()}}}#i(){return this.config(`variant`)===`multiselect`}#a(){let e=this.searchInput;if(e&&!this.open.get()){if(this.#i())e.value=``,this.activeIndex.set(-1);else{e.value=this.#e;let t=this.#o()[0];this.activeIndex.set(t?this.items().indexOf(t):-1),e.value!==``&&e.select()}this.query.set(``),this.open.set(!0)}}#o(){return this.items().filter(e=>e.getAttribute(`aria-selected`)===`true`)}#s(){let e=this.#o()[0];return e?this.itemValue(e):void 0}#c(e){return e.getAttribute(`data-combobox-value`)??this.itemValue(e)}#l(e){e&&(e.setAttribute(`aria-selected`,`false`),this.#d(!0))}#u(){let e=this.querySelector(`[data-combobox-slot~="value"]:not([data-combobox-state~="stamped"])`);return e instanceof HTMLInputElement?e:null}#d(e){let t=this.searchInput,n=this.#o().map(e=>this.#c(e)),r=JSON.stringify(n),i=r!==this.#r;this.#r=r,t&&this.#i()&&this.#p(t);let a=this.#u();if(!a)return;a.value=n[0]??``;for(let e of this.querySelectorAll(`[data-combobox-state~="stamped"]`))e.remove();let o=a;for(let e of n.slice(1)){let t=document.createElement(`input`);t.type=`hidden`,t.setAttribute(`data-combobox-slot`,`value`),t.setAttribute(`data-combobox-state`,`stamped`),a.name&&(t.name=a.name),t.value=e,o.after(t),o=t}e&&i&&a.dispatchEvent(new Event(`change`,{bubbles:!0}))}#f(){let e=this.querySelector(`[data-combobox-slot~="tag-template"]`),t=(e instanceof HTMLTemplateElement?e:Se()).content.firstElementChild;return t instanceof HTMLElement?t:null}#p(e){let t=e.closest(`[data-combobox-slot~="control"]`);if(!t)return;for(let e of t.querySelectorAll(`[data-combobox-slot~="tag"]`))e.remove();let n=this.#f();if(!n)return;let r=this.config(`label-remove`)??`Remove {label}`,i=this.#o().map(e=>{let t=this.itemValue(e),i=n.cloneNode(!0);if(i.setAttribute(`data-combobox-value`,this.#c(e)),!i.matches(`[data-combobox-slot~="tag"]`)){let e=i.getAttribute(`data-combobox-slot`);i.setAttribute(`data-combobox-slot`,e?`${e} tag`:`tag`)}let a=i.querySelector(`[data-combobox-slot~="tag-label"]`);return a?a.textContent=t:i.prepend(document.createTextNode(t)),i.querySelector(`[data-combobox-slot~="tag-remove"]`)?.setAttribute(`aria-label`,we(r,t)),i});e.before(...i),e.placeholder=i.length>0?``:this.#t}#m(){this.#e=``;let e=this.#i();for(let t of this.items())e?t.setAttribute(`aria-selected`,`false`):t.removeAttribute(`aria-selected`);this.#d(!0)}#h(){let e=this.searchInput;if(!e)return;let t=this.#i();for(let e of this.items()){let n=this.#n.includes(this.#c(e));t?e.setAttribute(`aria-selected`,String(n)):n?e.setAttribute(`aria-selected`,`true`):e.removeAttribute(`aria-selected`)}this.#e=t?``:this.#s()??``,e.value=this.#e,this.query.set(``),this.#d(!0)}});function Te(e){let t=e.split(`+`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0);if(t.length===0)return null;let n={key:``,ctrl:!1,alt:!1,shift:!1,meta:!1,mod:!1};for(let e of t.slice(0,-1))switch(e){case`mod`:n.mod=!0;break;case`ctrl`:case`control`:n.ctrl=!0;break;case`alt`:case`option`:n.alt=!0;break;case`shift`:n.shift=!0;break;case`meta`:case`cmd`:case`super`:n.meta=!0;break;default:return null}return n.key=t[t.length-1],n}function Ee(){return typeof navigator>`u`?!1:/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent)}function De(e,t,n=Ee()){let r=t.meta||t.mod&&n,i=t.ctrl||t.mod&&!n;return e.metaKey!==r||e.ctrlKey!==i||e.altKey!==t.alt||e.shiftKey!==t.shift?!1:e.key.toLowerCase()===t.key}function Oe(e){return e instanceof HTMLElement?e.isContentEditable?!0:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement:!1}function ke(e){return!e.ctrl&&!e.alt&&!e.meta&&!e.mod}function Ae(e,t,n={}){let r=Te(e);return!r||typeof document>`u`?!1:(document.addEventListener(`keydown`,e=>{e.defaultPrevented||e.repeat||ke(r)&&Oe(e.target)||De(e,r)&&(e.preventDefault(),t(e))},{signal:n.signal}),!0)}c(`ui-command`,class extends V{slotPrefix=`command`;managesPanel=!1;autoHighlight=!0;get sortByScore(){return this.config(`sort`)!==`document`}setup(e){super.setup(e);let t=this.searchInput,n=this.panel;if(!t||!n)return;let r=this.getAttribute(`data-command-hotkey`);r&&Ae(r,()=>this.#n(),{signal:e});for(let t of this.items()){let n=t.getAttribute(`data-command-hotkey`);n&&Ae(n,()=>this.#t(t,!0),{signal:e})}let i=()=>{t.value=``,this.query.set(``),this.activeIndex.set(0)};n instanceof HTMLDialogElement?this.addEventListener(`zazz:dialog-close`,e=>{e.target===n&&i()},{signal:e}):n.addEventListener(`toggle`,e=>{e.newState===`closed`&&i()},{signal:e})}commit(e,t){this.#e||this.#t(e,t===`keyboard`)}#e=!1;#t(e,t){if(this.dispatchEvent(new CustomEvent(`zazz:command-select`,{bubbles:!0,detail:{item:e,value:this.itemValue(e)}})),t){this.#e=!0;try{e.click()}finally{this.#e=!1}}e.hasAttribute(`data-command-stay-open`)||this.#r()}#n(){let e=this.panel;e&&(e instanceof HTMLDialogElement?e.open?e.close():e.showModal():e.togglePopover())}#r(){let e=this.panel;e&&(e instanceof HTMLDialogElement?e.open&&e.close():e.matches(`:popover-open`)&&e.hidePopover())}});var je=class extends s{setup(e){let t=this.closest(`dialog`);t&&!t.open?t.addEventListener(`zazz:dialog-open`,()=>this.init(),{signal:e}):this.init()}teardown(){this._emblaController?.abort(),delete this._emblaController,this._emblaApi?.destroy(),this._emblaApiThumb?.destroy(),delete this._emblaApi,delete this._emblaApiThumb,this.removeAttribute(`data-carousel-init`)}init(){ue.initRoot(this)}get api(){return this._emblaApi??null}};c(`ui-carousel`,je),c(`ui-lightbox`,class extends s{setup(e){let t=this.querySelector(`dialog`);t instanceof HTMLDialogElement&&(this.addEventListener(`zazz:dialog-open`,e=>{e.target===t&&this.#t(t)},{signal:e}),this.addEventListener(`zazz:dialog-close`,e=>{e.target===t&&this.#n(t)},{signal:e}))}#e(){return this.querySelector(`[data-lightbox-slot~="gallery"] :is(ui-carousel, [data-ui~="carousel"])`)}#t(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`);if(!t)return;t instanceof je&&t.init();let n=this.#e()?._emblaApi;t._emblaApi&&n&&t._emblaApi.scrollTo(n.selectedScrollSnap(),!0);let r=t.querySelector(`[data-carousel-slot~="viewport"]`);r instanceof HTMLElement&&r.focus({preventScroll:!0})}#n(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`)?._emblaApi,n=this.#e()?._emblaApi;t&&n&&n.scrollTo(t.selectedScrollSnap())}}),c(`ui-menu`,class extends s{setup(e){this.addEventListener(`keydown`,e=>this.#n(e),{signal:e})}#e(){let e=this.querySelector(`:scope > [data-menu-slot~="popover"]`);return e instanceof HTMLElement?e:null}#t(e){return Array.from(e.querySelectorAll(`a[href], button`)).filter(e=>e instanceof HTMLElement).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`&&e.closest(`ui-menu, [data-ui~="menu"]`)===this)}#n(e){if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest(`ui-menu, [data-ui~="menu"]`)!==this)return;let n=this.#e();if(!n)return;let r=t.parentElement===this&&(t.hasAttribute(`popovertarget`)||t.hasAttribute(`interestfor`)),i=n.matches(`:popover-open`);if(r&&!i&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),n.showPopover();let t=this.#t(n);t[e.key===`ArrowDown`?0:t.length-1]?.focus();return}if(!i||!n.contains(t))return;let a=this.#t(n);if(a.length===0)return;let o=a.indexOf(t),s;switch(e.key){case`ArrowDown`:s=o===-1?0:(o+1)%a.length;break;case`ArrowUp`:s=o===-1?a.length-1:(o-1+a.length)%a.length;break;case`Home`:s=0;break;case`End`:s=a.length-1;break;default:return}e.preventDefault(),a[s].focus()}});function Me(e,t){if(!e)return[t];let n=e.split(`-`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e)&&e>0);return n.reduce((e,t)=>e+t,0)===t&&n.length>0?n:[t]}function Ne(e,t,n){let r;switch(t){case`numeric`:r=/[^0-9]/g;break;case`alpha`:r=/[^a-zA-Z]/g;break;case`alphanumeric`:r=/[^a-zA-Z0-9]/g;break;case`none`:r=/\s/g}return e.replace(r,``).slice(0,n)}function Pe(e,t,n,r,i){let a=r?Math.min(n,t-1):-1;return Array.from({length:t},(t,n)=>{let r=e.charAt(n);return{char:r===``?``:i?`•`:r,filled:r!==``,active:n===a}})}function Fe(e,t){return t>0&&e.length===t}c(`ui-otp`,class extends s{#e=null;#t=``;setup(e){let t=this.querySelector(`input`);if(!(t instanceof HTMLInputElement))return;let n=t.maxLength>0?t.maxLength:6,r=this.getAttribute(`data-otp-type`)??`numeric`,i=this.hasAttribute(`data-otp-mask`),a=Me(this.getAttribute(`data-otp-groups`),n),o=this.#n(a);this.setAttribute(`data-otp-ready`,``);let s=F(Ne(t.value,r,n)),c=F(t.selectionStart??0),l=F(document.activeElement===t);t.addEventListener(`input`,()=>{let e=Ne(t.value,r,n);t.value!==e&&(t.value=e),s.set(e),c.set(t.selectionStart??e.length)},{signal:e}),document.addEventListener(`selectionchange`,()=>{document.activeElement===t&&c.set(t.selectionStart??0)},{signal:e}),t.addEventListener(`focus`,()=>l.set(!0),{signal:e}),t.addEventListener(`blur`,()=>l.set(!1),{signal:e}),o.addEventListener(`pointerdown`,e=>{let r=e.target instanceof Element?e.target.closest(`[data-otp-index]`):null;e.preventDefault(),t.focus();let i=r?Number(r.getAttribute(`data-otp-index`)):n,a=Math.min(i,t.value.length);t.setSelectionRange(a,a),c.set(a)},{signal:e}),z(()=>{let e=Pe(s.get(),n,c.get(),l.get(),i),r=o.querySelectorAll(`[data-otp-index]`);e.forEach((e,t)=>{let n=r[t];if(!(n instanceof HTMLElement))return;n.textContent=e.char;let i=[e.filled&&`filled`,e.active&&`active`].filter(Boolean).join(` `);i?n.setAttribute(`data-otp-state`,i):n.removeAttribute(`data-otp-state`)});let a=Fe(s.get(),n);a?this.setAttribute(`data-otp-complete`,``):this.removeAttribute(`data-otp-complete`),a&&this.hasAttribute(`data-otp-auto-submit`)&&this.#t!==s.get()&&(this.#t=s.get(),t.form?.requestSubmit())},{signal:e})}teardown(){this.#e?.remove(),this.#e=null,this.removeAttribute(`data-otp-ready`),this.removeAttribute(`data-otp-complete`)}#n(e){let t=document.createElement(`div`);t.setAttribute(`data-otp-slot`,`rail`),t.setAttribute(`aria-hidden`,`true`);let n=0;return e.forEach((e,r)=>{if(r>0){let e=document.createElement(`span`);e.setAttribute(`data-otp-slot`,`separator`),e.setAttribute(`aria-role`,`presentation`),e.textContent=`–`,t.append(e)}for(let r=0;r<e;r++){let e=document.createElement(`span`);e.setAttribute(`data-otp-slot`,`cell`),e.setAttribute(`data-otp-index`,String(n++)),t.append(e)}}),this.append(t),this.#e=t,t}});function Ie(e,t,n){return{type:e?`text`:`password`,ariaPressed:e?`true`:`false`,ariaLabel:e?n:t}}c(`ui-password`,class extends s{setup(e){let t=this.querySelector(`input[type="password"], input[type="text"]`),n=this.querySelector(`[data-password-group-slot~="toggle"]`);if(!(t instanceof HTMLInputElement)||!(n instanceof HTMLElement))return;let r=F(t.type===`text`);n.addEventListener(`click`,()=>r.set(!r.get()),{signal:e}),z(()=>{let e=this.getAttribute(`data-password-group-label-show`)||`Show password`,i=this.getAttribute(`data-password-group-label-hide`)||`Hide password`,a=Ie(r.get(),e,i);t.type=a.type,n.setAttribute(`aria-pressed`,a.ariaPressed),n.setAttribute(`aria-label`,a.ariaLabel)},{signal:e})}});function Le(e,t,n){return e.length===0?t:e.length===1?e[0]:`${e[0]} ${n.replace(`{n}`,String(e.length-1))}`}let Re=0;c(`ui-multiselect`,class extends s{#e=[];#t=null;setup(e){let t=this.querySelector(`select[multiple]`);if(!(t instanceof HTMLSelectElement))return;this.#t=t;let n=this.getAttribute(`data-multiselect-placeholder`)??`Select…`,r=this.getAttribute(`data-multiselect-label-more`)??`(+{n} more)`,{trigger:i,label:a,panel:o,checkboxes:s}=this.#n(t);t.setAttribute(`data-multiselect-state`,`enhanced`);let c=()=>Array.from(t.selectedOptions).map(e=>e.label),l=F(c());s.forEach((n,r)=>{n.addEventListener(`change`,()=>{let e=t.options[r];e&&(e.selected=n.checked),l.set(c()),t.dispatchEvent(new Event(`change`,{bubbles:!0}))},{signal:e})}),t.addEventListener(`change`,()=>l.set(c()),{signal:e}),t.form?.addEventListener(`reset`,()=>queueMicrotask(()=>l.set(c())),{signal:e}),o.addEventListener(`toggle`,e=>{i.setAttribute(`aria-expanded`,String(e.newState===`open`))},{signal:e}),z(()=>{l.get(),a.textContent=Le(c(),n,r),s.forEach((e,n)=>{let r=t.options[n];r&&e.checked!==r.selected&&(e.checked=r.selected)})},{signal:e})}teardown(){for(let e of this.#e)e.remove();this.#e=[],this.#t?.removeAttribute(`data-multiselect-state`),this.#t=null}#n(e){let t=`ui-multiselect-panel-${++Re}`,n=document.createElement(`button`);n.type=`button`,n.dataset.ui=`select`,n.setAttribute(`data-multiselect-slot`,`trigger`),n.setAttribute(`popovertarget`,t),n.setAttribute(`aria-expanded`,`false`);let r=document.createElement(`span`);r.setAttribute(`data-multiselect-slot`,`label`);let i=document.createElement(`span`);i.setAttribute(`data-multiselect-slot`,`icon`),i.setAttribute(`aria-hidden`,`true`),n.append(r,i);let a=document.createElement(`div`);a.id=t,a.setAttribute(`data-multiselect-slot`,`panel`),a.setAttribute(`popover`,`auto`);let o=this.getAttribute(`data-multiselect-side`),s=this.getAttribute(`data-multiselect-align`);o&&a.setAttribute(`data-popover-side`,o),s&&a.setAttribute(`data-popover-align`,s);let c=[];for(let[n,r]of Array.from(e.options).entries()){let e=document.createElement(`label`);e.setAttribute(`data-multiselect-slot`,`option`);let i=document.createElement(`input`);i.type=`checkbox`,i.id=`${t}-${n}`,i.checked=r.selected,i.disabled=r.disabled,e.append(i,document.createTextNode(r.label)),a.append(e),c.push(i)}return e.after(n,a),this.#e=[n,a],{trigger:n,label:r,panel:a,checkboxes:c}}}),c(`ui-tabs`,class extends s{setup(e){this.addEventListener(`keydown`,e=>this.#e(e),{signal:e})}#e(e){let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=t.closest(`[role="tablist"], [data-tabs-slot~="list"]`);if(!n||n.closest(`ui-tabs, [data-ui~="tabs"]`)!==this)return;let r=Array.from(n.querySelectorAll(`input[type="radio"]`)).filter(e=>e instanceof HTMLInputElement).filter(e=>!e.disabled);if(r.length<2)return;let i=this.getAttribute(`data-tabs-orientation`)===`vertical`,a=i?`ArrowUp`:`ArrowLeft`,o=i?`ArrowDown`:`ArrowRight`,s=r.indexOf(t);if(s===-1)return;let c;switch(e.key){case a:c=(s-1+r.length)%r.length;break;case o:c=(s+1)%r.length;break;case`Home`:c=0;break;case`End`:c=r.length-1;break;default:return}e.preventDefault();let l=r[c];l.checked=!0,l.focus(),l.dispatchEvent(new Event(`change`,{bubbles:!0}))}});function ze(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}Symbol.dispose??=Symbol(`Symbol.dispose`);const Be=[`success`,`info`,`warning`,`destructive`],Ve={success:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg>`,info:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"/></svg>`,warning:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd"/></svg>`,destructive:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/></svg>`,close:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>`};function He(e){for(let t of e)t.style.blockSize=`auto`;return{[Symbol.dispose](){for(let t of e)t.style.removeProperty(`block-size`)}}}function Ue(e){let t=e.length,n=Array.from({length:t}),r=0;for(let i=t-1;i>=0;i--){let a=t-1-i;n[i]={stackIndex:a,offsetPx:r,zIndex:t-a,front:a===0,visible:a<3},r+=e[i]}return{toasts:n,frontToastHeightPx:t>0?e[t-1]:null}}function Y(e,t,n){let r=(e.getAttribute(`data-toaster-state`)??``).split(/\s+/).filter(Boolean),i=n?[.../* @__PURE__ */ new Set([...r,t])]:r.filter(e=>e!==t);i.length?e.setAttribute(`data-toaster-state`,i.join(` `)):e.removeAttribute(`data-toaster-state`)}function X(e){return e.matches(`[data-toaster-state~="removed"]`)}var Z=class extends s{#e=/* @__PURE__ */ new Map;#t=0;#n=0;#r=null;#i=0;#a=F(!1);#o=F(typeof document<`u`&&document.hidden);#s=I(()=>this.#a.get()||this.#o.get());#c=F([]);#l=I(()=>Ue(this.#c.get().map(e=>e.height)));setup(e){if(this.hasAttribute(`popover`)||this.setAttribute(`popover`,`manual`),this.hasAttribute(`role`)||this.setAttribute(`role`,`region`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Notifications`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`-1`),!this.querySelector(`[data-toaster-slot~="list"]`)){let e=document.createElement(`ol`);e.setAttribute(`data-toaster-slot`,`list`),e.setAttribute(`aria-live`,`polite`),e.setAttribute(`aria-relevant`,`additions text`),e.setAttribute(`aria-atomic`,`false`),this.append(e)}this.addEventListener(`command`,e=>this.#u(e),{signal:e}),this.addEventListener(`mouseenter`,()=>this.#h(!0),{signal:e}),this.addEventListener(`mouseleave`,()=>this.#g(),{signal:e}),this.addEventListener(`focusin`,()=>this.#h(!0),{signal:e}),this.addEventListener(`focusout`,()=>this.#g(),{signal:e}),document.addEventListener(`visibilitychange`,()=>this.#o.set(document.hidden),{signal:e}),window.addEventListener(`resize`,()=>{cancelAnimationFrame(this.#n),this.#n=requestAnimationFrame(()=>this.#f())},{signal:e}),z(()=>{Y(this,`expanded`,this.#a.get())},{signal:e}),z(()=>{this.#s.get()?this.#y():this.#b()},{signal:e}),z(()=>{let e=this.#c.get(),{toasts:t,frontToastHeightPx:n}=this.#l.get();for(let n=0;n<e.length;n++){let{node:r,height:i}=e[n],a=t[n];Y(r,`front`,a.front),Y(r,`visible`,a.visible),r.style.zIndex=String(a.zIndex),r.style.setProperty(`--toasts-before`,String(a.stackIndex)),r.style.setProperty(`--initial-height`,`${i}px`),r.style.setProperty(`--offset`,`calc(${a.offsetPx}px + var(--ui-toaster-gap) * ${a.stackIndex})`)}n!==null&&this.style.setProperty(`--front-toast-height`,`${n}px`)},{signal:e})}teardown(){cancelAnimationFrame(this.#n),window.clearTimeout(this.#i);for(let e of this.#e.values())clearTimeout(e.timeoutId);this.#e.clear()}addToast(e={}){let t=`toast-${++this.#t}`,n=this.#p();return this.#x(),n.append(this.#d(e,t)),this.#f(),this.#_(t,e.duration??4e3),t}dismiss(e){if(e===void 0){this.dismissAll();return}let t=this.#p().querySelector(`[data-toaster-id="${CSS.escape(e)}"]`);if(!(t instanceof HTMLElement)||X(t))return;let n=this.#e.get(e);n&&clearTimeout(n.timeoutId),this.#e.delete(e),Y(t,`removed`,!0);let r=document.activeElement;r instanceof HTMLElement&&t.contains(r)&&r.matches(`:focus-visible`)&&this.#m().filter(e=>!X(e)).at(-1)?.focus({preventScroll:!0}),this.#f(),this.#C(t)}dismissAll(){for(let e of this.#m()){let t=e.dataset.toasterId;t&&this.dismiss(t)}}#u(e){let t=e.command;if(typeof t!=`string`||!t.startsWith(`--toast`))return;let n=this.#r;if(n&&n.source===e.source&&n.command===t)return;this.#r={source:e.source,command:t},window.setTimeout(()=>{this.#r=null},0);let r=e.source,i={},a=t.slice(8);if(Be.includes(a)&&(i.variant=a),r instanceof HTMLElement){let{toasterTitle:e,toasterDescription:t,toasterVariant:n,toasterDuration:a,toasterCloseButton:o}=r.dataset;if(e&&(i.title=e),t&&(i.description=t),!i.variant&&n&&Be.includes(n)&&(i.variant=n),a!==void 0){let e=a.trim()===``?NaN:Number(a);Number.isNaN(e)||(i.duration=e)}o!==void 0&&(i.closeButton=o!==`false`)}this.addToast(i)}#d(e,t){let n=document.createElement(`li`);if(n.setAttribute(`data-toaster-slot`,`toast`),n.dataset.toasterId=t,n.tabIndex=0,e.variant&&(n.dataset.toasterVariant=e.variant),e.variant){let t=document.createElement(`span`);t.setAttribute(`data-toaster-slot`,`icon`),t.setAttribute(`aria-hidden`,`true`),t.innerHTML=Ve[e.variant],n.append(t)}let r=document.createElement(`div`);if(r.setAttribute(`data-toaster-slot`,`content`),e.title){let t=document.createElement(`div`);t.setAttribute(`data-toaster-slot`,`title`),t.textContent=e.title,r.append(t)}if(e.description){let t=document.createElement(`div`);t.setAttribute(`data-toaster-slot`,`description`),t.textContent=e.description,r.append(t)}n.append(r);let i=e.action;if(i){let e=document.createElement(`button`);e.type=`button`,e.dataset.ui=`button`,e.setAttribute(`data-toaster-slot`,`action`),e.dataset.buttonSize=`sm`,e.textContent=i.label,e.addEventListener(`click`,e=>{i.onClick?.(e),e.defaultPrevented||this.dismiss(t)}),n.append(e)}if(e.closeButton!==!1){let e=document.createElement(`button`);e.type=`button`,e.dataset.ui=`button`,e.setAttribute(`data-toaster-slot`,`close`),e.dataset.buttonVariant=`ghost`,e.dataset.buttonSize=`icon-sm`,e.setAttribute(`aria-label`,`Close notification`),e.innerHTML=Ve.close,e.addEventListener(`click`,()=>this.dismiss(t)),n.append(e)}return n}#f(){try{var e=ze();let t=this.#m().filter(e=>!X(e));e.u(He(t));let n=t.map(e=>({node:e,height:e.offsetHeight}));this.#c.set(n)}catch(t){e.e=t}finally{e.d()}}#p(){let e=this.querySelector(`[data-toaster-slot~="list"]`);return e instanceof HTMLOListElement||(e=document.createElement(`ol`),e.setAttribute(`data-toaster-slot`,`list`),this.append(e)),e}#m(){return Array.from(this.#p().children).filter(e=>e instanceof HTMLElement).filter(e=>e.matches(`[data-toaster-slot~="toast"]`))}#h(e){e&&window.clearTimeout(this.#i),this.#a.set(e)}#g(){window.clearTimeout(this.#i),this.#i=window.setTimeout(()=>{let e=document.activeElement,t=e instanceof Node&&this.contains(e);!this.matches(`:hover`)&&!t&&this.#h(!1)},100)}#_(e,t){if(t===1/0||Number.isNaN(t))return;let n={remaining:t,startedAt:0,timeoutId:0};this.#e.set(e,n),this.#s.get()||this.#v(e,n)}#v(e,t){t.startedAt=Date.now(),t.timeoutId=window.setTimeout(()=>this.dismiss(e),t.remaining)}#y(){for(let e of this.#e.values())e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=0,e.remaining=Math.max(0,e.remaining-(Date.now()-e.startedAt)))}#b(){if(!this.#s.get())for(let[e,t]of this.#e)t.timeoutId||this.#v(e,t)}#x(){try{this.matches(`:popover-open`)||this.showPopover()}catch{}}#S(){try{this.matches(`:popover-open`)&&this.hidePopover()}catch{}}#C(e){let t=!1,n=()=>{t||(t=!0,e.remove(),this.#m().length===0&&(this.#h(!1),this.#S()))};e.addEventListener(`transitionend`,t=>{t.target===e&&n()});let r=getComputedStyle(e).transitionDuration.split(`,`).reduce((e,t)=>Math.max(e,Number.parseFloat(t)||0),0);window.setTimeout(n,Math.max(600,r*1e3+100))}};function We(e){let t=e instanceof Element?e:typeof e==`string`?document.getElementById(e):document.querySelector(`ui-toaster, [data-ui~="toaster"]`);return t instanceof Z?t:(console.warn('Toaster: no <ui-toaster> found. Add `<ui-toaster popover="manual"></ui-toaster>` to the page.'),null)}function Ge(e){return typeof e==`string`?{title:e}:e??{}}const Q={toast(e){let t=Ge(e),n=We(t.region);return n?n.addToast(t):null},success(e,t){return Q.toast({...t,title:e,variant:`success`})},info(e,t){return Q.toast({...t,title:e,variant:`info`})},warning(e,t){return Q.toast({...t,title:e,variant:`warning`})},error(e,t){return Q.toast({...t,title:e,variant:`destructive`})},dismiss(e){for(let t of document.querySelectorAll(`ui-toaster, [data-ui~="toaster"]`))t instanceof Z&&t.dismiss(e)}};c(`ui-toaster`,Z),typeof window<`u`&&(window.Toaster=Q);function $(e){return e.documentElement.getAttribute(`data-ui-navigation`)===`swap`}function Ke(e){let t=[];for(let n of[e,...e.querySelectorAll(`*`)])(n.scrollTop||n.scrollLeft)&&t.push([n,n.scrollTop,n.scrollLeft]);return t}function qe(e,t){let n=/* @__PURE__ */ new Map;for(let e of t.querySelectorAll(`a[href], area[href]`)){let t=e.getAttribute(`href`);n.set(t,[...n.get(t)??[],e])}for(let t of e.querySelectorAll(`a[href], area[href]`)){let e=(n.get(t.getAttribute(`href`))?.shift())?.getAttribute(`aria-current`);e==null?t.removeAttribute(`aria-current`):t.setAttribute(`aria-current`,e)}}function Je(e){let t=document.body,n=/* @__PURE__ */ new Map,r=[];for(let e of t.querySelectorAll(`[data-ui-persist]`)){let t=e.getAttribute(`data-ui-persist`);t&&!n.has(t)&&n.set(t,e)}for(let e of n.values())r.push(...Ke(e));let i=/* @__PURE__ */ new Map;for(let e of t.querySelectorAll(`[data-ui-persist-scroll]`)){let t=e.getAttribute(`data-ui-persist-scroll`);t&&!i.has(t)&&i.set(t,[e.scrollTop,e.scrollLeft])}let a=document.importNode(e,!0),o=[];for(let e of a.querySelectorAll(`[data-ui-persist]`)){let t=n.get(e.getAttribute(`data-ui-persist`)??``);t&&o.push([e,t])}for(let e of a.querySelectorAll(`[data-ui-persist-scroll]`)){let t=e.getAttribute(`data-ui-persist-scroll`)??``,n=i.get(t);i.delete(t),n&&r.push([e,...n])}t.before(a);for(let[e,t]of o){let n=e.parentNode;n&&(qe(t,e),typeof n.moveBefore==`function`?n.moveBefore(t,e):n.insertBefore(t,e),e.remove())}t.remove();for(let[e,t,n]of r)e.scrollTo({top:t,left:n,behavior:`instant`});return a}function Ye(e){let t=e.querySelector(`main`),n=t?.querySelector(`h1`)??t??e;n instanceof HTMLElement&&(n.hasAttribute(`tabindex`)||(n.tabIndex=-1),n.focus({preventScroll:!0}))}let Xe=0,Ze=``;function Qe(){let e=document.documentElement.style;Xe++===0&&(Ze=e.scrollBehavior,e.scrollBehavior=`auto`);let t=!0;return()=>{t&&(t=!1,--Xe===0&&(e.scrollBehavior=Ze))}}function $e(e){return new URL(e,location.href).origin===location.origin}function et(e){let t=/\.([a-z0-9]+)$/i.exec(new URL(e,location.href).pathname)?.[1];return!t||/^x?html?$/i.test(t)}if(`navigation`in window){let e=null;function t(t){e=t,location.replace(t)}window.navigation.addEventListener(`navigate`,n=>{e!==null&&n.destination.url===e?e=null:$(document)&&n.canIntercept&&n.navigationType!==`reload`&&!n.hashChange&&n.downloadRequest===null&&n.formData===null&&$e(n.destination.url)&&et(n.destination.url)&&n.intercept({async handler(){let e;try{let t=await fetch(n.destination.url,{signal:n.signal});if(!t.ok)throw Error(t.statusText);if(!t.headers.get(`content-type`)?.includes(`html`))throw Error(`not a page`);e=new DOMParser().parseFromString(await t.text(),`text/html`)}catch{if(n.signal.aborted)return;t(n.destination.url);return}if(n.signal.aborted)return;if(!$(e)||!(e.body instanceof HTMLElement)){t(n.destination.url);return}let r=document.body,i=()=>{r=Je(e.body),document.title=e.title,n.scroll()},a=Qe();if(document.startViewTransition)try{await document.startViewTransition(i).finished}finally{a()}else try{i()}finally{requestAnimationFrame(()=>requestAnimationFrame(a))}d(r),Ye(r)}})})}else $(document)&&console.warn(`Navigation API not supported: data-ui-navigation falls back to full page loads.`);typeof CSS<`u`&&!CSS.supports(`container-type`,`scroll-state`)&&import(`./scroll-state-C8mA5gq6.js`);function tt(){for(let e of document.querySelectorAll(`[style]`))if(e.getAttribute(`style`)?.includes(`:`)&&e.style.length===0)return!0;return!1}if(typeof document<`u`){let e=()=>{tt()&&import(`./csp-DR-s45Kg.js`)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):e()}export{u as t};
1
+ import e from"embla-carousel";import t from"embla-carousel-autoplay";import n from"embla-carousel-auto-scroll";import r from"embla-carousel-class-names";import{Signal as i}from"signal-polyfill";function a(e){if(e===`true`)return!0;if(e===`false`)return!1;if(!Number.isNaN(Number(e))&&e.trim()!==``)return Number(e);if(e.startsWith(`[`)&&e.endsWith(`]`))try{return JSON.parse(e)}catch{return e}return e}const o={parseValue:a,parseDataAttributes:(e,t)=>{let n={};for(let r of e.attributes)if(r.name.startsWith(t)){let e=r.name.replace(t,``).replace(/-([a-z])/g,(e,t)=>t.toUpperCase());n[e]=a(r.value)}return n}};typeof window<`u`&&(window.Utils=o);var s=class extends HTMLElement{#e=null;connectedCallback(){this.#e||(this.#e=new AbortController,this.setup(this.#e.signal))}connectedMoveCallback(){}disconnectedCallback(){this.#e?.abort(),this.#e=null,this.teardown?.()}};function c(e,t){typeof window<`u`&&(customElements.get(e)||customElements.define(e,t))}const l=[];function u(e){l.push(e)}function d(e){for(let t of l)t(e)}function f(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}const p=typeof CSS<`u`&&CSS.supports(`top`,`calc(sibling-index() * 1px)`);function m(e){let t=e.trim();return t?/^-?\d*\.?\d+ms$/.test(t)?parseFloat(t):/^-?\d*\.?\d+s$/.test(t)?parseFloat(t)*1e3:parseInt(t,10)||0:0}var h=class e{static#e(){return{margin:`0px`,threshold:.2,duration:f(`--ui-reveal-global-duration`)||`1000ms`,ease:f(`--ui-reveal-global-timing-function`)||`cubic-bezier(0.4, 0, 0.2, 1)`,wait:m(f(`--ui-reveal-global-wait`)),distance:f(`--ui-reveal-global-distance`)||`2rem`,step:f(`--ui-reveal-global-stagger-step`)||`120ms`,grow:parseFloat(f(`--ui-reveal-global-grow`))||.97,shrink:parseFloat(f(`--ui-reveal-global-shrink`))||1.03}}static get defaultConfig(){return e.#e()}#t=/* @__PURE__ */ new Map;config;constructor(t={}){this.config={...e.defaultConfig,...t.config},this.init()}#n(e){let t=JSON.stringify(e),n=this.#t.get(t);return n||(n=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(e.target.setAttribute(`data-reveal-state`,`in-view`),t.unobserve(e.target))})},e),this.#t.set(t,n)),n}#r(e){let t=e.dataset.revealMargin||this.config.margin,n=parseFloat(e.dataset.revealThreshold||this.config.threshold.toString());return{rootMargin:t,threshold:Math.min(Math.max(n,0),1)}}#i(e){let t=e.toString().trim();return/^-?\d*\.?\d+(ms|s)$/.test(t)?t:`${Math.max(0,parseInt(t,10)||0)}ms`}#a(e,t){Object.entries(t).forEach(([t,n])=>{n!=null&&e.style.setProperty(t,n.toString())})}#o(e){let t=e.dataset,n=this.#r(e),r=this.#n(n),i=t.revealStep?Math.max(0,m(t.revealStep)):null,a=t.revealWait?Math.max(0,m(t.revealWait)):null,o={duration:t.revealDuration?Math.max(0,parseInt(t.revealDuration,10)||0):this.config.duration,ease:t.revealEase||this.config.ease,distance:t.revealDistance||this.config.distance,order:t.revealOrder},s=Array.from(e.children),c=o.order===`reversed`?s.reverse():s;this.#a(e,{"--ui-reveal-stagger-base":a===null?null:`${a}ms`,"--ui-reveal-stagger-step":i===null?null:`${i}ms`});let l=0,u=0;if(!p){let t=getComputedStyle(e),n=(e,n)=>Math.max(0,m(t.getPropertyValue(e)||t.getPropertyValue(n)));l=n(`--ui-reveal-stagger-base`,`--ui-reveal-global-wait`),u=n(`--ui-reveal-stagger-step`,`--ui-reveal-global-stagger-step`)}c.forEach((e,n)=>{e instanceof HTMLElement&&(this.#a(e,{"--ui-reveal-duration":this.#i(o.duration),"--ui-reveal-ease":o.ease,"--ui-reveal-wait":p?null:`${l+u*n}ms`,"--ui-reveal-distance":o.distance,"--ui-reveal-scale":t.revealScale||null}),r.observe(e))})}#s(e){let t=e.dataset,n=this.#r(e),r=this.#n(n),i=t.revealDuration?Math.max(0,parseInt(t.revealDuration,10)||0):null,a=t.revealWait?Math.max(0,parseInt(t.revealWait,10)||0):null;this.#a(e,{"--ui-reveal-duration":i===null?null:this.#i(i),"--ui-reveal-wait":a===null?null:this.#i(a),"--ui-reveal-ease":t.revealEase||null,"--ui-reveal-distance":t.revealDistance||null,"--ui-reveal-scale":t.revealScale||null}),r.observe(e)}init(){this.#t.forEach(e=>e.disconnect()),this.#t.clear();let e=document.documentElement.style;e.setProperty(`--ui-reveal-global-duration`,this.#i(this.config.duration)),e.setProperty(`--ui-reveal-global-timing-function`,this.config.ease),e.setProperty(`--ui-reveal-global-wait`,this.#i(this.config.wait)),e.setProperty(`--ui-reveal-global-distance`,this.config.distance),e.setProperty(`--ui-reveal-global-grow`,this.config.grow.toString()),e.setProperty(`--ui-reveal-global-shrink`,this.config.shrink.toString()),e.setProperty(`--ui-reveal-global-stagger-step`,this.#i(this.config.step)),document.querySelectorAll(`[data-reveal]`).forEach(e=>{e instanceof HTMLElement&&this.#s(e)}),document.querySelectorAll(`[data-reveal-each]`).forEach(e=>{e instanceof HTMLElement&&this.#o(e)})}refresh(){this.init()}};if(typeof window<`u`&&typeof document<`u`){let e=null,t=()=>{e||=new h};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t(),u(()=>h.getAutoInstance()?.refresh()),h.disableAutoInit=()=>{e=`disabled`},h.getAutoInstance=()=>e===`disabled`?null:e}typeof window<`u`&&(window.Reveal=h);function g(e,t){e.dispatchEvent(new Event(t,{bubbles:!0}))}function ee(){if(typeof HTMLDialogElement>`u`||!(`closedBy`in HTMLDialogElement.prototype))return!1;let e=document.createElement(`dialog`);return e.setAttribute(`closedby`,`any`),e.closedBy===`any`}function te(e){let t=e.target;if(!(t instanceof HTMLDialogElement)||!t.open||t.getAttribute(`closedby`)!==`any`)return null;let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom?t:null}function ne(){let e=null;document.addEventListener(`pointerdown`,t=>{e=te(t)},!0),document.addEventListener(`pointerup`,t=>{let n=te(t);n&&n===e&&(typeof n.requestClose==`function`?n.requestClose():n.close()),e=null},!0)}const _=function(){_._bound||(_._bound=!0,new MutationObserver(function(e){for(let t of e)t.type===`attributes`&&t.attributeName===`open`&&t.target instanceof HTMLDialogElement&&t.target.hasAttribute(`open`)&&g(t.target,`zazz:dialog-open`)}).observe(document.documentElement,{attributes:!0,attributeFilter:[`open`],subtree:!0}),document.addEventListener(`close`,function(e){e.target instanceof HTMLDialogElement&&g(e.target,`zazz:dialog-close`)},!0),ee()||ne())};typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,_):_());function re(e){return e?e.trim().split(/\s+/).filter(Boolean):[]}const ie={autoplay:e=>t(v(e,`data-carousel-autoplay-`)),"auto-scroll":e=>n(v(e,`data-carousel-auto-scroll-`)),"class-names":e=>r(v(e,`data-carousel-class-names-`))};function v(e,t){return o.parseDataAttributes(e,t)}function y(e){let{autoplay:t,autoScroll:n}=e.plugins();for(let e of[t,n])e&&(e.options.stopOnInteraction===!1?e.reset():e.stop())}function b(e,t,n){let r=(e.getAttribute(`data-carousel-state`)??``).split(/\s+/).filter(Boolean),i=n?[.../* @__PURE__ */ new Set([...r,t])]:r.filter(e=>e!==t);i.length?e.setAttribute(`data-carousel-state`,i.join(` `)):e.removeAttribute(`data-carousel-state`)}function ae(e){let t=()=>{let t=e.slideNodes(),n=new Set(e.slidesInView()),r=new Set(e.internalEngine().slideRegistry[e.selectedScrollSnap()]??[]);t.forEach((e,t)=>{b(e,`in-view`,n.has(t)),b(e,`snapped`,r.has(t))})};e.on(`init`,t).on(`reInit`,t).on(`select`,t).on(`slidesInView`,t)}function x(e,t,n={}){e.forEach((e,r)=>{let i=r===t;b(e,`active`,i),n.ariaCurrent&&(i?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`))})}const oe=(e,t,n)=>{if(!t)return;let r=t.querySelector(`[data-carousel-slot~="dot"]`);if(!r)return;let i=[],a=()=>{let a=e.scrollSnapList().length;if(t.innerHTML=``,a<=1)i=[];else{i=[];for(let o=0;o<a;o++){let a=r.cloneNode(!0);i.push(a),t.appendChild(a),a.addEventListener(`click`,()=>{y(e),e.scrollTo(o)},{signal:n})}}},o=()=>{i.length&&x(i,e.selectedScrollSnap())};return e.on(`init`,a).on(`reInit`,a).on(`init`,o).on(`reInit`,o).on(`select`,o),()=>{t.innerHTML=``}},se=(e,t,n)=>{t.slideNodes().forEach((t,r)=>{t.addEventListener(`click`,()=>{y(e),e.scrollTo(r)},{signal:n})})},S=(e,t)=>{let n=t.slideNodes(),r=()=>{let r=e.selectedScrollSnap();t.scrollTo(r),x(n,r,{ariaCurrent:!0})};e.on(`select`,r),r()};let C=0;function w(e,t,n,r={},i){let a=r.dragThresholdPx??6,o=n.includes(`commandfor`),s=!1,c=!1,l=0,u=0,d=0,f=0,p=0,m=0,h=()=>Math.hypot(d-l,f-u);e.addEventListener(`pointerdown`,e=>{e instanceof PointerEvent&&(e.pointerType!==`mouse`||e.button===0)&&(s=!0,c=!1,l=e.clientX,u=e.clientY,d=e.clientX,f=e.clientY,p=t.selectedScrollSnap())},{passive:!0,signal:i}),e.addEventListener(`pointermove`,e=>{s&&e instanceof PointerEvent&&(d=e.clientX,f=e.clientY,!c&&h()>=a&&(c=!0))},{passive:!0,signal:i});let g=()=>{s&&c&&(m=performance.now()+250,o&&(C=m)),s=!1,c=!1};e.addEventListener(`pointerup`,g,{passive:!0,signal:i}),e.addEventListener(`pointercancel`,g,{passive:!0,signal:i}),t.on(`pointerUp`,g),t.on(`scroll`,()=>{s&&(o?(h()>=a||t.selectedScrollSnap()!==p)&&(c=!0):c=!0)}),e.addEventListener(`click`,t=>{if(performance.now()>m)return;let r=t.target instanceof Element?t.target.closest(n):null;r&&e.contains(r)&&(t.preventDefault(),t.stopImmediatePropagation())},{capture:!0,signal:i})}let T=!1;function E(){T||(T=!0,document.addEventListener(`command`,e=>{e.cancelable&&performance.now()<=C&&e.preventDefault()},!0))}function D(t){if(t.hasAttribute(`data-carousel-init`)||t.closest(`dialog:not([open])`))return;t.setAttribute(`data-carousel-init`,``);let n=t.querySelector(`[data-carousel-slot~="thumbs"]`),r=n?t.querySelector(`[data-carousel-slot~="viewport"]:not([data-carousel-slot~="thumbs"] *)`):t.querySelector(`[data-carousel-slot~="viewport"]`),i=t.querySelector(`[data-carousel-slot~="prev"]`),a=t.querySelector(`[data-carousel-slot~="next"]`),o=t.querySelector(`[data-carousel-slot~="dots"]`);if(!r)return;r.hasAttribute(`tabindex`)||r.setAttribute(`tabindex`,`0`);let s=v(t,`data-carousel-`);Object.keys(s).forEach(function(e){(e===`name`||e===`keyboard`||e===`plugins`||e.startsWith(`autoplay`)||e.startsWith(`autoScroll`)||e.startsWith(`classNames`))&&delete s[e]}),`watchDrag`in s||(s.watchDrag=e=>e.canScrollPrev()||e.canScrollNext());let c=[];for(let e of re(t.getAttribute(`data-carousel-plugins`))){let n=ie[e];n&&c.push(n(t))}let l=e(r,s,c),u=t.ownerDocument.documentElement;l.on(`pointerDown`,()=>{r&&b(r,`dragging`,!0),u.setAttribute(`data-ui-dragging`,``)}),l.on(`pointerUp`,()=>{r&&b(r,`dragging`,!1),u.removeAttribute(`data-ui-dragging`)}),ae(l),t._emblaApi=l;let d=new AbortController,{signal:f}=d;if(t._emblaController=d,i&&i.addEventListener(`click`,()=>{y(l),l.scrollPrev()},{signal:f}),a&&a.addEventListener(`click`,()=>{y(l),l.scrollNext()},{signal:f}),o&&oe(l,o,f),t.querySelector(`[data-carousel-slot~="slide"][commandfor]`)&&w(t,l,`[data-carousel-slot~="slide"][commandfor]`,{dragThresholdPx:14},f),n){let r=n.querySelector(`[data-carousel-slot~="viewport"]`);if(r){let i={containScroll:`keepSnaps`,dragFree:!0},a=v(n,`data-carousel-thumbs-`),o=e(r,{...i,...a});t._emblaApiThumb=o,se(l,o,f),S(l,o),w(n,o,`[data-carousel-slot~="slide"]`,{},f)}}}function O(e){(e||document).querySelectorAll(`:is(ui-carousel, [data-ui~="carousel"])`).forEach(function(e){e.closest(`ui-carousel`)||D(e)})}function ce(){document.addEventListener(`zazz:dialog-open`,function(e){if(!(e.target instanceof HTMLDialogElement))return;let t=e.target;O(t),t.querySelectorAll(`:is(ui-carousel, [data-ui~="carousel"])`).forEach(function(e){let t=e.getAttribute(`data-carousel-start-index`);t!=null&&e._emblaApi&&(e._emblaApi.scrollTo(Number(t),!0),e.removeAttribute(`data-carousel-start-index`));let n=e.querySelector(`[data-carousel-slot~="viewport"]`);n instanceof HTMLElement&&n.focus({preventScroll:!0})})})}function le(){let e=document.querySelector(`dialog[open]`);if(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])[data-carousel-init]`);if(t?._emblaApi&&t.getAttribute(`data-carousel-keyboard`)!==`false`)return t}let t=document.activeElement?.closest(`:is(ui-carousel, [data-ui~="carousel"])[data-carousel-init]`);return t?._emblaApi&&t.getAttribute(`data-carousel-keyboard`)!==`false`?t:null}const k=function(){k._bound||(k._bound=!0,document.addEventListener(`keydown`,function(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.defaultPrevented)return;let t=e.target;if(!(t instanceof HTMLElement)||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t.isContentEditable)return;let n=le();n&&(e.preventDefault(),y(n._emblaApi),e.key===`ArrowLeft`?n._emblaApi.scrollPrev():n._emblaApi.scrollNext())}))},ue={init:O,initRoot:D,addDotBtnsAndClickHandlers:oe,addThumbClickHandlers:se,addTogglethumbsActive:S};function de(){document.addEventListener(`click`,function(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`[data-carousel-start], [data-carousel-slot~='slide'][commandfor]`);if(!t)return;let n=t.getAttribute(`data-carousel-start`);if(n==null&&t.hasAttribute(`commandfor`)){let e=t.closest(`:is(ui-carousel, [data-ui~="carousel"])`);e?._emblaApi&&(n=String(e._emblaApi.selectedScrollSnap()))}let r=t.getAttribute(`commandfor`);if(!r)return;let i=document.getElementById(r);if(!i)return;let a=i.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`);a&&(a._emblaApi?a._emblaApi.scrollTo(Number(n),!0):n!=null&&a.setAttribute(`data-carousel-start-index`,n))})}typeof window<`u`&&typeof document<`u`&&(u(e=>O(e)),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,function(){O(),ce(),de(),k(),E()}):(O(),ce(),de(),k(),E())),typeof window<`u`&&(window.EmblaInit=ue);const A=.1,j=.999,fe=/[\\/_+.#"@[({&]/,pe=/[\\/_+.#"@[({&]/g,me=/[\s-]/,M=/[\s-]/g;function N(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?1:.99;let s=`${i},${a}`,c=o[s];if(c!==void 0)return c;let l=r.charAt(a),u=n.indexOf(l,i),d=0;for(;u>=0;){let s=N(e,t,n,r,u+1,a+1,o);if(s>d){if(u===i)s*=1;else if(fe.test(e.charAt(u-1))){s*=.8;let t=e.slice(i,u-1).match(pe);t&&i>0&&(s*=j**t.length)}else if(me.test(e.charAt(u-1))){s*=.9;let t=e.slice(i,u-1).match(M);t&&i>0&&(s*=j**t.length)}else s*=.17,i>0&&(s*=j**(u-i));e.charAt(u)!==t.charAt(a)&&(s*=.9999)}if(s<A&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a)){let i=N(e,t,n,r,u+1,a+2,o);i*A>s&&(s=i*A)}s>d&&(d=s),u=n.indexOf(l,u+1)}return o[s]=d,d}function P(e){return e.toLowerCase().replace(M,` `)}function he(e,t,n=[]){let r=n.length>0?`${e} ${n.join(` `)}`:e;return N(r,t,P(r),P(t),0,0,{})}Symbol.dispose??=Symbol(`Symbol.dispose`);function F(e,t){return new i.State(e,t)}function I(e,t){return new i.Computed(e,t)}let L=!0;const R=new i.subtle.Watcher(()=>{L&&(L=!1,queueMicrotask(ge))});function ge(){L=!0;for(let e of R.getPending())e.get();R.watch()}function z(e,t={}){let n,r=!1,a=new i.Computed(()=>{typeof n==`function`&&n(),n=e()});R.watch(a),a.get();let o=()=>{r||(r=!0,R.unwatch(a),typeof n==`function`&&n(),n=void 0)};return t.signal?.addEventListener(`abort`,o,{once:!0}),Object.assign(o,{[Symbol.dispose]:o})}typeof window<`u`&&(window.Signals={state:F,computed:I,effect:z});function _e(e,t){let n=e.trim();return t.map((e,t)=>{let r=n===``?1:he(e.value,n,e.keywords);return{index:t,score:r,hidden:r<=0}})}function ve(e,t,n){if(n===0)return-1;switch(t){case`ArrowDown`:return e<0?0:(e+1)%n;case`ArrowUp`:return e<0?n-1:(e-1+n)%n;case`Home`:return 0;case`End`:return n-1;default:return e}}let B=0;var V=class extends s{partSelector(e){return`[data-${this.slotPrefix}-slot~="${e}"]`}config(e){return this.getAttribute(`data-${this.slotPrefix}-${e}`)}managesPanel=!0;openOnFocus=!0;get sortByScore(){return this.config(`sort`)===`score`}autoHighlight=!1;get filtersItems(){return this.config(`filter`)!==`none`}get ordersByScore(){return this.sortByScore&&this.filtersItems}searchInput=null;panel=null;query=F(``);open=F(!1);activeIndex=F(-1);itemsVersion=F(0);setup(e){let t=this.slotPrefix,n=this.querySelector(this.partSelector(`panel`)),r=this.querySelector(`input[role="combobox"]`)??this.querySelector(this.partSelector(`input`));if(!(n instanceof HTMLElement)||!(r instanceof HTMLInputElement))return;this.panel=n,this.searchInput=r;let i=n.querySelector(this.partSelector(`list`));i instanceof HTMLElement&&(i.id||=`ui-${t}-list-${++B}`,r.setAttribute(`aria-controls`,i.id));let a=this.partSelector(`item`),o=e=>e instanceof Element&&(e.matches(a)||e.querySelector(a)!==null),s=new MutationObserver(e=>{e.some(e=>[...e.addedNodes,...e.removedNodes].some(o))&&(this.itemsVersion.set(this.itemsVersion.get()+1),this.autoHighlight&&this.activeIndex.set(0))});s.observe(i??n,{childList:!0,subtree:!0}),e.addEventListener(`abort`,()=>s.disconnect(),{once:!0}),r.addEventListener(`input`,()=>{this.query.set(r.value),this.activeIndex.set(this.autoHighlight?0:-1),this.managesPanel&&!this.#n()&&this.open.set(r.value.length>=this.#t())},{signal:e}),r.addEventListener(`keydown`,e=>this.#i(e),{signal:e}),this.#n()?(this.open.set(!0),r.setAttribute(`aria-expanded`,`true`)):this.managesPanel?(this.openOnFocus&&r.addEventListener(`focus`,()=>{r.value.length>=this.#t()&&this.open.set(!0)},{signal:e}),document.addEventListener(`pointerdown`,e=>{e.target instanceof Node&&(this.contains(e.target)||this.open.set(!1))},{signal:e}),this.addEventListener(`focusout`,e=>{let t=e.relatedTarget;t instanceof Node&&this.contains(t)||this.open.set(!1)},{signal:e})):n instanceof HTMLDialogElement?(this.addEventListener(`zazz:dialog-open`,e=>{e.target===n&&(this.open.set(!0),r.focus())},{signal:e}),this.addEventListener(`zazz:dialog-close`,e=>{e.target===n&&this.open.set(!1)},{signal:e})):n.addEventListener(`toggle`,e=>{let t=e.newState===`open`;this.open.set(t),t&&r.focus()},{signal:e}),n.addEventListener(`mousedown`,e=>{e.target instanceof Element&&(e.target.closest(`input, textarea, select, [contenteditable]`)||e.target.closest(this.partSelector(`list`))&&e.preventDefault())},{signal:e}),n.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(this.partSelector(`item`));t&&!t.hidden&&this.commit(t,`pointer`)},{signal:e}),this.#n()||(this.managesPanel?z(()=>{let e=this.open.get();r.setAttribute(`aria-expanded`,String(e)),e&&!this.#r()?n.showPopover():!e&&this.#r()&&n.hidePopover(),e||this.activeIndex.set(-1)},{signal:e}):z(()=>{r.setAttribute(`aria-expanded`,String(this.open.get()))},{signal:e})),z(()=>{let e=this.open.get(),n=this.query.get(),i=this.activeIndex.get();if(!e&&this.managesPanel&&!this.#n()){r.removeAttribute(`aria-activedescendant`);return}let{items:a,ranked:o,visible:s}=this.#e(n),c=this.ordersByScore;for(let e of o){let t=a[e.index];t.hidden=e.hidden,c?t.style.order=String(-Math.round(e.score*1e3)):t.style.order&&t.style.removeProperty(`order`)}s.forEach((e,n)=>{e.id||=`ui-${t}-item-${++B}`,n===i?e.setAttribute(`data-${this.slotPrefix}-state`,`highlighted`):e.removeAttribute(`data-${this.slotPrefix}-state`)});let l=i>=0?s[i]:void 0;l?(r.setAttribute(`aria-activedescendant`,l.id),l.scrollIntoView({block:`nearest`})):r.removeAttribute(`aria-activedescendant`)},{signal:e})}items(){let e=this.panel;return e?Array.from(e.querySelectorAll(this.partSelector(`item`))).filter(e=>e instanceof HTMLElement):[]}visibleItems(e,t){let n=t.filter(e=>!e.hidden);return this.ordersByScore&&n.sort((e,t)=>t.score-e.score||e.index-t.index),n.map(t=>e[t.index])}#e(e){this.itemsVersion.get();let t=this.items(),n=_e(this.filtersItems?e:``,t.map(e=>({value:this.itemValue(e),keywords:(e.getAttribute(`data-${this.slotPrefix}-keywords`)??``).split(/\s+/).filter(Boolean)})));return{items:t,ranked:n,visible:this.visibleItems(t,n)}}itemValue(e){let t=e.getAttribute(`data-${this.slotPrefix}-value`);if(t!==null)return t;if(!e.querySelector(`kbd, ui-kbd-group`))return e.textContent?.trim()??``;let n=e.cloneNode(!0);for(let e of n.querySelectorAll(`kbd, ui-kbd-group`))e.remove();return n.textContent?.trim()??``}clearQuery(){let e=this.searchInput;e&&(e.value=``,this.query.set(``))}#t(){let e=Number(this.config(`min-length`));return Number.isFinite(e)&&e>0?e:0}#n(){return this.managesPanel&&this.panel!==null&&!this.panel.hasAttribute(`popover`)}#r(){return this.panel?.matches(`:popover-open`)??!1}#i(e){let t=this.searchInput;if(t){if(e.key===`Escape`&&this.managesPanel)this.open.get()&&!this.#n()?(e.preventDefault(),this.open.set(!1)):t.value&&(e.preventDefault(),this.clearQuery());else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){if((e.key===`Home`||e.key===`End`)&&this.activeIndex.get()<0)return;e.preventDefault(),this.managesPanel&&!this.open.get()&&this.open.set(!0);let t=this.#e(this.query.get()).visible.length;this.activeIndex.set(ve(this.activeIndex.get(),e.key,t))}else if(e.key===`Enter`){let t=this.activeIndex.get(),n=t>=0?this.#e(this.query.get()).visible[t]:void 0;n&&(e.preventDefault(),this.commit(n,`keyboard`))}}}};c(`ui-autocomplete`,class extends V{slotPrefix=`autocomplete`;commit(e,t){let n=this.searchInput;n&&(n.value=this.itemValue(e),this.query.set(n.value),this.open.set(!1),n.focus(),n.dispatchEvent(new Event(`change`,{bubbles:!0})))}});const H=`data-checkbox-controls`;function ye(e){let t=e.filter(Boolean).length;return t===0?`none`:t===e.length?`all`:`some`}function U(e){let t=e.getAttribute(H);if(!t)return[];let n=(e.form??e.ownerDocument).querySelectorAll(`input[type="checkbox"]`);return Array.from(n).filter(n=>n.name===t&&n!==e)}function be(e){if(!e.name)return null;let t=(e.form??e.ownerDocument).querySelectorAll(`input[type="checkbox"][${H}]`);for(let n of t)if(n.getAttribute(H)===e.name&&n!==e)return n;return null}const W=/* @__PURE__ */ new Map;function G(e){W.get(e)?.members.set(U(e).map(e=>e.checked))}function K(e){let t=F(U(e).map(e=>e.checked)),n=I(()=>ye(t.get())),r=z(()=>{let r=n.get(),i=t.get();e.checked=r===`all`,e.indeterminate=r===`some`,U(e).forEach((e,t)=>{let n=e.closest(`tr`);n&&(i[t]?n.setAttribute(`data-table-state`,`selected`):n.getAttribute(`data-table-state`)===`selected`&&n.removeAttribute(`data-table-state`))})});W.set(e,{members:t,dispose:r})}function xe(e){let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return;if(t.hasAttribute(H)){W.has(t)||K(t);for(let e of U(t))e.checked=t.checked;G(t);return}let n=be(t);n&&(W.has(n)||K(n),G(n))}function q(e=document){for(let[e,t]of W)e.isConnected||(t.dispose(),W.delete(e));let t=e.querySelectorAll(`input[type="checkbox"][${H}]`);for(let e of t)W.has(e)?G(e):K(e)}typeof window<`u`&&typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>q()):q(),document.addEventListener(`change`,xe),u(q));let J=null;function Se(){return J||(J=document.createElement(`template`),J.innerHTML=`<span data-ui="badge" data-combobox-slot="tag"><span data-combobox-slot="tag-label"></span><button type="button" tabindex="-1" data-combobox-slot="tag-remove"></button></span>`),J}function Ce(e,t,n){return n?{value:``,clear:!1}:e===``?{value:``,clear:!0}:{value:t,clear:!1}}function we(e,t){return e.replace(`{label}`,t)}c(`ui-combobox`,class extends V{slotPrefix=`combobox`;openOnFocus=!1;#e=``;#t=``;#n=[];#r=``;setup(e){super.setup(e);let t=this.searchInput;if(!t)return;let n=this.#i();this.#t=t.getAttribute(`placeholder`)??``,n&&this.querySelector(`[data-combobox-slot~="list"]`)?.setAttribute(`aria-multiselectable`,`true`);let r=this.#u();if(r!==null&&r.value!==``&&this.#o().length===0&&this.items().find(e=>this.#c(e)===r.value)?.setAttribute(`aria-selected`,`true`),n)for(let e of this.items())e.getAttribute(`aria-selected`)!==`true`&&e.setAttribute(`aria-selected`,`false`);this.#n=this.#o().map(e=>this.#c(e)),this.#e=n?``:this.#s()??``,t.value=this.#e,this.#d(!1);let i=t.closest(`[data-combobox-slot~="control"]`);t.addEventListener(`click`,()=>this.#a(),{signal:e}),i?.addEventListener(`mousedown`,e=>{e.target instanceof Element&&e.target!==t&&(e.preventDefault(),t.focus(),e.target.closest(`[data-combobox-slot~="trigger"], [data-combobox-slot~="tag"]`)||this.#a())},{signal:e}),i?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-combobox-slot~="tag-remove"]`);if(!n)return;e.preventDefault();let r=n.closest(`[data-combobox-slot~="tag"]`)?.getAttribute(`data-combobox-value`);this.#l(this.items().find(e=>this.#c(e)===r)),t.focus()},{signal:e});let a=this.querySelector(`[data-combobox-slot~="trigger"]`);a instanceof HTMLElement&&a.addEventListener(`click`,()=>{this.open.get()?this.open.set(!1):this.#a()},{signal:e}),n&&t.addEventListener(`keydown`,e=>{if(e.key!==`Backspace`||t.value!==``)return;let n=this.#o().at(-1);n&&(e.preventDefault(),this.#l(n))},{signal:e}),this.addEventListener(`focusout`,e=>{let n=e.relatedTarget;if(n instanceof Node&&this.contains(n))return;let r=Ce(t.value,this.#e,this.#i());t.value=r.value,this.query.set(``),r.clear&&this.#m()},{signal:e}),(r??t).form?.addEventListener(`reset`,()=>queueMicrotask(()=>this.#h()),{signal:e})}teardown(){for(let e of this.querySelectorAll(`[data-combobox-slot~="tag"], [data-combobox-state~="stamped"]`))e.remove();this.searchInput&&(this.searchInput.placeholder=this.#t)}itemValue(e){return e.textContent?.trim()??``}clearQuery(){let e=this.searchInput;e&&(e.value=this.#i()?``:this.#e,this.query.set(``))}commit(e,t){let n=this.searchInput;if(n){if(this.#i())e.setAttribute(`aria-selected`,String(e.getAttribute(`aria-selected`)!==`true`)),n.value=``,this.query.set(``),this.activeIndex.set(this.items().indexOf(e)),this.#d(!0),n.focus();else{this.#e=this.itemValue(e),n.value=this.#e,this.query.set(``);for(let e of this.items())e.removeAttribute(`aria-selected`);e.setAttribute(`aria-selected`,`true`),this.#d(!0),n.focus(),this.panel?.hasAttribute(`popover`)?this.open.set(!1):n.select()}}}#i(){return this.config(`variant`)===`multiselect`}#a(){let e=this.searchInput;if(e&&!this.open.get()){if(this.#i())e.value=``,this.activeIndex.set(-1);else{e.value=this.#e;let t=this.#o()[0];this.activeIndex.set(t?this.items().indexOf(t):-1),e.value!==``&&e.select()}this.query.set(``),this.open.set(!0)}}#o(){return this.items().filter(e=>e.getAttribute(`aria-selected`)===`true`)}#s(){let e=this.#o()[0];return e?this.itemValue(e):void 0}#c(e){return e.getAttribute(`data-combobox-value`)??this.itemValue(e)}#l(e){e&&(e.setAttribute(`aria-selected`,`false`),this.#d(!0))}#u(){let e=this.querySelector(`[data-combobox-slot~="value"]:not([data-combobox-state~="stamped"])`);return e instanceof HTMLInputElement?e:null}#d(e){let t=this.searchInput,n=this.#o().map(e=>this.#c(e)),r=JSON.stringify(n),i=r!==this.#r;this.#r=r,t&&this.#i()&&this.#p(t);let a=this.#u();if(!a)return;a.value=n[0]??``;for(let e of this.querySelectorAll(`[data-combobox-state~="stamped"]`))e.remove();let o=a;for(let e of n.slice(1)){let t=document.createElement(`input`);t.type=`hidden`,t.setAttribute(`data-combobox-slot`,`value`),t.setAttribute(`data-combobox-state`,`stamped`),a.name&&(t.name=a.name),t.value=e,o.after(t),o=t}e&&i&&a.dispatchEvent(new Event(`change`,{bubbles:!0}))}#f(){let e=this.querySelector(`[data-combobox-slot~="tag-template"]`),t=(e instanceof HTMLTemplateElement?e:Se()).content.firstElementChild;return t instanceof HTMLElement?t:null}#p(e){let t=e.closest(`[data-combobox-slot~="control"]`);if(!t)return;for(let e of t.querySelectorAll(`[data-combobox-slot~="tag"]`))e.remove();let n=this.#f();if(!n)return;let r=this.config(`label-remove`)??`Remove {label}`,i=this.#o().map(e=>{let t=this.itemValue(e),i=n.cloneNode(!0);if(i.setAttribute(`data-combobox-value`,this.#c(e)),!i.matches(`[data-combobox-slot~="tag"]`)){let e=i.getAttribute(`data-combobox-slot`);i.setAttribute(`data-combobox-slot`,e?`${e} tag`:`tag`)}let a=i.querySelector(`[data-combobox-slot~="tag-label"]`);return a?a.textContent=t:i.prepend(document.createTextNode(t)),i.querySelector(`[data-combobox-slot~="tag-remove"]`)?.setAttribute(`aria-label`,we(r,t)),i});e.before(...i),e.placeholder=i.length>0?``:this.#t}#m(e=!0){this.#e=``;let t=this.#i();for(let e of this.items())t?e.setAttribute(`aria-selected`,`false`):e.removeAttribute(`aria-selected`);this.searchInput&&(this.searchInput.value=``),this.query.set(``),this.#d(e)}get value(){let e=this.#o()[0];return e?this.#c(e):``}set value(e){let t=this.items().find(t=>this.#c(t)===e);if(!t){this.#m(!1);return}let n=this.#i();for(let e of this.items())n?e.setAttribute(`aria-selected`,`false`):e.removeAttribute(`aria-selected`);t.setAttribute(`aria-selected`,`true`),this.#e=n?``:this.itemValue(t);let r=this.searchInput;r&&(r.value=this.#e),this.query.set(``),this.#d(!1)}#h(){let e=this.searchInput;if(!e)return;let t=this.#i();for(let e of this.items()){let n=this.#n.includes(this.#c(e));t?e.setAttribute(`aria-selected`,String(n)):n?e.setAttribute(`aria-selected`,`true`):e.removeAttribute(`aria-selected`)}this.#e=t?``:this.#s()??``,e.value=this.#e,this.query.set(``),this.#d(!0)}});function Te(e){let t=e.split(`+`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0);if(t.length===0)return null;let n={key:``,ctrl:!1,alt:!1,shift:!1,meta:!1,mod:!1};for(let e of t.slice(0,-1))switch(e){case`mod`:n.mod=!0;break;case`ctrl`:case`control`:n.ctrl=!0;break;case`alt`:case`option`:n.alt=!0;break;case`shift`:n.shift=!0;break;case`meta`:case`cmd`:case`super`:n.meta=!0;break;default:return null}return n.key=t[t.length-1],n}function Ee(){return typeof navigator>`u`?!1:/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent)}function De(e,t,n=Ee()){let r=t.meta||t.mod&&n,i=t.ctrl||t.mod&&!n;return e.metaKey!==r||e.ctrlKey!==i||e.altKey!==t.alt||e.shiftKey!==t.shift?!1:e.key.toLowerCase()===t.key}function Oe(e){return e instanceof HTMLElement?e.isContentEditable?!0:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement:!1}function ke(e){return!e.ctrl&&!e.alt&&!e.meta&&!e.mod}function Ae(e,t,n={}){let r=Te(e);return!r||typeof document>`u`?!1:(document.addEventListener(`keydown`,e=>{e.defaultPrevented||e.repeat||ke(r)&&Oe(e.target)||De(e,r)&&(e.preventDefault(),t(e))},{signal:n.signal}),!0)}c(`ui-command`,class extends V{slotPrefix=`command`;managesPanel=!1;autoHighlight=!0;get sortByScore(){return this.config(`sort`)!==`document`}setup(e){super.setup(e);let t=this.searchInput,n=this.panel;if(!t||!n)return;let r=this.getAttribute(`data-command-hotkey`);r&&Ae(r,()=>this.#n(),{signal:e});for(let t of this.items()){let n=t.getAttribute(`data-command-hotkey`);n&&Ae(n,()=>this.#t(t,!0),{signal:e})}let i=()=>{t.value=``,this.query.set(``),this.activeIndex.set(0)};n instanceof HTMLDialogElement?this.addEventListener(`zazz:dialog-close`,e=>{e.target===n&&i()},{signal:e}):n.addEventListener(`toggle`,e=>{e.newState===`closed`&&i()},{signal:e})}commit(e,t){this.#e||this.#t(e,t===`keyboard`)}#e=!1;#t(e,t){if(this.dispatchEvent(new CustomEvent(`zazz:command-select`,{bubbles:!0,detail:{item:e,value:this.itemValue(e)}})),t){this.#e=!0;try{e.click()}finally{this.#e=!1}}e.hasAttribute(`data-command-stay-open`)||this.#r()}#n(){let e=this.panel;e&&(e instanceof HTMLDialogElement?e.open?e.close():e.showModal():e.togglePopover())}#r(){let e=this.panel;e&&(e instanceof HTMLDialogElement?e.open&&e.close():e.matches(`:popover-open`)&&e.hidePopover())}});var je=class extends s{setup(e){let t=this.closest(`dialog`);t&&!t.open?t.addEventListener(`zazz:dialog-open`,()=>this.init(),{signal:e}):this.init()}teardown(){this._emblaController?.abort(),delete this._emblaController,this._emblaApi?.destroy(),this._emblaApiThumb?.destroy(),delete this._emblaApi,delete this._emblaApiThumb,this.removeAttribute(`data-carousel-init`)}init(){ue.initRoot(this)}get api(){return this._emblaApi??null}};c(`ui-carousel`,je),c(`ui-lightbox`,class extends s{setup(e){let t=this.querySelector(`dialog`);t instanceof HTMLDialogElement&&(this.addEventListener(`zazz:dialog-open`,e=>{e.target===t&&this.#t(t)},{signal:e}),this.addEventListener(`zazz:dialog-close`,e=>{e.target===t&&this.#n(t)},{signal:e}))}#e(){return this.querySelector(`[data-lightbox-slot~="gallery"] :is(ui-carousel, [data-ui~="carousel"])`)}#t(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`);if(!t)return;t instanceof je&&t.init();let n=this.#e()?._emblaApi;t._emblaApi&&n&&t._emblaApi.scrollTo(n.selectedScrollSnap(),!0);let r=t.querySelector(`[data-carousel-slot~="viewport"]`);r instanceof HTMLElement&&r.focus({preventScroll:!0})}#n(e){let t=e.querySelector(`:is(ui-carousel, [data-ui~="carousel"])`)?._emblaApi,n=this.#e()?._emblaApi;t&&n&&n.scrollTo(t.selectedScrollSnap())}}),c(`ui-menu`,class extends s{setup(e){this.addEventListener(`keydown`,e=>this.#n(e),{signal:e})}#e(){let e=this.querySelector(`:scope > [data-menu-slot~="popover"]`);return e instanceof HTMLElement?e:null}#t(e){return Array.from(e.querySelectorAll(`a[href], button`)).filter(e=>e instanceof HTMLElement).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`&&e.closest(`ui-menu, [data-ui~="menu"]`)===this)}#n(e){if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest(`ui-menu, [data-ui~="menu"]`)!==this)return;let n=this.#e();if(!n)return;let r=t.parentElement===this&&(t.hasAttribute(`popovertarget`)||t.hasAttribute(`interestfor`)),i=n.matches(`:popover-open`);if(r&&!i&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),n.showPopover();let t=this.#t(n);t[e.key===`ArrowDown`?0:t.length-1]?.focus();return}if(!i||!n.contains(t))return;let a=this.#t(n);if(a.length===0)return;let o=a.indexOf(t),s;switch(e.key){case`ArrowDown`:s=o===-1?0:(o+1)%a.length;break;case`ArrowUp`:s=o===-1?a.length-1:(o-1+a.length)%a.length;break;case`Home`:s=0;break;case`End`:s=a.length-1;break;default:return}e.preventDefault(),a[s].focus()}});function Me(e,t){if(!e)return[t];let n=e.split(`-`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e)&&e>0);return n.reduce((e,t)=>e+t,0)===t&&n.length>0?n:[t]}function Ne(e,t,n){let r;switch(t){case`numeric`:r=/[^0-9]/g;break;case`alpha`:r=/[^a-zA-Z]/g;break;case`alphanumeric`:r=/[^a-zA-Z0-9]/g;break;case`none`:r=/\s/g}return e.replace(r,``).slice(0,n)}function Pe(e,t,n,r,i){let a=r?Math.min(n,t-1):-1;return Array.from({length:t},(t,n)=>{let r=e.charAt(n);return{char:r===``?``:i?`•`:r,filled:r!==``,active:n===a}})}function Fe(e,t){return t>0&&e.length===t}c(`ui-otp`,class extends s{#e=null;#t=``;setup(e){let t=this.querySelector(`input`);if(!(t instanceof HTMLInputElement))return;let n=t.maxLength>0?t.maxLength:6,r=this.getAttribute(`data-otp-type`)??`numeric`,i=this.hasAttribute(`data-otp-mask`),a=Me(this.getAttribute(`data-otp-groups`),n),o=this.#n(a);this.setAttribute(`data-otp-ready`,``);let s=F(Ne(t.value,r,n)),c=F(t.selectionStart??0),l=F(document.activeElement===t);t.addEventListener(`input`,()=>{let e=Ne(t.value,r,n);t.value!==e&&(t.value=e),s.set(e),c.set(t.selectionStart??e.length)},{signal:e}),document.addEventListener(`selectionchange`,()=>{document.activeElement===t&&c.set(t.selectionStart??0)},{signal:e}),t.addEventListener(`focus`,()=>l.set(!0),{signal:e}),t.addEventListener(`blur`,()=>l.set(!1),{signal:e}),o.addEventListener(`pointerdown`,e=>{let r=e.target instanceof Element?e.target.closest(`[data-otp-index]`):null;e.preventDefault(),t.focus();let i=r?Number(r.getAttribute(`data-otp-index`)):n,a=Math.min(i,t.value.length);t.setSelectionRange(a,a),c.set(a)},{signal:e}),z(()=>{let e=Pe(s.get(),n,c.get(),l.get(),i),r=o.querySelectorAll(`[data-otp-index]`);e.forEach((e,t)=>{let n=r[t];if(!(n instanceof HTMLElement))return;n.textContent=e.char;let i=[e.filled&&`filled`,e.active&&`active`].filter(Boolean).join(` `);i?n.setAttribute(`data-otp-state`,i):n.removeAttribute(`data-otp-state`)});let a=Fe(s.get(),n);a?this.setAttribute(`data-otp-complete`,``):this.removeAttribute(`data-otp-complete`),a&&this.hasAttribute(`data-otp-auto-submit`)&&this.#t!==s.get()&&(this.#t=s.get(),t.form?.requestSubmit())},{signal:e})}teardown(){this.#e?.remove(),this.#e=null,this.removeAttribute(`data-otp-ready`),this.removeAttribute(`data-otp-complete`)}#n(e){let t=document.createElement(`div`);t.setAttribute(`data-otp-slot`,`rail`),t.setAttribute(`aria-hidden`,`true`);let n=0;return e.forEach((e,r)=>{if(r>0){let e=document.createElement(`span`);e.setAttribute(`data-otp-slot`,`separator`),e.setAttribute(`aria-role`,`presentation`),e.textContent=`–`,t.append(e)}for(let r=0;r<e;r++){let e=document.createElement(`span`);e.setAttribute(`data-otp-slot`,`cell`),e.setAttribute(`data-otp-index`,String(n++)),t.append(e)}}),this.append(t),this.#e=t,t}});function Ie(e,t,n){return{type:e?`text`:`password`,ariaPressed:e?`true`:`false`,ariaLabel:e?n:t}}c(`ui-password`,class extends s{setup(e){let t=this.querySelector(`input[type="password"], input[type="text"]`),n=this.querySelector(`[data-password-group-slot~="toggle"]`);if(!(t instanceof HTMLInputElement)||!(n instanceof HTMLElement))return;let r=F(t.type===`text`);n.addEventListener(`click`,()=>r.set(!r.get()),{signal:e}),z(()=>{let e=this.getAttribute(`data-password-group-label-show`)||`Show password`,i=this.getAttribute(`data-password-group-label-hide`)||`Hide password`,a=Ie(r.get(),e,i);t.type=a.type,n.setAttribute(`aria-pressed`,a.ariaPressed),n.setAttribute(`aria-label`,a.ariaLabel)},{signal:e})}});function Le(e,t,n){return e.length===0?t:e.length===1?e[0]:`${e[0]} ${n.replace(`{n}`,String(e.length-1))}`}let Re=0;c(`ui-multiselect`,class extends s{#e=[];#t=null;setup(e){let t=this.querySelector(`select[multiple]`);if(!(t instanceof HTMLSelectElement))return;this.#t=t;let n=this.getAttribute(`data-multiselect-placeholder`)??`Select…`,r=this.getAttribute(`data-multiselect-label-more`)??`(+{n} more)`,{trigger:i,label:a,panel:o,checkboxes:s}=this.#n(t);t.setAttribute(`data-multiselect-state`,`enhanced`);let c=()=>Array.from(t.selectedOptions).map(e=>e.label),l=F(c());s.forEach((n,r)=>{n.addEventListener(`change`,()=>{let e=t.options[r];e&&(e.selected=n.checked),l.set(c()),t.dispatchEvent(new Event(`change`,{bubbles:!0}))},{signal:e})}),t.addEventListener(`change`,()=>l.set(c()),{signal:e}),t.form?.addEventListener(`reset`,()=>queueMicrotask(()=>l.set(c())),{signal:e}),o.addEventListener(`toggle`,e=>{i.setAttribute(`aria-expanded`,String(e.newState===`open`))},{signal:e}),z(()=>{l.get(),a.textContent=Le(c(),n,r),s.forEach((e,n)=>{let r=t.options[n];r&&e.checked!==r.selected&&(e.checked=r.selected)})},{signal:e})}teardown(){for(let e of this.#e)e.remove();this.#e=[],this.#t?.removeAttribute(`data-multiselect-state`),this.#t=null}#n(e){let t=`ui-multiselect-panel-${++Re}`,n=document.createElement(`button`);n.type=`button`,n.dataset.ui=`select`,n.setAttribute(`data-multiselect-slot`,`trigger`),n.setAttribute(`popovertarget`,t),n.setAttribute(`aria-expanded`,`false`);let r=document.createElement(`span`);r.setAttribute(`data-multiselect-slot`,`label`);let i=document.createElement(`span`);i.setAttribute(`data-multiselect-slot`,`icon`),i.setAttribute(`aria-hidden`,`true`),n.append(r,i);let a=document.createElement(`div`);a.id=t,a.setAttribute(`data-multiselect-slot`,`panel`),a.setAttribute(`popover`,`auto`);let o=this.getAttribute(`data-multiselect-side`),s=this.getAttribute(`data-multiselect-align`);o&&a.setAttribute(`data-popover-side`,o),s&&a.setAttribute(`data-popover-align`,s);let c=[];for(let[n,r]of Array.from(e.options).entries()){let e=document.createElement(`label`);e.setAttribute(`data-multiselect-slot`,`option`);let i=document.createElement(`input`);i.type=`checkbox`,i.id=`${t}-${n}`,i.checked=r.selected,i.disabled=r.disabled,e.append(i,document.createTextNode(r.label)),a.append(e),c.push(i)}return e.after(n,a),this.#e=[n,a],{trigger:n,label:r,panel:a,checkboxes:c}}}),c(`ui-tabs`,class extends s{setup(e){this.addEventListener(`keydown`,e=>this.#e(e),{signal:e})}#e(e){let t=e.target;if(!(t instanceof HTMLInputElement)||t.type!==`radio`)return;let n=t.closest(`[role="tablist"], [data-tabs-slot~="list"]`);if(!n||n.closest(`ui-tabs, [data-ui~="tabs"]`)!==this)return;let r=Array.from(n.querySelectorAll(`input[type="radio"]`)).filter(e=>e instanceof HTMLInputElement).filter(e=>!e.disabled);if(r.length<2)return;let i=this.getAttribute(`data-tabs-orientation`)===`vertical`,a=i?`ArrowUp`:`ArrowLeft`,o=i?`ArrowDown`:`ArrowRight`,s=r.indexOf(t);if(s===-1)return;let c;switch(e.key){case a:c=(s-1+r.length)%r.length;break;case o:c=(s+1)%r.length;break;case`Home`:c=0;break;case`End`:c=r.length-1;break;default:return}e.preventDefault();let l=r[c];l.checked=!0,l.focus(),l.dispatchEvent(new Event(`change`,{bubbles:!0}))}});function ze(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}Symbol.dispose??=Symbol(`Symbol.dispose`);const Be=[`success`,`info`,`warning`,`destructive`],Ve={success:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg>`,info:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"/></svg>`,warning:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd"/></svg>`,destructive:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/></svg>`,close:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>`};function He(e){for(let t of e)t.style.blockSize=`auto`;return{[Symbol.dispose](){for(let t of e)t.style.removeProperty(`block-size`)}}}function Ue(e){let t=e.length,n=Array.from({length:t}),r=0;for(let i=t-1;i>=0;i--){let a=t-1-i;n[i]={stackIndex:a,offsetPx:r,zIndex:t-a,front:a===0,visible:a<3},r+=e[i]}return{toasts:n,frontToastHeightPx:t>0?e[t-1]:null}}function Y(e,t,n){let r=(e.getAttribute(`data-toaster-state`)??``).split(/\s+/).filter(Boolean),i=n?[.../* @__PURE__ */ new Set([...r,t])]:r.filter(e=>e!==t);i.length?e.setAttribute(`data-toaster-state`,i.join(` `)):e.removeAttribute(`data-toaster-state`)}function X(e){return e.matches(`[data-toaster-state~="removed"]`)}var Z=class extends s{#e=/* @__PURE__ */ new Map;#t=0;#n=0;#r=null;#i=0;#a=F(!1);#o=F(typeof document<`u`&&document.hidden);#s=I(()=>this.#a.get()||this.#o.get());#c=F([]);#l=I(()=>Ue(this.#c.get().map(e=>e.height)));setup(e){if(this.hasAttribute(`popover`)||this.setAttribute(`popover`,`manual`),this.hasAttribute(`role`)||this.setAttribute(`role`,`region`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Notifications`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`-1`),!this.querySelector(`[data-toaster-slot~="list"]`)){let e=document.createElement(`ol`);e.setAttribute(`data-toaster-slot`,`list`),e.setAttribute(`aria-live`,`polite`),e.setAttribute(`aria-relevant`,`additions text`),e.setAttribute(`aria-atomic`,`false`),this.append(e)}this.addEventListener(`command`,e=>this.#u(e),{signal:e}),this.addEventListener(`mouseenter`,()=>this.#h(!0),{signal:e}),this.addEventListener(`mouseleave`,()=>this.#g(),{signal:e}),this.addEventListener(`focusin`,()=>this.#h(!0),{signal:e}),this.addEventListener(`focusout`,()=>this.#g(),{signal:e}),document.addEventListener(`visibilitychange`,()=>this.#o.set(document.hidden),{signal:e}),window.addEventListener(`resize`,()=>{cancelAnimationFrame(this.#n),this.#n=requestAnimationFrame(()=>this.#f())},{signal:e}),z(()=>{Y(this,`expanded`,this.#a.get())},{signal:e}),z(()=>{this.#s.get()?this.#y():this.#b()},{signal:e}),z(()=>{let e=this.#c.get(),{toasts:t,frontToastHeightPx:n}=this.#l.get();for(let n=0;n<e.length;n++){let{node:r,height:i}=e[n],a=t[n];Y(r,`front`,a.front),Y(r,`visible`,a.visible),r.style.zIndex=String(a.zIndex),r.style.setProperty(`--toasts-before`,String(a.stackIndex)),r.style.setProperty(`--initial-height`,`${i}px`),r.style.setProperty(`--offset`,`calc(${a.offsetPx}px + var(--ui-toaster-gap) * ${a.stackIndex})`)}n!==null&&this.style.setProperty(`--front-toast-height`,`${n}px`)},{signal:e})}teardown(){cancelAnimationFrame(this.#n),window.clearTimeout(this.#i);for(let e of this.#e.values())clearTimeout(e.timeoutId);this.#e.clear()}addToast(e={}){let t=`toast-${++this.#t}`,n=this.#p();return this.#x(),n.append(this.#d(e,t)),this.#f(),this.#_(t,e.duration??4e3),t}dismiss(e){if(e===void 0){this.dismissAll();return}let t=this.#p().querySelector(`[data-toaster-id="${CSS.escape(e)}"]`);if(!(t instanceof HTMLElement)||X(t))return;let n=this.#e.get(e);n&&clearTimeout(n.timeoutId),this.#e.delete(e),Y(t,`removed`,!0);let r=document.activeElement;r instanceof HTMLElement&&t.contains(r)&&r.matches(`:focus-visible`)&&this.#m().filter(e=>!X(e)).at(-1)?.focus({preventScroll:!0}),this.#f(),this.#C(t)}dismissAll(){for(let e of this.#m()){let t=e.dataset.toasterId;t&&this.dismiss(t)}}#u(e){let t=e.command;if(typeof t!=`string`||!t.startsWith(`--toast`))return;let n=this.#r;if(n&&n.source===e.source&&n.command===t)return;this.#r={source:e.source,command:t},window.setTimeout(()=>{this.#r=null},0);let r=e.source,i={},a=t.slice(8);if(Be.includes(a)&&(i.variant=a),r instanceof HTMLElement){let{toasterTitle:e,toasterDescription:t,toasterVariant:n,toasterDuration:a,toasterCloseButton:o}=r.dataset;if(e&&(i.title=e),t&&(i.description=t),!i.variant&&n&&Be.includes(n)&&(i.variant=n),a!==void 0){let e=a.trim()===``?NaN:Number(a);Number.isNaN(e)||(i.duration=e)}o!==void 0&&(i.closeButton=o!==`false`)}this.addToast(i)}#d(e,t){let n=document.createElement(`li`);if(n.setAttribute(`data-toaster-slot`,`toast`),n.dataset.toasterId=t,n.tabIndex=0,e.variant&&(n.dataset.toasterVariant=e.variant),e.variant){let t=document.createElement(`span`);t.setAttribute(`data-toaster-slot`,`icon`),t.setAttribute(`aria-hidden`,`true`),t.innerHTML=Ve[e.variant],n.append(t)}let r=document.createElement(`div`);if(r.setAttribute(`data-toaster-slot`,`content`),e.title){let t=document.createElement(`div`);t.setAttribute(`data-toaster-slot`,`title`),t.textContent=e.title,r.append(t)}if(e.description){let t=document.createElement(`div`);t.setAttribute(`data-toaster-slot`,`description`),t.textContent=e.description,r.append(t)}n.append(r);let i=e.action;if(i){let e=document.createElement(`button`);e.type=`button`,e.dataset.ui=`button`,e.setAttribute(`data-toaster-slot`,`action`),e.dataset.buttonSize=`sm`,e.textContent=i.label,e.addEventListener(`click`,e=>{i.onClick?.(e),e.defaultPrevented||this.dismiss(t)}),n.append(e)}if(e.closeButton!==!1){let e=document.createElement(`button`);e.type=`button`,e.dataset.ui=`button`,e.setAttribute(`data-toaster-slot`,`close`),e.dataset.buttonVariant=`ghost`,e.dataset.buttonSize=`icon-sm`,e.setAttribute(`aria-label`,`Close notification`),e.innerHTML=Ve.close,e.addEventListener(`click`,()=>this.dismiss(t)),n.append(e)}return n}#f(){try{var e=ze();let t=this.#m().filter(e=>!X(e));e.u(He(t));let n=t.map(e=>({node:e,height:e.offsetHeight}));this.#c.set(n)}catch(t){e.e=t}finally{e.d()}}#p(){let e=this.querySelector(`[data-toaster-slot~="list"]`);return e instanceof HTMLOListElement||(e=document.createElement(`ol`),e.setAttribute(`data-toaster-slot`,`list`),this.append(e)),e}#m(){return Array.from(this.#p().children).filter(e=>e instanceof HTMLElement).filter(e=>e.matches(`[data-toaster-slot~="toast"]`))}#h(e){e&&window.clearTimeout(this.#i),this.#a.set(e)}#g(){window.clearTimeout(this.#i),this.#i=window.setTimeout(()=>{let e=document.activeElement,t=e instanceof Node&&this.contains(e);!this.matches(`:hover`)&&!t&&this.#h(!1)},100)}#_(e,t){if(t===1/0||Number.isNaN(t))return;let n={remaining:t,startedAt:0,timeoutId:0};this.#e.set(e,n),this.#s.get()||this.#v(e,n)}#v(e,t){t.startedAt=Date.now(),t.timeoutId=window.setTimeout(()=>this.dismiss(e),t.remaining)}#y(){for(let e of this.#e.values())e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=0,e.remaining=Math.max(0,e.remaining-(Date.now()-e.startedAt)))}#b(){if(!this.#s.get())for(let[e,t]of this.#e)t.timeoutId||this.#v(e,t)}#x(){try{this.matches(`:popover-open`)||this.showPopover()}catch{}}#S(){try{this.matches(`:popover-open`)&&this.hidePopover()}catch{}}#C(e){let t=!1,n=()=>{t||(t=!0,e.remove(),this.#m().length===0&&(this.#h(!1),this.#S()))};e.addEventListener(`transitionend`,t=>{t.target===e&&n()});let r=getComputedStyle(e).transitionDuration.split(`,`).reduce((e,t)=>Math.max(e,Number.parseFloat(t)||0),0);window.setTimeout(n,Math.max(600,r*1e3+100))}};function We(e){let t=e instanceof Element?e:typeof e==`string`?document.getElementById(e):document.querySelector(`ui-toaster, [data-ui~="toaster"]`);return t instanceof Z?t:(console.warn('Toaster: no <ui-toaster> found. Add `<ui-toaster popover="manual"></ui-toaster>` to the page.'),null)}function Ge(e){return typeof e==`string`?{title:e}:e??{}}const Q={toast(e){let t=Ge(e),n=We(t.region);return n?n.addToast(t):null},success(e,t){return Q.toast({...t,title:e,variant:`success`})},info(e,t){return Q.toast({...t,title:e,variant:`info`})},warning(e,t){return Q.toast({...t,title:e,variant:`warning`})},error(e,t){return Q.toast({...t,title:e,variant:`destructive`})},dismiss(e){for(let t of document.querySelectorAll(`ui-toaster, [data-ui~="toaster"]`))t instanceof Z&&t.dismiss(e)}};c(`ui-toaster`,Z),typeof window<`u`&&(window.Toaster=Q);function $(e){return e.documentElement.getAttribute(`data-ui-navigation`)===`swap`}function Ke(e){let t=[];for(let n of[e,...e.querySelectorAll(`*`)])(n.scrollTop||n.scrollLeft)&&t.push([n,n.scrollTop,n.scrollLeft]);return t}function qe(e,t){let n=/* @__PURE__ */ new Map;for(let e of t.querySelectorAll(`a[href], area[href]`)){let t=e.getAttribute(`href`);n.set(t,[...n.get(t)??[],e])}for(let t of e.querySelectorAll(`a[href], area[href]`)){let e=(n.get(t.getAttribute(`href`))?.shift())?.getAttribute(`aria-current`);e==null?t.removeAttribute(`aria-current`):t.setAttribute(`aria-current`,e)}}function Je(e){let t=document.body,n=/* @__PURE__ */ new Map,r=[];for(let e of t.querySelectorAll(`[data-ui-persist]`)){let t=e.getAttribute(`data-ui-persist`);t&&!n.has(t)&&n.set(t,e)}for(let e of n.values())r.push(...Ke(e));let i=/* @__PURE__ */ new Map;for(let e of t.querySelectorAll(`[data-ui-persist-scroll]`)){let t=e.getAttribute(`data-ui-persist-scroll`);t&&!i.has(t)&&i.set(t,[e.scrollTop,e.scrollLeft])}let a=document.importNode(e,!0),o=[];for(let e of a.querySelectorAll(`[data-ui-persist]`)){let t=n.get(e.getAttribute(`data-ui-persist`)??``);t&&o.push([e,t])}for(let e of a.querySelectorAll(`[data-ui-persist-scroll]`)){let t=e.getAttribute(`data-ui-persist-scroll`)??``,n=i.get(t);i.delete(t),n&&r.push([e,...n])}t.before(a);for(let[e,t]of o){let n=e.parentNode;n&&(qe(t,e),typeof n.moveBefore==`function`?n.moveBefore(t,e):n.insertBefore(t,e),e.remove())}t.remove();for(let[e,t,n]of r)e.scrollTo({top:t,left:n,behavior:`instant`});return a}function Ye(e){let t=e.querySelector(`main`),n=t?.querySelector(`h1`)??t??e;n instanceof HTMLElement&&(n.hasAttribute(`tabindex`)||(n.tabIndex=-1),n.focus({preventScroll:!0}))}let Xe=0,Ze=``;function Qe(){let e=document.documentElement.style;Xe++===0&&(Ze=e.scrollBehavior,e.scrollBehavior=`auto`);let t=!0;return()=>{t&&(t=!1,--Xe===0&&(e.scrollBehavior=Ze))}}function $e(e){return new URL(e,location.href).origin===location.origin}function et(e){let t=/\.([a-z0-9]+)$/i.exec(new URL(e,location.href).pathname)?.[1];return!t||/^x?html?$/i.test(t)}if(`navigation`in window){let e=null;function t(t){e=t,location.replace(t)}window.navigation.addEventListener(`navigate`,n=>{e!==null&&n.destination.url===e?e=null:$(document)&&n.canIntercept&&n.navigationType!==`reload`&&!n.hashChange&&n.downloadRequest===null&&n.formData===null&&$e(n.destination.url)&&et(n.destination.url)&&n.intercept({async handler(){let e;try{let t=await fetch(n.destination.url,{signal:n.signal});if(!t.ok)throw Error(t.statusText);if(!t.headers.get(`content-type`)?.includes(`html`))throw Error(`not a page`);e=new DOMParser().parseFromString(await t.text(),`text/html`)}catch{if(n.signal.aborted)return;t(n.destination.url);return}if(n.signal.aborted)return;if(!$(e)||!(e.body instanceof HTMLElement)){t(n.destination.url);return}let r=document.body,i=()=>{r=Je(e.body),document.title=e.title,n.scroll()},a=Qe();if(document.startViewTransition)try{await document.startViewTransition(i).finished}finally{a()}else try{i()}finally{requestAnimationFrame(()=>requestAnimationFrame(a))}d(r),Ye(r)}})})}else $(document)&&console.warn(`Navigation API not supported: data-ui-navigation falls back to full page loads.`);typeof CSS<`u`&&!CSS.supports(`container-type`,`scroll-state`)&&import(`./scroll-state-C8mA5gq6.js`);function tt(){for(let e of document.querySelectorAll(`[style]`))if(e.getAttribute(`style`)?.includes(`:`)&&e.style.length===0)return!0;return!1}if(typeof document<`u`){let e=()=>{tt()&&import(`./csp-DR-s45Kg.js`)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):e()}export{u as t};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zazz-ui/core",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Zazz Design Framework — a zero-build, semantic-token CSS + vanilla JS UI kit built on modern web standards.",
5
5
  "keywords": [
6
6
  "cascade-layers",
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-lifecycle.d.ts","sourceRoot":"","sources":["dialog-lifecycle.ts"],"names":[],"mappings":"AAqCA;;;;;GAKG;AACH,iBAAS,qBAAqB,IAAI,OAAO,CAOxC;AAED;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,iBAAiB,GAAG,IAAI,CAQ3D;AAmCD,UAAU,qBAAqB;IAC7B,IAAI,IAAI,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,EAAE,qBAgC1B,CAAC;AAYF,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"dialog-lifecycle.d.ts","sourceRoot":"","sources":["dialog-lifecycle.ts"],"names":[],"mappings":"AAqCA;;;;;GAKG;AACH,iBAAS,qBAAqB,IAAI,OAAO,CAOxC;AAED;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,iBAAiB,GAAG,IAAI,CAQ3D;AAmCD,UAAU,qBAAqB;IAC7B,IAAI,IAAI,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,EAAE,qBAmC1B,CAAC;AAYF,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -110,7 +110,10 @@ const initDialogLifecycle = function () {
110
110
  }
111
111
  }
112
112
  });
113
- observer.observe(document.body, {
113
+ // The root, not <body>: swap navigation (base/navigation.ts) replaces the
114
+ // whole <body>, and an observer on the old one would watch nothing after
115
+ // the first in-site navigation. <html> stays put for the page's lifetime.
116
+ observer.observe(document.documentElement, {
114
117
  attributes: true,
115
118
  attributeFilter: ["open"],
116
119
  subtree: true,
@@ -127,7 +127,10 @@ const initDialogLifecycle: InitDialogLifecycleFn = function () {
127
127
  }
128
128
  }
129
129
  });
130
- observer.observe(document.body, {
130
+ // The root, not <body>: swap navigation (base/navigation.ts) replaces the
131
+ // whole <body>, and an observer on the old one would watch nothing after
132
+ // the first in-site navigation. <html> stays put for the page's lifetime.
133
+ observer.observe(document.documentElement, {
131
134
  attributes: true,
132
135
  attributeFilter: ["open"],
133
136
  subtree: true,
@@ -404,12 +404,9 @@
404
404
 
405
405
  :where([data-ui~="badge"][data-badge-variant="ghost"]) {
406
406
  --_badge-bg: transparent;
407
- /* the muted variant's opaque surface */
408
- --_badge-bg--hover: light-dark(
409
- color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
410
- color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
411
- );
412
- --_badge-bg--active: oklch(from var(--_badge-bg--hover) calc(l - 0.025) c h);
407
+ /* the translucent muted role: shows the surface beneath and follows a retheme */
408
+ --_badge-bg--hover: var(--color-muted);
409
+ --_badge-bg--active: oklch(from var(--_badge-bg--hover) l c h / calc(alpha * 1.5));
413
410
 
414
411
  --_badge-text: var(--color-foreground);
415
412
  --_badge-text--hover: var(--color-foreground);
@@ -432,12 +432,9 @@
432
432
 
433
433
  :where([data-ui~="button"][data-button-variant="ghost"]) {
434
434
  --_button-bg: transparent;
435
- /* the muted variant's opaque surface */
436
- --_button-bg--hover: light-dark(
437
- color-mix(in srgb, var(--color-foreground) 5%, var(--color-background)),
438
- color-mix(in srgb, var(--color-foreground) 10%, var(--color-background))
439
- );
440
- --_button-bg--active: oklch(from var(--_button-bg--hover) calc(l - 0.025) c h);
435
+ /* the translucent muted role: shows the surface beneath and follows a retheme */
436
+ --_button-bg--hover: var(--color-muted);
437
+ --_button-bg--active: oklch(from var(--_button-bg--hover) l c h / calc(alpha * 1.5));
441
438
 
442
439
  --_button-text: var(--color-foreground);
443
440
  --_button-text--hover: var(--color-foreground);
@@ -29,6 +29,11 @@
29
29
  * this control is inert without its script (the hidden input still submits a
30
30
  * server-set value, but no tags render).
31
31
  *
32
+ * Scripts read and set the selection through the element's `value` property,
33
+ * which mirrors `<select>.value`: setting it moves the selection, the label,
34
+ * and the hidden input without focusing the input or dispatching `change`; an
35
+ * unknown value clears the selection.
36
+ *
32
37
  * Attributes on the root: `data-combobox-variant="multiselect"`, `data-combobox-sort="score"`,
33
38
  * `data-combobox-filter="none"` (another source filters; the engine only navigates),
34
39
  * `data-combobox-min-length="<n>"`, `data-combobox-label-remove="Remove {label}"`.
@@ -95,6 +100,24 @@ declare class UiCombobox extends TypeaheadElement {
95
100
  * @param item - The committed option.
96
101
  */
97
102
  protected commit(item: HTMLElement, _source: "keyboard" | "pointer"): void;
103
+ /**
104
+ * @description The selected item's form value (`data-combobox-value`, or its
105
+ * label), like `<select>.value`; the empty string when nothing is selected.
106
+ * In the multiselect variant it is the first selected value.
107
+ *
108
+ * @returns The committed form value.
109
+ */
110
+ get value(): string;
111
+ /**
112
+ * @description Selects the item carrying this form value, as a script sets
113
+ * `<select>.value`: the label, the hidden input, and `aria-selected` follow,
114
+ * but no `change` is dispatched and focus stays where it was. A value no
115
+ * row carries clears the selection; in the multiselect variant the value
116
+ * becomes the whole selection, as `<select multiple>.value` does.
117
+ *
118
+ * @param value - The form value to select.
119
+ */
120
+ set value(value: string);
98
121
  }
99
122
  export { UiCombobox, resolveBlur, resolveRemoveLabel };
100
123
  export type { BlurOutcome };
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["combobox.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA0B3D,2EAA2E;AAC3E,UAAU,WAAW;IACnB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,WAAW,CAI7F;AAED;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,cAAM,UAAW,SAAQ,gBAAgB;;IACvC,SAAS,CAAC,QAAQ,CAAC,UAAU,cAAc;IAC3C,gFAAgF;IAChF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAS;IAOhD,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAgIzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAOzB;IAED;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAE7C;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAU,IAAI,IAAI,CAK3B;IAED;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CA+BzE;CAuOF;AAID,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["combobox.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA0B3D,2EAA2E;AAC3E,UAAU,WAAW;IACnB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,WAAW,CAI7F;AAED;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,cAAM,UAAW,SAAQ,gBAAgB;;IACvC,SAAS,CAAC,QAAQ,CAAC,UAAU,cAAc;IAC3C,gFAAgF;IAChF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAS;IAOhD,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAgIzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAOzB;IAED;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAE7C;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAU,IAAI,IAAI,CAK3B;IAED;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CA+BzE;IAwND;;;;;;OAMG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED;;;;;;;;OAQG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAiBtB;CAqBF;AAID,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -30,6 +30,11 @@
30
30
  * this control is inert without its script (the hidden input still submits a
31
31
  * server-set value, but no tags render).
32
32
  *
33
+ * Scripts read and set the selection through the element's `value` property,
34
+ * which mirrors `<select>.value`: setting it moves the selection, the label,
35
+ * and the hidden input without focusing the input or dispatching `change`; an
36
+ * unknown value clears the selection.
37
+ *
33
38
  * Attributes on the root: `data-combobox-variant="multiselect"`, `data-combobox-sort="score"`,
34
39
  * `data-combobox-filter="none"` (another source filters; the engine only navigates),
35
40
  * `data-combobox-min-length="<n>"`, `data-combobox-label-remove="Remove {label}"`.
@@ -457,9 +462,11 @@ class UiCombobox extends TypeaheadElement {
457
462
  /**
458
463
  * @description Empties the committed state: label, hidden value, tags, and
459
464
  * `aria-selected` all clear together.
465
+ *
466
+ * @param notify - Whether to dispatch `change` (a script setting `value` stays silent).
460
467
  * @private
461
468
  */
462
- #clearSelection() {
469
+ #clearSelection(notify = true) {
463
470
  this.#committedLabel = "";
464
471
  const multiselect = this.#multiselect();
465
472
  for (const item of this.items()) {
@@ -468,7 +475,51 @@ class UiCombobox extends TypeaheadElement {
468
475
  else
469
476
  item.removeAttribute("aria-selected");
470
477
  }
471
- this.#syncSelection(true);
478
+ if (this.searchInput)
479
+ this.searchInput.value = "";
480
+ this.query.set("");
481
+ this.#syncSelection(notify);
482
+ }
483
+ /**
484
+ * @description The selected item's form value (`data-combobox-value`, or its
485
+ * label), like `<select>.value`; the empty string when nothing is selected.
486
+ * In the multiselect variant it is the first selected value.
487
+ *
488
+ * @returns The committed form value.
489
+ */
490
+ get value() {
491
+ const selected = this.#selectedItems()[0];
492
+ return selected ? this.#itemFormValue(selected) : "";
493
+ }
494
+ /**
495
+ * @description Selects the item carrying this form value, as a script sets
496
+ * `<select>.value`: the label, the hidden input, and `aria-selected` follow,
497
+ * but no `change` is dispatched and focus stays where it was. A value no
498
+ * row carries clears the selection; in the multiselect variant the value
499
+ * becomes the whole selection, as `<select multiple>.value` does.
500
+ *
501
+ * @param value - The form value to select.
502
+ */
503
+ set value(value) {
504
+ const match = this.items().find((item) => this.#itemFormValue(item) === value);
505
+ if (!match) {
506
+ this.#clearSelection(false);
507
+ return;
508
+ }
509
+ const multiselect = this.#multiselect();
510
+ for (const other of this.items()) {
511
+ if (multiselect)
512
+ other.setAttribute("aria-selected", "false");
513
+ else
514
+ other.removeAttribute("aria-selected");
515
+ }
516
+ match.setAttribute("aria-selected", "true");
517
+ this.#committedLabel = multiselect ? "" : this.itemValue(match);
518
+ const input = this.searchInput;
519
+ if (input)
520
+ input.value = this.#committedLabel;
521
+ this.query.set("");
522
+ this.#syncSelection(false);
472
523
  }
473
524
  /**
474
525
  * @description Restores the selection the markup shipped with (form reset).
@@ -31,6 +31,11 @@
31
31
  * this control is inert without its script (the hidden input still submits a
32
32
  * server-set value, but no tags render).
33
33
  *
34
+ * Scripts read and set the selection through the element's `value` property,
35
+ * which mirrors `<select>.value`: setting it moves the selection, the label,
36
+ * and the hidden input without focusing the input or dispatching `change`; an
37
+ * unknown value clears the selection.
38
+ *
34
39
  * Attributes on the root: `data-combobox-variant="multiselect"`, `data-combobox-sort="score"`,
35
40
  * `data-combobox-filter="none"` (another source filters; the engine only navigates),
36
41
  * `data-combobox-min-length="<n>"`, `data-combobox-label-remove="Remove {label}"`.
@@ -513,16 +518,60 @@ class UiCombobox extends TypeaheadElement {
513
518
  /**
514
519
  * @description Empties the committed state: label, hidden value, tags, and
515
520
  * `aria-selected` all clear together.
521
+ *
522
+ * @param notify - Whether to dispatch `change` (a script setting `value` stays silent).
516
523
  * @private
517
524
  */
518
- #clearSelection(): void {
525
+ #clearSelection(notify = true): void {
519
526
  this.#committedLabel = "";
520
527
  const multiselect = this.#multiselect();
521
528
  for (const item of this.items()) {
522
529
  if (multiselect) item.setAttribute("aria-selected", "false");
523
530
  else item.removeAttribute("aria-selected");
524
531
  }
525
- this.#syncSelection(true);
532
+ if (this.searchInput) this.searchInput.value = "";
533
+ this.query.set("");
534
+ this.#syncSelection(notify);
535
+ }
536
+
537
+ /**
538
+ * @description The selected item's form value (`data-combobox-value`, or its
539
+ * label), like `<select>.value`; the empty string when nothing is selected.
540
+ * In the multiselect variant it is the first selected value.
541
+ *
542
+ * @returns The committed form value.
543
+ */
544
+ get value(): string {
545
+ const selected = this.#selectedItems()[0];
546
+ return selected ? this.#itemFormValue(selected) : "";
547
+ }
548
+
549
+ /**
550
+ * @description Selects the item carrying this form value, as a script sets
551
+ * `<select>.value`: the label, the hidden input, and `aria-selected` follow,
552
+ * but no `change` is dispatched and focus stays where it was. A value no
553
+ * row carries clears the selection; in the multiselect variant the value
554
+ * becomes the whole selection, as `<select multiple>.value` does.
555
+ *
556
+ * @param value - The form value to select.
557
+ */
558
+ set value(value: string) {
559
+ const match = this.items().find((item) => this.#itemFormValue(item) === value);
560
+ if (!match) {
561
+ this.#clearSelection(false);
562
+ return;
563
+ }
564
+ const multiselect = this.#multiselect();
565
+ for (const other of this.items()) {
566
+ if (multiselect) other.setAttribute("aria-selected", "false");
567
+ else other.removeAttribute("aria-selected");
568
+ }
569
+ match.setAttribute("aria-selected", "true");
570
+ this.#committedLabel = multiselect ? "" : this.itemValue(match);
571
+ const input = this.searchInput;
572
+ if (input) input.value = this.#committedLabel;
573
+ this.query.set("");
574
+ this.#syncSelection(false);
526
575
  }
527
576
 
528
577
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["debug.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,+GAA+G;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA+CD,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,EAAE,CAmB1E;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAyCtF;AAED,eAAO,MAAM,aAAa,8KACiJ,CAAC;AAI5K,cAAM,OAAQ,SAAQ,WAAW;IAC/B,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAgDzC;CACF;AAID,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["debug.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,+GAA+G;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AA+CD,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,EAAE,CAmB1E;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAyCtF;AAED,eAAO,MAAM,aAAa,8KACiJ,CAAC;AAI5K,cAAM,OAAQ,SAAQ,WAAW;IAC/B,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAmDzC;CACF;AAID,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -160,7 +160,10 @@ class UiDebug extends ZazzElement {
160
160
  report();
161
161
  });
162
162
  });
163
- observer.observe(document.body, {
163
+ // The root, not <body>: swap navigation replaces the whole <body>, and a
164
+ // persisted <ui-debug> would otherwise watch the old one. `report` reads
165
+ // `document.body` on each run, so it always audits the current page.
166
+ observer.observe(document.documentElement, {
164
167
  attributes: true,
165
168
  attributeFilter: ["style", "data-ui"],
166
169
  childList: true,
@@ -204,7 +204,10 @@ class UiDebug extends ZazzElement {
204
204
  report();
205
205
  });
206
206
  });
207
- observer.observe(document.body, {
207
+ // The root, not <body>: swap navigation replaces the whole <body>, and a
208
+ // persisted <ui-debug> would otherwise watch the old one. `report` reads
209
+ // `document.body` on each run, so it always audits the current page.
210
+ observer.observe(document.documentElement, {
208
211
  attributes: true,
209
212
  attributeFilter: ["style", "data-ui"],
210
213
  childList: true,