mtrl 0.4.3 → 0.4.5

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/index.js CHANGED
@@ -1,35 +1,35 @@
1
1
  /**
2
- * mtrl v0.4.3
2
+ * mtrl v0.4.5
3
3
  * A functional TypeScript component library based on Material Design 3
4
4
  * @license MIT
5
5
  */
6
- var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(Z)=>$[Q]=()=>Z})};var T=(J,$)=>()=>(J&&($=J(J=0)),$);var b=(...J)=>($)=>J.reduce((Q,Z)=>Z(Q),$),z3=(...J)=>($)=>J.reduceRight((Q,Z)=>Z(Q),$),W3=(...J)=>($,Q={})=>J.reduce((Z,q)=>({...Z,...q(Z,Q)}),$);var Y3=(J={})=>({element:null,config:J,setup(){return this}});var GJ=(J,$={})=>{return Object.entries($).forEach(([Q,Z])=>{if(Z===null||Z===void 0)return;J.setAttribute(Q,String(Z))}),J},U3=(J,$=[])=>{return $.forEach((Q)=>J.removeAttribute(Q)),J};var f="mtrl",X3=(J)=>`mtrl-${J}`,B3=(J,$)=>`${J}--${$}`,F3=(J,$)=>`${J}-${$}`,zJ,WJ,H3;var w6=T(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(zJ||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(WJ||={});H3={bem:(J,$,Q)=>{let Z=J;if($)Z+=`-${$}`;if(Q)Z+=`--${Q}`;return Z},join:(...J)=>J.filter(Boolean).join(" ")}});var z9,e6=(...J)=>{let $=J.flat().reduce((Z,q)=>{if(typeof q==="string")Z.push(...q.split(/\s+/));return Z},[]).filter(Boolean),Q=new Set;return $.forEach((Z)=>Q.add(Z)),Array.from(Q)},g=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.add(...Z);return J},j6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.remove(...Z);return J},YJ=(J,...$)=>{let Q=e6(...$);for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;J.classList.toggle(j)}return J},R6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return!0;for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;if(!J.classList.contains(j))return!1}return!0};var R9=T(()=>{w6();z9=`${f}-`});var k3,UJ=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let Z in $){let q=$[Z],j=(G)=>{let K=!0;if(typeof q==="function")try{let z={...Q,element:J};K=q(z,G)}catch(z){console.warn(`Error in event condition for ${Z}:`,z),K=!1}else K=Boolean(q);if(K){if(Q.emit)Q.emit(Z,{event:G,element:J,originalEvent:G});else if(Q.on)J.dispatchEvent(new CustomEvent(Z,{detail:{event:G,element:J,originalEvent:G},bubbles:!0,cancelable:!0}))}};J.__eventHandlers[Z]=j,J.addEventListener(Z,j)}},XJ=(J,{html:$,text:Q,id:Z})=>{if($)J.innerHTML=$;if(Q)J.textContent=Q;if(Z)J.id=Z},BJ=(J,$,Q)=>{if($)g(J,$);if(Q){let Z=e6(Q);if(Z.length)J.classList.add(...Z)}},FJ=(J,$,Q,Z)=>{if($)$.appendChild(J);if(Q)Q(J,Z);return J},v=(J={})=>{let{tag:$="div",container:Q=null,html:Z="",text:q="",id:j="",data:G={},class:K,className:z,rawClass:W,attributes:Y={},forwardEvents:U={},onCreate:X,context:_,...H}=J,B=document.createElement($);XJ(B,{html:Z,text:q,id:j}),BJ(B,K||z,W);for(let k in G)B.dataset[k]=G[k];let M={...Y,...H};for(let k in M){let N=M[k];if(N!=null)B.setAttribute(k,String(N))}return UJ(B,U,_),FJ(B,Q,X,_)},M3=(J={})=>{let{tag:$="svg",container:Q=null,html:Z="",text:q="",id:j="",class:G,className:K,rawClass:z,attributes:W={},forwardEvents:Y={},onCreate:U,context:X,..._}=J;if(!k3.includes($.toLowerCase()))console.warn(`Warning: '${$}' is not a standard SVG element tag.`);let H=document.createElementNS("http://www.w3.org/2000/svg",$);XJ(H,{html:Z,text:q,id:j}),BJ(H,G||K,z);let B={...W,..._};for(let M in B){let k=B[M];if(k!=null)H.setAttributeNS(null,M,String(k))}return UJ(H,Y,X),FJ(H,Q,U,X)},HJ=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var A6=T(()=>{R9();R9();k3=["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","tspan","textPath","defs","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","use","foreignObject","desc","title","metadata","symbol","switch"]});function V3(J){return"touches"in J}function N3(J){return"clientX"in J&&"clientY"in J}var kJ=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},u7,W9,E$,u6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},p6=(J)=>{if(V3(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(N3(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var q7=T(()=>{u7={passive:!0},W9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},E$={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var _3=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),S=(J={})=>({config:J,componentName:J.componentName,..._3(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let Z=p6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:Z.clientX,y:Z.clientY},isTouching:!0,activeTarget:Z.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),h=(J={})=>($)=>{let Q=(W)=>{if(j.updateTouchState(W,"start"),z.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",p6(W))},Z=(W)=>{if(!j.touchState.isTouching)return;let Y=Date.now()-j.touchState.startTime;if(z.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(W,"end"),Y<W9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",p6(W));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",p6(W))},q=(W)=>{if(!j.touchState.isTouching)return;let Y=p6(W),U=Y.clientX-j.touchState.startPosition.x,X=Y.clientY-j.touchState.startPosition.y;if(Math.abs(U)>W9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:U>0?"right":"left",deltaX:U,deltaY:X});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...Y,deltaX:U,deltaY:X})},j=$,G=$.config.parent||J.parent;if(typeof G==="string")G=document.querySelector(G);let K={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),u6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:G},z=v(K);if(u6()&&J.interactive)z.addEventListener("touchstart",Q,u7),z.addEventListener("touchend",Z),z.addEventListener("touchmove",q,u7);return{...$,element:z,addClass(...W){return z.classList.add(...W.filter(Boolean)),this},destroy(){if(u6()&&J.interactive)z.removeEventListener("touchstart",Q),z.removeEventListener("touchend",Z),z.removeEventListener("touchmove",q);HJ(z),z.remove()}}};var c=T(()=>{A6();q7()});var f6=()=>{let J=new Map;return{on:($,Q)=>{let Z=J.get($)||[];return J.set($,[...Z,Q]),()=>{let q=J.get($)||[];J.set($,q.filter((j)=>j!==Q))}},off($,Q){let Z=J.get($)||[];J.set($,Z.filter((q)=>q!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((q)=>q(...Q))},clear:()=>{J.clear()}}};var d=()=>(J)=>{let $=f6();return{...J,on(Q,Z){return $.on(Q,Z),this},off(Q,Z){return $.off(Q,Z),this},emit(Q,Z){return $.emit(Q,Z),this}}};var MJ=()=>{};var L3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");return G.className=`${Z}-${$.componentName||"component"}-text`,G.textContent=j,G};return{setText(j){if(!Q&&j)if(Q=q(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},Y9=(J)=>($)=>{let Q=L3($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var D3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");G.className=`${Z}-icon`;let K=`${Z}-${$.componentName||"component"}-icon`;if(G.classList.add(K),$.iconSize)G.classList.add(`${Z}-icon--${$.iconSize}`);return G.innerHTML=j,G};return{setIcon(j){if(!Q&&j)if(Q=q(j),$.iconPosition==="end")J.appendChild(Q);else J.insertBefore(Q,J.firstChild);else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},O3=(J,$)=>{let{text:Q,icon:Z}=$,q=`${J.getClass("button")}--circular`;if(!Q&&Z)J.element.classList.add(q);else J.element.classList.remove(q)},U9=(J)=>($)=>{let Q=D3($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)O3($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var K6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var f7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var VJ,g7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=VJ[J.position.toUpperCase()]||J.position,Z=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(Z),{...$,position:{setPosition(j){let G=Q,K=`${J.prefix}-${J.componentName}--${G}`,z=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(K),$.element.classList.add(z),this},getPosition(){return Q}}}};var NJ=T(()=>{((K)=>{K.LEFT="left";K.RIGHT="right";K.TOP="top";K.BOTTOM="bottom";K.START="start";K.END="end";K.CENTER="center"})(VJ||={})});var _J,h9,sK;var LJ=T(()=>{((G)=>{G.LINEAR="linear";G.EASE="ease";G.EASE_IN="ease-in";G.EASE_OUT="ease-out";G.EASE_IN_OUT="ease-in-out";G.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(_J||={});h9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},sK={duration:{type:"number",minimum:0,default:h9.duration},timing:{type:"string",enum:Object.values(_J),default:h9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:h9.opacity}}});var P3=(J={})=>{let $={...h9,...J,opacity:J.opacity||h9.opacity},Q=new WeakMap,Z=[],q=()=>{let z=document.createElement("div");return z.className=`${f}-ripple-wave`,z},j=(z,W)=>{if(typeof document.addEventListener==="function")document.addEventListener(z,W),Z.push({event:z,handler:W})},G=(z,W)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(z,W),Z=Z.filter((Y)=>!(Y.event===z&&Y.handler===W))},K=(z,W)=>{if(!W||!W.__rippleContainer)return;let Y=W.__rippleContainer,U=W.getBoundingClientRect(),X=q(),_=Math.max(U.width,U.height)*2,H=z.clientX-U.left-_/2,B=z.clientY-U.top-_/2;Object.assign(X.style,{width:`${_}px`,height:`${_}px`,left:`${H}px`,top:`${B}px`}),Y.appendChild(X),X.offsetHeight,requestAnimationFrame(()=>{X.classList.add("active")});let M=()=>{G("mouseup",M),G("mouseleave",M),X.classList.remove("active"),X.classList.add("fade-out"),setTimeout(()=>{if(X.parentNode)X.parentNode.removeChild(X);Q.get(W)?.delete(X)},$.duration)};j("mouseup",M),j("mouseleave",M)};return{mount:(z)=>{if(!z)return;if(window.getComputedStyle(z).position==="static")z.style.position="relative";let Y=z.querySelector(`.${f}-ripple`);if(!Y)Y=document.createElement("div"),Y.className=`${f}-ripple`,z.appendChild(Y);z.__rippleContainer=Y,Q.set(z,new Set);let U=(X)=>K(X,z);if(!z.__rippleHandlers)z.__rippleHandlers=[];z.__rippleHandlers.push(U),z.addEventListener("mousedown",U)},unmount:(z)=>{if(!z)return;if(Z.forEach(({event:W,handler:Y})=>{G(W,Y)}),Z=[],z.__rippleHandlers)z.__rippleHandlers.forEach((W)=>{z.removeEventListener("mousedown",W)}),z.__rippleHandlers=[];if(Q.has(z)){let W=Q.get(z);if(W)W.forEach((Y)=>{if(Y.parentNode)Y.parentNode.removeChild(Y)});Q.delete(z)}if(z.__rippleContainer&&z.__rippleContainer.parentNode)z.__rippleContainer.parentNode.removeChild(z.__rippleContainer),delete z.__rippleContainer}}},S6=(J)=>($)=>{if(!J.ripple)return $;let Q=P3(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let Z=$.lifecycle.mount,q=$.lifecycle.destroy;$.lifecycle.mount=()=>{Z.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),q.call($.lifecycle)}}return{...$,ripple:Q}};var DJ=T(()=>{LJ();w6()});function OJ(J){return"emit"in J&&typeof J.emit==="function"}var u9=(J={})=>($)=>{let Q=document.createElement("input"),Z=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(Z)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",Z);let q={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(q).forEach(([j,G])=>{if(G!==null&&G!==void 0)if(j==="disabled"&&G===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(G===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(G))}),Q.addEventListener("change",(j)=>{if(OJ($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,OJ($))$.emit("value",{value:j});return this}}};var f9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",Z=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(Z(),$.emit)$.on?.("change",Z);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,Z(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,Z(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,Z(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var PJ=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function M6(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function _6(J){return"emit"in J&&typeof J.emit==="function"}var d7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",Z=document.createElement(Q?"textarea":"input");Z.className=`${$.getClass("textfield")}-input`;let q={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||""};if(!Q)q.type=J.type||"text";else q["data-type"]="multiline";Object.entries(q).forEach(([K,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)Z.setAttribute(K,"")}else Z.setAttribute(K,String(z))});let j=()=>{let K=!Z.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,K),K},G=()=>{if(Z.matches(":-webkit-autofill")||window.getComputedStyle(Z).backgroundColor==="rgb(250, 255, 189)"||window.getComputedStyle(Z).backgroundColor==="rgb(232, 240, 254)"){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),_6($))$.emit("input",{value:Z.value,isEmpty:!1,isAutofilled:!0})}};if(Z.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),_6($))$.emit("focus",{isEmpty:j()});setTimeout(G,100)}),Z.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),_6($))$.emit("blur",{isEmpty:j()})}),Z.addEventListener("input",()=>{if(_6($))$.emit("input",{value:Z.value,isEmpty:j(),isAutofilled:!1});else j()}),j(),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(Z),M6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),K.call($.lifecycle)}}return{...$,input:Z,setValue(K){return Z.value=K||"",j(),this},getValue(){return Z.value},setAttribute(K,z){return Z.setAttribute(K,z),this},getAttribute(K){return Z.getAttribute(K)},removeAttribute(K){return Z.removeAttribute(K),this}}};var RJ=()=>{};var X9=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label");Q.className=`${J.prefix}-${J.componentName}-label`,Q.textContent=J.label;let Z=J.labelPosition||"start";if(Z==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(Z&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${Z}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var R3=`
6
+ var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(Z)=>$[Q]=()=>Z})};var T=(J,$)=>()=>(J&&($=J(J=0)),$);var b=(...J)=>($)=>J.reduce((Q,Z)=>Z(Q),$),z3=(...J)=>($)=>J.reduceRight((Q,Z)=>Z(Q),$),W3=(...J)=>($,Q={})=>J.reduce((Z,q)=>({...Z,...q(Z,Q)}),$);var Y3=(J={})=>({element:null,config:J,setup(){return this}});var GJ=(J,$={})=>{return Object.entries($).forEach(([Q,Z])=>{if(Z===null||Z===void 0)return;J.setAttribute(Q,String(Z))}),J},U3=(J,$=[])=>{return $.forEach((Q)=>J.removeAttribute(Q)),J};var f="mtrl",X3=(J)=>`mtrl-${J}`,B3=(J,$)=>`${J}--${$}`,F3=(J,$)=>`${J}-${$}`,zJ,WJ,H3;var w6=T(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(zJ||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(WJ||={});H3={bem:(J,$,Q)=>{let Z=J;if($)Z+=`-${$}`;if(Q)Z+=`--${Q}`;return Z},join:(...J)=>J.filter(Boolean).join(" ")}});var z9,e6=(...J)=>{let $=J.flat().reduce((Z,q)=>{if(typeof q==="string")Z.push(...q.split(/\s+/));return Z},[]).filter(Boolean),Q=new Set;return $.forEach((Z)=>Q.add(Z)),Array.from(Q)},g=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.add(...Z);return J},j6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.remove(...Z);return J},YJ=(J,...$)=>{let Q=e6(...$);for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;J.classList.toggle(j)}return J},R6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return!0;for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;if(!J.classList.contains(j))return!1}return!0};var R9=T(()=>{w6();z9=`${f}-`});var M3,UJ=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let Z in $){let q=$[Z],j=(K)=>{let G=!0;if(typeof q==="function")try{let W={...Q,element:J};G=q(W,K)}catch(W){console.warn(`Error in event condition for ${Z}:`,W),G=!1}else G=Boolean(q);if(G){if(Q.emit)Q.emit(Z,{event:K,element:J,originalEvent:K});else if(Q.on)J.dispatchEvent(new CustomEvent(Z,{detail:{event:K,element:J,originalEvent:K},bubbles:!0,cancelable:!0}))}};J.__eventHandlers[Z]=j,J.addEventListener(Z,j)}},XJ=(J,{html:$,text:Q,id:Z})=>{if($)J.innerHTML=$;if(Q)J.textContent=Q;if(Z)J.id=Z},BJ=(J,$,Q)=>{if($)g(J,$);if(Q){let Z=e6(Q);if(Z.length)J.classList.add(...Z)}},FJ=(J,$,Q,Z)=>{if($)$.appendChild(J);if(Q)Q(J,Z);return J},v=(J={})=>{let{tag:$="div",container:Q=null,html:Z="",text:q="",id:j="",data:K={},class:G,className:W,rawClass:z,attributes:Y={},forwardEvents:U={},onCreate:X,context:_,...H}=J,B=document.createElement($);XJ(B,{html:Z,text:q,id:j}),BJ(B,G||W,z);for(let M in K)B.dataset[M]=K[M];let k={...Y,...H};for(let M in k){let V=k[M];if(V!=null)B.setAttribute(M,String(V))}return UJ(B,U,_),FJ(B,Q,X,_)},k3=(J={})=>{let{tag:$="svg",container:Q=null,html:Z="",text:q="",id:j="",class:K,className:G,rawClass:W,attributes:z={},forwardEvents:Y={},onCreate:U,context:X,..._}=J;if(!M3.includes($.toLowerCase()))console.warn(`Warning: '${$}' is not a standard SVG element tag.`);let H=document.createElementNS("http://www.w3.org/2000/svg",$);XJ(H,{html:Z,text:q,id:j}),BJ(H,K||G,W);let B={...z,..._};for(let k in B){let M=B[k];if(M!=null)H.setAttributeNS(null,k,String(M))}return UJ(H,Y,X),FJ(H,Q,U,X)},HJ=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var A6=T(()=>{R9();R9();M3=["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","tspan","textPath","defs","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","use","foreignObject","desc","title","metadata","symbol","switch"]});function N3(J){return"touches"in J}function V3(J){return"clientX"in J&&"clientY"in J}var MJ=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},u7,W9,E$,u6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},p6=(J)=>{if(N3(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(V3(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var q7=T(()=>{u7={passive:!0},W9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},E$={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var _3=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),S=(J={})=>({config:J,componentName:J.componentName,..._3(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let Z=p6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:Z.clientX,y:Z.clientY},isTouching:!0,activeTarget:Z.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),h=(J={})=>($)=>{let Q=(z)=>{if(j.updateTouchState(z,"start"),W.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",p6(z))},Z=(z)=>{if(!j.touchState.isTouching)return;let Y=Date.now()-j.touchState.startTime;if(W.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(z,"end"),Y<W9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",p6(z));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",p6(z))},q=(z)=>{if(!j.touchState.isTouching)return;let Y=p6(z),U=Y.clientX-j.touchState.startPosition.x,X=Y.clientY-j.touchState.startPosition.y;if(Math.abs(U)>W9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:U>0?"right":"left",deltaX:U,deltaY:X});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...Y,deltaX:U,deltaY:X})},j=$,K=$.config.parent||J.parent;if(typeof K==="string")K=document.querySelector(K);let G={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),u6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:K},W=v(G);if(u6()&&J.interactive)W.addEventListener("touchstart",Q,u7),W.addEventListener("touchend",Z),W.addEventListener("touchmove",q,u7);return{...$,element:W,addClass(...z){return W.classList.add(...z.filter(Boolean)),this},destroy(){if(u6()&&J.interactive)W.removeEventListener("touchstart",Q),W.removeEventListener("touchend",Z),W.removeEventListener("touchmove",q);HJ(W),W.remove()}}};var c=T(()=>{A6();q7()});var f6=()=>{let J=new Map;return{on:($,Q)=>{let Z=J.get($)||[];return J.set($,[...Z,Q]),()=>{let q=J.get($)||[];J.set($,q.filter((j)=>j!==Q))}},off($,Q){let Z=J.get($)||[];J.set($,Z.filter((q)=>q!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((q)=>q(...Q))},clear:()=>{J.clear()}}};var d=()=>(J)=>{let $=f6();return{...J,on(Q,Z){return $.on(Q,Z),this},off(Q,Z){return $.off(Q,Z),this},emit(Q,Z){return $.emit(Q,Z),this}}};var kJ=()=>{};var L3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let K=document.createElement("span");return K.className=`${Z}-${$.componentName||"component"}-text`,K.textContent=j,K};return{setText(j){if(!Q&&j)if(Q=q(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},Y9=(J)=>($)=>{let Q=L3($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var D3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let K=document.createElement("span");K.className=`${Z}-icon`;let G=`${Z}-${$.componentName||"component"}-icon`;if(K.classList.add(G),$.iconSize)K.classList.add(`${Z}-icon--${$.iconSize}`);return K.innerHTML=j,K};return{setIcon(j){if(!Q&&j)if(Q=q(j),$.iconPosition==="end")J.appendChild(Q);else J.insertBefore(Q,J.firstChild);else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},O3=(J,$)=>{let{text:Q,icon:Z}=$,q=`${J.getClass("button")}--circular`;if(!Q&&Z)J.element.classList.add(q);else J.element.classList.remove(q)},U9=(J)=>($)=>{let Q=D3($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)O3($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var K6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var f7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var NJ,g7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=NJ[J.position.toUpperCase()]||J.position,Z=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(Z),{...$,position:{setPosition(j){let K=Q,G=`${J.prefix}-${J.componentName}--${K}`,W=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(G),$.element.classList.add(W),this},getPosition(){return Q}}}};var VJ=T(()=>{((G)=>{G.LEFT="left";G.RIGHT="right";G.TOP="top";G.BOTTOM="bottom";G.START="start";G.END="end";G.CENTER="center"})(NJ||={})});var _J,h9,sK;var LJ=T(()=>{((K)=>{K.LINEAR="linear";K.EASE="ease";K.EASE_IN="ease-in";K.EASE_OUT="ease-out";K.EASE_IN_OUT="ease-in-out";K.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(_J||={});h9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},sK={duration:{type:"number",minimum:0,default:h9.duration},timing:{type:"string",enum:Object.values(_J),default:h9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:h9.opacity}}});var P3=(J={})=>{let $={...h9,...J,opacity:J.opacity||h9.opacity},Q=new WeakMap,Z=[],q=()=>{let W=document.createElement("div");return W.className=`${f}-ripple-wave`,W},j=(W,z)=>{if(typeof document.addEventListener==="function")document.addEventListener(W,z),Z.push({event:W,handler:z})},K=(W,z)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(W,z),Z=Z.filter((Y)=>!(Y.event===W&&Y.handler===z))},G=(W,z)=>{if(!z||!z.__rippleContainer)return;let Y=z.__rippleContainer,U=z.getBoundingClientRect(),X=q(),_=Math.max(U.width,U.height)*2,H=W.clientX-U.left-_/2,B=W.clientY-U.top-_/2;Object.assign(X.style,{width:`${_}px`,height:`${_}px`,left:`${H}px`,top:`${B}px`}),Y.appendChild(X),X.offsetHeight,requestAnimationFrame(()=>{X.classList.add("active")});let k=()=>{K("mouseup",k),K("mouseleave",k),X.classList.remove("active"),X.classList.add("fade-out"),setTimeout(()=>{if(X.parentNode)X.parentNode.removeChild(X);Q.get(z)?.delete(X)},$.duration)};j("mouseup",k),j("mouseleave",k)};return{mount:(W)=>{if(!W)return;if(window.getComputedStyle(W).position==="static")W.style.position="relative";let Y=W.querySelector(`.${f}-ripple`);if(!Y)Y=document.createElement("div"),Y.className=`${f}-ripple`,W.appendChild(Y);W.__rippleContainer=Y,Q.set(W,new Set);let U=(X)=>G(X,W);if(!W.__rippleHandlers)W.__rippleHandlers=[];W.__rippleHandlers.push(U),W.addEventListener("mousedown",U)},unmount:(W)=>{if(!W)return;if(Z.forEach(({event:z,handler:Y})=>{K(z,Y)}),Z=[],W.__rippleHandlers)W.__rippleHandlers.forEach((z)=>{W.removeEventListener("mousedown",z)}),W.__rippleHandlers=[];if(Q.has(W)){let z=Q.get(W);if(z)z.forEach((Y)=>{if(Y.parentNode)Y.parentNode.removeChild(Y)});Q.delete(W)}if(W.__rippleContainer&&W.__rippleContainer.parentNode)W.__rippleContainer.parentNode.removeChild(W.__rippleContainer),delete W.__rippleContainer}}},S6=(J)=>($)=>{if(!J.ripple)return $;let Q=P3(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let Z=$.lifecycle.mount,q=$.lifecycle.destroy;$.lifecycle.mount=()=>{Z.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),q.call($.lifecycle)}}return{...$,ripple:Q}};var DJ=T(()=>{LJ();w6()});function OJ(J){return"emit"in J&&typeof J.emit==="function"}var u9=(J={})=>($)=>{let Q=document.createElement("input"),Z=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(Z)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",Z);let q={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(q).forEach(([j,K])=>{if(K!==null&&K!==void 0)if(j==="disabled"&&K===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(K===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(K))}),Q.addEventListener("change",(j)=>{if(OJ($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,OJ($))$.emit("value",{value:j});return this}}};var f9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",Z=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(Z(),$.emit)$.on?.("change",Z);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,Z(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,Z(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,Z(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var PJ=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function k6(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function N6(J){return"emit"in J&&typeof J.emit==="function"}var d7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",Z=document.createElement(Q?"textarea":"input");Z.className=`${$.getClass("textfield")}-input`;let q={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||"",placeholder:J.placeholder||" "};if(!Q)q.type=J.type||"text";else q["data-type"]="multiline";Object.entries(q).forEach(([W,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)Z.setAttribute(W,"")}else Z.setAttribute(W,String(z))});let j=()=>{let W=!Z.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,W),W},K=(W=!0)=>{console.log("checkForAutofill");let z=Z.value&&Z.value.length>0,Y=Z.matches(":-webkit-autofill"),X=window.getComputedStyle(Z).backgroundColor,_=X==="rgb(250, 255, 189)"||X==="rgb(232, 240, 254)"||X==="rgb(250, 255, 0)"||X==="rgba(255, 255, 0, 0.1)";if(z||Y||_){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),W&&N6($)&&(Y||_))$.emit("input",{value:Z.value,isEmpty:!1,isAutofilled:!0})}},G=null;if(typeof MutationObserver!=="undefined")G=new MutationObserver((W)=>{W.forEach((z)=>{if(z.type==="attributes"&&(z.attributeName==="value"||z.attributeName==="data-autofilled"))K(!0)})}),G.observe(Z,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(Z.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),N6($))$.emit("focus",{isEmpty:j()});K(!1)}),Z.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),N6($))$.emit("blur",{isEmpty:j()});K(!1)}),Z.addEventListener("input",()=>{if(N6($))$.emit("input",{value:Z.value,isEmpty:j(),isAutofilled:!1});else j()}),Z.addEventListener("change",()=>{let W=j();if(K(!1),N6($))$.emit("change",{value:Z.value,isEmpty:W,isAutofilled:Z.matches?.(":-webkit-autofill")||!1})}),Z.addEventListener("animationstart",(W)=>{if(W.animationName==="onAutoFillStart"||W.animationName?.includes("autofill"))K()}),j(),setTimeout(()=>{K(!1)},0),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(Z),k6($)){let W=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(G)G.disconnect();Z.remove(),W.call($.lifecycle)}}return{...$,input:Z,setValue(W){return Z.value=W||"",j(),this},getValue(){return Z.value},setAttribute(W,z){return Z.setAttribute(W,z),this},getAttribute(W){return Z.getAttribute(W)},removeAttribute(W){return Z.removeAttribute(W),this}}};var RJ=()=>{};var X9=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label");Q.className=`${J.prefix}-${J.componentName}-label`,Q.textContent=J.label;let Z=J.labelPosition||"start";if(Z==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(Z&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${Z}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var R3=`
7
7
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8
8
  <polyline points="20 6 9 17 4 12"></polyline>
9
- </svg>`,l7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let Z=document.createElement("span");if(Z.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(Z),J.icon!=="none"){let q=document.createElement("span");q.className=`${J.prefix}-${J.componentName}-thumb-icon`,q.innerHTML=J.icon||R3,Z.appendChild(q)}return $.element.appendChild(Q),{...$,track:Q,thumb:Z}};var h$=(J)=>{let $=new Map;return{on(Q,Z){return J.addEventListener(Q,Z),$.set(Z,Q),this},off(Q,Z){return J.removeEventListener(Q,Z),$.delete(Z),this},destroy(){$.forEach((Q,Z)=>{J.removeEventListener(Q,Z)}),$.clear()},getHandlers(){return new Map($)}}};var AJ=(J)=>($)=>{let Q=h$(J||$.element),Z={addListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.on(j,G)}),this},removeListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.off(j,G)}),this},once(q,j){let G=(K)=>{j(K),Q.off(q,G)};return Q.on(q,G),this},on(q,j){return Q.on(q,j),this},off(q,j){return Q.off(q,j),this},destroy(){Q.destroy()}};if(M6($)){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),q.call($.lifecycle)}}return{...$,events:Z,on:Z.on.bind(Z),off:Z.off.bind(Z)}};var wJ=()=>{};var xJ=T(()=>{K7();w6()});var G7=(J,$,Q={})=>{let Z=null,q=0,{leading:j=!0,trailing:G=!0}=Q;return function(...K){let z=Date.now();if(!q&&!j)q=z;let W=$-(z-q);if(W<=0||W>$){if(Z)clearTimeout(Z),Z=null;q=z,J.apply(this,K)}else if(!Z&&G)Z=window.setTimeout(()=>{q=j?Date.now():0,Z=null,J.apply(this,K)},W)}},z7=(J,$,Q={})=>{let Z=null,q=null,j=null,G,K=null,z=0,{leading:W=!1,maxWait:Y}=Q,U=(B)=>{let M=B-(K||0),k=B-z;return!K||M>=$||M<0||Y!==void 0&&k>=Y},X=(B)=>{let M=q,k=j;return q=j=null,z=B,G=J.apply(k,M),G},_=(B)=>{if(Z=null,q)return X(B);return G},H=(B)=>{return z=B,Z=window.setTimeout(()=>{_(Date.now())},$),W?X(B):G};return function(...B){let M=Date.now(),k=U(M);if(q=B,j=this,K=M,k){if(Z===null)return H(M);if(Y!==void 0)Z=window.setTimeout(()=>{let N=Date.now();if(U(N))return _(N)},Math.min($,Y-(M-z)))}if(Z===null)Z=window.setTimeout(()=>{_(Date.now())},$);return G}},u$=(J)=>{let $=!1,Q;return function(...Z){if(!$)$=!0,Q=J.apply(this,Z);return Q}};var yJ=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=G7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,throttled:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.throttled),delete Q[G];return j};if(M6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.throttled)}),G.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addThrottledEvent:Z,removeThrottledEvent:q};return j};var TJ=()=>{};function A3(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var IJ=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=z7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,debounced:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.debounced),delete Q[G];return j};if(A3($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.debounced)}),G.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addDebouncedEvent:Z,removeDebouncedEvent:q};return j};var SJ=()=>{};var f$=()=>{};function bJ(J,$,Q,Z){return Math.sqrt(Math.pow(Q-J,2)+Math.pow(Z-$,2))}function vJ(J,$,Q,Z){let q=Math.atan2(Z-$,Q-J)*180/Math.PI;return q<0?q+360:q}function b6(J,$,Q){let Z=Date.now(),q=!1,j={type:J,originalEvent:$,target:Q.target||$.target,startTime:Q.startTime,endTime:Z,duration:Z-Q.startTime,defaultPrevented:q,preventDefault:()=>{if(q=!0,j.defaultPrevented=!0,$.cancelable)$.preventDefault()},stopPropagation:()=>{$.stopPropagation()}};return j}function CJ(){return"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0}function EJ(){return!!window.PointerEvent}function g$(J){if("touches"in J&&J.touches.length>0)return{clientX:J.touches[0].clientX,clientY:J.touches[0].clientY};return{clientX:J.clientX,clientY:J.clientY}}function d$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY;if(Math.sqrt(q*q+j*j)<Q.tapDistanceThreshold){let W=Date.now()-$.lastTapTime<300?$.tapCount+1:1;return{...b6("tap",Z,$),type:"tap",count:W,x:$.currentX,y:$.currentY}}return null}var l$=()=>{};function w3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}function p$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY,G=Math.sqrt(q*q+j*j),z=Date.now()-$.startTime,W=G/z;if(G>=Q.swipeThreshold&&z<=Q.swipeTimeThreshold){let Y=w3(q,j);return{...b6("swipe",Z,$),type:"swipe",direction:Y,deltaX:q,deltaY:j,distance:G,velocity:W,startX:$.startX,startY:$.startY,endX:$.currentX,endY:$.currentY}}return null}var s$=T(()=>{f$()});function m$(J,$){let{state:Q,options:Z,originalEvent:q}=J,j=window.setTimeout(()=>{if(Q.active){let G=Math.abs(Q.currentX-Q.startX),K=Math.abs(Q.currentY-Q.startY);if(G<Z.tapDistanceThreshold&&K<Z.tapDistanceThreshold){let z={...b6("longpress",q,Q),type:"longpress",x:Q.currentX,y:Q.currentY};$(z)}}},Z.longPressTime);return()=>{clearTimeout(j)}}function hJ(J){let{state:$,options:Q}=J,Z=Math.abs($.currentX-$.startX),q=Math.abs($.currentY-$.startY);return Z>Q.tapDistanceThreshold||q>Q.tapDistanceThreshold}var a$=()=>{};function c$(J){let{state:$,originalEvent:Q}=J,Z=$.currentX-$.startX,q=$.currentY-$.startY,j=$.currentX-$.lastX,G=$.currentY-$.lastY;if(Math.sqrt(j*j+G*G)>0)return{...b6("pan",Q,$),type:"pan",deltaX:Z,deltaY:q,startX:$.startX,startY:$.startY,currentX:$.currentX,currentY:$.currentY};return null}var i$=()=>{};function o$(J,$,Q){let{state:Z,originalEvent:q}=J,j=bJ($.clientX,$.clientY,Q.clientX,Q.clientY),G=10;if(Math.abs(j-Z.startDistance)>10){let K=j/Z.startDistance,z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...b6("pinch",q,Z),type:"pinch",scale:K,centerX:z,centerY:W}}return null}var t$=()=>{};function n$(J,$,Q){let{state:Z,originalEvent:q}=J,j=vJ($.clientX,$.clientY,Q.clientX,Q.clientY),G=10,K=j-Z.startAngle;if(Math.abs(K)>10){let z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...b6("rotate",q,Z),type:"rotate",rotation:K,centerX:z,centerY:W}}return null}var e$=()=>{};var r7=(J,$={})=>{let Q={swipeThreshold:30,swipeTimeThreshold:300,longPressTime:500,tapDistanceThreshold:10,preventDefault:!0,stopPropagation:!1,...$},Z=new Map,q={active:!1,startTime:0,startX:0,startY:0,lastX:0,lastY:0,currentX:0,currentY:0,touchCount:0,longPressTimer:null,startDistance:0,startAngle:0,lastTapTime:0,tapCount:0,target:null},j=CJ(),G=EJ(),K={tap:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,longpress:!0,pan:!0,pinch:j||G,rotate:j||G},z=(k)=>{let N=Z.get(k.type);if(!N)return;if(N.forEach((F)=>{try{F(k)}catch(V){console.error(`Error in gesture handler for ${k.type}:`,V)}}),k.type==="swipe"&&"direction"in k){let F={...k,type:`swipe${k.direction}`};z(F)}if(Q.preventDefault&&!k.defaultPrevented)k.preventDefault();if(Q.stopPropagation)k.stopPropagation()},W=null,Y=(k)=>{let N=g$(k),F="touches"in k?k.touches.length:1;if(q.active=!0,q.startTime=Date.now(),q.startX=q.lastX=q.currentX=N.clientX,q.startY=q.lastY=q.currentY=N.clientY,q.touchCount=F,q.target=k.target,F===2&&"touches"in k){let O=k.touches[0],P=k.touches[1];if(q.startDistance=Math.sqrt(Math.pow(P.clientX-O.clientX,2)+Math.pow(P.clientY-O.clientY,2)),q.startAngle=Math.atan2(P.clientY-O.clientY,P.clientX-O.clientX)*180/Math.PI,q.startAngle<0)q.startAngle+=360}let V={state:q,options:Q,originalEvent:k};if(W)W();W=m$(V,(O)=>{z(O)})},U=(k)=>{if(!q.active)return;let N=g$(k),F="touches"in k?k.touches.length:1;q.lastX=q.currentX,q.lastY=q.currentY,q.currentX=N.clientX,q.currentY=N.clientY;let V={state:q,options:Q,originalEvent:k};if(hJ(V)&&W)W(),W=null;let O=c$(V);if(O)z(O);if(F===2&&"touches"in k){let P=k.touches[0],L=k.touches[1],D=o$(V,P,L);if(D)z(D);let R=n$(V,P,L);if(R)z(R)}},X=(k)=>{if(!q.active)return;if(W)W(),W=null;let N={state:q,options:Q,originalEvent:k},F=d$(N);if(F)q.lastTapTime=Date.now(),q.tapCount=F.count,z(F);else{let V=p$(N);if(V)z(V)}q.active=!1},_=()=>{if(W)W(),W=null;q.active=!1},H={},B=()=>{if(G)H={pointerdown:Y,pointermove:U,pointerup:X,pointercancel:_};else if(j)H={touchstart:Y,touchmove:U,touchend:X,touchcancel:_};else H={mousedown:Y,mousemove:U,mouseup:X,mouseleave:_};Object.entries(H).forEach(([k,N])=>{J.addEventListener(k,N,{passive:!Q.preventDefault})})},M=()=>{Object.entries(H).forEach(([k,N])=>{J.removeEventListener(k,N)}),H={}};return B(),{on(k,N){if(!Z.has(k))Z.set(k,new Set);return Z.get(k).add(N),this},off(k,N){let F=Z.get(k);if(F){if(F.delete(N),F.size===0)Z.delete(k)}return this},isSupported(k){return k in K&&K[k]},enable(){return B(),this},disable(){return M(),this},destroy(){if(M(),W)W(),W=null;Z.clear()}}};var uJ=T(()=>{f$();l$();s$();a$();i$();t$();e$()});var p7=T(()=>{uJ();l$();s$();a$();t$();e$();i$()});var fJ=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add gesture recognition: missing element"),$;let{enableGestures:Q=!0,gestureHandlers:Z={},...q}=J,j=r7($.element,q);if(Object.entries(Z).forEach(([G,K])=>{j.on(G,K)}),!Q)j.disable();if(_6($)){let G=(K)=>{$.emit(K.type,K)};["tap","swipe","swipeleft","swiperight","swipeup","swipedown","longpress","pinch","rotate","pan"].forEach((K)=>{j.on(K,G)})}if(M6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{j.destroy(),G.call($.lifecycle)}}return{...$,gestures:j,onGesture(G,K){return j.on(G,K),this},offGesture(G,K){return j.off(G,K),this},isGestureSupported(G){return j.isSupported(G)},enableGestures(){return j.enable(),this},disableGestures(){return j.disable(),this}}};var gJ=T(()=>{p7()});function $8(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var G6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,Z={enable(){if($.element.classList.remove(Q),$8($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let q=$.element;if("disabled"in q)q.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),$8($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let q=$.element;if("disabled"in q)q.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if($8($))return $.input.disabled;let q=$.element;return"disabled"in q&&q.disabled}};if(J.disabled)requestAnimationFrame(()=>{Z.disable()});return{...$,disabled:Z}};function y3(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function T3(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function I3(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var C=()=>(J)=>{let $=!1,Q=f6();return{...J,lifecycle:{onMount:(q)=>Q.on("mount",q),onUnmount:(q)=>Q.on("unmount",q),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(y3(J))J.events.destroy();if(T3(J)){let q=J.text.getElement();if(q)q.remove()}if(I3(J)){let q=J.icon.getElement();if(q)q.remove()}if(J.element)J.element.remove()}}}};var dJ=()=>{};var o=T(()=>{MJ();NJ();DJ();RJ();wJ();xJ();TJ();SJ();gJ();dJ()});var S3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add tap gesture recognition: missing element"),$;let{tapDistanceThreshold:Q=10,preventDefault:Z=!0,onTap:q,enabled:j=!0}=J,G=new Set;if(q)G.add(q);let K=0,z=0,W=!1,Y=0,U=0,X=0,_=j,H=(O,P,L)=>{let D=Date.now();if(D-U<300)X++;else X=1;U=D;let w={type:"tap",originalEvent:O,target:O.target,startTime:Y,endTime:D,duration:D-Y,defaultPrevented:!1,preventDefault:()=>{if(w.defaultPrevented=!0,O.cancelable)O.preventDefault()},stopPropagation:()=>{O.stopPropagation()},count:X,x:P,y:L};if(G.forEach((A)=>{try{A(w)}catch(x){console.error("Error in tap handler:",x)}}),_6($))$.emit("tap",w);if(Z&&!w.defaultPrevented)w.preventDefault()},B=(O)=>{if(!_)return;let P="touches"in O?O.touches[0]:O;K=P.clientX,z=P.clientY,Y=Date.now(),W=!0},M=(O)=>{if(!W||!_)return;let P="changedTouches"in O&&O.changedTouches.length>0?O.changedTouches[0]:O,L=P.clientX,D=P.clientY,R=L-K,w=D-z;if(Math.sqrt(R*R+w*w)<Q)H(O,L,D);W=!1},k=()=>{W=!1},N={mousedown:B,mouseup:M,mouseleave:k,touchstart:B,touchend:M,touchcancel:k},F=()=>{Object.entries(N).forEach(([O,P])=>{$.element.addEventListener(O,P,{passive:!Z})})},V=()=>{Object.entries(N).forEach(([O,P])=>{$.element.removeEventListener(O,P)})};if(_)F();if(M6($)){let O=$.lifecycle.destroy;$.lifecycle.destroy=()=>{V(),G.clear(),O.call($.lifecycle)}}return{...$,onTap(O){return G.add(O),this},offTap(O){return G.delete(O),this},enableTap(){if(!_)_=!0,F();return this},disableTap(){if(_)_=!1,V();return this}}};var lJ=()=>{};function b3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}var v3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add swipe gesture recognition: missing element"),$;let{swipeThreshold:Q=30,swipeTimeThreshold:Z=300,preventDefault:q=!0,onSwipe:j,onSwipeLeft:G,onSwipeRight:K,onSwipeUp:z,onSwipeDown:W,enabled:Y=!0}=J,U={swipe:new Set,swipeleft:new Set,swiperight:new Set,swipeup:new Set,swipedown:new Set};if(j)U.swipe.add(j);if(G)U.swipeleft.add(G);if(K)U.swiperight.add(K);if(z)U.swipeup.add(z);if(W)U.swipedown.add(W);let X=0,_=0,H=!1,B=0,M=Y,k=(D,R,w)=>{let A=R-X,x=w-_,I=Math.sqrt(A*A+x*x),r=Date.now(),a=r-B,k6=I/a,i=b3(A,x),y={type:"swipe",originalEvent:D,target:D.target,startTime:B,endTime:r,duration:a,defaultPrevented:!1,preventDefault:()=>{if(y.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},direction:i,deltaX:A,deltaY:x,distance:I,velocity:k6,startX:X,startY:_,endX:R,endY:w};U.swipe.forEach((m)=>{try{m(y)}catch(s){console.error("Error in swipe handler:",s)}});let l=`swipe${i}`;if(U[l].forEach((m)=>{try{m({...y,type:l})}catch(s){console.error(`Error in ${l} handler:`,s)}}),_6($))$.emit("swipe",y),$.emit(l,y);if(q&&!y.defaultPrevented)y.preventDefault()},N=(D)=>{if(!M)return;let R="touches"in D?D.touches[0]:D;X=R.clientX,_=R.clientY,B=Date.now(),H=!0},F=(D)=>{if(!H||!M)return;let R="changedTouches"in D&&D.changedTouches.length>0?D.changedTouches[0]:D,w=R.clientX,A=R.clientY,x=w-X,I=A-_,r=Math.sqrt(x*x+I*I),a=Date.now()-B;if(r>=Q&&a<=Z)k(D,w,A);H=!1},V=()=>{H=!1},O={mousedown:N,mouseup:F,mouseleave:V,touchstart:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(M)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{L(),Object.values(U).forEach((R)=>R.clear()),D.call($.lifecycle)}}return{...$,onSwipe(D){return U.swipe.add(D),this},onSwipeLeft(D){return U.swipeleft.add(D),this},onSwipeRight(D){return U.swiperight.add(D),this},onSwipeUp(D){return U.swipeup.add(D),this},onSwipeDown(D){return U.swipedown.add(D),this},offSwipe(D){return U.swipe.delete(D),this},offSwipeLeft(D){return U.swipeleft.delete(D),this},offSwipeRight(D){return U.swiperight.delete(D),this},offSwipeUp(D){return U.swipeup.delete(D),this},offSwipeDown(D){return U.swipedown.delete(D),this},enableSwipe(){if(!M)M=!0,P();return this},disableSwipe(){if(M)M=!1,L();return this}}};var rJ=T(()=>{p7()});var C3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add long press gesture recognition: missing element"),$;let{longPressTime:Q=500,moveThreshold:Z=10,preventDefault:q=!0,onLongPress:j,enabled:G=!0}=J,K=new Set;if(j)K.add(j);let z=0,W=0,Y=0,U=0,X=!1,_=0,H=null,B=G,M=(D)=>{let R={type:"longpress",originalEvent:D,target:D.target,startTime:_,endTime:Date.now(),duration:Date.now()-_,defaultPrevented:!1,preventDefault:()=>{if(R.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},x:Y,y:U};if(K.forEach((w)=>{try{w(R)}catch(A){console.error("Error in long press handler:",A)}}),_6($))$.emit("longpress",R);if(q&&!R.defaultPrevented)R.preventDefault()},k=(D)=>{if(!B)return;let R="touches"in D?D.touches[0]:D;if(z=Y=R.clientX,W=U=R.clientY,_=Date.now(),X=!0,H!==null)window.clearTimeout(H);H=window.setTimeout(()=>{if(X){let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)<Z)M(D)}H=null},Q)},N=(D)=>{if(!X||!B)return;let R="touches"in D?D.touches[0]:D;Y=R.clientX,U=R.clientY;let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)>Z){if(H!==null)window.clearTimeout(H),H=null}},F=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},V=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},O={mousedown:k,mousemove:N,mouseup:F,mouseleave:V,touchstart:k,touchmove:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(B)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(L(),H!==null)window.clearTimeout(H),H=null;K.clear(),D.call($.lifecycle)}}return{...$,onLongPress(D){return K.add(D),this},offLongPress(D){return K.delete(D),this},enableLongPress(){if(!B)B=!0,P();return this},disableLongPress(){if(B){if(B=!1,L(),H!==null)window.clearTimeout(H),H=null}return this}}};var pJ=()=>{};var E3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add pan gesture recognition: missing element"),$;let{preventDefault:Q=!0,onPanStart:Z,onPan:q,onPanEnd:j,enabled:G=!0}=J,K={panstart:new Set,pan:new Set,panend:new Set};if(Z)K.panstart.add(Z);if(q)K.pan.add(q);if(j)K.panend.add(j);let z=0,W=0,Y=0,U=0,X=0,_=0,H=!1,B=!1,M=0,k=G,N=(A,x)=>{let I={type:x,originalEvent:A,target:A.target,startTime:M,endTime:Date.now(),duration:Date.now()-M,defaultPrevented:!1,preventDefault:()=>{if(I.defaultPrevented=!0,A.cancelable)A.preventDefault()},stopPropagation:()=>{A.stopPropagation()},deltaX:X-z,deltaY:_-W,startX:z,startY:W,currentX:X,currentY:_};return I},F=(A,x)=>{let I=N(A,x);if(K[x].forEach((r)=>{try{r(I)}catch(a){console.error(`Error in ${x} handler:`,a)}}),_6($))$.emit(x,I);if(Q&&!I.defaultPrevented)I.preventDefault()},V=(A)=>{if(!k)return;let x="touches"in A?A.touches[0]:A;z=Y=X=x.clientX,W=U=_=x.clientY,M=Date.now(),H=!0,B=!1},O=(A)=>{if(!H||!k)return;let x="touches"in A?A.touches[0]:A;Y=X,U=_,X=x.clientX,_=x.clientY;let I=X-Y,r=_-U;if(Math.sqrt(I*I+r*r)>0){if(!B)B=!0,F(A,"panstart");F(A,"pan")}},P=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},L=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},D={mousedown:V,mousemove:O,mouseup:P,mouseleave:L,touchstart:V,touchmove:O,touchend:P,touchcancel:L},R=()=>{Object.entries(D).forEach(([A,x])=>{$.element.addEventListener(A,x,{passive:!Q})})},w=()=>{Object.entries(D).forEach(([A,x])=>{$.element.removeEventListener(A,x)})};if(k)R();if(M6($)){let A=$.lifecycle.destroy;$.lifecycle.destroy=()=>{w(),Object.values(K).forEach((x)=>x.clear()),A.call($.lifecycle)}}return{...$,onPanStart(A){return K.panstart.add(A),this},onPan(A){return K.pan.add(A),this},onPanEnd(A){return K.panend.add(A),this},offPanStart(A){return K.panstart.delete(A),this},offPan(A){return K.pan.delete(A),this},offPanEnd(A){return K.panend.delete(A),this},enablePan(){if(!k)k=!0,R();return this},disablePan(){if(k)k=!1,w();return this}}};var sJ=()=>{};var J6=T(()=>{c();o();lJ();rJ();pJ();sJ()});function mJ(J,$){W7[J]=$}function s7(J){return W7[J]||{}}function aJ(J){Object.assign(W7,J)}function cJ(){Object.keys(W7).forEach((J)=>{delete W7[J]})}var W7;var J8=T(()=>{W7={}});var u=(J,$={},Q)=>{let Z=s7(Q),q=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,G={...J,...Z,...$,componentName:Q,prefix:f,className:q!==void 0?q:j};if("class"in G&&G.className!==void 0)delete G.class;return G},p=(J,$)=>{let Q=J.className||J.class,Z=$.className,q=[...Array.isArray(Q)?Q:[Q],...Array.isArray(Z)?Z:[Z]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:q.length>0?q:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var t=T(()=>{w6();J8()});var m7,a7,c7,g9=4;var Q8=T(()=>{m7={SMALL:"small",LARGE:"large"},a7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},c7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var h3,iJ=(J={})=>u(h3,J,"badge"),oJ=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":d9(J.label||"",J.max);return p(J,{tag:"span",attributes:$,className:J.class,text:Q})},tJ=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),d9=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),Z=Number(J);if($!==void 0&&!isNaN(Z)&&Z>$)Q=`${$}+`;if(Q.length>g9){let q=Number(J);if(!isNaN(q))if(q>=1000)Q="999+";else Q=Q.substring(0,g9-1)+"+";else Q=Q.substring(0,g9)}return Q};var i7=T(()=>{t();Q8();h3={variant:m7.LARGE,color:a7.ERROR,position:c7.TOP_RIGHT,label:"",visible:!0}});var nJ="small",u3="large",f3="error",g3="top-right",eJ=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},$0=(J)=>($)=>{let Q=J.variant||u3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===nJ)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let Z=d9(J.label,J.max);$.element.textContent=Z}return $},J0=(J)=>($)=>{let Q=J.color||f3;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},Q0=(J)=>($)=>{let Q=J.position||g3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},Z0=(J)=>($)=>{if(J.max===void 0||J.variant===nJ)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=d9(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},q0=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let Z=J.target.parentNode;if(Z)Z.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var j0=T(()=>{i7()});var K0="small",d3,l3,r3,G0=({visibility:J,lifecycle:$})=>(Q)=>{let Z={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(q){if(Q.config.label=q,Q.config.variant===K0)return Q.element.textContent="",Z;let j=d9(q,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof q==="number"&&Q.config.max!==void 0&&q>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")Z.hide();else Z.show();return Z},getLabel(){return Q.element.textContent||""},setContent(q){return Z.setLabel(q)},getContent(){return Z.getLabel()},show(){return J.show(),Z},hide(){return J.hide(),Z},toggle(q){return J.toggle(q),Z},isVisible(){return J.isVisible()},setMax(q){if(Q.config.max=q,Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setColor(q){return d3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},setVariant(q){if(l3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Q.config.variant=q,q===K0)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setPosition(q){return r3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},attachTo(q){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let G=q.parentNode;if(G)G.replaceChild(j,q),j.appendChild(q),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,Z.wrapper=j;return Z},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,Z.wrapper=void 0;return Z},destroy(){if($.destroy(),Q.wrapper){let q=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&q)j.replaceChild(q,Q.wrapper)}},addClass:(...q)=>{return Q.addClass(...q),Z},removeClass:(...q)=>{return Q.removeClass(...q),Z},on:(q,j)=>{return Q.on(q,j),Z},off:(q,j)=>{return Q.off(q,j),Z}};return Z};var z0=T(()=>{i7();d3=["error","primary","secondary","tertiary","success","warning","info"],l3=["small","large"],r3=["top-right","top-left","bottom-right","bottom-left"]});var p3=(J={})=>{let $=iJ(J);try{return b(S,d(),h(oJ($)),$0($),J0($),Q0($),Z0($),eJ(),q0($),C(),(Z)=>G0(tJ(Z))(Z))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},j7;var W0=T(()=>{J6();c();o();j0();z0();i7();j7=p3});var K7=T(()=>{W0()});var a3=(J)=>{let $=new Map,Q=(j,G)=>`${j}_${G.toString()}`,Z=(j,G)=>(K)=>{try{j(K)}catch(z){console.error(`Error in ${G} handler:`,z)}},q=(j,G)=>{try{J.removeEventListener(j,G)}catch(K){console.warn(`Failed to remove ${j} listener:`,K)}};return{on(j,G,K={}){let z=Z(G,j),W=Q(j,G);return $.set(W,{original:G,enhanced:z,event:j,options:K}),J.addEventListener(j,z,K),this},off(j,G){let K=Q(j,G),z=$.get(K);if(z)q(j,z.enhanced),$.delete(K);return this},pause(){return $.forEach(({enhanced:j,event:G})=>{q(G,j)}),this},resume(){return $.forEach(({enhanced:j,event:G,options:K})=>{J.addEventListener(G,j,K)}),this},destroy(){$.forEach(({enhanced:j,event:G})=>{q(G,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,G){let K=Q(j,G);return $.has(K)}}};var A9=T(()=>{A6();R9()});var B9,v6,Y7,g6,W6,s6,d6,z6;var m6=T(()=>{B9={LINEAR:"linear",CIRCULAR:"circular"},v6={FLAT:"flat",WAVY:"wavy"},Y7={CHANGE:"change",COMPLETE:"complete"},g6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},W6={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},s6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},d6={THIN:4,THICK:8},z6={LINEAR:{AMPLITUDE:3,SPEED:0.88,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1.1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var a6=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},X0=(J,$)=>{let q=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let G=0,K=q.length;G<K;++G){let z=q[G];if(z in j)j=j[z];else return}return j};var w9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,Z=J;while(Z&&Q<$){let G=window.getComputedStyle(Z).backgroundColor;if(G.startsWith("var(")){let K=G.match(/var\((--[\w-]+)\)/);if(K){let z=K[1];G=window.getComputedStyle(document.documentElement).getPropertyValue(z).trim()||"transparent"}}if(G&&G!=="transparent"&&G!=="rgba(0, 0, 0, 0)"&&G!=="rgba(0,0,0,0)")return{color:G,element:Z};Z=Z.parentElement,Q++}let q=window.getComputedStyle(document.body).backgroundColor;if(q!=="transparent"&&q!=="rgba(0, 0, 0, 0)")return{color:q,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var j8=()=>{};function B6(J,$){let Q=`--${f}-${J}`;if($?.onThemeChange)i3($.onThemeChange);let q=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!q)q=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!q&&$?.fallback)return $.fallback;if(!q)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(q))return`rgba(${q}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(q)){let j=q.replace("#",""),G,K,z;if(j.length===3)G=parseInt(j[0]+j[0],16),K=parseInt(j[1]+j[1],16),z=parseInt(j[2]+j[2],16);else G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$.alpha})`}return q}var o7,x9=null,c3=()=>{if(x9)return;x9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){o7.forEach((Q)=>Q());break}}),x9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},i3=(J)=>{if(!x9)c3();return o7.add(J),()=>{o7.delete(J)}};var B0=T(()=>{w6();o7=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(x9)x9.disconnect(),x9=null;o7.clear()})});var U7=(J,$)=>{let Z=document.createElement("canvas").getContext("2d");if(!Z)return`rgba(0, 0, 0, ${$})`;Z.fillStyle=J;let q=Z.fillStyle;if(q.startsWith("#")){let j=q.substring(1),G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$})`}if(q.startsWith("rgb")){let j=q.match(/\d+/g);if(j){let[G,K,z]=j;return`rgba(${G}, ${K}, ${z}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var o3=(J,$)=>(Q,Z)=>J(Q,Z)?$(Q,Z):Q,t3=(...J)=>J.filter(Boolean).join(" ");var $9=T(()=>{q7();j8();B0()});var t7=(J,$,Q)=>{let Z=null,q=()=>{if(Z)clearTimeout(Z);Z=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((G)=>{for(let K of G){let{width:z}=K.contentRect,W=parseFloat($.style.width||"0");if(Math.abs(z-W)>2)q()}});return j.observe(J),()=>{if(Z)clearTimeout(Z);j.disconnect()}}else return window.addEventListener("resize",q),()=>{if(Z)clearTimeout(Z);window.removeEventListener("resize",q)}};var F0=(J,$,Q,Z,q,j,G,K,z)=>{let W=Math.max(100,Math.abs(j-q)*50),Y=(j-q)/W,U=z6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let X=0;X<=W;X++){let _=q+Y*X,H=_*K+z*U,B=Math.sin(H),k=Math.sign(B)*Math.pow(Math.abs(B),z6.CIRCULAR.POWER)*G,N=Z+k,F=$+N*Math.cos(_),V=Q+N*Math.sin(_);if(X===0)J.moveTo(F,V);else J.lineTo(F,V)}J.stroke()},H0=(J,$,Q,Z,q,j=0,G="flat")=>{let{ctx:K,width:z,height:W}=J,Y=X7($.thickness),U=G==="wavy",X=Math.min(z,W),_=q?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,H=X/2-Y/2,B=H*(_/100),M=U?y9(Y,B):0,k=H-M,N=z/2,F=W/2;K.clearRect(0,0,z,W);let O=(s6.CIRCULAR.GAP+2*Y)/k,P=-Math.PI/2,L=2*Math.PI-O;K.lineWidth=Y,K.lineCap="round",K.lineJoin="round";let D=q?z6.CIRCULAR.INDETERMINATE_FREQUENCY:z6.CIRCULAR.FREQUENCY;if(q){let y=j%1333/1333,l=(O9)=>{let U6=O9<=0.5?O9*2:2-O9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},m=()=>{let O9=j/1568*2*Math.PI,U6=Math.floor(j/1333),h6=j%1333/1333,n6=0;if(h6>0.5){let Z7=(h6-0.5)*2;n6=0.722*(Z7<0.5?2*Z7*Z7:1-Math.pow(-2*Z7+2,2)/2)}return O9+(U6*0.722+n6)*2*Math.PI},s=l(y)*2*Math.PI,K9=m(),N6=P+K9,X6=N6+s;K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath();let C9=O/2;if(K.arc(N,F,k,X6+C9,N6-C9+2*Math.PI),K.stroke(),K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"}),U)F0(K,N,F,k,N6,X6,M,D,j);else K.beginPath(),K.arc(N,F,k,N6,X6),K.stroke();return}let R=Q/Z,A=Math.max(R,0.001),x=0.95,I=L;if(R>=x){let i=(R-x)/(1-x),y=i*i;I=L+O*y}if(R<0.99){let y=P+I*A+O/2,l=P+L+O/2;if(y<l)K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath(),K.arc(N,F,k,y,l),K.stroke()}K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"});let r=M;if(U){let i=z6.CIRCULAR.START_TRANSITION_END,y=z6.CIRCULAR.END_TRANSITION_START;if(R===0&&i>0)r=0;else if(R>0&&R<=i){let l=R/i;r=M*Math.pow(l,2)}else if(R>=y){let l=(R-y)/(1-y),m=1-Math.pow(1-l,2);r=M*(1-m)}if(R>=1)r=0}let a=P,k6=P+I*A;if(U)F0(K,N,F,k,a,k6,r,D,j);else K.beginPath(),K.arc(N,F,k,a,k6),K.stroke()};var k0=T(()=>{m6();$9();n7()});var B7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},F9=(J,$,Q,Z,q,j,G)=>{if(J.beginPath(),!q||G.amplitude===0)J.moveTo($,Z),J.lineTo(Q,Z);else{let K=$;for(let z=$;z<=Q;z+=1){let W=z*G.frequency+j*G.speed,Y=Math.sin(W),U=Math.sign(Y)*Math.pow(Math.abs(Y),z6.LINEAR.POWER),X=Z+U*G.amplitude;if(z===$)J.moveTo(z,X);else J.lineTo(z,X);K=z}if(K<Q){let z=Q*G.frequency+j*G.speed,W=Math.sin(z),Y=Math.sign(W)*Math.pow(Math.abs(W),z6.LINEAR.POWER),U=Z+Y*G.amplitude;J.lineTo(Q,U)}}J.stroke()},M0=(J,$)=>{let[Q,Z,q]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=Z)return 0.661479;else if(q&&J<=q)return 0.661479;return q?0.661479-0.5814790000000001*((J-q)/(1-q)):0.08},V0=(J,$)=>{for(let q=0;q<$.length-1;q++){let[j,G]=$[q],[K,z]=$[q+1];if(J<=K){let W=(J-j)/(K-j);return G+(z-G)*W}}let[Q,Z]=$[$.length-1];return Z+(220-Z)*((J-Q)/(1-Q))},N0=(J,$,Q,Z,q,j,G=0,K=!0,z="flat")=>{let{ctx:W,width:Y,height:U}=J,X=X7($.thickness),_=U/2,H=z==="wavy",B=X/2,M=Y-B*2,k=s6.LINEAR.GAP,N=Q/Z,F=0.001,V=Math.max(N,0.001),O=B+M*V;W.clearRect(0,0,Y,U);let P=B6("sys-color-primary",{fallback:"#6750A4"}),L=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let k6=G%2000/2000,i=k*2+X/2,y=M0(k6,[0.3665,0.6915]),l=V0(k6,[[0,-120],[0.2,0],[0.5915,83.6714]]),m=k6<=0.5?0:M0(k6,[0.8335,null,0.8335]),s=k6<=0.5?-54.8889:V0(k6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),N6=[{scale:y,translate:l,start:Math.max(B,B+M*l/100),end:Math.min(Y-B,B+M*l/100+M*y)},{scale:m,translate:s,start:Math.max(B,B+M*s/100),end:Math.min(Y-B,B+M*s/100+M*m)}].filter((U6)=>U6.end>U6.start).sort((U6,h6)=>U6.start-h6.start),X6=[];for(let U6=0;U6<N6.length;U6++){let h6=N6[U6];if(X6.length===0)X6.push({...h6});else{let n6=X6[X6.length-1];if(h6.start<=n6.end+i)n6.end=Math.max(n6.end,h6.end);else X6.push({...h6})}}B7(W,X,L);let C9=X;if(X6.length===0)F9(W,B,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=X6[0].start;if(U6-B>i+C9)F9(W,B,U6-i,_,!1,0,{amplitude:0,frequency:0,speed:0});if(X6.length===2){if(X6[1].start-X6[0].end>2*i+C9)F9(W,X6[0].end+i,X6[1].start-i,_,!1,0,{amplitude:0,frequency:0,speed:0})}let n6=X6[X6.length-1].end;if(Y-B-n6>i+C9)F9(W,n6+i,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0})}B7(W,X,P);let O9={amplitude:H?y9(X,z6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:z6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};X6.forEach((U6)=>{F9(W,U6.start,U6.end,_,H,G,O9)});return}let D=z6.LINEAR.START_TRANSITION_END,R=z6.LINEAR.END_TRANSITION_START,w=(k+X)/2;B7(W,X,L);let A=N===0?B+X+k:Math.min(O+w,Y-B);F9(W,A,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0}),B7(W,X,P);let x=N>=1?Y-B:Math.max(B,O-w),I;if(N===0)I=B+(H?0.1:0);else{let a=X/2;I=Math.max(B+a,x)}let r=H?y9(X,z6.LINEAR.AMPLITUDE):0;if(H){if(N===0&&D>0)r=0;else if(V<=D)r*=Math.pow(V/D,2);else if(V>=R)r*=Math.pow((1-V)/(1-R),2)}if(F9(W,B,I,_,H,G,{amplitude:r,frequency:z6.LINEAR.FREQUENCY*2*Math.PI/100,speed:z6.LINEAR.SPEED*2*Math.PI/1000}),q>0&&q>Q){B7(W,X,B6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let a=B+M*(q/Z);F9(W,O,a,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(N<1&&K){let a=Math.min(X*0.5,2);W.beginPath(),W.arc(Y-B,_,a,0,2*Math.PI),W.fillStyle=P,W.fill()}};var _0=T(()=>{m6();$9();n7()});var X7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?d6.THICK:d6.THIN},y9=(J,$,Q)=>{let q=1+0.3*(4-J)/(J+4),j=$*q;return Q?Math.min(j,Q):j},K8=(J,$,Q,Z)=>{let q=window.devicePixelRatio||1,j=X7(Z?.thickness),{ctx:G}=$;if(Q){let K=Math.max(24,Math.min(Z?.size??s6.CIRCULAR.SIZE,240)),z=0;if(Z?.shape==="wavy"){let Y=K/2-j/2,U=Z?.indeterminate?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,X=Y*(U/100);z=y9(j,X)}let W=K+z*2;J.style.width=J.style.height=`${W}px`,J.width=J.height=Math.round(W*q),$.width=$.height=W}else{let K=J.parentElement;if(!K)return;let z=Math.max(K.getBoundingClientRect().width||K.offsetWidth,200),W=0;if(Z?.shape==="wavy"){let U=z6.LINEAR.AMPLITUDE,X=y9(j,U);W=Math.ceil(X*2)}let Y=j+W;J.style.width=`${z}px`,J.style.height=`${Y}px`,J.width=Math.round(z*q),J.height=Math.round(Y*q),$.width=z,$.height=Y}G.setTransform(1,0,0,1,0,0),G.scale(q,q)},L0=(J,$,Q)=>{let Z={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return K8(J,Z,$,Q),Z},D0=(J)=>($)=>{let Z=J.variant===B9.CIRCULAR,q=document.createElement("canvas");q.className=`${$.getClass(W6.CONTAINER)}-canvas`,q.style.maxWidth="100%",q.style.maxHeight="100%",q.style.boxSizing="border-box",$.element.appendChild(q);let j=null,G=null,K=null,z=J.thickness,W=J.shape,Y=J.size??s6.CIRCULAR.SIZE,U=J.value??0,X=U,_=0,H=()=>{try{return j=L0(q,Z,{...J,thickness:z,shape:W,size:Y}),$.ctx=j.ctx,!0}catch(D){return console.warn("Canvas initialization failed:",D),!1}};if(!H())requestAnimationFrame(()=>{if(!H())setTimeout(H,100)});$.canvas=q,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=W;let B=(D=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,w=(A)=>{if(!$.state?.indeterminate){M();return}if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.animationId=requestAnimationFrame(w)};$.animationId=requestAnimationFrame(w)},M=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},k=(D=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,w=(A)=>{if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.wavyAnimationId=requestAnimationFrame(w)};$.wavyAnimationId=requestAnimationFrame(w)},N=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},F=(D=0)=>{if(!j)return;let R=$.state,w=R?.value??J.value??0,A=R?.max??J.max??100,x=R?.buffer??J.buffer??0,I=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:z,shape:W,size:Y};K8(q,j,Z,r);let a=I||!R?w:U;if(Z)H0(j,r,a,A,I,D,W);else N0(j,r,a,A,x,I,D,!0,W)},V=()=>{if(!j)return;try{let D=L0(q,Z,{...J,thickness:z,shape:W,size:Y});$.ctx=D.ctx,Object.assign(j,D),F()}catch(D){console.warn("Canvas resize failed:",D)}};G=t7($.element,q,()=>{if($.element.offsetWidth>0||Z)V()});let O=B6("sys-color-primary",{onThemeChange:F});K=typeof O==="function"?O:null;let P=()=>{if(!j){requestAnimationFrame(P);return}if(F(),$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k()};requestAnimationFrame(P);let L=(D)=>{if(!j)return;let R={...J,thickness:z,shape:W,size:Y,...D};K8(q,j,Z,R),F()};if($.setThickness=(D)=>{z=D,L({thickness:D})},$.setSize=(D)=>{if(!Z)return;Y=Math.max(24,Math.min(D,240)),L({size:Y})},$.getSize=()=>Z?Y:void 0,$.setShape=(D)=>{if(W===D)return;if(W=D,$.currentShape=W,L({shape:D}),$.state?.indeterminate){let R=$.animationTime||0;if(N(),M(),D==="wavy"||!Z)k(R);else B(R)}else if(D==="wavy"){if(!$.wavyAnimationId)k()}else N();F($.animationTime||0)},$.setValue=(D,R=!0)=>{if(X=Math.max(0,Math.min($.state.max,D)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(U=X,F(),W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}));return}let w=U,A=performance.now(),x=A-_,I=300;if(x<300&&_>0)I=Math.max(100,x*0.9);_=A;let r=(a)=>{let k6=a-A,i=Math.min(k6/I,1),y=i<0.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;if(U=w+(X-w)*y,!$.wavyAnimationId||W!=="wavy")F(a);if(i<1)$.valueAnimationId=requestAnimationFrame(r);else{if(U=X,$.valueAnimationId=null,W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(D)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=D,D){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(U=$.state.value,W==="wavy"||!Z)k();else B()}else{if(U=$.state.value,M(),W==="wavy"){if(!$.wavyAnimationId)k()}else N();F()}},$.hide=()=>{$.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.opacity="0";let D=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",D)};return $.element.addEventListener("transitionend",D),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(G)G();if(K)K();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),D()}}return Object.assign($,{startWavyAnimation:k,stopWavyAnimation:N,startIndeterminateAnimation:B,stopIndeterminateAnimation:M}),{...$,canvas:q,get ctx(){return j?.ctx},draw:F,resize:V}};var n7=T(()=>{m6();$9();k0();_0()});var O0=(J)=>($)=>{if(J.indeterminate&&$.element)g($.element,W6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(W6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==v6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(W6.CIRCULAR)||"")){let G=$.getClass?.(W6.CONTAINER)||"";g($.element,`${G}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??v6.FLAT,labelFormatter:J.labelFormatter??((j,G)=>`${Math.round(j/G*100)}%`),showLabel:J.showLabel},Z=$.lifecycle?.init,q=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==v6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),Z)Z()},destroy:()=>{if(q)q()}},{...$,state:Q}};var P0=T(()=>{m6();A9()});var R0=(J)=>($)=>{let{element:Q,getClass:Z,canvas:q}=$,j=Q.classList.contains(Z(W6.CIRCULAR)),G=(Y,U)=>{Q.dispatchEvent(new CustomEvent(Y,{detail:U}))},K=(Y,U)=>{Q.setAttribute("aria-valuenow",Y.toString());let X=$.label;if(X){let _=J.label?.formatter||((H,B)=>`${Math.round(H/B*100)}%`);X.textContent=_(Y,U)}if(typeof $.draw==="function")$.draw()},z=(Y)=>{if(Y){if(g(Q,W6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||v6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(j6(Q,W6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())z(!0);let W={element:Q,track:q,indicator:q,buffer:q,getClass:Z,getValue(){return J.value.getValue()},setValue(Y,U=!0){let X=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(Y),X!==Y){Q.setAttribute("aria-valuenow",Y.toString());let H=$.label;if(H){let M=J.label?.formatter||((k,N)=>`${Math.round(k/N*100)}%`);H.textContent=M(Y,_)}let B={value:Y,max:_};if(G(Y7.CHANGE,B),$.setValue&&typeof $.setValue==="function")$.setValue(Y,U);else K(Y,_)}return W},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(Y){if(J.buffer.setBuffer(Y),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return W},setIndeterminate(Y){if(J.state.isIndeterminate()===Y)return W;return J.state.setIndeterminate(Y),z(Y),W},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return W},hideLabel(){if(J.label?.hide)J.label.hide();return W},setLabelFormatter(Y){if(J.label?.format)J.label.format(Y);let U=$.label||$.state?.label;if(U)U.textContent=Y(J.value.getValue(),J.value.getMax());return W},getThickness(){return J.thickness?.getThickness()||d6.THIN},setThickness(Y){if(J.thickness)J.thickness.setThickness(Y);if($.setThickness)$.setThickness(Y);return W},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return v6.FLAT},setShape(Y){return $.setShape?.(Y),W},setSize(Y){if($.setSize)$.setSize(Y);return W},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),W},disable(){return J.disabled.disable(),W},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return W},show(){if($.show)$.show();return W},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(Y,U){return Q.addEventListener(Y,U),W},off(Y,U){return Q.removeEventListener(Y,U),W},addClass(...Y){return Y.forEach((U)=>Q.classList.add(U)),W},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return W};var A0=T(()=>{m6();A9()});var n3,w0=(J={})=>{return u(n3,J,"progress")},x0=(J)=>{let $=J.indeterminate===!0,Q=J.variant===B9.CIRCULAR,Z={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)Z["aria-valuenow"]=J.value.toString();if(J.disabled===!0)Z["aria-disabled"]="true";let q=[J.class,W6.CONTAINER,Q?W6.CIRCULAR:W6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==v6.FLAT)q.push(`${W6.CONTAINER}--${J.shape}`);return p(J,{tag:"div",attributes:Z,className:q})},y0=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:g6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(W6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return d6.THIN;else if($==="thick")return d6.THICK;else if(typeof $==="number")return $;return d6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var T0=T(()=>{t();m6();n3={variant:g6.VARIANT,value:g6.VALUE,max:g6.MAX,buffer:g6.BUFFER,showLabel:g6.SHOW_LABEL,thickness:"thin",shape:g6.SHAPE}});var I0={};KJ(I0,{default:()=>G8});var e3=(J={})=>{let $=w0(J);try{let Q=b(S,d(),h(x0($)),K6($),G6($),O0($),D0($),(Z)=>{return R0(y0(Z))(Z)},C())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},G8;var z8=T(()=>{J6();c();o();n7();P0();A0();T0();G8=e3});var $q=async(J)=>{let{default:$}=await Promise.resolve().then(() => (z8(),I0));return $(J)},S0=(J)=>($)=>{if(!J.progress)return $;let Q={},Z=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:Y,...U}=J.progress;if(Y)Q=Y;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...U}})(),q=null,j=null,G=!1,K="",z=async()=>{if(q)return q;if(!j)j=$q(Z).then((Y)=>{return q=Y,g(q.element,$.getClass("button-progress")),q.element.style.display="none",Object.entries(Q).forEach(([U,X])=>{q.on(U,X)}),$.progress=q,q});return j},W=()=>{let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y&&Y.nextSibling)return Y.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let Y=await z();if(Y.element){if(!$.element.contains(Y.element)){let X=W();if(X)$.element.insertBefore(Y.element,X);else $.element.appendChild(Y.element)}Y.element.style.display="",g($.element,`${$.getClass("button")}--progress`);let U=$.element.querySelector(`.${$.getClass("button-icon")}`);if(U instanceof HTMLElement)U.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!q)return $;q.element.style.display="none",j6($.element,`${$.getClass("button")}--progress`);let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y instanceof HTMLElement)Y.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(Y){return(await z()).setValue(Y),$},$.setProgressSync=function(Y){return $.setProgress(Y),$},$.setIndeterminate=async function(Y){return(await z()).setIndeterminate(Y),$},$.setIndeterminateSync=function(Y){return $.setIndeterminate(Y),$},$.setLoading=async function(Y,U){if(Y&&!G){if($.setText&&$.getText)K=$.getText();if(G=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(U&&$.setText)$.setText(U)}else if(!Y&&G){if(G=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(U&&$.setText)$.setText(U);else if(K&&$.setText)$.setText(K)}return $},$.setLoadingSync=function(Y,U){return $.setLoading(Y,U),$},$.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(q)q.destroy();if(q&&q.element.parentNode)q.element.parentNode.removeChild(q.element);Y()}}if(J.showProgress)z().then(()=>{$.showProgress()});return $};var b0=T(()=>{A9()});var Jq=(J={},$={})=>{let Q={...J},Z=f6(),q=new Map,j=$.middleware||[],G=(z,W)=>{Z.emit("change",z,W)},K=(z,W)=>{return j.reduce((Y,U)=>U(Y,W),z)};return{getState:()=>{let z={};return q.forEach((W,Y)=>{z[Y]=W(Q)}),{...Q,...z}},setState:(z)=>{let W={...Q},Y=typeof z==="function"?z(Q):{...Q,...z};Q=K(Y,W),G(Q,W)},subscribe:(z)=>Z.on("change",z),derive:(z,W)=>{return q.set(z,W),()=>{q.delete(z)}},select:(z)=>z(Q),reset:()=>{Q={...J},G(Q,{})}}},Qq=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,Z)=>{if(J[Z]!==$[Z])Q[Z]={from:$[Z],to:J[Z]};return Q},{})}),J},Zq=(J)=>($)=>Object.keys($).reduce((Q,Z)=>{if(J($[Z],Z))Q[Z]=$[Z];return Q},{});var v0=()=>{};var qq=(J,$={})=>{let Q=!1,Z=f6();return{onMount:(q)=>Z.on("mount",q),onUnmount:(q)=>Z.on("unmount",q),mount:()=>{if(!Q)Q=!0,Z.emit("mount")},unmount:()=>{if(Q)Q=!1,Z.emit("unmount"),Z.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let q=$.text.getElement();if(q)q.remove()}if($.icon){let q=$.icon.getElement();if(q)q.remove()}if(J)J.remove()}}};var C0=()=>{};var jq=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};function x6(J){return J&&typeof J==="object"&&"element"in J}function F7(){return document.createDocumentFragment()}function Kq(...J){return e6(...J)}function l9(J,$=!1,Q=!1){if(!J||$)return{...J};if(!(J.class||J.className||J.rawClass))return{...J};let q={...J};if(q.className){if(!q.class)q.class=q.className;else{let j=Kq([q.class,q.className]);q.class=j.join(" ")}delete q.className}if(q.class&&!$){if(typeof q.class==="string"){let j=q.class.split(/\s+/).filter(Boolean);if(Q)q.class=j.map((G)=>{if(!G||G.startsWith(H9))return G;if(G.includes("__")){let[K,z]=G.split("__");return`${H9}${K}__${z}`}else if(G.includes("--")){let[K,z]=G.split("--");return`${H9}${K}--${z}`}return`${H9}${G}`}).join(" ");else q.class=j.map((G)=>G&&!G.startsWith(H9)?`${H9}${G}`:G).filter(Boolean).join(" ")}else if(Array.isArray(q.class))q.class=q.class.filter(Boolean).map((j)=>typeof j==="string"&&!j.startsWith(H9)?`${H9}${j}`:j).join(" ")}return q}function W8(J){let $={};if(!J||typeof J!=="object")return $;for(let Q in J){let Z=J[Q];if(Z&&typeof Z!=="function"&&(Z instanceof HTMLElement||typeof SVGElement!=="undefined"&&Z instanceof SVGElement||x6(Z)))$[Q]=Z}return $}var H9;var H7=T(()=>{w6();A9();H9=`${f}-`});function J9(J){let $=W8(J);return{layout:J,element:J.element,component:$,get(Z){return J[Z]??null},getAll(){return $},destroy(){let Z=J.element;if(Z){if(x6(Z)&&typeof Z.destroy==="function")Z.destroy();else if(x6(Z)&&Z.element?.parentNode)Z.element.parentNode.removeChild(Z.element);else if(Z instanceof HTMLElement&&Z.parentNode)Z.parentNode.removeChild(Z)}for(let q in J){if(q==="element")continue;let j=J[q];if(x6(j)&&typeof j.destroy==="function")j.destroy()}}}}var k7=T(()=>{H7()});function e7(J,$=null,Q=0,Z={}){Q++;let q={},j=[],G=F7(),K=null;if(!Array.isArray(J))return console.error("Schema is not an array!",$,Q,J),J9(q);let z=Z.creator||v;for(let W=0;W<J.length;W++){let Y=J[W];if(!Y)continue;if(Array.isArray(Y)){let F=e7(Y,K||$,Q,Z);Object.assign(q,F.layout);continue}let U,X,_;if(typeof Y==="function"){U=Y;let N=J[W+1],F=J[W+2];if(typeof N==="string")if(X=N,W++,a6(F))_=F,W++;else _={};else if(a6(N))_=N,W++;else _={}}else if(typeof Y==="string"){U=z,X=Y;let N=J[W+1];if(a6(N))_=N,W++;else _={};if(U===v&&!("tag"in _))_.tag="div"}else if(a6(Y))U=z,_=Y;else{console.warn("Skipping unsupported item type:",Y);continue}let H=J[W+1];if(a6(H)&&!Array.isArray(H)&&typeof H.prefix!=="undefined")Object.assign(_,H),W++;let M=("prefix"in _?_.prefix:Z.prefix!==!1)?l9(_):{..._};if(X&&!("name"in M)&&!(U===v||U.isElement))M.name=X;K=r9(U,M);let k=x6(K)?K.element:K;if(Q===1)q.element=k;if(X)q[X]=K,j.push([X,K]);if(K){if("insert"in K&&typeof K.insert==="function")K.insert(G);else G.appendChild(k);if($){if(K._container=$,"onInserted"in K&&typeof K.onInserted==="function")K.onInserted($)}}}if($&&G.hasChildNodes())(x6($)?$.element:$).appendChild(G);return q.components=j,J9(q)}var E0=T(()=>{A6();H7();k7();M7();$9()});function $$(J,$=null,Q={}){let Z={},q=Q.creator||v;if(J.element&&!$){let K=J.element,z=K.creator||q,W=K.options||{},Y=Q.prefix!==!1?l9(W):{...W},U=r9(z,Y),X=x6(U)?U.element:U;if(Z.element=U,K.name)Z[K.name]=U;if(K.children){let _=F7(),H=[];for(let B in K.children){let M=K.children[B];if(M&&!M.name)M.name=B;let k=$$({[B]:M},_,Q);H.push(k.layout)}X.appendChild(_);for(let B of H)Object.assign(Z,B)}return J9(Z)}let j=$?F7():null,G=[];for(let K in J){let z=J[K];if(!z)continue;let W=z.creator||q,Y=z.options||{},X=("prefix"in Y?Y.prefix:Q.prefix!==!1)?l9(Y):{...Y};if(!z.name&&K!=="element")z.name=K;let _=r9(W,X);if(Z[K]=_,z.name&&z.name!==K)Z[z.name]=_;let H=x6(_)?_.element:_;if(j)j.appendChild(H);if(z.children){let B=typeof SVGElement!=="undefined"&&H instanceof SVGElement,M=$$(z.children,H,Q);if(G.push(M.layout),B)Object.assign(Z,M.layout)}}if($&&j)(x6($)?$.element:$).appendChild(j);for(let K of G)Object.assign(Z,K);return J9(Z)}var h0=T(()=>{A6();H7();k7();M7()});function u0(J){if(!J)return;Array.from(J.classList).filter((Z)=>Z.startsWith("layout--")||Z.includes("-layout--")).forEach((Z)=>{J.classList.remove(Z)})}function p9(J){return R6(J,"layout--stack")?"stack":R6(J,"layout--row")?"row":R6(J,"layout--grid")?"grid":""}function Y8(J,$,Q=!0){if(!J||!$)return;if(Q)u0(J);if($.type)g(J,`layout--${$.type}`);if($.gap!==void 0){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-gap-${$.gap}`)}if($.align){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-${$.align}`)}if($.justify){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-justify-${$.justify}`)}if($.type==="grid"||p9(J)==="grid"){if(typeof $.columns==="number")g(J,`layout--grid-cols-${$.columns}`);else if($.columns==="auto-fill")g(J,"layout--grid-fill");else if($.columns==="auto-fit")g(J,"layout--grid-cols-auto-fit");if($.dense)g(J,"layout--grid-dense");if($.autoHeight)g(J,"layout--grid-auto-height")}if($.type==="row"||p9(J)==="row"){if($.wrap===!1||$.wrap==="nowrap")g(J,"layout--row-nowrap");else if($.wrap==="reverse")g(J,"layout--row-wrap-reverse");if($.mobileStack)g(J,"layout--row-mobile-stack");if($.mobileScroll)g(J,"layout--row-mobile-scroll")}if($.class)$.class.split(" ").filter(Boolean).forEach((Z)=>{J.classList.add(Z)})}function U8(J,$){if(!J||!$)return;if(g(J,"layout__item"),$.width&&$.width>=1&&$.width<=12)g(J,`layout__item--${$.width}`);if($.sm)g(J,`layout__item--sm-${$.sm}`);if($.md)g(J,`layout__item--md-${$.md}`);if($.lg)g(J,`layout__item--lg-${$.lg}`);if($.xl)g(J,`layout__item--xl-${$.xl}`);if($.span)g(J,`layout__item--span-${$.span}`);if($.rowSpan)g(J,`layout__item--row-span-${$.rowSpan}`);if($.order)if(typeof $.order==="number")g(J,`layout__item--order-${$.order}`);else g(J,`layout__item--order-${$.order}`);if($.align)g(J,`layout__item--self-${$.align}`);if($.auto)g(J,"layout__item--auto")}var X8=T(()=>{R9()});function r9(J,$={}){try{let{layout:Q,layoutItem:Z,style:q,attributes:j}=$,G=$.events||$.event,K={...$};delete K.layout,delete K.layoutItem,delete K.events,delete K.event;let W=typeof J==="function"&&Object.getOwnPropertyDescriptor(J,"prototype")?.writable===!1?new J(K):J(K);if(W){let Y=W.element||(W instanceof HTMLElement?W:null);if(Y){if(Q)Y8(Y,Q);if(Z)U8(Y,Z);if(q&&typeof q==="object")Object.assign(Y.style,q);if(j&&typeof j==="object"){for(let[U,X]of Object.entries(j))if(X!==void 0&&X!==null)Y.setAttribute(U,X.toString())}if(G){if(typeof G==="object"&&!Array.isArray(G)){for(let[U,X]of Object.entries(G))if(typeof X==="function")Y.addEventListener(U,X)}else if(Array.isArray(G)){for(let U of G)if(Array.isArray(U)&&U.length>=2){let[X,_]=U;if(typeof X==="string"&&typeof _==="function")Y.addEventListener(X,_)}}}}}return W}catch(Q){return console.error("Error creating component instance:",Q),document.createElement("div")}}function f0(J){return Array.isArray(J)&&J.length>=3&&typeof J[0]==="function"&&typeof J[1]==="string"&&a6(J[2])}function B8(J,$=null,Q=0,Z={}){if(!J)return console.warn("Empty schema provided to layout processor"),{layout:{},element:document.createElement("div"),component:{},get:()=>null,getAll:()=>({}),destroy:()=>{}};if(f0(J))return e7(J,$,Q,Z);return Array.isArray(J)?e7(J,$,Q,Z):$$(J,$,Z)}var M7=T(()=>{E0();h0();$9();X8()});function s9(J,$=null,Q={}){if(typeof J==="function")J=J();if(typeof J==="string"){let Z=document.createElement("template");Z.innerHTML=J.trim();let q=Z.content;if($&&q.hasChildNodes())$.appendChild(q);let j={element:q.firstElementChild};return J9(j)}return B8(J,$,0,Q)}var J$=T(()=>{M7();k7()});function V7(J,$,...Q){if(J===g0)return Q.flat(1/0).filter(Boolean);let Z=$||{};if(Z.style&&typeof Z.style==="object")Z.style=Object.entries(Z.style).map(([K,z])=>{return`${K.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${z}`}).join("; ");let q=Z.id||Z.name||`el-${Math.floor(Math.random()*1e4)}`,j={...Z};delete j.id,delete j.name;let G=Q.flat(1/0).filter((K)=>K!==null&&K!==void 0&&K!==!1);if(typeof J==="function")return[J,q,j,G.length>0?F8(G):void 0].filter(Boolean);else if(typeof J==="string")return[v,q,{...j,tag:J},G.length>0?F8(G):void 0].filter(Boolean);return[]}function F8(J){let $=[];for(let Q of J)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")$.push(String(Q));else if(Array.isArray(Q))$.push(...F8(Q));else if(Q&&typeof Q==="object")$.push(Q);return $}function Gq(J,$){return s9(J,$)}var g0;var H8=T(()=>{A6();J$();g0=Symbol("Fragment")});var d0;var Q$=T(()=>{H7();J$();k7();M7();X8();H8();J$();d0=s9});var Y6,zq,k8=(J={})=>{let $=new Map,Q=new Set,Z=null,q=null,j=null,G=!1,K=!1,z=null,W=[],Y={event:Y6.CHANGE,data:null},U=J.transform||((M)=>M),X=J.validate||(()=>!0);function _(M,k){if(Q.size===0)return;Y.event=M,Y.data=k,W.length=0,Q.forEach((N)=>W.push(N));for(let N=0;N<W.length;N++)W[N](Y)}function H(){if(G&&j!==null)return j;if(!Z&&!q){let N=Array.from($.values());return j=N,G=!0,N}let M=Array.from($.values()),k=M;if(Z)k=M.filter(Z);if(q)k.sort(q);return j=k,G=!0,k}function B(M){if(!Array.isArray(M)){if(!X(M))return[];return[U(M)]}if(M.length===0)return[];let k=[];for(let N=0;N<M.length;N++)if(X(M[N])){let F=U(M[N]);if(F.id)k.push(F);else throw new Error("Items must have an id property")}return k}return{subscribe(M){return Q.add(M),()=>{Q.delete(M)}},getItems:H,getSize(){return $.size},isLoading(){return K},getError(){return z},query(M){Z=M,G=!1,_(Y6.CHANGE,H())},sort(M){q=M,G=!1,_(Y6.CHANGE,H())},async add(M){try{K=!0,_(Y6.LOADING,!0);let k=B(M);if(k.length===0)return k;for(let N=0;N<k.length;N++)$.set(k[N].id,k[N]);return G=!1,_(Y6.ADD,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async update(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let F=0;F<k.length;F++)if(!$.has(k[F].id))throw new Error(`Item with id ${k[F].id} not found`);let N=B(k);for(let F=0;F<N.length;F++)$.set(N[F].id,N[F]);return G=!1,_(Y6.UPDATE,N),_(Y6.CHANGE,H()),N}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async remove(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let N=0;N<k.length;N++)if(!$.has(k[N]))throw new Error(`Item with id ${k[N]} not found`);for(let N=0;N<k.length;N++)$.delete(k[N]);return G=!1,_(Y6.REMOVE,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},clear(){$.clear(),Z=null,q=null,j=null,G=!1,_(Y6.CHANGE,[])}}};var N7=T(()=>{Y6={CHANGE:"change",ADD:"add",UPDATE:"update",REMOVE:"remove",ERROR:"error",LOADING:"loading"},zq={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var y6,M8=(J={})=>{return{handleError:(Q,Z)=>{throw J.onError?.(Q,Z),Q}}};var V8=T(()=>{y6={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var Wq,N8=(J={})=>{let $=M8(J),Q=null,Z=new Map,q=new Map,j={strategy:J.pagination?.strategy||"cursor",cursorParamName:J.pagination?.cursorParamName||"cursor",pageParamName:J.pagination?.pageParamName||"page",perPageParamName:J.pagination?.perPageParamName||"per_page",offsetParamName:J.pagination?.offsetParamName||"offset",limitParamName:J.pagination?.limitParamName||"limit",defaultPageSize:J.pagination?.defaultPageSize||20},G=(H)=>{if(!H)return"http://localhost";if(/^https?:\/\//i.test(H))return H;if(H.startsWith("/"))return`${window.location.origin}${H}`;return`http://${H}`},K=(H,B={})=>{try{let M=H+JSON.stringify(B);if(q.has(M))return q.get(M);let k=G(J.base),N=new URL(k+H);if(Object.entries(B).forEach(([V,O])=>{if(Array.isArray(O))O.forEach((P)=>N.searchParams.append(V,P));else if(O!==null&&O!==void 0)N.searchParams.append(V,String(O))}),J.base&&J.base.startsWith("/")){let V=`${N.pathname}${N.search}`;return q.set(M,V),V}let F=N.toString();return q.set(M,F),F}catch(M){throw console.error("Error building URL:",M,{base:J.base,endpoint:H,params:B}),M}},z=(H)=>{let B={};return Object.entries(H).forEach(([M,k])=>{if(typeof k==="object")Object.entries(k).forEach(([N,F])=>{let V=Wq[N];if(V)B[`${M}_${V}`]=F});else B[M]=k}),B},W=async(H,B={})=>{if(Q)Q.abort();Q=new AbortController;try{let M=await fetch(H,{...B,headers:{"Content-Type":"application/json",...J.headers,...B.headers},signal:Q.signal});if(!M.ok){let N;try{N=await M.json()}catch{N={message:`HTTP error ${M.status}`}}return console.error("API error response:",N),$.handleError(new Error(N.message||"API request failed"))}let k=M.headers.get("content-type");if(k&&k.includes("application/json"))return await M.json();else return await M.text()}catch(M){if(console.error("API request error:",M),M.name==="AbortError")return null;return $.handleError(M)}finally{Q=null}},Y=(H)=>{if(!J.cache)return null;let B=Z.get(H);if(!B)return null;let{data:M,timestamp:k}=B;if(Date.now()-k>300000)return Z.delete(H),null;return M},U=(H,B)=>{if(!J.cache)return;Z.set(H,{data:B,timestamp:Date.now()})},X=(H={},B={})=>{let M={};switch(j.strategy){case"cursor":{let N=H.cursor||B.cursor;if(N)M[j.cursorParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"offset":{let N=H.offset!==void 0?H.offset:B.offset!==void 0?B.offset:0;M[j.offsetParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"page":{let N=H.page!==void 0?H.page:B.page!==void 0?B.page:H.cursor?H.cursor:1;M[j.pageParamName]=N;let F=H.per_page||H.perPage||H.limit||B.per_page||B.perPage||B.limit||j.defaultPageSize;M[j.perPageParamName]=F;break}}return M},_=(H,B={},M={})=>{if(J.adapter?.parseResponse)return J.adapter.parseResponse(H);if(H&&H.items)return H;if(Array.isArray(H))return{items:H,meta:{cursor:null,hasNext:!1}};let k=H.data||H.items||H.results||H.content||[],N=H.meta||H.pagination||H.page||{},F=N.total||H.total||k.length,V={cursor:null,hasNext:!1,total:F};switch(j.strategy){case"cursor":{if(N.next||N.nextCursor||N.nextPage)V.cursor=String(N.next||N.nextCursor||N.nextPage),V.hasNext=!0;else if(N.hasMore||N.hasNext)V.hasNext=Boolean(N.hasMore||N.hasNext),V.cursor=N.cursor||(N.page?String(Number(N.page)+1):null);else{let P=B.limit||M.limit||j.defaultPageSize;if(V.hasNext=k.length>=P,V.hasNext&&k.length>0){let L=k[k.length-1];V.cursor=L.id||L._id||String(k.length)}}break}case"offset":{let P=Number(B.offset||M.offset||N.offset||0),L=Number(B.limit||M.limit||N.limit||j.defaultPageSize),D=k.length;if(F!==void 0)V.hasNext=P+D<F;else V.hasNext=D>=L;V.cursor=V.hasNext?String(P+D):null,V.offset=P;break}case"page":{let P=Number(B.page||M.page||N.page||N.current_page||1),L=Number(B.per_page||B.perPage||B.limit||M.per_page||M.perPage||M.limit||N.per_page||N.perPage||N.size||N.limit||j.defaultPageSize);V.page=P;let D=Number(N.totalPages||N.total_pages||N.pages||N.pageCount||0);if(D>0)V.hasNext=P<D,V.pages=D;else if(F!==void 0){let R=Math.ceil(F/L);V.hasNext=P<R,V.pages=R}else V.hasNext=k.length>=L;V.cursor=V.hasNext?String(P+1):null;break}}return{items:k,meta:V}};return{...$,create:async(H)=>{let B=K(J.endpoints?.create||"/create"),M=await W(B,{method:"POST",body:JSON.stringify({items:H})});return _(M)},read:async(H={},B={})=>{let M={...H};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((w)=>{delete M[w]});let k=z(M),N=X(H,B),F={};if(H.search||B.search)F.search=H.search||B.search;if(H.sort||B.sort)F.sort=H.sort||B.sort;if(H.fields||B.fields)F.fields=H.fields||B.fields;let V={...k,...N,...F};Object.keys(V).forEach((w)=>{if(V[w]===void 0)delete V[w]});let O=K(J.endpoints?.list||"/list",V),P=O.toString(),L=Y(P);if(L)return L;let D=await W(O),R=_(D,H,B);return U(P,R),R},update:async(H)=>{let B=K(J.endpoints?.update||"/update"),M=await W(B,{method:"PUT",body:JSON.stringify({items:H})});return _(M)},delete:async(H)=>{let B=K(J.endpoints?.delete||"/delete"),M=await W(B,{method:"DELETE",body:JSON.stringify({ids:H})});return _(M)},query:async(H={},B={})=>{let M={...H},k={...B};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((D)=>{delete M[D],delete k[D]});let N=z(M),F=X(H,B),V={...k};if(H.search||B.search)V.search=H.search||B.search;let O={...N,...F,...V},P=K(J.endpoints?.list||"/list",O),L=await W(P);return _(L,H,B)},setPaginationStrategy:(H)=>{j.strategy=H},getPaginationConfig:()=>{return{...j}},disconnect:()=>{if(Q)Q.abort(),Q=null;Z.clear(),q.clear()}}};var _8=T(()=>{V8();Wq={[y6.EQ]:"eq",[y6.NE]:"ne",[y6.GT]:"gt",[y6.GTE]:"gte",[y6.LT]:"lt",[y6.LTE]:"lte",[y6.IN]:"in",[y6.NIN]:"nin",[y6.CONTAINS]:"contains",[y6.STARTS_WITH]:"startsWith",[y6.ENDS_WITH]:"endsWith"}});function Uq(J){return{...Yq,...J}}function l0(J){if(!J.renderItem||typeof J.renderItem!=="function")throw new Error("List manager requires a renderItem function");let $=Uq(J);if(!$.collection)$.collection="items";if(!$.transform)$.transform=(Q)=>Q;return $}function r0(J){return Boolean(J.baseUrl)}function p0(J){return J.staticItems||J.items||[]}var Yq;var s0=T(()=>{Yq={renderBufferSize:5,overscanCount:3,itemHeight:48,measureItemsInitially:!0,pageSize:20,loadThreshold:0.8,throttleMs:16,dedupeItems:!0,dynamicItemSize:!1,scrollStrategy:"scroll"}});function m0(J){if(getComputedStyle(J).position==="static")J.style.position="relative";let $=document.createElement("div");$.style.position="relative",$.style.width="100%",$.style.willChange="transform";let Q=document.createElement("div");return Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="1px",Q.style.visibility="hidden",Q.style.pointerEvents="none",J.appendChild($),J.appendChild(Q),{container:J,content:$,spacer:Q}}function a0(J){let $=document.createElement("div");$.className="mtrl-list-sentinel mtrl-list-sentinel--top",$.style.position="absolute",$.style.top="0",$.style.left="0",$.style.width="100%",$.style.height="1px",$.style.pointerEvents="none",$.style.visibility="hidden";let Q=document.createElement("div");return Q.className="mtrl-list-sentinel mtrl-list-sentinel--bottom",Q.style.position="absolute",Q.style.bottom="0",Q.style.left="0",Q.style.width="100%",Q.style.height="1px",Q.style.pointerEvents="none",Q.style.visibility="hidden",J.content.appendChild($),J.content.appendChild(Q),{...J,topSentinel:$,bottomSentinel:Q}}function L8(J,$){J.spacer.style.height=`${$}px`}function c0(J){if(J.content.parentNode)J.content.parentNode.removeChild(J.content);if(J.spacer.parentNode)J.spacer.parentNode.removeChild(J.spacer);if(J.topSentinel&&J.topSentinel.parentNode)J.topSentinel.remove();if(J.bottomSentinel&&J.bottomSentinel.parentNode)J.bottomSentinel.remove()}var i0=(J=48)=>{let $=new Map,Q=new Map,Z=!1,q=!0,j=!1,G=(W)=>{if(!W)return;return W.id||W.original&&W.original.id},K=(W)=>{if(Z&&Q.size>=W.length)return;if(Q.clear(),q){let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y),Y+=J}}else{let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y);let _=X&&$.has(X)?$.get(X):J;Y+=_}}Z=!0},z=(W)=>{if(!W)return;if(j=W.dynamicItemSize===!0,q=!j,W.itemHeight)J=W.itemHeight};return{setup:(W)=>{z(W)},measureItemHeight:(W,Y)=>{if(!Y||!W)return J;if(q&&$.size>0)return J;let U=G(W);if(!U)return J;let X=Y.offsetHeight;if(j||$.size===0||$.has(U)){if(X>0){let H=$.get(U)!==X;if($.size===0&&!j)J=X;if(H){if($.set(U,X),Z&&!q)Z=!1}}}if($.size===1&&!j&&Y.offsetHeight>0)return $.values().next().value;return j?$.get(U)||J:J},getItemHeight:(W)=>{if(q)return J;if(!W)return J;let Y=G(W);if(!Y)return J;if($.has(Y))return $.get(Y)||J;return J},setItemHeights:(W)=>{if(q&&!j)return!1;let Y=!1;for(let[U,X]of Object.entries(W))if($.get(U)!==X&&X>0)$.set(U,X),Y=!0;if(Y)Z=!1;return Y},calculateTotalHeight:(W)=>{if(!W||W.length===0)return 0;let Y=W.length;if(q)return Y*J;let U=0;for(let X of W){if(!X)continue;let _=G(X);U+=_&&$.has(_)?$.get(_):J}return U},getItemOffset:(W,Y)=>{if(Z&&Q.has(Y))return Q.get(Y)||0;if(K(W),Q.has(Y))return Q.get(Y)||0;if(q){let U=W.findIndex((X)=>G(X)===Y);if(U>=0)return U*J}else{let U=0;for(let X of W){let _=G(X);if(_===Y)return U;let H=_&&$.has(_)?$.get(_):J;U+=H}}return-1},getOffsetAtIndex:(W)=>{let Y=`index:${W}`;if(Z&&Q.has(Y))return Q.get(Y)||0;if(q)return W*J;return W*J},measureMarkedElements:(W,Y)=>{let U=$.size===0?".mtrl-list-item":'[data-needs-measurement="true"]',X=W.querySelectorAll(U),_=!1;if(X.length>0){if($.size===0&&X.length>0){let B=X[0].offsetHeight;if(B>0){if(J=B,_=!0,!j)return!0}}if(j)for(let H=0;H<X.length;H++){let B=X[H],M=B.getAttribute("data-id");if(M){if(Y.find((N)=>G(N)===M)){let N=B.offsetHeight;if(N>0&&$.get(M)!==N)$.set(M,N),_=!0;delete B.dataset.needsMeasurement}}}if(_&&!q)Z=!1}return _},hasCachedOffsets:()=>{return Z},calculateOffsets:K,clear:()=>{$.clear(),Q.clear(),Z=!1},getAllHeights:()=>{return new Map($)},getDefaultHeight:()=>{return J},isUsingUniformHeight:()=>{return q}}};function Xq(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3}=q,K=Math.floor(J/$),z=Math.ceil(Q/$),W=K+z,Y=Math.max(0,K-j-G),U=Math.min(Z,W+j+G);return{start:Y,end:U}}function Bq(J,$,Q,Z,q,j,G){let K=0,z=$.length-1,W=0;if(typeof Z.hasCachedOffsets==="function"&&Z.hasCachedOffsets())while(K<=z){let H=Math.floor((K+z)/2);if(!$[H]){K=H+1;continue}if(Z.getItemOffset($,$[H].id)<J)W=H,K=H+1;else z=H-1}else{let H=Z.getAllHeights(),B=G;if(H.size>0){let k=0,N=0;H.forEach((F)=>{k+=F,N++}),B=k/N}W=Math.floor(J/B);let M=W*B;while(W<$.length&&M<J){if($[W])M+=Z.getItemHeight($[W]);W++}while(W>0&&M>J)if(W--,$[W])M-=Z.getItemHeight($[W])}W=Math.max(0,Math.min(W,$.length-1));let Y=Math.max(0,W-q-j),U=0;for(let H=0;H<Y;H++)if($[H])U+=Z.getItemHeight($[H]);let X=Y,_=J+Q+q*G;while(X<$.length&&U<_){if($[X])U+=Z.getItemHeight($[X]);X++}return X=Math.min($.length,X+j),{start:Y,end:X}}function o0(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3,itemHeight:K=48}=q;if($.length===0)return{start:0,end:0};if($.length<10)return{start:0,end:$.length};let z=Z.getAllHeights();if(new Set(z.values()).size<=1&&$.length>20)return Xq(J,K,Q,$.length,q);if($.length>100)return Bq(J,$,Q,Z,j,G,K);let Y=0,U=0,X=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+H>J-j*q.itemHeight){U=Math.max(0,_-G);break}Y+=H}Y=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+=H,Y>J+Q+j*q.itemHeight){X=Math.min($.length,_+G);break}}if(X===0)X=$.length;return{start:U,end:X}}function t0(J,$,Q){if(typeof Q.hasCachedOffsets==="function"&&Q.hasCachedOffsets()&&typeof Q.getOffsetAtIndex==="function"){let j=[];for(let G=$.start;G<$.end;G++)if(J[G])j.push({index:G,item:J[G],offset:Q.getOffsetAtIndex(G)});return j}let Z=0;for(let j=0;j<$.start;j++)if(J[j])Z+=Q.getItemHeight(J[j]);let q=[];for(let j=$.start;j<$.end;j++)if(J[j])q.push({index:j,item:J[j],offset:Z}),Z+=Q.getItemHeight(J[j]);return q}function n0(J,$,Q,Z){if(Q<=0||$<=0)return!1;return(J+$)/Q>Z}var e0=(J,$,Q,Z)=>{let q=null,j=new Map,G={start:0,end:0};if(typeof Q.setup==="function")Q.setup(J);let K=(W,Y)=>{if(!W){console.warn("Attempted to render undefined item at index",Y);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}let U=Z.getRecycledElement(W),X=J.renderItem(W,Y,U);if(!X){console.warn("renderItem returned null or undefined for item",W);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}if(!X.classList.contains("mtrl-list-item"))X.classList.add("mtrl-list-item");if(W.id&&!X.hasAttribute("data-id"))X.setAttribute("data-id",W.id);if(W.type)X.dataset.itemType=W.type;if((J.dynamicItemSize===!0||j.size===0)&&!X.hasAttribute("data-needs-measurement"))X.dataset.needsMeasurement="true";if(q)q(W,X);return X},z=(W,Y,U)=>{if(Math.abs(U.end-U.start-(G.end-G.start))>10)return!1;let _=0;return Array.from(W).forEach((H)=>{if(Y.has(H))_++}),_>=W.size/2};return{setRenderHook:(W)=>{q=W},renderVisibleItems:(W,Y)=>{if(!$.content)return console.warn("Cannot render items: content element missing"),new Map;if(Y.start===G.start&&Y.end===G.end)return j;G=Y;let{topSentinel:U,bottomSentinel:X}=$,_=t0(W,Y,Q),H=new Set(_.map((k)=>k.item.id)),B=new Set(j.keys());if(z(H,B,Y)){let k=_.filter((F)=>!B.has(F.item.id));if(Array.from(j.entries()).filter(([F])=>!H.has(F)).forEach(([F,V])=>{Z.recycleElement(V),j.delete(F),V.remove()}),k.length>0){let F=document.createDocumentFragment();k.forEach(({index:V,item:O,offset:P})=>{let L=K(O,V);L.style.position="absolute",L.style.top=`${P}px`,L.style.left="0",L.style.width="100%",F.appendChild(L),j.set(O.id,L)}),$.content.appendChild(F)}_.forEach(({item:F,offset:V})=>{if(j.has(F.id)){let O=j.get(F.id);if(parseInt(O.style.top,10)!==V)O.style.top=`${V}px`}})}else{let k=new Map;Array.from($.content.children).forEach((F)=>{if(F===U||F===X)return;let V=F.getAttribute("data-id");if(V)k.set(V,F),F.remove()});let N=document.createDocumentFragment();j.clear(),_.forEach(({index:F,item:V,offset:O})=>{let P;if(k.has(V.id)){if(P=k.get(V.id),k.delete(V.id),P.style.top=`${O}px`,J.dynamicItemSize===!0||j.size===0)P.dataset.needsMeasurement="true"}else P=K(V,F),P.style.position="absolute",P.style.top=`${O}px`,P.style.left="0",P.style.width="100%";N.appendChild(P),j.set(V.id,P)}),k.forEach((F)=>{Z.recycleElement(F)}),$.content.innerHTML="",$.content.appendChild(N)}if(U&&!U.parentNode)$.content.insertBefore(U,$.content.firstChild);if(X&&!X.parentNode)$.content.appendChild(X);return j},getItemElements:()=>{return new Map(j)}}};var $4=()=>{};function J4(J,$,Q,Z){let{scrollStrategy:q="scroll"}=Q;switch(q){case"intersection":return Q4(J,$,Z);case"hybrid":return Fq(J,$,Z);case"scroll":default:return D8(J,Q,Z)}}function D8(J,$,Q){let Z=null,q=0,j=5,G=$.throttleMs||16,K=0;return{setup:()=>{let z=(W)=>{let Y=W.target.scrollTop;if(Math.abs(Y-q)<j)return;let U=Date.now();if(U-K<G){if(Z)return;Z=requestAnimationFrame(()=>{q=Y,K=Date.now(),Q.onScroll(Y),Z=null});return}q=Y,K=U,Q.onScroll(Y)};return J.addEventListener("scroll",z,{passive:!0}),()=>{if(J.removeEventListener("scroll",z),Z)cancelAnimationFrame(Z),Z=null}},getScrollTop:()=>{return J.scrollTop}}}function Q4(J,$,Q){let Z=null,q=null,j=null,G=!1;return{setup:()=>{if(!("IntersectionObserver"in window))return console.warn("IntersectionObserver not supported, falling back to scroll events"),D8(J,{renderItem:()=>document.createElement("div")},Q).setup();if(!$.topSentinel||!$.bottomSentinel)Object.assign($,a0($));if(Z=new IntersectionObserver((W)=>{if(G)return;G=!0;let Y=!1,U=!1;if(W.forEach((X)=>{if(X.target===$.topSentinel&&X.isIntersecting)Y=!0;if(X.target===$.bottomSentinel&&X.isIntersecting)U=!0,Y=!0}),U){if(j!==null)clearTimeout(j);j=window.setTimeout(()=>{Q.onLoadMore(),j=null},100)}if(Y)Q.onScroll(J.scrollTop);setTimeout(()=>{G=!1},100)},{root:J,rootMargin:"400px 0px 400px 0px",threshold:0}),$.topSentinel)Z.observe($.topSentinel);if($.bottomSentinel)Z.observe($.bottomSentinel);let K=()=>{if(!G)Q.onScroll(J.scrollTop)},z=0;return q=()=>{let W=Date.now();if(W-z<200)return;z=W,K()},J.addEventListener("scroll",q,{passive:!0}),()=>{if(Z)Z.disconnect(),Z=null;if(q)J.removeEventListener("scroll",q),q=null;if(j!==null)clearTimeout(j),j=null}},getScrollTop:()=>{return J.scrollTop}}}function Fq(J,$,Q){let q=D8(J,{throttleMs:32,renderItem:()=>document.createElement("div")},{onScroll:Q.onScroll,onLoadMore:()=>{}}),j=Q4(J,$,{onScroll:(K)=>{let z=J.scrollTop;if(Math.abs(z-K)>50)Q.onScroll(z)},onLoadMore:Q.onLoadMore}),G=[];return{setup:()=>{return G.push(q.setup()),G.push(j.setup()),()=>{G.forEach((K)=>K()),G=[]}},getScrollTop:()=>{return q.getScrollTop()}}}var Z4=()=>{};var q4=()=>{let J=new Map,$=50;return{getRecycledElement:(Q)=>{let Z=Q.type||"default";if(!J.has(Z))return J.set(Z,[]),null;let q=J.get(Z);return q.length>0?q.pop():null},recycleElement:(Q,Z=!1)=>{if(!Q)return;if(!Z&&Q.innerHTML.length<100)return;let q=Q.dataset.itemType||"default";if(!J.has(q))J.set(q,[]);let j=J.get(q);if(j.length<50){Q.style.display="none",Q.style.top="-9999px";for(let G in Q.dataset)if(G!=="itemType")delete Q.dataset[G];j.push(Q)}},getPool:(Q)=>{return J.get(Q)||[]},clear:()=>{J.forEach((Q)=>{Q.length=0}),J.clear()},getSize:()=>{let Q=0;return J.forEach((Z)=>{Q+=Z.length}),Q}}};function j4(J){let $=Boolean(J.baseUrl),Q=!$,Z=Q?J.staticItems||J.items||[]:[],q=J.pagination?.strategy||"cursor";return{items:Z,visibleItems:[],visibleRange:{start:0,end:0},totalHeight:0,totalHeightDirty:!0,itemHeights:new Map,loading:!1,cursor:null,page:q==="page"?1:void 0,paginationStrategy:q,hasNext:$,itemElements:new Map,scrollTop:0,containerHeight:0,scrollRAF:null,resizeRAF:null,mounted:!1,itemCount:Z.length,useStatic:Q,renderHook:null}}function K4(J,$,Q,Z=!0){let q=Q.cursor??null,j=Q.hasNext??!1,G=J.page;if(Q.page!==void 0)G=Q.page;else if(q&&/^\d+$/.test(q))G=parseInt(q,10)-1;if(J.paginationStrategy==="page"&&Q.page===void 0&&!q)G=J.page;let K;if(J.paginationStrategy==="page"&&J.page===1)K=[...$];else{let W=$;if(Z&&$.length>0&&J.items.length>0){let Y=new Set;for(let U=0;U<J.items.length;U++){let X=J.items[U];if(X&&X.id)Y.add(X.id)}W=$.filter((U)=>U&&U.id&&!Y.has(U.id))}K=[...J.items,...W]}let z=Q.total!==void 0?Q.total:K.length;return{items:K,cursor:q,page:G,hasNext:j,totalHeightDirty:!0,itemCount:z}}function G4(J,$,Q){return{visibleItems:$,visibleRange:Q}}function O8(J,$){return{totalHeight:$,totalHeightDirty:!1}}function P8(J,$){return{loading:$}}function z4(J,$=[]){return{items:J.useStatic?[...$]:[],visibleItems:[],visibleRange:{start:0,end:0},itemElements:new Map,cursor:null,page:J.paginationStrategy==="page"?1:void 0,hasNext:!J.useStatic,totalHeightDirty:!0,itemCount:J.useStatic?$.length:0}}function W4(J,$){let Q={};switch($||J.paginationStrategy||"cursor"){case"page":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);else if(J.page!==void 0)Q.page=J.page;else Q.page=1;break}case"offset":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.offset=parseInt(J.cursor,10);else Q.offset=0;break}case"cursor":default:{if(J.cursor)Q.cursor=J.cursor;if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);break}}return Q}var R8=(J,$,Q)=>{Q.collection=J;let Z=l0(Q);if(!$||!($ instanceof HTMLElement))throw new Error("List manager requires a valid container element");let q=r0(Z),j=!q,G=j?p0(Z):[],K=j4(Z);K.useStatic=j;let z=m0($),W=i0(Z.itemHeight),Y=q4(),U=e0(Z,z,W,Y),X=k8({transform:Z.transform,initialCapacity:j?G.length:50}),_=q?N8({base:Z.baseUrl,endpoints:{list:`/${J}`},headers:{"Content-Type":"application/json"},cache:!0,pagination:Z.pagination?{strategy:Z.pagination.strategy||"cursor",...Z.pagination}:{strategy:"cursor"}}):null,H=[],B=async(L={})=>{try{if(Object.assign(K,P8(K,!0)),K.useStatic)return{items:[...K.items],meta:{cursor:null,hasNext:!1}};if(!_)throw new Error("Cannot load items: API adapter not initialized");let D=await _.read(L),R=Array.isArray(D.items)?D.items.map(Z.transform):[];if(Object.assign(K,K4(K,R,D.meta,Z.dedupeItems)),K.paginationStrategy==="page"&&L.page===1){if(await X.clear(),R.length>0)await X.add(R)}else if(Z.dedupeItems){let w=new Set(K.items.map((x)=>x.id).filter(Boolean)),A=R.filter((x)=>!w.has(x.id));if(A.length>0)await X.add(A)}else await X.add(R);if(K.totalHeightDirty=!0,Z.afterLoad){let w=[...K.items],A={loading:!1,hasNext:K.hasNext,hasPrev:!!L.cursor||L.page&&L.page>1,items:[...R],allItems:w};Z.afterLoad(A)}if(K.paginationStrategy==="cursor"&&D.meta?.cursor)K.cursor=D.meta.cursor;else if(K.paginationStrategy==="page"&&L.page)K.page=L.page;return{items:R,meta:D.meta}}catch(D){return console.error(`Error loading ${J}:`,D),{items:[],meta:{cursor:null,hasNext:!1}}}finally{Object.assign(K,P8(K,!1))}},M=(L=K.scrollTop)=>{if(!K.mounted)return;if(K.containerHeight===0)K.containerHeight=$.clientHeight;K.scrollTop=L;let D=o0(L,K.items,K.containerHeight,W,Z);if(D.start===K.visibleRange.start&&D.end===K.visibleRange.end)return;if(Object.assign(K,G4(K,K.items.slice(D.start,D.end).filter(Boolean),D)),typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);if(K.totalHeightDirty){let w=W.calculateTotalHeight(K.items);Object.assign(K,O8(K,w)),L8(z,w)}if(U.renderVisibleItems(K.items,D),W.measureMarkedElements(z.content,K.items)){let w=W.calculateTotalHeight(K.items);Object.assign(K,O8(K,w)),L8(z,w)}k(L)},k=(L)=>{if(K.loading||!K.hasNext)return;if(n0(L,K.containerHeight,K.totalHeight,Z.loadThreshold))N()},N=async()=>{if(K.loading||!K.hasNext)return{hasNext:K.hasNext,items:[]};if(K.useStatic)return{hasNext:!1,items:[]};let L=Z.pagination?.strategy||"cursor";if(K.paginationStrategy=L,L==="page")if(K.cursor&&/^\d+$/.test(K.cursor))K.page=parseInt(K.cursor,10);else if(K.page!==void 0)K.page+=1;else K.page=1;let D=W4(K,L);if(!D.limit&&!D.per_page)if(L==="page"){let w=Z.pagination?.perPageParamName||"per_page";D[w]=Z.pageSize||20}else{let w=Z.pagination?.limitParamName||"limit";D[w]=Z.pageSize||20}let R=await B(D);return M(K.scrollTop),{hasNext:K.hasNext,items:R.items}},F=async()=>{if(Object.assign(K,z4(K,G)),Y.clear(),X.clear(),K.useStatic&&G&&G.length>0)K.items=[...G],await X.add(G);else await B();M(0)},V=(L,D="start")=>{if(typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);let R=W.getItemOffset(K.items,L);if(R===-1)return;let w=R;if(D==="center")w=R-K.containerHeight/2;else if(D==="end"){let A=K.items.findIndex((I)=>I&&I.id===L);if(A===-1)return;let x=W.getItemHeight(K.items[A]);w=R-K.containerHeight+x}$.scrollTo({top:Math.max(0,w),behavior:"smooth"})},P=(()=>{K.mounted=!0;let D=J4($,z,Z,{onScroll:M,onLoadMore:N}).setup();H.push(D);let R=X.subscribe(({event:w})=>{if(w===Y6.CHANGE)K.totalHeightDirty=!0,requestAnimationFrame(()=>{M(K.scrollTop)})});if(H.push(R),K.useStatic&&G&&G.length>0)X.add(G).then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error adding static items to collection:",w)});else if(!K.useStatic)B().then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error loading items:",w)});if("ResizeObserver"in window){let w=new ResizeObserver((A)=>{for(let x of A)if(x.target===$){let I=$.clientHeight;if(I!==K.containerHeight){if(K.containerHeight=I,K.resizeRAF)cancelAnimationFrame(K.resizeRAF);K.resizeRAF=requestAnimationFrame(()=>{M(K.scrollTop),K.resizeRAF=null})}}});w.observe($),H.push(()=>{if(w.disconnect(),K.resizeRAF)cancelAnimationFrame(K.resizeRAF),K.resizeRAF=null})}else{let w=null,A=()=>{if(w)clearTimeout(w);w=window.setTimeout(()=>{let x=$.clientHeight;if(x!==K.containerHeight)K.containerHeight=x,M(K.scrollTop);w=null},100)};window.addEventListener("resize",A,{passive:!0}),H.push(()=>{if(window.removeEventListener("resize",A),w)clearTimeout(w),w=null})}return()=>{H.forEach((w)=>w()),H.length=0,K.mounted=!1}})();return{loadItems:B,loadMore:N,refresh:F,updateVisibleItems:M,scrollToItem:V,setItemHeights:(L)=>{let D=W.setItemHeights(L);if(D)K.totalHeightDirty=!0,M(K.scrollTop);return D},getCollection:()=>X,getVisibleItems:()=>K.visibleItems,getAllItems:()=>K.items,isLoading:()=>K.loading,hasNextPage:()=>K.hasNext,isApiMode:()=>q,setRenderHook:(L)=>{U.setRenderHook(L),M(K.scrollTop)},destroy:()=>{if(P(),X.clear(),typeof W.clear==="function")W.clear();if(Y.clear(),z.content)z.content.innerHTML="";if(c0(z),_&&typeof _.disconnect==="function")_.disconnect()}}},Hq;var A8=T(()=>{N7();_8();s0();$4();Z4();Hq={track:(J)=>({id:J._id,headline:J.title||"Untitled",supportingText:J.artist||"Unknown Artist",meta:J.year?.toString()||""}),playlist:(J)=>({id:J._id,headline:J.name||"Untitled Playlist",supportingText:`${J.tracks?.length||0} tracks`,meta:J.creator||""}),country:(J)=>({id:J._id,headline:J.name||J.code,supportingText:J.continent||"",meta:J.code||""})}});var Y4=T(()=>{N7();N7();N7();A8();V8();_8()});var U4=(J,$,Q,Z,q,j)=>{if(Z<0||q<0)return;let G=typeof j==="number"?[j,j,j,j]:j,[K,z,W,Y]=G;J.beginPath(),J.moveTo($+K,Q),J.lineTo($+Z-z,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+z),J.lineTo($+Z,Q+q-W),J.quadraticCurveTo($+Z,Q+q,$+Z-W,Q+q),J.lineTo($+Y,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-Y),J.lineTo($,Q+K),J.quadraticCurveTo($,Q,$+K,Q),J.closePath()},QX=(J,$,Q,Z,q,j,G)=>{if(J.save(),G)J.fillStyle=G;U4(J,$,Q,Z,q,j),J.fill(),J.restore()},X4=(J,$,Q,Z,q,j)=>{return J.save(),U4(J,$,Q,Z,q,j),J.clip(),()=>J.restore()},B4=(J,$,Q,Z,q,j,G,K)=>{if(Z<0||q<0)return;if(J.save(),K)J.fillStyle=K;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+Z-G,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+G),J.lineTo($+Z,Q+q-G),J.quadraticCurveTo($+Z,Q+q,$+Z-G,Q+q),J.lineTo($+j,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},F4=(J,$,Q,Z)=>{if(Z)J.fillStyle=Z,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var w8=(J)=>{let j=J;for(let U=0;U<4;U++){let B=j*j,k=1.6*(B*j)+-1.8000000000000003*B+1.2000000000000002*j-J,N=4.800000000000001*B+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(k)<0.00001)break;j=j-k/N}let G=0,K=3-G,z=1-G-K,W=j*j,Y=W*j;return z*Y+K*W+G*j},H4,qX;var k4=T(()=>{H4={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},qX={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:w8}});class kq{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Mq{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var M4=(J,$,Q)=>{let Z=window.devicePixelRatio||1,q=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*Z),J.height=Math.round(Q*Z),q.setTransform(1,0,0,1,0,0),q.scale(Z,Z),{canvas:J,ctx:q,width:$,height:Q,pixelRatio:Z}},V4=(J,$,Q)=>{let{canvas:Z,ctx:q,pixelRatio:j}=J;Z.style.width=`${$}px`,Z.style.height=`${Q}px`,Z.width=Math.round($*j),Z.height=Math.round(Q*j),J.width=$,J.height=Q,q.setTransform(1,0,0,1,0,0),q.scale(j,j)},N4=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},x8=(J,$)=>{let Q=B6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},_4=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var L4=T(()=>{$9()});var y8=T(()=>{k4();L4()});var _7=T(()=>{J6();A9();v0();C0();Q$();Y4();y8();w6();J8();$9();p7()});var D4=({disabled:J,lifecycle:$})=>(Q)=>{let Z={setText:(G)=>{return Q.text.setText(G),Z},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},q={setIcon:(G)=>{return Q.icon.setIcon(G),q},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:Z,icon:q,disabled:J,lifecycle:$,getClass:Q.getClass,on:(G,K)=>{if(Q.on)Q.on(G,K);return j},off:(G,K)=>{if(Q.off)Q.off(G,K);return j},addClass:(...G)=>{if(Q.addClass)Q.addClass(...G);else g(Q.element,...G);return j},getValue:()=>Q.element.value,setValue(G){return Q.element.value=G,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(G){return Q.text.setText(G),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let G=Q.icon.getElement();return!!G&&!!G.innerHTML.trim()&&!!G.parentNode},setIcon(G){let K=Q.componentName||"button",z=Q.getClass(K);if(!G){let W=Q.icon.getElement();if(W&&W.parentNode)W.parentNode.removeChild(W),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${z}--icon`)}else if(!j.hasIcon()){let W=document.createElement("span");if(W.className=`${Q.getClass("button-icon")}`,W.innerHTML=G,Q.element.firstChild)Q.element.insertBefore(W,Q.element.firstChild);else Q.element.appendChild(W);Q.icon.getElement=()=>W,Q.icon.getIcon=()=>G,Q.element.classList.add(`${z}--icon`)}else{let W=Q.icon.getElement();if(W)W.innerHTML=G}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(G){let K=Q.componentName||"button",z=Q.getClass(K);return["filled","tonal","outlined","elevated","text"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getVariant(){let G=Q.componentName||"button",K=Q.getClass(G),z=["filled","tonal","outlined","elevated","text"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"filled"},getSize(){let G=Q.componentName||"button",K=Q.getClass(G),z=["xs","s","m","l","xl"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"s"},setSize(G){let K=Q.componentName||"button",z=Q.getClass(K);return["xs","s","m","l","xl"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getShape(){let G=Q.componentName||"button",K=Q.getClass(G),z=["round","square"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"round"},setShape(G){let K=Q.componentName||"button",z=Q.getClass(K);return["round","square"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},setActive(G){if(G)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(G){return Q.element.setAttribute("aria-label",G),j},destroy(){$.destroy()},updateCircularStyle(){let G=Q.text.getText()!=="",K=j.hasIcon();if(!G)g(Q.element,"button--circular"),j6(Q.element,"button--icon");else j6(Q.element,"button--circular");if(K&&G)g(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(G)=>{return await Q.setProgress(G),j};if(Q.setProgressSync)j.setProgressSync=(G)=>{return Q.setProgressSync(G),j};if(Q.setIndeterminate)j.setIndeterminate=async(G)=>{return await Q.setIndeterminate(G),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(G)=>{return Q.setIndeterminateSync(G),j};if(Q.setLoading)j.setLoading=async(G,K)=>{return await Q.setLoading(G,K),j};if(Q.setLoadingSync)j.setLoadingSync=(G,K)=>{return Q.setLoadingSync(G,K),j};return j};var O4=T(()=>{_7()});var Z$,q$,j$,K$,P4,m9;var T8=T(()=>{Z$={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},q$={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},j$={ROUND:"round",SQUARE:"square"},K$={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},P4={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},m9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Vq,R4=(J={})=>u(Vq,J,"button"),A4=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},w4=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var x4=T(()=>{t();T8();Vq={variant:Z$.FILLED,size:q$.S,shape:j$.ROUND,disabled:!1,type:K$.BUTTON,ripple:!0,rippleConfig:{duration:m9.DURATION,timing:m9.TIMING,opacity:m9.OPACITY}}});var Nq=(J={})=>{let $=R4(J);try{return b(S,d(),h(A4($)),K6($),f7($),Y9($),U9($),G6($),S0($),S6($),C(),(Z)=>{if($.shape&&Z.element){let q=`${$.prefix}-${$.componentName}--${$.shape}`;Z.element.classList.add(q)}return Z},(Z)=>D4(w4(Z))(Z))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},Q9;var y4=T(()=>{J6();c();o();b0();O4();x4();Q9=Nq});var T4={};KJ(T4,{default:()=>Q9});var T9=T(()=>{y4()});var G9={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},y$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},T$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},P9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},I$={START:"start",CENTER:"center",END:"end"},$6={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var E7={FILLED:"filled",OUTLINED:"outlined"},h7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},S$={MOUSE:"mouse",KEYBOARD:"keyboard"},b$={CHANGE:"change",OPEN:"open",CLOSE:"close"},v$={DROPDOWN:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},E9={VARIANT:E7.FILLED,PLACEMENT:h7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},C$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};K7();J6();t();var Z8={CENTER:"center",END:"end"},q8=300;var s3={tag:"div",hasFab:!1,fabPosition:Z8.END,autoHide:!1,transitionDuration:q8},Y0=(J={})=>u(s3,J,"bottom-app-bar");var U0=(J={})=>{let $=Y0(J),Q=S($),Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-actions`;let q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=h({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),G=d()(j),K=C()(G);K.element.appendChild(Z),K.element.appendChild(q);let z=!0,W=window.scrollY;if($.autoHide){let U=()=>{let _=window.scrollY;if(_>W+10){if(z)Y.hide(),$.onVisibilityChange?.(!1)}else if(_<W-10){if(!z)Y.show(),$.onVisibilityChange?.(!0)}W=_};window.addEventListener("scroll",U,{passive:!0});let X=K.lifecycle.destroy;K.lifecycle.destroy=()=>{window.removeEventListener("scroll",U),X()}}let Y={...K,addAction(U){return Z.appendChild(U),this},addFab(U){return q.innerHTML="",q.appendChild(U),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),z=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),z=!1,this},isVisible(){return z},getActionsContainer(){return Z}};if($.autoHide&&$.transitionDuration)Y.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return Y};var m3=U0;T9();J6();c();o();var I8=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let Z=$.element.querySelector(`.${$.getClass("card")}-header`);if(Z)Z.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),G=j[j.length-1];if(G.nextSibling)$.element.insertBefore(Q,G.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,Z="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(Z==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let Z=$.element.querySelector(`.${$.getClass("card")}-actions`);if(Z)Z.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(Z)=>{$.element.setAttribute("aria-grabbed","true"),Q(Z)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});t();w6();J6();c();A6();var G$=(J={})=>{let $={...J,componentName:"card-content",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${f}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((Z)=>{if(Z instanceof HTMLElement)Q.element.appendChild(Z)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},z$=(J={})=>{let $={...J,componentName:"card-header",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),Z=v({tag:"div",className:`${f}-card-header-text`,container:Q.element});if(J.title){v({tag:"h3",className:`${f}-card-header-title`,text:J.title,container:Z,attributes:{id:`${Q.element.id||"card-header"}-title`}});let q=Q.element.closest(`.${f}-card`);if(q&&!q.hasAttribute("aria-labelledby"))q.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)v({tag:"h4",className:`${f}-card-header-subtitle`,text:J.subtitle,container:Z});if(J.avatar){let q=typeof J.avatar==="string"?v({tag:"div",className:`${f}-card-header-avatar`,html:J.avatar}):J.avatar,j=q.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(q,Q.element.firstChild)}if(J.action){let q=typeof J.action==="string"?v({tag:"div",className:`${f}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},L7=(J={})=>{let $={...J,componentName:"card-actions",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${f}-card-actions--full-bleed`:null,J.vertical?`${f}-card-actions--vertical`:null,J.align?`${f}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((Z,q)=>{if(Z instanceof HTMLElement){if(!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby")&&Z.textContent?.trim()==="")Z.setAttribute("aria-label",`Action ${q+1}`);Q.element.appendChild(Z)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},D7=(J={})=>{let $={...J,componentName:"card-media",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${f}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${f}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let Z=document.createElement("img");if(Z.src=J.src,Z.className=`${f}-card-media-img`,Z.alt=J.alt||"",!J.alt)Z.setAttribute("aria-hidden","true");Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var I9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},O7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},S8={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},I4={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},b8={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},S4={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},b4={TOP:"top",BOTTOM:"bottom"},v4={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var _q={variant:I9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},C4=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},E4=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=z$($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=G$($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=L7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (T9(),T4)).then(({default:Q})=>{let Z=$.buttons.map((j)=>Q(j).element),q=L7({actions:Z,align:$.actionsConfig?.align||"end"});J.setActions(q)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},h4=(J={})=>u(_q,J,"card"),u4=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",Z={};if(J.aria)Object.entries(J.aria).forEach(([q,j])=>{if(j!==void 0){let G=q.startsWith("aria-")?q:`aria-${q}`;Z[G]=j}});if(!Z.role&&!J.aria?.role)Z.role=Q;if($&&!Z.tabindex)Z.tabindex="0";return p(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:Z,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},f4=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),S9=O7,g4=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL1))}),J.element.addEventListener("keydown",(Z)=>{if((Z.key==="Enter"||Z.key===" ")&&$.clickable)Z.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(Z)=>{if(J.element.style.setProperty("--card-elevation",String(S9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:Z}),Z.dataTransfer){let q=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";Z.dataTransfer.setData("text/plain",q)}}),J.element.addEventListener("dragend",(Z)=>{J.element.style.setProperty("--card-elevation",String(S9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:Z})});return J};w6();A6();var Lq=(J={})=>($)=>{let Q=J.initialState||!1,Z=null,q=Q;function j(G){if(q=G,G&&!Z)Z=v({tag:"div",className:`${f}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),v({tag:"div",className:`${f}-card-loading-spinner`,container:Z}),$.element.classList.add(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!G&&Z)Z.remove(),Z=null,$.element.classList.remove(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>q,setLoading:j}}},v8=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(S9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(S9.LEVEL0));return J},Dq=(J={})=>($)=>{let Q=J.initialExpanded||!1,Z=Q,q=J.expandableContent,j=v({tag:"button",className:`${f}-card-expand-button`,attributes:{"aria-expanded":Z?"true":"false","aria-label":Z?"Collapse content":"Expand content","aria-controls":q?.id||`${$.element.id||"card"}-expandable-content`}}),G=$.element.querySelector(`.${f}-card-actions`);if(G)G.appendChild(j);else v({tag:"div",className:`${f}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(q){if(q.classList.add(`${f}-card-expandable-content`),!q.id)q.id=`${$.element.id||"card"}-expandable-content`;if(!Q)q.style.display="none",q.setAttribute("aria-hidden","true");else q.setAttribute("aria-hidden","false");$.element.appendChild(q)}function K(W){if(Z=W,q)q.style.display=W?"block":"none",q.setAttribute("aria-hidden",W?"false":"true");if(j.setAttribute("aria-expanded",W?"true":"false"),j.setAttribute("aria-label",W?"Collapse content":"Expand content"),W)$.element.classList.add(`${f}-card--expanded`);else $.element.classList.remove(`${f}-card--expanded`);$.emit?.("expandedChanged",{expanded:W})}function z(){K(!Z)}return j.addEventListener("click",(W)=>{W.stopPropagation(),z()}),j.addEventListener("keydown",(W)=>{if(W.key==="Enter"||W.key===" ")W.preventDefault(),z()}),{...$,expandable:{isExpanded:()=>Z,setExpanded:K,toggleExpanded:z}}},Oq=(J={})=>($)=>{let Q=J.threshold||100,Z=0,q=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=v({tag:"button",className:`${f}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),G=v({tag:"button",className:`${f}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),G.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function K(Y){Z=Y.touches[0].clientX,$.element.style.transition="none"}function z(Y){if(!Z)return;q=Y.touches[0].clientX;let U=q-Z;$.element.style.transform=`translateX(${U}px)`}function W(){if(!Z)return;$.element.style.transition="transform 0.3s ease";let Y=q-Z;if(Math.abs(Y)>=Q)if(Y>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(Y<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";Z=0,q=0}return $.element.addEventListener("touchstart",K),$.element.addEventListener("touchmove",z),$.element.addEventListener("touchend",W),$.element.classList.add(`${f}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var Pq=(J={})=>{let $=C4(J),Q=h4($);try{let Z=b(S,d(),h(u4(Q)),K6(Q),Q.clickable?S6(Q):(q)=>q,C(),g4,v8,(q)=>I8(f4(q))(q))(Q);return E4(Z,$),Z}catch(Z){throw console.error("Card creation error:",Z instanceof Error?Z.message:String(Z)),new Error(`Failed to create card: ${Z instanceof Error?Z.message:String(Z)}`)}},d4=Pq;J6();c();o();var k9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},l4={DEFAULT:"default",SNAP:"snap"},Rq={LARGE:"large",MEDIUM:"medium",SMALL:"small"},W$={SLIDE:"slide",FADE:"fade",NONE:"none"},a9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},F6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:W$.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:k9.MULTI_BROWSE,SCROLL_BEHAVIOR:l4.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[k9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[k9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[k9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[k9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var C8=(J)=>($)=>{let Q={...$},Z=J.layout||F6.LAYOUT,q=()=>{let F=document.createElement("div");return F.className=`${$.getClass("carousel")}-wrapper`,F.dataset.layout=Z,$.element.appendChild(F),F},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||F6.GAP}`;let G=q();G.appendChild(j);let K=J.initialSlide||0,z=0,W=[],Y=[];function U(F){if(Y[F]?.size)return Y[F].size;switch(Z){case"multi-browse":if(F===0||F===1)return"large";if(F===2)return"medium";return"small";case"uncontained":return"large";case"hero":return F===0?"large":"small";case"full-screen":return"large";default:return"large"}}function X(){let F=j.clientWidth,V=typeof F6.ITEM_WIDTHS[Z].LARGE==="number"?F6.ITEM_WIDTHS[Z].LARGE:F,O=typeof F6.ITEM_WIDTHS[Z].MEDIUM==="number"?F6.ITEM_WIDTHS[Z].MEDIUM:F*0.75,P=typeof F6.ITEM_WIDTHS[Z].SMALL==="number"?F6.ITEM_WIDTHS[Z].SMALL:F6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")V=Math.min(V,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")P=J.smallItemWidth;if(Z==="full-screen")V=F,O=F,P=F;W.forEach((L,D)=>{let R=U(D);switch(R){case"large":L.style.width=`${V}px`;break;case"medium":L.style.width=`${O}px`;break;case"small":L.style.width=`${P}px`;break}L.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let w=L.querySelector(`.${$.getClass("carousel")}-slide-title`),A=L.querySelector(`.${$.getClass("carousel")}-slide-description`);if(w)if(R==="small"&&Z!=="uncontained")w.classList.add("visually-hidden");else w.classList.remove("visually-hidden");if(A)if(R==="small"||R==="medium"&&Z==="multi-browse")A.classList.add("visually-hidden");else A.classList.remove("visually-hidden")})}function _(F,V){let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide`,O.setAttribute("role","listitem"),O.setAttribute("aria-roledescription","slide"),O.dataset.borderRadius=`${J.borderRadius||F6.BORDER_RADIUS}`;let P=document.createElement("div");P.className=`${$.getClass("carousel")}-slide-image`;let L=document.createElement("img");if(L.src=F.image,L.alt=F.title||"Carousel slide",P.appendChild(L),F.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,F.accent)R.style.backgroundColor=F.accent;P.appendChild(R)}let D=document.createElement("div");if(D.className=`${$.getClass("carousel")}-slide-content`,F.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=F.title,Z==="full-screen")D.appendChild(R);else P.appendChild(R)}if(F.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=F.description,D.appendChild(R)}if(F.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=F.buttonText,F.buttonUrl)R.href=F.buttonUrl;if(F.accent)R.style.backgroundColor=F.accent;D.appendChild(R)}if(O.appendChild(P),O.appendChild(D),V!==void 0&&V>=0&&V<=Y.length)Y.splice(V,0,F);else Y.push(F);if(V!==void 0&&V>=0&&V<=W.length)if(V<W.length)j.insertBefore(O,W[V]),W.splice(V,0,O);else j.appendChild(O),W.push(O);else j.appendChild(O),W.push(O);return z++,X(),O}let H=()=>{if(J.showAllLink===!1)return;let F=document.createElement("div");F.className=`${$.getClass("carousel")}-show-all`,F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.setAttribute("aria-label","Show all items");let V=document.createElement("span");V.textContent="Show all",F.appendChild(V),G.appendChild(F),F.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),F.addEventListener("keydown",(O)=>{if(O.key==="Enter"||O.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();O.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((F)=>{_(F)});if(J.showAllLink!==!1&&Z!=="full-screen")H();let B=()=>{X();let F=new CustomEvent(a9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(F)};window.addEventListener("resize",B),setTimeout(X,0);let M=(F)=>{if(F<0||F>=z)if(J.loop)if(F<0)F=z-1;else F=0;else return Q;if(K!==F){let V=new CustomEvent(a9.SLIDE_CHANGE,{detail:{previousSlide:K,nextSlide:F}});$.element.dispatchEvent(V),K=F,W.forEach((L,D)=>{if(D===K)L.classList.add(`${$.getClass("carousel")}-slide--active`),L.setAttribute("aria-current","true");else L.classList.remove(`${$.getClass("carousel")}-slide--active`),L.removeAttribute("aria-current")});let O=J.scrollBehavior==="snap"?"smooth":"auto";if(W[F])if(Z==="hero"&&J.centered){let L=W[F].offsetWidth,D=j.clientWidth,R=W[F].offsetLeft;j.scrollTo({left:R-D/2+L/2,behavior:O})}else W[F].scrollIntoView({behavior:O,block:"nearest",inline:"start"});let P=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(P)}return Q};if(Object.assign(Q,{slides:{addSlide:(F,V)=>{return _(F,V),Q.slides},removeSlide:(F)=>{if(F>=0&&F<W.length){if(j.removeChild(W[F]),W.splice(F,1),Y.splice(F,1),z--,K>=z)K=z-1;if(K<0)K=0;X()}return Q.slides},updateSlide:(F,V)=>{if(F>=0&&F<W.length){Y[F]=V;let O=W[F],P=O.querySelector("img");if(P)P.src=V.image,P.alt=V.title||"Carousel slide";let L=O.querySelector(`.${$.getClass("carousel")}-slide-title`);if(L&&V.title)L.textContent=V.title;let D=O.querySelector(`.${$.getClass("carousel")}-slide-description`);if(D&&V.description)D.textContent=V.description;let R=O.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&V.accent)R.style.backgroundColor=V.accent;let w=O.querySelector(`.${$.getClass("carousel")}-slide-button`);if(w)if(V.buttonText){if(w.textContent=V.buttonText,V.buttonUrl)w.href=V.buttonUrl;if(V.accent)w.style.backgroundColor=V.accent}else w.parentElement?.removeChild(w);else if(V.buttonText){let A=O.querySelector(`.${$.getClass("carousel")}-slide-content`);if(A){let x=document.createElement("a");if(x.className=`${$.getClass("carousel")}-slide-button`,x.textContent=V.buttonText,V.buttonUrl)x.href=V.buttonUrl;if(V.accent)x.style.backgroundColor=V.accent;A.appendChild(x)}}if(V.size)X()}return Q.slides},getSlide:(F)=>{if(F>=0&&F<Y.length)return Y[F];return null},getCount:()=>z,getElements:()=>[...W]},slidesContainer:j,slideData:Y,wrapper:G,getCurrentSlide:()=>K,goTo:M,next:()=>M(K+1),prev:()=>M(K-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(F)=>{return J.borderRadius=F,W.forEach((V)=>{V.dataset.borderRadius=`${F}`}),Q},setGap:(F)=>{return J.gap=F,j.dataset.gap=`${F}`,Q},updateLayout:(F)=>{return J.layout=F,G.dataset.layout=F,$.element.dataset.layout=F,Object.values(k9).forEach((V)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${V}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${F}`),X(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let F=0,V=1/0,O=j.scrollLeft,P=j.clientWidth;if(W.forEach((L,D)=>{let w=L.offsetLeft+L.offsetWidth/2,A=O+P/2,x=Math.abs(w-A);if(x<V)V=x,F=D}),F!==K){K=F,W.forEach((D,R)=>{if(R===K)D.classList.add(`${$.getClass("carousel")}-slide--active`),D.setAttribute("aria-current","true");else D.classList.remove(`${$.getClass("carousel")}-slide--active`),D.removeAttribute("aria-current")});let L=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(L)}},150)});return Q};var E8=(J)=>($)=>{let Q,Z,q,j=!1,G=0,K=0,z,W=J.scrollBehavior||"default",Y=(V)=>{if(V.button!==0)return;cancelAnimationFrame(z),Q=V.clientX,Z=$.slidesContainer.scrollLeft,q=Q,j=!0,K=Date.now(),G=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(V.pointerId),V.preventDefault()},U=(V)=>{if(!j)return;let O=V.clientX-Q;$.slidesContainer.scrollLeft=Z-O;let P=Date.now(),L=P-K;if(L>0)G=(V.clientX-q)/L;q=V.clientX,K=P,V.preventDefault()},X=()=>{let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft,L=J.layout==="hero"&&J.centered,D=0,R=1/0;return V.forEach((w)=>{let A;if(L)A=w.offsetLeft+w.offsetWidth/2-O/2;else A=w.offsetLeft;let x=Math.abs(A-P);if(x<R)R=x,D=A}),D},_=(V,O,P)=>{let L=Date.now(),D=O-V,R=500;if(Math.abs(P)>0.5)R=Math.min(R,300);let w=()=>{let A=Date.now()-L,x=Math.min(A/R,1);x=1-Math.pow(1-x,3);let I=V+D*x;if($.slidesContainer.scrollLeft=I,x<1)z=requestAnimationFrame(w)};z=requestAnimationFrame(w)},H=(V)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),W==="snap"){let O=X();_($.slidesContainer.scrollLeft,O,G)}else if(Math.abs(G)>0.5){let O=G*100,P=$.slidesContainer.scrollLeft-O;_($.slidesContainer.scrollLeft,P,G)}G=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},B=(V)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),$.slidesContainer.style.scrollBehavior=""},M=(V)=>{if(J.layout==="full-screen")return;V.preventDefault();let P=(V.deltaY||V.deltaX)*0.5;if(W==="snap")$.slidesContainer.scrollLeft+=P,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let L=X();_($.slidesContainer.scrollLeft,L,0)},150);else $.slidesContainer.scrollLeft+=P},k=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft;V.forEach((L)=>{let{offsetLeft:D,offsetWidth:R}=L,w=D+R/2,A=P+O/2,x=w-A,I=Math.max(-1,Math.min(1,x/(O/2))),r=L.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${I*-5}%)`})},N=()=>{k()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",Y),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",B),$.slidesContainer.addEventListener("wheel",M,{passive:!1}),$.slidesContainer.addEventListener("scroll",N,{passive:!0});let F=(V)=>{if($.element!==document.activeElement)return;switch(V.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"Home":if($.goTo)$.goTo(0);V.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);V.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",F),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(z),$.slidesContainer.removeEventListener("pointerdown",Y),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",B),$.slidesContainer.removeEventListener("wheel",M),$.slidesContainer.removeEventListener("scroll",N),$.element.removeEventListener("keydown",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var r4=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(Z,q)=>{return J.slides.addSlide(Z,q),Q.slides},removeSlide:(Z)=>{return J.slides.removeSlide(Z),Q.slides},updateSlide:(Z,q)=>{return J.slides.updateSlide(Z,q),Q.slides},getSlide:(Z)=>{if($.slideData&&Z>=0&&Z<$.slideData.length)return $.slideData[Z];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(Z){return $.goTo(Z),this},getCurrentSlide:$.getCurrentSlide,addSlide(Z,q){return J.slides.addSlide(Z,q),this},removeSlide(Z){return J.slides.removeSlide(Z),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(Z){if($.setBorderRadius)$.setBorderRadius(Z);return this},setGap(Z){if($.setGap)$.setGap(Z);return this},destroy(){J.lifecycle.destroy()},on(Z,q){if($.on)$.on(Z,q);else if($.element.addEventListener)$.element.addEventListener(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);else if($.element.removeEventListener)$.element.removeEventListener(Z,q);return this},addClass(...Z){if($.addClass)$.addClass(...Z);else Z.forEach((q)=>$.element.classList.add(q));return this}};return Q};t();var Aq={initialSlide:F6.INITIAL_SLIDE,loop:F6.LOOP,transition:W$.SLIDE,transitionDuration:F6.TRANSITION_DURATION,borderRadius:F6.BORDER_RADIUS,gap:F6.GAP,prefix:"carousel",showAllLink:!0},p4=(J={})=>u(Aq,J,"carousel"),s4=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return p(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var wq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||xq(J.layout);let $=p4(J);try{let Z={...b(S,d(),h(s4($)))($)};yq(Z,J);let q=C8($)(Z),j=E8($)(q),G=C()(j),K={slides:{addSlide:G.slides.addSlide,removeSlide:G.slides.removeSlide,updateSlide:G.slides.updateSlide,getCount:G.slides.getCount,getElements:G.slides.getElements},lifecycle:{destroy:G.lifecycle.destroy}},z=r4(K)(G);return z.element.dataset.layout=J.layout,z.element.dataset.scrollBehavior=J.scrollBehavior,z}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function xq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function yq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var m4=wq;J6();c();o();var a4=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(q){return Z.setIndeterminate?.(q),this},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});t();var Tq={variant:"filled",labelPosition:"end"},c4=(J={})=>u(Tq,J,"checkbox"),i4=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),o4=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.innerHTML=`
9
+ </svg>`,l7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let Z=document.createElement("span");if(Z.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(Z),J.icon!=="none"){let q=document.createElement("span");q.className=`${J.prefix}-${J.componentName}-thumb-icon`,q.innerHTML=J.icon||R3,Z.appendChild(q)}return $.element.appendChild(Q),{...$,track:Q,thumb:Z}};var h$=(J)=>{let $=new Map;return{on(Q,Z){return J.addEventListener(Q,Z),$.set(Z,Q),this},off(Q,Z){return J.removeEventListener(Q,Z),$.delete(Z),this},destroy(){$.forEach((Q,Z)=>{J.removeEventListener(Q,Z)}),$.clear()},getHandlers(){return new Map($)}}};var AJ=(J)=>($)=>{let Q=h$(J||$.element),Z={addListeners(q){return Object.entries(q).forEach(([j,K])=>{Q.on(j,K)}),this},removeListeners(q){return Object.entries(q).forEach(([j,K])=>{Q.off(j,K)}),this},once(q,j){let K=(G)=>{j(G),Q.off(q,K)};return Q.on(q,K),this},on(q,j){return Q.on(q,j),this},off(q,j){return Q.off(q,j),this},destroy(){Q.destroy()}};if(k6($)){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),q.call($.lifecycle)}}return{...$,events:Z,on:Z.on.bind(Z),off:Z.off.bind(Z)}};var wJ=()=>{};var xJ=T(()=>{K7();w6()});var G7=(J,$,Q={})=>{let Z=null,q=0,{leading:j=!0,trailing:K=!0}=Q;return function(...G){let W=Date.now();if(!q&&!j)q=W;let z=$-(W-q);if(z<=0||z>$){if(Z)clearTimeout(Z),Z=null;q=W,J.apply(this,G)}else if(!Z&&K)Z=window.setTimeout(()=>{q=j?Date.now():0,Z=null,J.apply(this,G)},z)}},z7=(J,$,Q={})=>{let Z=null,q=null,j=null,K,G=null,W=0,{leading:z=!1,maxWait:Y}=Q,U=(B)=>{let k=B-(G||0),M=B-W;return!G||k>=$||k<0||Y!==void 0&&M>=Y},X=(B)=>{let k=q,M=j;return q=j=null,W=B,K=J.apply(M,k),K},_=(B)=>{if(Z=null,q)return X(B);return K},H=(B)=>{return W=B,Z=window.setTimeout(()=>{_(Date.now())},$),z?X(B):K};return function(...B){let k=Date.now(),M=U(k);if(q=B,j=this,G=k,M){if(Z===null)return H(k);if(Y!==void 0)Z=window.setTimeout(()=>{let V=Date.now();if(U(V))return _(V)},Math.min($,Y-(k-W)))}if(Z===null)Z=window.setTimeout(()=>{_(Date.now())},$);return K}},u$=(J)=>{let $=!1,Q;return function(...Z){if(!$)$=!0,Q=J.apply(this,Z);return Q}};var yJ=(J={})=>($)=>{let Q={},Z=(K,G,W,z={})=>{if(Q[K])q(K);let Y=G7(G,W,z);return $.element.addEventListener(K,Y),Q[K]={original:G,throttled:Y},j},q=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.throttled),delete Q[K];return j};if(k6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let W=Q[G];$.element.removeEventListener(G,W.throttled)}),K.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([K,G])=>{Z(K,G.handler,G.wait,G.options)});let j={...$,addThrottledEvent:Z,removeThrottledEvent:q};return j};var TJ=()=>{};function A3(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var IJ=(J={})=>($)=>{let Q={},Z=(K,G,W,z={})=>{if(Q[K])q(K);let Y=z7(G,W,z);return $.element.addEventListener(K,Y),Q[K]={original:G,debounced:Y},j},q=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.debounced),delete Q[K];return j};if(A3($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let W=Q[G];$.element.removeEventListener(G,W.debounced)}),K.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([K,G])=>{Z(K,G.handler,G.wait,G.options)});let j={...$,addDebouncedEvent:Z,removeDebouncedEvent:q};return j};var SJ=()=>{};var f$=()=>{};function bJ(J,$,Q,Z){return Math.sqrt(Math.pow(Q-J,2)+Math.pow(Z-$,2))}function vJ(J,$,Q,Z){let q=Math.atan2(Z-$,Q-J)*180/Math.PI;return q<0?q+360:q}function b6(J,$,Q){let Z=Date.now(),q=!1,j={type:J,originalEvent:$,target:Q.target||$.target,startTime:Q.startTime,endTime:Z,duration:Z-Q.startTime,defaultPrevented:q,preventDefault:()=>{if(q=!0,j.defaultPrevented=!0,$.cancelable)$.preventDefault()},stopPropagation:()=>{$.stopPropagation()}};return j}function CJ(){return"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0}function EJ(){return!!window.PointerEvent}function g$(J){if("touches"in J&&J.touches.length>0)return{clientX:J.touches[0].clientX,clientY:J.touches[0].clientY};return{clientX:J.clientX,clientY:J.clientY}}function d$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY;if(Math.sqrt(q*q+j*j)<Q.tapDistanceThreshold){let z=Date.now()-$.lastTapTime<300?$.tapCount+1:1;return{...b6("tap",Z,$),type:"tap",count:z,x:$.currentX,y:$.currentY}}return null}var l$=()=>{};function w3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}function p$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY,K=Math.sqrt(q*q+j*j),W=Date.now()-$.startTime,z=K/W;if(K>=Q.swipeThreshold&&W<=Q.swipeTimeThreshold){let Y=w3(q,j);return{...b6("swipe",Z,$),type:"swipe",direction:Y,deltaX:q,deltaY:j,distance:K,velocity:z,startX:$.startX,startY:$.startY,endX:$.currentX,endY:$.currentY}}return null}var s$=T(()=>{f$()});function m$(J,$){let{state:Q,options:Z,originalEvent:q}=J,j=window.setTimeout(()=>{if(Q.active){let K=Math.abs(Q.currentX-Q.startX),G=Math.abs(Q.currentY-Q.startY);if(K<Z.tapDistanceThreshold&&G<Z.tapDistanceThreshold){let W={...b6("longpress",q,Q),type:"longpress",x:Q.currentX,y:Q.currentY};$(W)}}},Z.longPressTime);return()=>{clearTimeout(j)}}function hJ(J){let{state:$,options:Q}=J,Z=Math.abs($.currentX-$.startX),q=Math.abs($.currentY-$.startY);return Z>Q.tapDistanceThreshold||q>Q.tapDistanceThreshold}var a$=()=>{};function c$(J){let{state:$,originalEvent:Q}=J,Z=$.currentX-$.startX,q=$.currentY-$.startY,j=$.currentX-$.lastX,K=$.currentY-$.lastY;if(Math.sqrt(j*j+K*K)>0)return{...b6("pan",Q,$),type:"pan",deltaX:Z,deltaY:q,startX:$.startX,startY:$.startY,currentX:$.currentX,currentY:$.currentY};return null}var i$=()=>{};function o$(J,$,Q){let{state:Z,originalEvent:q}=J,j=bJ($.clientX,$.clientY,Q.clientX,Q.clientY),K=10;if(Math.abs(j-Z.startDistance)>10){let G=j/Z.startDistance,W=($.clientX+Q.clientX)/2,z=($.clientY+Q.clientY)/2;return{...b6("pinch",q,Z),type:"pinch",scale:G,centerX:W,centerY:z}}return null}var t$=()=>{};function n$(J,$,Q){let{state:Z,originalEvent:q}=J,j=vJ($.clientX,$.clientY,Q.clientX,Q.clientY),K=10,G=j-Z.startAngle;if(Math.abs(G)>10){let W=($.clientX+Q.clientX)/2,z=($.clientY+Q.clientY)/2;return{...b6("rotate",q,Z),type:"rotate",rotation:G,centerX:W,centerY:z}}return null}var e$=()=>{};var r7=(J,$={})=>{let Q={swipeThreshold:30,swipeTimeThreshold:300,longPressTime:500,tapDistanceThreshold:10,preventDefault:!0,stopPropagation:!1,...$},Z=new Map,q={active:!1,startTime:0,startX:0,startY:0,lastX:0,lastY:0,currentX:0,currentY:0,touchCount:0,longPressTimer:null,startDistance:0,startAngle:0,lastTapTime:0,tapCount:0,target:null},j=CJ(),K=EJ(),G={tap:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,longpress:!0,pan:!0,pinch:j||K,rotate:j||K},W=(M)=>{let V=Z.get(M.type);if(!V)return;if(V.forEach((F)=>{try{F(M)}catch(N){console.error(`Error in gesture handler for ${M.type}:`,N)}}),M.type==="swipe"&&"direction"in M){let F={...M,type:`swipe${M.direction}`};W(F)}if(Q.preventDefault&&!M.defaultPrevented)M.preventDefault();if(Q.stopPropagation)M.stopPropagation()},z=null,Y=(M)=>{let V=g$(M),F="touches"in M?M.touches.length:1;if(q.active=!0,q.startTime=Date.now(),q.startX=q.lastX=q.currentX=V.clientX,q.startY=q.lastY=q.currentY=V.clientY,q.touchCount=F,q.target=M.target,F===2&&"touches"in M){let O=M.touches[0],P=M.touches[1];if(q.startDistance=Math.sqrt(Math.pow(P.clientX-O.clientX,2)+Math.pow(P.clientY-O.clientY,2)),q.startAngle=Math.atan2(P.clientY-O.clientY,P.clientX-O.clientX)*180/Math.PI,q.startAngle<0)q.startAngle+=360}let N={state:q,options:Q,originalEvent:M};if(z)z();z=m$(N,(O)=>{W(O)})},U=(M)=>{if(!q.active)return;let V=g$(M),F="touches"in M?M.touches.length:1;q.lastX=q.currentX,q.lastY=q.currentY,q.currentX=V.clientX,q.currentY=V.clientY;let N={state:q,options:Q,originalEvent:M};if(hJ(N)&&z)z(),z=null;let O=c$(N);if(O)W(O);if(F===2&&"touches"in M){let P=M.touches[0],L=M.touches[1],D=o$(N,P,L);if(D)W(D);let R=n$(N,P,L);if(R)W(R)}},X=(M)=>{if(!q.active)return;if(z)z(),z=null;let V={state:q,options:Q,originalEvent:M},F=d$(V);if(F)q.lastTapTime=Date.now(),q.tapCount=F.count,W(F);else{let N=p$(V);if(N)W(N)}q.active=!1},_=()=>{if(z)z(),z=null;q.active=!1},H={},B=()=>{if(K)H={pointerdown:Y,pointermove:U,pointerup:X,pointercancel:_};else if(j)H={touchstart:Y,touchmove:U,touchend:X,touchcancel:_};else H={mousedown:Y,mousemove:U,mouseup:X,mouseleave:_};Object.entries(H).forEach(([M,V])=>{J.addEventListener(M,V,{passive:!Q.preventDefault})})},k=()=>{Object.entries(H).forEach(([M,V])=>{J.removeEventListener(M,V)}),H={}};return B(),{on(M,V){if(!Z.has(M))Z.set(M,new Set);return Z.get(M).add(V),this},off(M,V){let F=Z.get(M);if(F){if(F.delete(V),F.size===0)Z.delete(M)}return this},isSupported(M){return M in G&&G[M]},enable(){return B(),this},disable(){return k(),this},destroy(){if(k(),z)z(),z=null;Z.clear()}}};var uJ=T(()=>{f$();l$();s$();a$();i$();t$();e$()});var p7=T(()=>{uJ();l$();s$();a$();t$();e$();i$()});var fJ=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add gesture recognition: missing element"),$;let{enableGestures:Q=!0,gestureHandlers:Z={},...q}=J,j=r7($.element,q);if(Object.entries(Z).forEach(([K,G])=>{j.on(K,G)}),!Q)j.disable();if(N6($)){let K=(G)=>{$.emit(G.type,G)};["tap","swipe","swipeleft","swiperight","swipeup","swipedown","longpress","pinch","rotate","pan"].forEach((G)=>{j.on(G,K)})}if(k6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{j.destroy(),K.call($.lifecycle)}}return{...$,gestures:j,onGesture(K,G){return j.on(K,G),this},offGesture(K,G){return j.off(K,G),this},isGestureSupported(K){return j.isSupported(K)},enableGestures(){return j.enable(),this},disableGestures(){return j.disable(),this}}};var gJ=T(()=>{p7()});function $8(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var G6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,Z={enable(){if($.element.classList.remove(Q),$8($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let q=$.element;if("disabled"in q)q.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),$8($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let q=$.element;if("disabled"in q)q.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if($8($))return $.input.disabled;let q=$.element;return"disabled"in q&&q.disabled}};if(J.disabled)requestAnimationFrame(()=>{Z.disable()});return{...$,disabled:Z}};function y3(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function T3(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function I3(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var C=()=>(J)=>{let $=!1,Q=f6();return{...J,lifecycle:{onMount:(q)=>Q.on("mount",q),onUnmount:(q)=>Q.on("unmount",q),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(y3(J))J.events.destroy();if(T3(J)){let q=J.text.getElement();if(q)q.remove()}if(I3(J)){let q=J.icon.getElement();if(q)q.remove()}if(J.element)J.element.remove()}}}};var dJ=()=>{};var o=T(()=>{kJ();VJ();DJ();RJ();wJ();xJ();TJ();SJ();gJ();dJ()});var S3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add tap gesture recognition: missing element"),$;let{tapDistanceThreshold:Q=10,preventDefault:Z=!0,onTap:q,enabled:j=!0}=J,K=new Set;if(q)K.add(q);let G=0,W=0,z=!1,Y=0,U=0,X=0,_=j,H=(O,P,L)=>{let D=Date.now();if(D-U<300)X++;else X=1;U=D;let w={type:"tap",originalEvent:O,target:O.target,startTime:Y,endTime:D,duration:D-Y,defaultPrevented:!1,preventDefault:()=>{if(w.defaultPrevented=!0,O.cancelable)O.preventDefault()},stopPropagation:()=>{O.stopPropagation()},count:X,x:P,y:L};if(K.forEach((A)=>{try{A(w)}catch(x){console.error("Error in tap handler:",x)}}),N6($))$.emit("tap",w);if(Z&&!w.defaultPrevented)w.preventDefault()},B=(O)=>{if(!_)return;let P="touches"in O?O.touches[0]:O;G=P.clientX,W=P.clientY,Y=Date.now(),z=!0},k=(O)=>{if(!z||!_)return;let P="changedTouches"in O&&O.changedTouches.length>0?O.changedTouches[0]:O,L=P.clientX,D=P.clientY,R=L-G,w=D-W;if(Math.sqrt(R*R+w*w)<Q)H(O,L,D);z=!1},M=()=>{z=!1},V={mousedown:B,mouseup:k,mouseleave:M,touchstart:B,touchend:k,touchcancel:M},F=()=>{Object.entries(V).forEach(([O,P])=>{$.element.addEventListener(O,P,{passive:!Z})})},N=()=>{Object.entries(V).forEach(([O,P])=>{$.element.removeEventListener(O,P)})};if(_)F();if(k6($)){let O=$.lifecycle.destroy;$.lifecycle.destroy=()=>{N(),K.clear(),O.call($.lifecycle)}}return{...$,onTap(O){return K.add(O),this},offTap(O){return K.delete(O),this},enableTap(){if(!_)_=!0,F();return this},disableTap(){if(_)_=!1,N();return this}}};var lJ=()=>{};function b3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}var v3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add swipe gesture recognition: missing element"),$;let{swipeThreshold:Q=30,swipeTimeThreshold:Z=300,preventDefault:q=!0,onSwipe:j,onSwipeLeft:K,onSwipeRight:G,onSwipeUp:W,onSwipeDown:z,enabled:Y=!0}=J,U={swipe:new Set,swipeleft:new Set,swiperight:new Set,swipeup:new Set,swipedown:new Set};if(j)U.swipe.add(j);if(K)U.swipeleft.add(K);if(G)U.swiperight.add(G);if(W)U.swipeup.add(W);if(z)U.swipedown.add(z);let X=0,_=0,H=!1,B=0,k=Y,M=(D,R,w)=>{let A=R-X,x=w-_,I=Math.sqrt(A*A+x*x),r=Date.now(),a=r-B,M6=I/a,i=b3(A,x),y={type:"swipe",originalEvent:D,target:D.target,startTime:B,endTime:r,duration:a,defaultPrevented:!1,preventDefault:()=>{if(y.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},direction:i,deltaX:A,deltaY:x,distance:I,velocity:M6,startX:X,startY:_,endX:R,endY:w};U.swipe.forEach((m)=>{try{m(y)}catch(s){console.error("Error in swipe handler:",s)}});let l=`swipe${i}`;if(U[l].forEach((m)=>{try{m({...y,type:l})}catch(s){console.error(`Error in ${l} handler:`,s)}}),N6($))$.emit("swipe",y),$.emit(l,y);if(q&&!y.defaultPrevented)y.preventDefault()},V=(D)=>{if(!k)return;let R="touches"in D?D.touches[0]:D;X=R.clientX,_=R.clientY,B=Date.now(),H=!0},F=(D)=>{if(!H||!k)return;let R="changedTouches"in D&&D.changedTouches.length>0?D.changedTouches[0]:D,w=R.clientX,A=R.clientY,x=w-X,I=A-_,r=Math.sqrt(x*x+I*I),a=Date.now()-B;if(r>=Q&&a<=Z)M(D,w,A);H=!1},N=()=>{H=!1},O={mousedown:V,mouseup:F,mouseleave:N,touchstart:V,touchend:F,touchcancel:N},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(k)P();if(k6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{L(),Object.values(U).forEach((R)=>R.clear()),D.call($.lifecycle)}}return{...$,onSwipe(D){return U.swipe.add(D),this},onSwipeLeft(D){return U.swipeleft.add(D),this},onSwipeRight(D){return U.swiperight.add(D),this},onSwipeUp(D){return U.swipeup.add(D),this},onSwipeDown(D){return U.swipedown.add(D),this},offSwipe(D){return U.swipe.delete(D),this},offSwipeLeft(D){return U.swipeleft.delete(D),this},offSwipeRight(D){return U.swiperight.delete(D),this},offSwipeUp(D){return U.swipeup.delete(D),this},offSwipeDown(D){return U.swipedown.delete(D),this},enableSwipe(){if(!k)k=!0,P();return this},disableSwipe(){if(k)k=!1,L();return this}}};var rJ=T(()=>{p7()});var C3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add long press gesture recognition: missing element"),$;let{longPressTime:Q=500,moveThreshold:Z=10,preventDefault:q=!0,onLongPress:j,enabled:K=!0}=J,G=new Set;if(j)G.add(j);let W=0,z=0,Y=0,U=0,X=!1,_=0,H=null,B=K,k=(D)=>{let R={type:"longpress",originalEvent:D,target:D.target,startTime:_,endTime:Date.now(),duration:Date.now()-_,defaultPrevented:!1,preventDefault:()=>{if(R.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},x:Y,y:U};if(G.forEach((w)=>{try{w(R)}catch(A){console.error("Error in long press handler:",A)}}),N6($))$.emit("longpress",R);if(q&&!R.defaultPrevented)R.preventDefault()},M=(D)=>{if(!B)return;let R="touches"in D?D.touches[0]:D;if(W=Y=R.clientX,z=U=R.clientY,_=Date.now(),X=!0,H!==null)window.clearTimeout(H);H=window.setTimeout(()=>{if(X){let w=Y-W,A=U-z;if(Math.sqrt(w*w+A*A)<Z)k(D)}H=null},Q)},V=(D)=>{if(!X||!B)return;let R="touches"in D?D.touches[0]:D;Y=R.clientX,U=R.clientY;let w=Y-W,A=U-z;if(Math.sqrt(w*w+A*A)>Z){if(H!==null)window.clearTimeout(H),H=null}},F=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},N=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},O={mousedown:M,mousemove:V,mouseup:F,mouseleave:N,touchstart:M,touchmove:V,touchend:F,touchcancel:N},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(B)P();if(k6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(L(),H!==null)window.clearTimeout(H),H=null;G.clear(),D.call($.lifecycle)}}return{...$,onLongPress(D){return G.add(D),this},offLongPress(D){return G.delete(D),this},enableLongPress(){if(!B)B=!0,P();return this},disableLongPress(){if(B){if(B=!1,L(),H!==null)window.clearTimeout(H),H=null}return this}}};var pJ=()=>{};var E3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add pan gesture recognition: missing element"),$;let{preventDefault:Q=!0,onPanStart:Z,onPan:q,onPanEnd:j,enabled:K=!0}=J,G={panstart:new Set,pan:new Set,panend:new Set};if(Z)G.panstart.add(Z);if(q)G.pan.add(q);if(j)G.panend.add(j);let W=0,z=0,Y=0,U=0,X=0,_=0,H=!1,B=!1,k=0,M=K,V=(A,x)=>{let I={type:x,originalEvent:A,target:A.target,startTime:k,endTime:Date.now(),duration:Date.now()-k,defaultPrevented:!1,preventDefault:()=>{if(I.defaultPrevented=!0,A.cancelable)A.preventDefault()},stopPropagation:()=>{A.stopPropagation()},deltaX:X-W,deltaY:_-z,startX:W,startY:z,currentX:X,currentY:_};return I},F=(A,x)=>{let I=V(A,x);if(G[x].forEach((r)=>{try{r(I)}catch(a){console.error(`Error in ${x} handler:`,a)}}),N6($))$.emit(x,I);if(Q&&!I.defaultPrevented)I.preventDefault()},N=(A)=>{if(!M)return;let x="touches"in A?A.touches[0]:A;W=Y=X=x.clientX,z=U=_=x.clientY,k=Date.now(),H=!0,B=!1},O=(A)=>{if(!H||!M)return;let x="touches"in A?A.touches[0]:A;Y=X,U=_,X=x.clientX,_=x.clientY;let I=X-Y,r=_-U;if(Math.sqrt(I*I+r*r)>0){if(!B)B=!0,F(A,"panstart");F(A,"pan")}},P=(A)=>{if(!H||!M)return;if(B)F(A,"panend");H=!1,B=!1},L=(A)=>{if(!H||!M)return;if(B)F(A,"panend");H=!1,B=!1},D={mousedown:N,mousemove:O,mouseup:P,mouseleave:L,touchstart:N,touchmove:O,touchend:P,touchcancel:L},R=()=>{Object.entries(D).forEach(([A,x])=>{$.element.addEventListener(A,x,{passive:!Q})})},w=()=>{Object.entries(D).forEach(([A,x])=>{$.element.removeEventListener(A,x)})};if(M)R();if(k6($)){let A=$.lifecycle.destroy;$.lifecycle.destroy=()=>{w(),Object.values(G).forEach((x)=>x.clear()),A.call($.lifecycle)}}return{...$,onPanStart(A){return G.panstart.add(A),this},onPan(A){return G.pan.add(A),this},onPanEnd(A){return G.panend.add(A),this},offPanStart(A){return G.panstart.delete(A),this},offPan(A){return G.pan.delete(A),this},offPanEnd(A){return G.panend.delete(A),this},enablePan(){if(!M)M=!0,R();return this},disablePan(){if(M)M=!1,w();return this}}};var sJ=()=>{};var J6=T(()=>{c();o();lJ();rJ();pJ();sJ()});function mJ(J,$){W7[J]=$}function s7(J){return W7[J]||{}}function aJ(J){Object.assign(W7,J)}function cJ(){Object.keys(W7).forEach((J)=>{delete W7[J]})}var W7;var J8=T(()=>{W7={}});var u=(J,$={},Q)=>{let Z=s7(Q),q=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,K={...J,...Z,...$,componentName:Q,prefix:f,className:q!==void 0?q:j};if("class"in K&&K.className!==void 0)delete K.class;return K},p=(J,$)=>{let Q=J.className||J.class,Z=$.className,q=[...Array.isArray(Q)?Q:[Q],...Array.isArray(Z)?Z:[Z]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:q.length>0?q:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var t=T(()=>{w6();J8()});var m7,a7,c7,g9=4;var Q8=T(()=>{m7={SMALL:"small",LARGE:"large"},a7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},c7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var h3,iJ=(J={})=>u(h3,J,"badge"),oJ=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":d9(J.label||"",J.max);return p(J,{tag:"span",attributes:$,className:J.class,text:Q})},tJ=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),d9=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),Z=Number(J);if($!==void 0&&!isNaN(Z)&&Z>$)Q=`${$}+`;if(Q.length>g9){let q=Number(J);if(!isNaN(q))if(q>=1000)Q="999+";else Q=Q.substring(0,g9-1)+"+";else Q=Q.substring(0,g9)}return Q};var i7=T(()=>{t();Q8();h3={variant:m7.LARGE,color:a7.ERROR,position:c7.TOP_RIGHT,label:"",visible:!0}});var nJ="small",u3="large",f3="error",g3="top-right",eJ=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},$0=(J)=>($)=>{let Q=J.variant||u3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===nJ)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let Z=d9(J.label,J.max);$.element.textContent=Z}return $},J0=(J)=>($)=>{let Q=J.color||f3;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},Q0=(J)=>($)=>{let Q=J.position||g3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},Z0=(J)=>($)=>{if(J.max===void 0||J.variant===nJ)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=d9(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},q0=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let Z=J.target.parentNode;if(Z)Z.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var j0=T(()=>{i7()});var K0="small",d3,l3,r3,G0=({visibility:J,lifecycle:$})=>(Q)=>{let Z={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(q){if(Q.config.label=q,Q.config.variant===K0)return Q.element.textContent="",Z;let j=d9(q,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof q==="number"&&Q.config.max!==void 0&&q>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")Z.hide();else Z.show();return Z},getLabel(){return Q.element.textContent||""},setContent(q){return Z.setLabel(q)},getContent(){return Z.getLabel()},show(){return J.show(),Z},hide(){return J.hide(),Z},toggle(q){return J.toggle(q),Z},isVisible(){return J.isVisible()},setMax(q){if(Q.config.max=q,Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setColor(q){return d3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},setVariant(q){if(l3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Q.config.variant=q,q===K0)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setPosition(q){return r3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},attachTo(q){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let K=q.parentNode;if(K)K.replaceChild(j,q),j.appendChild(q),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,Z.wrapper=j;return Z},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,Z.wrapper=void 0;return Z},destroy(){if($.destroy(),Q.wrapper){let q=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&q)j.replaceChild(q,Q.wrapper)}},addClass:(...q)=>{return Q.addClass(...q),Z},removeClass:(...q)=>{return Q.removeClass(...q),Z},on:(q,j)=>{return Q.on(q,j),Z},off:(q,j)=>{return Q.off(q,j),Z}};return Z};var z0=T(()=>{i7();d3=["error","primary","secondary","tertiary","success","warning","info"],l3=["small","large"],r3=["top-right","top-left","bottom-right","bottom-left"]});var p3=(J={})=>{let $=iJ(J);try{return b(S,d(),h(oJ($)),$0($),J0($),Q0($),Z0($),eJ(),q0($),C(),(Z)=>G0(tJ(Z))(Z))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},j7;var W0=T(()=>{J6();c();o();j0();z0();i7();j7=p3});var K7=T(()=>{W0()});var a3=(J)=>{let $=new Map,Q=(j,K)=>`${j}_${K.toString()}`,Z=(j,K)=>(G)=>{try{j(G)}catch(W){console.error(`Error in ${K} handler:`,W)}},q=(j,K)=>{try{J.removeEventListener(j,K)}catch(G){console.warn(`Failed to remove ${j} listener:`,G)}};return{on(j,K,G={}){let W=Z(K,j),z=Q(j,K);return $.set(z,{original:K,enhanced:W,event:j,options:G}),J.addEventListener(j,W,G),this},off(j,K){let G=Q(j,K),W=$.get(G);if(W)q(j,W.enhanced),$.delete(G);return this},pause(){return $.forEach(({enhanced:j,event:K})=>{q(K,j)}),this},resume(){return $.forEach(({enhanced:j,event:K,options:G})=>{J.addEventListener(K,j,G)}),this},destroy(){$.forEach(({enhanced:j,event:K})=>{q(K,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,K){let G=Q(j,K);return $.has(G)}}};var A9=T(()=>{A6();R9()});var B9,v6,Y7,g6,W6,s6,d6,z6;var m6=T(()=>{B9={LINEAR:"linear",CIRCULAR:"circular"},v6={FLAT:"flat",WAVY:"wavy"},Y7={CHANGE:"change",COMPLETE:"complete"},g6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},W6={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},s6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},d6={THIN:4,THICK:8},z6={LINEAR:{AMPLITUDE:3,SPEED:0.88,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1.1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var a6=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},X0=(J,$)=>{let q=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let K=0,G=q.length;K<G;++K){let W=q[K];if(W in j)j=j[W];else return}return j};var w9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,Z=J;while(Z&&Q<$){let K=window.getComputedStyle(Z).backgroundColor;if(K.startsWith("var(")){let G=K.match(/var\((--[\w-]+)\)/);if(G){let W=G[1];K=window.getComputedStyle(document.documentElement).getPropertyValue(W).trim()||"transparent"}}if(K&&K!=="transparent"&&K!=="rgba(0, 0, 0, 0)"&&K!=="rgba(0,0,0,0)")return{color:K,element:Z};Z=Z.parentElement,Q++}let q=window.getComputedStyle(document.body).backgroundColor;if(q!=="transparent"&&q!=="rgba(0, 0, 0, 0)")return{color:q,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var j8=()=>{};function B6(J,$){let Q=`--${f}-${J}`;if($?.onThemeChange)i3($.onThemeChange);let q=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!q)q=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!q&&$?.fallback)return $.fallback;if(!q)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(q))return`rgba(${q}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(q)){let j=q.replace("#",""),K,G,W;if(j.length===3)K=parseInt(j[0]+j[0],16),G=parseInt(j[1]+j[1],16),W=parseInt(j[2]+j[2],16);else K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),W=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${W}, ${$.alpha})`}return q}var o7,x9=null,c3=()=>{if(x9)return;x9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){o7.forEach((Q)=>Q());break}}),x9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},i3=(J)=>{if(!x9)c3();return o7.add(J),()=>{o7.delete(J)}};var B0=T(()=>{w6();o7=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(x9)x9.disconnect(),x9=null;o7.clear()})});var U7=(J,$)=>{let Z=document.createElement("canvas").getContext("2d");if(!Z)return`rgba(0, 0, 0, ${$})`;Z.fillStyle=J;let q=Z.fillStyle;if(q.startsWith("#")){let j=q.substring(1),K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),W=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${W}, ${$})`}if(q.startsWith("rgb")){let j=q.match(/\d+/g);if(j){let[K,G,W]=j;return`rgba(${K}, ${G}, ${W}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var o3=(J,$)=>(Q,Z)=>J(Q,Z)?$(Q,Z):Q,t3=(...J)=>J.filter(Boolean).join(" ");var $9=T(()=>{q7();j8();B0()});var t7=(J,$,Q)=>{let Z=null,q=()=>{if(Z)clearTimeout(Z);Z=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((K)=>{for(let G of K){let{width:W}=G.contentRect,z=parseFloat($.style.width||"0");if(Math.abs(W-z)>2)q()}});return j.observe(J),()=>{if(Z)clearTimeout(Z);j.disconnect()}}else return window.addEventListener("resize",q),()=>{if(Z)clearTimeout(Z);window.removeEventListener("resize",q)}};var F0=(J,$,Q,Z,q,j,K,G,W)=>{let z=Math.max(100,Math.abs(j-q)*50),Y=(j-q)/z,U=z6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let X=0;X<=z;X++){let _=q+Y*X,H=_*G+W*U,B=Math.sin(H),M=Math.sign(B)*Math.pow(Math.abs(B),z6.CIRCULAR.POWER)*K,V=Z+M,F=$+V*Math.cos(_),N=Q+V*Math.sin(_);if(X===0)J.moveTo(F,N);else J.lineTo(F,N)}J.stroke()},H0=(J,$,Q,Z,q,j=0,K="flat")=>{let{ctx:G,width:W,height:z}=J,Y=X7($.thickness),U=K==="wavy",X=Math.min(W,z),_=q?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,H=X/2-Y/2,B=H*(_/100),k=U?y9(Y,B):0,M=H-k,V=W/2,F=z/2;G.clearRect(0,0,W,z);let O=(s6.CIRCULAR.GAP+2*Y)/M,P=-Math.PI/2,L=2*Math.PI-O;G.lineWidth=Y,G.lineCap="round",G.lineJoin="round";let D=q?z6.CIRCULAR.INDETERMINATE_FREQUENCY:z6.CIRCULAR.FREQUENCY;if(q){let y=j%1333/1333,l=(O9)=>{let U6=O9<=0.5?O9*2:2-O9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},m=()=>{let O9=j/1568*2*Math.PI,U6=Math.floor(j/1333),h6=j%1333/1333,n6=0;if(h6>0.5){let Z7=(h6-0.5)*2;n6=0.722*(Z7<0.5?2*Z7*Z7:1-Math.pow(-2*Z7+2,2)/2)}return O9+(U6*0.722+n6)*2*Math.PI},s=l(y)*2*Math.PI,K9=m(),_6=P+K9,X6=_6+s;G.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath();let C9=O/2;if(G.arc(V,F,M,X6+C9,_6-C9+2*Math.PI),G.stroke(),G.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"}),U)F0(G,V,F,M,_6,X6,k,D,j);else G.beginPath(),G.arc(V,F,M,_6,X6),G.stroke();return}let R=Q/Z,A=Math.max(R,0.001),x=0.95,I=L;if(R>=x){let i=(R-x)/(1-x),y=i*i;I=L+O*y}if(R<0.99){let y=P+I*A+O/2,l=P+L+O/2;if(y<l)G.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath(),G.arc(V,F,M,y,l),G.stroke()}G.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"});let r=k;if(U){let i=z6.CIRCULAR.START_TRANSITION_END,y=z6.CIRCULAR.END_TRANSITION_START;if(R===0&&i>0)r=0;else if(R>0&&R<=i){let l=R/i;r=k*Math.pow(l,2)}else if(R>=y){let l=(R-y)/(1-y),m=1-Math.pow(1-l,2);r=k*(1-m)}if(R>=1)r=0}let a=P,M6=P+I*A;if(U)F0(G,V,F,M,a,M6,r,D,j);else G.beginPath(),G.arc(V,F,M,a,M6),G.stroke()};var M0=T(()=>{m6();$9();n7()});var B7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},F9=(J,$,Q,Z,q,j,K)=>{if(J.beginPath(),!q||K.amplitude===0)J.moveTo($,Z),J.lineTo(Q,Z);else{let G=$;for(let W=$;W<=Q;W+=1){let z=W*K.frequency+j*K.speed,Y=Math.sin(z),U=Math.sign(Y)*Math.pow(Math.abs(Y),z6.LINEAR.POWER),X=Z+U*K.amplitude;if(W===$)J.moveTo(W,X);else J.lineTo(W,X);G=W}if(G<Q){let W=Q*K.frequency+j*K.speed,z=Math.sin(W),Y=Math.sign(z)*Math.pow(Math.abs(z),z6.LINEAR.POWER),U=Z+Y*K.amplitude;J.lineTo(Q,U)}}J.stroke()},k0=(J,$)=>{let[Q,Z,q]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=Z)return 0.661479;else if(q&&J<=q)return 0.661479;return q?0.661479-0.5814790000000001*((J-q)/(1-q)):0.08},N0=(J,$)=>{for(let q=0;q<$.length-1;q++){let[j,K]=$[q],[G,W]=$[q+1];if(J<=G){let z=(J-j)/(G-j);return K+(W-K)*z}}let[Q,Z]=$[$.length-1];return Z+(220-Z)*((J-Q)/(1-Q))},V0=(J,$,Q,Z,q,j,K=0,G=!0,W="flat")=>{let{ctx:z,width:Y,height:U}=J,X=X7($.thickness),_=U/2,H=W==="wavy",B=X/2,k=Y-B*2,M=s6.LINEAR.GAP,V=Q/Z,F=0.001,N=Math.max(V,0.001),O=B+k*N;z.clearRect(0,0,Y,U);let P=B6("sys-color-primary",{fallback:"#6750A4"}),L=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let M6=K%2000/2000,i=M*2+X/2,y=k0(M6,[0.3665,0.6915]),l=N0(M6,[[0,-120],[0.2,0],[0.5915,83.6714]]),m=M6<=0.5?0:k0(M6,[0.8335,null,0.8335]),s=M6<=0.5?-54.8889:N0(M6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),_6=[{scale:y,translate:l,start:Math.max(B,B+k*l/100),end:Math.min(Y-B,B+k*l/100+k*y)},{scale:m,translate:s,start:Math.max(B,B+k*s/100),end:Math.min(Y-B,B+k*s/100+k*m)}].filter((U6)=>U6.end>U6.start).sort((U6,h6)=>U6.start-h6.start),X6=[];for(let U6=0;U6<_6.length;U6++){let h6=_6[U6];if(X6.length===0)X6.push({...h6});else{let n6=X6[X6.length-1];if(h6.start<=n6.end+i)n6.end=Math.max(n6.end,h6.end);else X6.push({...h6})}}B7(z,X,L);let C9=X;if(X6.length===0)F9(z,B,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=X6[0].start;if(U6-B>i+C9)F9(z,B,U6-i,_,!1,0,{amplitude:0,frequency:0,speed:0});if(X6.length===2){if(X6[1].start-X6[0].end>2*i+C9)F9(z,X6[0].end+i,X6[1].start-i,_,!1,0,{amplitude:0,frequency:0,speed:0})}let n6=X6[X6.length-1].end;if(Y-B-n6>i+C9)F9(z,n6+i,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0})}B7(z,X,P);let O9={amplitude:H?y9(X,z6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:z6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};X6.forEach((U6)=>{F9(z,U6.start,U6.end,_,H,K,O9)});return}let D=z6.LINEAR.START_TRANSITION_END,R=z6.LINEAR.END_TRANSITION_START,w=(M+X)/2;B7(z,X,L);let A=V===0?B+X+M:Math.min(O+w,Y-B);F9(z,A,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0}),B7(z,X,P);let x=V>=1?Y-B:Math.max(B,O-w),I;if(V===0)I=B+(H?0.1:0);else{let a=X/2;I=Math.max(B+a,x)}let r=H?y9(X,z6.LINEAR.AMPLITUDE):0;if(H){if(V===0&&D>0)r=0;else if(N<=D)r*=Math.pow(N/D,2);else if(N>=R)r*=Math.pow((1-N)/(1-R),2)}if(F9(z,B,I,_,H,K,{amplitude:r,frequency:z6.LINEAR.FREQUENCY*2*Math.PI/100,speed:z6.LINEAR.SPEED*2*Math.PI/1000}),q>0&&q>Q){B7(z,X,B6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let a=B+k*(q/Z);F9(z,O,a,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(V<1&&G){let a=Math.min(X*0.5,2);z.beginPath(),z.arc(Y-B,_,a,0,2*Math.PI),z.fillStyle=P,z.fill()}};var _0=T(()=>{m6();$9();n7()});var X7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?d6.THICK:d6.THIN},y9=(J,$,Q)=>{let q=1+0.3*(4-J)/(J+4),j=$*q;return Q?Math.min(j,Q):j},K8=(J,$,Q,Z)=>{let q=window.devicePixelRatio||1,j=X7(Z?.thickness),{ctx:K}=$;if(Q){let G=Math.max(24,Math.min(Z?.size??s6.CIRCULAR.SIZE,240)),W=0;if(Z?.shape==="wavy"){let Y=G/2-j/2,U=Z?.indeterminate?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,X=Y*(U/100);W=y9(j,X)}let z=G+W*2;J.style.width=J.style.height=`${z}px`,J.width=J.height=Math.round(z*q),$.width=$.height=z}else{let G=J.parentElement;if(!G)return;let W=Math.max(G.getBoundingClientRect().width||G.offsetWidth,200),z=0;if(Z?.shape==="wavy"){let U=z6.LINEAR.AMPLITUDE,X=y9(j,U);z=Math.ceil(X*2)}let Y=j+z;J.style.width=`${W}px`,J.style.height=`${Y}px`,J.width=Math.round(W*q),J.height=Math.round(Y*q),$.width=W,$.height=Y}K.setTransform(1,0,0,1,0,0),K.scale(q,q)},L0=(J,$,Q)=>{let Z={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return K8(J,Z,$,Q),Z},D0=(J)=>($)=>{let Z=J.variant===B9.CIRCULAR,q=document.createElement("canvas");q.className=`${$.getClass(W6.CONTAINER)}-canvas`,q.style.maxWidth="100%",q.style.maxHeight="100%",q.style.boxSizing="border-box",$.element.appendChild(q);let j=null,K=null,G=null,W=J.thickness,z=J.shape,Y=J.size??s6.CIRCULAR.SIZE,U=J.value??0,X=U,_=0,H=()=>{try{return j=L0(q,Z,{...J,thickness:W,shape:z,size:Y}),$.ctx=j.ctx,!0}catch(D){return console.warn("Canvas initialization failed:",D),!1}};if(!H())requestAnimationFrame(()=>{if(!H())setTimeout(H,100)});$.canvas=q,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=z;let B=(D=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,w=(A)=>{if(!$.state?.indeterminate){k();return}if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.animationId=requestAnimationFrame(w)};$.animationId=requestAnimationFrame(w)},k=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},M=(D=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,w=(A)=>{if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.wavyAnimationId=requestAnimationFrame(w)};$.wavyAnimationId=requestAnimationFrame(w)},V=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},F=(D=0)=>{if(!j)return;let R=$.state,w=R?.value??J.value??0,A=R?.max??J.max??100,x=R?.buffer??J.buffer??0,I=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:W,shape:z,size:Y};K8(q,j,Z,r);let a=I||!R?w:U;if(Z)H0(j,r,a,A,I,D,z);else V0(j,r,a,A,x,I,D,!0,z)},N=()=>{if(!j)return;try{let D=L0(q,Z,{...J,thickness:W,shape:z,size:Y});$.ctx=D.ctx,Object.assign(j,D),F()}catch(D){console.warn("Canvas resize failed:",D)}};K=t7($.element,q,()=>{if($.element.offsetWidth>0||Z)N()});let O=B6("sys-color-primary",{onThemeChange:F});G=typeof O==="function"?O:null;let P=()=>{if(!j){requestAnimationFrame(P);return}if(F(),$.state?.indeterminate)if(z==="wavy"||!Z)M();else B();else if(z==="wavy")M()};requestAnimationFrame(P);let L=(D)=>{if(!j)return;let R={...J,thickness:W,shape:z,size:Y,...D};K8(q,j,Z,R),F()};if($.setThickness=(D)=>{W=D,L({thickness:D})},$.setSize=(D)=>{if(!Z)return;Y=Math.max(24,Math.min(D,240)),L({size:Y})},$.getSize=()=>Z?Y:void 0,$.setShape=(D)=>{if(z===D)return;if(z=D,$.currentShape=z,L({shape:D}),$.state?.indeterminate){let R=$.animationTime||0;if(V(),k(),D==="wavy"||!Z)M(R);else B(R)}else if(D==="wavy"){if(!$.wavyAnimationId)M()}else V();F($.animationTime||0)},$.setValue=(D,R=!0)=>{if(X=Math.max(0,Math.min($.state.max,D)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(U=X,F(),z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)M();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}));return}let w=U,A=performance.now(),x=A-_,I=300;if(x<300&&_>0)I=Math.max(100,x*0.9);_=A;let r=(a)=>{let M6=a-A,i=Math.min(M6/I,1),y=i<0.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;if(U=w+(X-w)*y,!$.wavyAnimationId||z!=="wavy")F(a);if(i<1)$.valueAnimationId=requestAnimationFrame(r);else{if(U=X,$.valueAnimationId=null,z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)M();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(D)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=D,D){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(U=$.state.value,z==="wavy"||!Z)M();else B()}else{if(U=$.state.value,k(),z==="wavy"){if(!$.wavyAnimationId)M()}else V();F()}},$.hide=()=>{$.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.opacity="0";let D=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",D)};return $.element.addEventListener("transitionend",D),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(z==="wavy"||!Z)M();else B();else if(z==="wavy")M();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(K)K();if(G)G();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),D()}}return Object.assign($,{startWavyAnimation:M,stopWavyAnimation:V,startIndeterminateAnimation:B,stopIndeterminateAnimation:k}),{...$,canvas:q,get ctx(){return j?.ctx},draw:F,resize:N}};var n7=T(()=>{m6();$9();M0();_0()});var O0=(J)=>($)=>{if(J.indeterminate&&$.element)g($.element,W6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(W6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==v6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(W6.CIRCULAR)||"")){let K=$.getClass?.(W6.CONTAINER)||"";g($.element,`${K}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??v6.FLAT,labelFormatter:J.labelFormatter??((j,K)=>`${Math.round(j/K*100)}%`),showLabel:J.showLabel},Z=$.lifecycle?.init,q=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==v6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),Z)Z()},destroy:()=>{if(q)q()}},{...$,state:Q}};var P0=T(()=>{m6();A9()});var R0=(J)=>($)=>{let{element:Q,getClass:Z,canvas:q}=$,j=Q.classList.contains(Z(W6.CIRCULAR)),K=(Y,U)=>{Q.dispatchEvent(new CustomEvent(Y,{detail:U}))},G=(Y,U)=>{Q.setAttribute("aria-valuenow",Y.toString());let X=$.label;if(X){let _=J.label?.formatter||((H,B)=>`${Math.round(H/B*100)}%`);X.textContent=_(Y,U)}if(typeof $.draw==="function")$.draw()},W=(Y)=>{if(Y){if(g(Q,W6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||v6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(j6(Q,W6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())W(!0);let z={element:Q,track:q,indicator:q,buffer:q,getClass:Z,getValue(){return J.value.getValue()},setValue(Y,U=!0){let X=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(Y),X!==Y){Q.setAttribute("aria-valuenow",Y.toString());let H=$.label;if(H){let k=J.label?.formatter||((M,V)=>`${Math.round(M/V*100)}%`);H.textContent=k(Y,_)}let B={value:Y,max:_};if(K(Y7.CHANGE,B),$.setValue&&typeof $.setValue==="function")$.setValue(Y,U);else G(Y,_)}return z},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(Y){if(J.buffer.setBuffer(Y),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return z},setIndeterminate(Y){if(J.state.isIndeterminate()===Y)return z;return J.state.setIndeterminate(Y),W(Y),z},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return z},hideLabel(){if(J.label?.hide)J.label.hide();return z},setLabelFormatter(Y){if(J.label?.format)J.label.format(Y);let U=$.label||$.state?.label;if(U)U.textContent=Y(J.value.getValue(),J.value.getMax());return z},getThickness(){return J.thickness?.getThickness()||d6.THIN},setThickness(Y){if(J.thickness)J.thickness.setThickness(Y);if($.setThickness)$.setThickness(Y);return z},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return v6.FLAT},setShape(Y){return $.setShape?.(Y),z},setSize(Y){if($.setSize)$.setSize(Y);return z},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),z},disable(){return J.disabled.disable(),z},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return z},show(){if($.show)$.show();return z},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(Y,U){return Q.addEventListener(Y,U),z},off(Y,U){return Q.removeEventListener(Y,U),z},addClass(...Y){return Y.forEach((U)=>Q.classList.add(U)),z},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return z};var A0=T(()=>{m6();A9()});var n3,w0=(J={})=>{return u(n3,J,"progress")},x0=(J)=>{let $=J.indeterminate===!0,Q=J.variant===B9.CIRCULAR,Z={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)Z["aria-valuenow"]=J.value.toString();if(J.disabled===!0)Z["aria-disabled"]="true";let q=[J.class,W6.CONTAINER,Q?W6.CIRCULAR:W6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==v6.FLAT)q.push(`${W6.CONTAINER}--${J.shape}`);return p(J,{tag:"div",attributes:Z,className:q})},y0=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:g6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(W6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return d6.THIN;else if($==="thick")return d6.THICK;else if(typeof $==="number")return $;return d6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var T0=T(()=>{t();m6();n3={variant:g6.VARIANT,value:g6.VALUE,max:g6.MAX,buffer:g6.BUFFER,showLabel:g6.SHOW_LABEL,thickness:"thin",shape:g6.SHAPE}});var I0={};KJ(I0,{default:()=>G8});var e3=(J={})=>{let $=w0(J);try{let Q=b(S,d(),h(x0($)),K6($),G6($),O0($),D0($),(Z)=>{return R0(y0(Z))(Z)},C())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},G8;var z8=T(()=>{J6();c();o();n7();P0();A0();T0();G8=e3});var $q=async(J)=>{let{default:$}=await Promise.resolve().then(() => (z8(),I0));return $(J)},S0=(J)=>($)=>{if(!J.progress)return $;let Q={},Z=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:Y,...U}=J.progress;if(Y)Q=Y;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...U}})(),q=null,j=null,K=!1,G="",W=async()=>{if(q)return q;if(!j)j=$q(Z).then((Y)=>{return q=Y,g(q.element,$.getClass("button-progress")),q.element.style.display="none",Object.entries(Q).forEach(([U,X])=>{q.on(U,X)}),$.progress=q,q});return j},z=()=>{let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y&&Y.nextSibling)return Y.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let Y=await W();if(Y.element){if(!$.element.contains(Y.element)){let X=z();if(X)$.element.insertBefore(Y.element,X);else $.element.appendChild(Y.element)}Y.element.style.display="",g($.element,`${$.getClass("button")}--progress`);let U=$.element.querySelector(`.${$.getClass("button-icon")}`);if(U instanceof HTMLElement)U.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!q)return $;q.element.style.display="none",j6($.element,`${$.getClass("button")}--progress`);let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y instanceof HTMLElement)Y.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(Y){return(await W()).setValue(Y),$},$.setProgressSync=function(Y){return $.setProgress(Y),$},$.setIndeterminate=async function(Y){return(await W()).setIndeterminate(Y),$},$.setIndeterminateSync=function(Y){return $.setIndeterminate(Y),$},$.setLoading=async function(Y,U){if(Y&&!K){if($.setText&&$.getText)G=$.getText();if(K=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(U&&$.setText)$.setText(U)}else if(!Y&&K){if(K=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(U&&$.setText)$.setText(U);else if(G&&$.setText)$.setText(G)}return $},$.setLoadingSync=function(Y,U){return $.setLoading(Y,U),$},$.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(q)q.destroy();if(q&&q.element.parentNode)q.element.parentNode.removeChild(q.element);Y()}}if(J.showProgress)W().then(()=>{$.showProgress()});return $};var b0=T(()=>{A9()});var Jq=(J={},$={})=>{let Q={...J},Z=f6(),q=new Map,j=$.middleware||[],K=(W,z)=>{Z.emit("change",W,z)},G=(W,z)=>{return j.reduce((Y,U)=>U(Y,z),W)};return{getState:()=>{let W={};return q.forEach((z,Y)=>{W[Y]=z(Q)}),{...Q,...W}},setState:(W)=>{let z={...Q},Y=typeof W==="function"?W(Q):{...Q,...W};Q=G(Y,z),K(Q,z)},subscribe:(W)=>Z.on("change",W),derive:(W,z)=>{return q.set(W,z),()=>{q.delete(W)}},select:(W)=>W(Q),reset:()=>{Q={...J},K(Q,{})}}},Qq=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,Z)=>{if(J[Z]!==$[Z])Q[Z]={from:$[Z],to:J[Z]};return Q},{})}),J},Zq=(J)=>($)=>Object.keys($).reduce((Q,Z)=>{if(J($[Z],Z))Q[Z]=$[Z];return Q},{});var v0=()=>{};var qq=(J,$={})=>{let Q=!1,Z=f6();return{onMount:(q)=>Z.on("mount",q),onUnmount:(q)=>Z.on("unmount",q),mount:()=>{if(!Q)Q=!0,Z.emit("mount")},unmount:()=>{if(Q)Q=!1,Z.emit("unmount"),Z.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let q=$.text.getElement();if(q)q.remove()}if($.icon){let q=$.icon.getElement();if(q)q.remove()}if(J)J.remove()}}};var C0=()=>{};var jq=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};function x6(J){return J&&typeof J==="object"&&"element"in J}function F7(){return document.createDocumentFragment()}function Kq(...J){return e6(...J)}function l9(J,$=!1,Q=!1){if(!J||$)return{...J};if(!(J.class||J.className||J.rawClass))return{...J};let q={...J};if(q.className){if(!q.class)q.class=q.className;else{let j=Kq([q.class,q.className]);q.class=j.join(" ")}delete q.className}if(q.class&&!$){if(typeof q.class==="string"){let j=q.class.split(/\s+/).filter(Boolean);if(Q)q.class=j.map((K)=>{if(!K||K.startsWith(H9))return K;if(K.includes("__")){let[G,W]=K.split("__");return`${H9}${G}__${W}`}else if(K.includes("--")){let[G,W]=K.split("--");return`${H9}${G}--${W}`}return`${H9}${K}`}).join(" ");else q.class=j.map((K)=>K&&!K.startsWith(H9)?`${H9}${K}`:K).filter(Boolean).join(" ")}else if(Array.isArray(q.class))q.class=q.class.filter(Boolean).map((j)=>typeof j==="string"&&!j.startsWith(H9)?`${H9}${j}`:j).join(" ")}return q}function W8(J){let $={};if(!J||typeof J!=="object")return $;for(let Q in J){let Z=J[Q];if(Z&&typeof Z!=="function"&&(Z instanceof HTMLElement||typeof SVGElement!=="undefined"&&Z instanceof SVGElement||x6(Z)))$[Q]=Z}return $}var H9;var H7=T(()=>{w6();A9();H9=`${f}-`});function J9(J){let $=W8(J);return{layout:J,element:J.element,component:$,get(Z){return J[Z]??null},getAll(){return $},destroy(){let Z=J.element;if(Z){if(x6(Z)&&typeof Z.destroy==="function")Z.destroy();else if(x6(Z)&&Z.element?.parentNode)Z.element.parentNode.removeChild(Z.element);else if(Z instanceof HTMLElement&&Z.parentNode)Z.parentNode.removeChild(Z)}for(let q in J){if(q==="element")continue;let j=J[q];if(x6(j)&&typeof j.destroy==="function")j.destroy()}}}}var M7=T(()=>{H7()});function e7(J,$=null,Q=0,Z={}){Q++;let q={},j=[],K=F7(),G=null;if(!Array.isArray(J))return console.error("Schema is not an array!",$,Q,J),J9(q);let W=Z.creator||v;for(let z=0;z<J.length;z++){let Y=J[z];if(!Y)continue;if(Array.isArray(Y)){let F=e7(Y,G||$,Q,Z);Object.assign(q,F.layout);continue}let U,X,_;if(typeof Y==="function"){U=Y;let V=J[z+1],F=J[z+2];if(typeof V==="string")if(X=V,z++,a6(F))_=F,z++;else _={};else if(a6(V))_=V,z++;else _={}}else if(typeof Y==="string"){U=W,X=Y;let V=J[z+1];if(a6(V))_=V,z++;else _={};if(U===v&&!("tag"in _))_.tag="div"}else if(a6(Y))U=W,_=Y;else{console.warn("Skipping unsupported item type:",Y);continue}let H=J[z+1];if(a6(H)&&!Array.isArray(H)&&typeof H.prefix!=="undefined")Object.assign(_,H),z++;let k=("prefix"in _?_.prefix:Z.prefix!==!1)?l9(_):{..._};if(X&&!("name"in k)&&!(U===v||U.isElement))k.name=X;G=r9(U,k);let M=x6(G)?G.element:G;if(Q===1)q.element=M;if(X)q[X]=G,j.push([X,G]);if(G){if("insert"in G&&typeof G.insert==="function")G.insert(K);else K.appendChild(M);if($){if(G._container=$,"onInserted"in G&&typeof G.onInserted==="function")G.onInserted($)}}}if($&&K.hasChildNodes())(x6($)?$.element:$).appendChild(K);return q.components=j,J9(q)}var E0=T(()=>{A6();H7();M7();k7();$9()});function $$(J,$=null,Q={}){let Z={},q=Q.creator||v;if(J.element&&!$){let G=J.element,W=G.creator||q,z=G.options||{},Y=Q.prefix!==!1?l9(z):{...z},U=r9(W,Y),X=x6(U)?U.element:U;if(Z.element=U,G.name)Z[G.name]=U;if(G.children){let _=F7(),H=[];for(let B in G.children){let k=G.children[B];if(k&&!k.name)k.name=B;let M=$$({[B]:k},_,Q);H.push(M.layout)}X.appendChild(_);for(let B of H)Object.assign(Z,B)}return J9(Z)}let j=$?F7():null,K=[];for(let G in J){let W=J[G];if(!W)continue;let z=W.creator||q,Y=W.options||{},X=("prefix"in Y?Y.prefix:Q.prefix!==!1)?l9(Y):{...Y};if(!W.name&&G!=="element")W.name=G;let _=r9(z,X);if(Z[G]=_,W.name&&W.name!==G)Z[W.name]=_;let H=x6(_)?_.element:_;if(j)j.appendChild(H);if(W.children){let B=typeof SVGElement!=="undefined"&&H instanceof SVGElement,k=$$(W.children,H,Q);if(K.push(k.layout),B)Object.assign(Z,k.layout)}}if($&&j)(x6($)?$.element:$).appendChild(j);for(let G of K)Object.assign(Z,G);return J9(Z)}var h0=T(()=>{A6();H7();M7();k7()});function u0(J){if(!J)return;Array.from(J.classList).filter((Z)=>Z.startsWith("layout--")||Z.includes("-layout--")).forEach((Z)=>{J.classList.remove(Z)})}function p9(J){return R6(J,"layout--stack")?"stack":R6(J,"layout--row")?"row":R6(J,"layout--grid")?"grid":""}function Y8(J,$,Q=!0){if(!J||!$)return;if(Q)u0(J);if($.type)g(J,`layout--${$.type}`);if($.gap!==void 0){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-gap-${$.gap}`)}if($.align){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-${$.align}`)}if($.justify){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-justify-${$.justify}`)}if($.type==="grid"||p9(J)==="grid"){if(typeof $.columns==="number")g(J,`layout--grid-cols-${$.columns}`);else if($.columns==="auto-fill")g(J,"layout--grid-fill");else if($.columns==="auto-fit")g(J,"layout--grid-cols-auto-fit");if($.dense)g(J,"layout--grid-dense");if($.autoHeight)g(J,"layout--grid-auto-height")}if($.type==="row"||p9(J)==="row"){if($.wrap===!1||$.wrap==="nowrap")g(J,"layout--row-nowrap");else if($.wrap==="reverse")g(J,"layout--row-wrap-reverse");if($.mobileStack)g(J,"layout--row-mobile-stack");if($.mobileScroll)g(J,"layout--row-mobile-scroll")}if($.class)$.class.split(" ").filter(Boolean).forEach((Z)=>{J.classList.add(Z)})}function U8(J,$){if(!J||!$)return;if(g(J,"layout__item"),$.width&&$.width>=1&&$.width<=12)g(J,`layout__item--${$.width}`);if($.sm)g(J,`layout__item--sm-${$.sm}`);if($.md)g(J,`layout__item--md-${$.md}`);if($.lg)g(J,`layout__item--lg-${$.lg}`);if($.xl)g(J,`layout__item--xl-${$.xl}`);if($.span)g(J,`layout__item--span-${$.span}`);if($.rowSpan)g(J,`layout__item--row-span-${$.rowSpan}`);if($.order)if(typeof $.order==="number")g(J,`layout__item--order-${$.order}`);else g(J,`layout__item--order-${$.order}`);if($.align)g(J,`layout__item--self-${$.align}`);if($.auto)g(J,"layout__item--auto")}var X8=T(()=>{R9()});function r9(J,$={}){try{let{layout:Q,layoutItem:Z,style:q,attributes:j}=$,K=$.events||$.event,G={...$};delete G.layout,delete G.layoutItem,delete G.events,delete G.event;let z=typeof J==="function"&&Object.getOwnPropertyDescriptor(J,"prototype")?.writable===!1?new J(G):J(G);if(z){let Y=z.element||(z instanceof HTMLElement?z:null);if(Y){if(Q)Y8(Y,Q);if(Z)U8(Y,Z);if(q&&typeof q==="object")Object.assign(Y.style,q);if(j&&typeof j==="object"){for(let[U,X]of Object.entries(j))if(X!==void 0&&X!==null)Y.setAttribute(U,X.toString())}if(K){if(typeof K==="object"&&!Array.isArray(K)){for(let[U,X]of Object.entries(K))if(typeof X==="function")Y.addEventListener(U,X)}else if(Array.isArray(K)){for(let U of K)if(Array.isArray(U)&&U.length>=2){let[X,_]=U;if(typeof X==="string"&&typeof _==="function")Y.addEventListener(X,_)}}}}}return z}catch(Q){return console.error("Error creating component instance:",Q),document.createElement("div")}}function f0(J){return Array.isArray(J)&&J.length>=3&&typeof J[0]==="function"&&typeof J[1]==="string"&&a6(J[2])}function B8(J,$=null,Q=0,Z={}){if(!J)return console.warn("Empty schema provided to layout processor"),{layout:{},element:document.createElement("div"),component:{},get:()=>null,getAll:()=>({}),destroy:()=>{}};if(f0(J))return e7(J,$,Q,Z);return Array.isArray(J)?e7(J,$,Q,Z):$$(J,$,Z)}var k7=T(()=>{E0();h0();$9();X8()});function s9(J,$=null,Q={}){if(typeof J==="function")J=J();if(typeof J==="string"){let Z=document.createElement("template");Z.innerHTML=J.trim();let q=Z.content;if($&&q.hasChildNodes())$.appendChild(q);let j={element:q.firstElementChild};return J9(j)}return B8(J,$,0,Q)}var J$=T(()=>{k7();M7()});function N7(J,$,...Q){if(J===g0)return Q.flat(1/0).filter(Boolean);let Z=$||{};if(Z.style&&typeof Z.style==="object")Z.style=Object.entries(Z.style).map(([G,W])=>{return`${G.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${W}`}).join("; ");let q=Z.id||Z.name||`el-${Math.floor(Math.random()*1e4)}`,j={...Z};delete j.id,delete j.name;let K=Q.flat(1/0).filter((G)=>G!==null&&G!==void 0&&G!==!1);if(typeof J==="function")return[J,q,j,K.length>0?F8(K):void 0].filter(Boolean);else if(typeof J==="string")return[v,q,{...j,tag:J},K.length>0?F8(K):void 0].filter(Boolean);return[]}function F8(J){let $=[];for(let Q of J)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")$.push(String(Q));else if(Array.isArray(Q))$.push(...F8(Q));else if(Q&&typeof Q==="object")$.push(Q);return $}function Gq(J,$){return s9(J,$)}var g0;var H8=T(()=>{A6();J$();g0=Symbol("Fragment")});var d0;var Q$=T(()=>{H7();J$();M7();k7();X8();H8();J$();d0=s9});var Y6,zq,M8=(J={})=>{let $=new Map,Q=new Set,Z=null,q=null,j=null,K=!1,G=!1,W=null,z=[],Y={event:Y6.CHANGE,data:null},U=J.transform||((k)=>k),X=J.validate||(()=>!0);function _(k,M){if(Q.size===0)return;Y.event=k,Y.data=M,z.length=0,Q.forEach((V)=>z.push(V));for(let V=0;V<z.length;V++)z[V](Y)}function H(){if(K&&j!==null)return j;if(!Z&&!q){let V=Array.from($.values());return j=V,K=!0,V}let k=Array.from($.values()),M=k;if(Z)M=k.filter(Z);if(q)M.sort(q);return j=M,K=!0,M}function B(k){if(!Array.isArray(k)){if(!X(k))return[];return[U(k)]}if(k.length===0)return[];let M=[];for(let V=0;V<k.length;V++)if(X(k[V])){let F=U(k[V]);if(F.id)M.push(F);else throw new Error("Items must have an id property")}return M}return{subscribe(k){return Q.add(k),()=>{Q.delete(k)}},getItems:H,getSize(){return $.size},isLoading(){return G},getError(){return W},query(k){Z=k,K=!1,_(Y6.CHANGE,H())},sort(k){q=k,K=!1,_(Y6.CHANGE,H())},async add(k){try{G=!0,_(Y6.LOADING,!0);let M=B(k);if(M.length===0)return M;for(let V=0;V<M.length;V++)$.set(M[V].id,M[V]);return K=!1,_(Y6.ADD,M),_(Y6.CHANGE,H()),M}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},async update(k){try{G=!0,_(Y6.LOADING,!0);let M=Array.isArray(k)?k:[k];if(M.length===0)return[];for(let F=0;F<M.length;F++)if(!$.has(M[F].id))throw new Error(`Item with id ${M[F].id} not found`);let V=B(M);for(let F=0;F<V.length;F++)$.set(V[F].id,V[F]);return K=!1,_(Y6.UPDATE,V),_(Y6.CHANGE,H()),V}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},async remove(k){try{G=!0,_(Y6.LOADING,!0);let M=Array.isArray(k)?k:[k];if(M.length===0)return[];for(let V=0;V<M.length;V++)if(!$.has(M[V]))throw new Error(`Item with id ${M[V]} not found`);for(let V=0;V<M.length;V++)$.delete(M[V]);return K=!1,_(Y6.REMOVE,M),_(Y6.CHANGE,H()),M}catch(M){throw W=M instanceof Error?M:new Error(String(M)),_(Y6.ERROR,W),W}finally{G=!1,_(Y6.LOADING,!1)}},clear(){$.clear(),Z=null,q=null,j=null,K=!1,_(Y6.CHANGE,[])}}};var V7=T(()=>{Y6={CHANGE:"change",ADD:"add",UPDATE:"update",REMOVE:"remove",ERROR:"error",LOADING:"loading"},zq={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var y6,k8=(J={})=>{return{handleError:(Q,Z)=>{throw J.onError?.(Q,Z),Q}}};var N8=T(()=>{y6={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var Wq,V8=(J={})=>{let $=k8(J),Q=null,Z=new Map,q=new Map,j={strategy:J.pagination?.strategy||"cursor",cursorParamName:J.pagination?.cursorParamName||"cursor",pageParamName:J.pagination?.pageParamName||"page",perPageParamName:J.pagination?.perPageParamName||"per_page",offsetParamName:J.pagination?.offsetParamName||"offset",limitParamName:J.pagination?.limitParamName||"limit",defaultPageSize:J.pagination?.defaultPageSize||20},K=(H)=>{if(!H)return"http://localhost";if(/^https?:\/\//i.test(H))return H;if(H.startsWith("/"))return`${window.location.origin}${H}`;return`http://${H}`},G=(H,B={})=>{try{let k=H+JSON.stringify(B);if(q.has(k))return q.get(k);let M=K(J.base),V=new URL(M+H);if(Object.entries(B).forEach(([N,O])=>{if(Array.isArray(O))O.forEach((P)=>V.searchParams.append(N,P));else if(O!==null&&O!==void 0)V.searchParams.append(N,String(O))}),J.base&&J.base.startsWith("/")){let N=`${V.pathname}${V.search}`;return q.set(k,N),N}let F=V.toString();return q.set(k,F),F}catch(k){throw console.error("Error building URL:",k,{base:J.base,endpoint:H,params:B}),k}},W=(H)=>{let B={};return Object.entries(H).forEach(([k,M])=>{if(typeof M==="object")Object.entries(M).forEach(([V,F])=>{let N=Wq[V];if(N)B[`${k}_${N}`]=F});else B[k]=M}),B},z=async(H,B={})=>{if(Q)Q.abort();Q=new AbortController;try{let k=await fetch(H,{...B,headers:{"Content-Type":"application/json",...J.headers,...B.headers},signal:Q.signal});if(!k.ok){let V;try{V=await k.json()}catch{V={message:`HTTP error ${k.status}`}}return console.error("API error response:",V),$.handleError(new Error(V.message||"API request failed"))}let M=k.headers.get("content-type");if(M&&M.includes("application/json"))return await k.json();else return await k.text()}catch(k){if(console.error("API request error:",k),k.name==="AbortError")return null;return $.handleError(k)}finally{Q=null}},Y=(H)=>{if(!J.cache)return null;let B=Z.get(H);if(!B)return null;let{data:k,timestamp:M}=B;if(Date.now()-M>300000)return Z.delete(H),null;return k},U=(H,B)=>{if(!J.cache)return;Z.set(H,{data:B,timestamp:Date.now()})},X=(H={},B={})=>{let k={};switch(j.strategy){case"cursor":{let V=H.cursor||B.cursor;if(V)k[j.cursorParamName]=V;let F=H.limit||B.limit||j.defaultPageSize;k[j.limitParamName]=F;break}case"offset":{let V=H.offset!==void 0?H.offset:B.offset!==void 0?B.offset:0;k[j.offsetParamName]=V;let F=H.limit||B.limit||j.defaultPageSize;k[j.limitParamName]=F;break}case"page":{let V=H.page!==void 0?H.page:B.page!==void 0?B.page:H.cursor?H.cursor:1;k[j.pageParamName]=V;let F=H.per_page||H.perPage||H.limit||B.per_page||B.perPage||B.limit||j.defaultPageSize;k[j.perPageParamName]=F;break}}return k},_=(H,B={},k={})=>{if(J.adapter?.parseResponse)return J.adapter.parseResponse(H);if(H&&H.items)return H;if(Array.isArray(H))return{items:H,meta:{cursor:null,hasNext:!1}};let M=H.data||H.items||H.results||H.content||[],V=H.meta||H.pagination||H.page||{},F=V.total||H.total||M.length,N={cursor:null,hasNext:!1,total:F};switch(j.strategy){case"cursor":{if(V.next||V.nextCursor||V.nextPage)N.cursor=String(V.next||V.nextCursor||V.nextPage),N.hasNext=!0;else if(V.hasMore||V.hasNext)N.hasNext=Boolean(V.hasMore||V.hasNext),N.cursor=V.cursor||(V.page?String(Number(V.page)+1):null);else{let P=B.limit||k.limit||j.defaultPageSize;if(N.hasNext=M.length>=P,N.hasNext&&M.length>0){let L=M[M.length-1];N.cursor=L.id||L._id||String(M.length)}}break}case"offset":{let P=Number(B.offset||k.offset||V.offset||0),L=Number(B.limit||k.limit||V.limit||j.defaultPageSize),D=M.length;if(F!==void 0)N.hasNext=P+D<F;else N.hasNext=D>=L;N.cursor=N.hasNext?String(P+D):null,N.offset=P;break}case"page":{let P=Number(B.page||k.page||V.page||V.current_page||1),L=Number(B.per_page||B.perPage||B.limit||k.per_page||k.perPage||k.limit||V.per_page||V.perPage||V.size||V.limit||j.defaultPageSize);N.page=P;let D=Number(V.totalPages||V.total_pages||V.pages||V.pageCount||0);if(D>0)N.hasNext=P<D,N.pages=D;else if(F!==void 0){let R=Math.ceil(F/L);N.hasNext=P<R,N.pages=R}else N.hasNext=M.length>=L;N.cursor=N.hasNext?String(P+1):null;break}}return{items:M,meta:N}};return{...$,create:async(H)=>{let B=G(J.endpoints?.create||"/create"),k=await z(B,{method:"POST",body:JSON.stringify({items:H})});return _(k)},read:async(H={},B={})=>{let k={...H};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((w)=>{delete k[w]});let M=W(k),V=X(H,B),F={};if(H.search||B.search)F.search=H.search||B.search;if(H.sort||B.sort)F.sort=H.sort||B.sort;if(H.fields||B.fields)F.fields=H.fields||B.fields;let N={...M,...V,...F};Object.keys(N).forEach((w)=>{if(N[w]===void 0)delete N[w]});let O=G(J.endpoints?.list||"/list",N),P=O.toString(),L=Y(P);if(L)return L;let D=await z(O),R=_(D,H,B);return U(P,R),R},update:async(H)=>{let B=G(J.endpoints?.update||"/update"),k=await z(B,{method:"PUT",body:JSON.stringify({items:H})});return _(k)},delete:async(H)=>{let B=G(J.endpoints?.delete||"/delete"),k=await z(B,{method:"DELETE",body:JSON.stringify({ids:H})});return _(k)},query:async(H={},B={})=>{let k={...H},M={...B};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((D)=>{delete k[D],delete M[D]});let V=W(k),F=X(H,B),N={...M};if(H.search||B.search)N.search=H.search||B.search;let O={...V,...F,...N},P=G(J.endpoints?.list||"/list",O),L=await z(P);return _(L,H,B)},setPaginationStrategy:(H)=>{j.strategy=H},getPaginationConfig:()=>{return{...j}},disconnect:()=>{if(Q)Q.abort(),Q=null;Z.clear(),q.clear()}}};var _8=T(()=>{N8();Wq={[y6.EQ]:"eq",[y6.NE]:"ne",[y6.GT]:"gt",[y6.GTE]:"gte",[y6.LT]:"lt",[y6.LTE]:"lte",[y6.IN]:"in",[y6.NIN]:"nin",[y6.CONTAINS]:"contains",[y6.STARTS_WITH]:"startsWith",[y6.ENDS_WITH]:"endsWith"}});function Uq(J){return{...Yq,...J}}function l0(J){if(!J.renderItem||typeof J.renderItem!=="function")throw new Error("List manager requires a renderItem function");let $=Uq(J);if(!$.collection)$.collection="items";if(!$.transform)$.transform=(Q)=>Q;return $}function r0(J){return Boolean(J.baseUrl)}function p0(J){return J.staticItems||J.items||[]}var Yq;var s0=T(()=>{Yq={renderBufferSize:5,overscanCount:3,itemHeight:48,measureItemsInitially:!0,pageSize:20,loadThreshold:0.8,throttleMs:16,dedupeItems:!0,dynamicItemSize:!1,scrollStrategy:"scroll"}});function m0(J){if(getComputedStyle(J).position==="static")J.style.position="relative";let $=document.createElement("div");$.style.position="relative",$.style.width="100%",$.style.willChange="transform";let Q=document.createElement("div");return Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="1px",Q.style.visibility="hidden",Q.style.pointerEvents="none",J.appendChild($),J.appendChild(Q),{container:J,content:$,spacer:Q}}function a0(J){let $=document.createElement("div");$.className="mtrl-list-sentinel mtrl-list-sentinel--top",$.style.position="absolute",$.style.top="0",$.style.left="0",$.style.width="100%",$.style.height="1px",$.style.pointerEvents="none",$.style.visibility="hidden";let Q=document.createElement("div");return Q.className="mtrl-list-sentinel mtrl-list-sentinel--bottom",Q.style.position="absolute",Q.style.bottom="0",Q.style.left="0",Q.style.width="100%",Q.style.height="1px",Q.style.pointerEvents="none",Q.style.visibility="hidden",J.content.appendChild($),J.content.appendChild(Q),{...J,topSentinel:$,bottomSentinel:Q}}function L8(J,$){J.spacer.style.height=`${$}px`}function c0(J){if(J.content.parentNode)J.content.parentNode.removeChild(J.content);if(J.spacer.parentNode)J.spacer.parentNode.removeChild(J.spacer);if(J.topSentinel&&J.topSentinel.parentNode)J.topSentinel.remove();if(J.bottomSentinel&&J.bottomSentinel.parentNode)J.bottomSentinel.remove()}var i0=(J=48)=>{let $=new Map,Q=new Map,Z=!1,q=!0,j=!1,K=(z)=>{if(!z)return;return z.id||z.original&&z.original.id},G=(z)=>{if(Z&&Q.size>=z.length)return;if(Q.clear(),q){let Y=0;for(let U=0;U<z.length;U++)if(z[U]){let X=K(z[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y),Y+=J}}else{let Y=0;for(let U=0;U<z.length;U++)if(z[U]){let X=K(z[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y);let _=X&&$.has(X)?$.get(X):J;Y+=_}}Z=!0},W=(z)=>{if(!z)return;if(j=z.dynamicItemSize===!0,q=!j,z.itemHeight)J=z.itemHeight};return{setup:(z)=>{W(z)},measureItemHeight:(z,Y)=>{if(!Y||!z)return J;if(q&&$.size>0)return J;let U=K(z);if(!U)return J;let X=Y.offsetHeight;if(j||$.size===0||$.has(U)){if(X>0){let H=$.get(U)!==X;if($.size===0&&!j)J=X;if(H){if($.set(U,X),Z&&!q)Z=!1}}}if($.size===1&&!j&&Y.offsetHeight>0)return $.values().next().value;return j?$.get(U)||J:J},getItemHeight:(z)=>{if(q)return J;if(!z)return J;let Y=K(z);if(!Y)return J;if($.has(Y))return $.get(Y)||J;return J},setItemHeights:(z)=>{if(q&&!j)return!1;let Y=!1;for(let[U,X]of Object.entries(z))if($.get(U)!==X&&X>0)$.set(U,X),Y=!0;if(Y)Z=!1;return Y},calculateTotalHeight:(z)=>{if(!z||z.length===0)return 0;let Y=z.length;if(q)return Y*J;let U=0;for(let X of z){if(!X)continue;let _=K(X);U+=_&&$.has(_)?$.get(_):J}return U},getItemOffset:(z,Y)=>{if(Z&&Q.has(Y))return Q.get(Y)||0;if(G(z),Q.has(Y))return Q.get(Y)||0;if(q){let U=z.findIndex((X)=>K(X)===Y);if(U>=0)return U*J}else{let U=0;for(let X of z){let _=K(X);if(_===Y)return U;let H=_&&$.has(_)?$.get(_):J;U+=H}}return-1},getOffsetAtIndex:(z)=>{let Y=`index:${z}`;if(Z&&Q.has(Y))return Q.get(Y)||0;if(q)return z*J;return z*J},measureMarkedElements:(z,Y)=>{let U=$.size===0?".mtrl-list-item":'[data-needs-measurement="true"]',X=z.querySelectorAll(U),_=!1;if(X.length>0){if($.size===0&&X.length>0){let B=X[0].offsetHeight;if(B>0){if(J=B,_=!0,!j)return!0}}if(j)for(let H=0;H<X.length;H++){let B=X[H],k=B.getAttribute("data-id");if(k){if(Y.find((V)=>K(V)===k)){let V=B.offsetHeight;if(V>0&&$.get(k)!==V)$.set(k,V),_=!0;delete B.dataset.needsMeasurement}}}if(_&&!q)Z=!1}return _},hasCachedOffsets:()=>{return Z},calculateOffsets:G,clear:()=>{$.clear(),Q.clear(),Z=!1},getAllHeights:()=>{return new Map($)},getDefaultHeight:()=>{return J},isUsingUniformHeight:()=>{return q}}};function Xq(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:K=3}=q,G=Math.floor(J/$),W=Math.ceil(Q/$),z=G+W,Y=Math.max(0,G-j-K),U=Math.min(Z,z+j+K);return{start:Y,end:U}}function Bq(J,$,Q,Z,q,j,K){let G=0,W=$.length-1,z=0;if(typeof Z.hasCachedOffsets==="function"&&Z.hasCachedOffsets())while(G<=W){let H=Math.floor((G+W)/2);if(!$[H]){G=H+1;continue}if(Z.getItemOffset($,$[H].id)<J)z=H,G=H+1;else W=H-1}else{let H=Z.getAllHeights(),B=K;if(H.size>0){let M=0,V=0;H.forEach((F)=>{M+=F,V++}),B=M/V}z=Math.floor(J/B);let k=z*B;while(z<$.length&&k<J){if($[z])k+=Z.getItemHeight($[z]);z++}while(z>0&&k>J)if(z--,$[z])k-=Z.getItemHeight($[z])}z=Math.max(0,Math.min(z,$.length-1));let Y=Math.max(0,z-q-j),U=0;for(let H=0;H<Y;H++)if($[H])U+=Z.getItemHeight($[H]);let X=Y,_=J+Q+q*K;while(X<$.length&&U<_){if($[X])U+=Z.getItemHeight($[X]);X++}return X=Math.min($.length,X+j),{start:Y,end:X}}function o0(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:K=3,itemHeight:G=48}=q;if($.length===0)return{start:0,end:0};if($.length<10)return{start:0,end:$.length};let W=Z.getAllHeights();if(new Set(W.values()).size<=1&&$.length>20)return Xq(J,G,Q,$.length,q);if($.length>100)return Bq(J,$,Q,Z,j,K,G);let Y=0,U=0,X=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+H>J-j*q.itemHeight){U=Math.max(0,_-K);break}Y+=H}Y=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+=H,Y>J+Q+j*q.itemHeight){X=Math.min($.length,_+K);break}}if(X===0)X=$.length;return{start:U,end:X}}function t0(J,$,Q){if(typeof Q.hasCachedOffsets==="function"&&Q.hasCachedOffsets()&&typeof Q.getOffsetAtIndex==="function"){let j=[];for(let K=$.start;K<$.end;K++)if(J[K])j.push({index:K,item:J[K],offset:Q.getOffsetAtIndex(K)});return j}let Z=0;for(let j=0;j<$.start;j++)if(J[j])Z+=Q.getItemHeight(J[j]);let q=[];for(let j=$.start;j<$.end;j++)if(J[j])q.push({index:j,item:J[j],offset:Z}),Z+=Q.getItemHeight(J[j]);return q}function n0(J,$,Q,Z){if(Q<=0||$<=0)return!1;return(J+$)/Q>Z}var e0=(J,$,Q,Z)=>{let q=null,j=new Map,K={start:0,end:0};if(typeof Q.setup==="function")Q.setup(J);let G=(z,Y)=>{if(!z){console.warn("Attempted to render undefined item at index",Y);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}let U=Z.getRecycledElement(z),X=J.renderItem(z,Y,U);if(!X){console.warn("renderItem returned null or undefined for item",z);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}if(!X.classList.contains("mtrl-list-item"))X.classList.add("mtrl-list-item");if(z.id&&!X.hasAttribute("data-id"))X.setAttribute("data-id",z.id);if(z.type)X.dataset.itemType=z.type;if((J.dynamicItemSize===!0||j.size===0)&&!X.hasAttribute("data-needs-measurement"))X.dataset.needsMeasurement="true";if(q)q(z,X);return X},W=(z,Y,U)=>{if(Math.abs(U.end-U.start-(K.end-K.start))>10)return!1;let _=0;return Array.from(z).forEach((H)=>{if(Y.has(H))_++}),_>=z.size/2};return{setRenderHook:(z)=>{q=z},renderVisibleItems:(z,Y)=>{if(!$.content)return console.warn("Cannot render items: content element missing"),new Map;if(Y.start===K.start&&Y.end===K.end)return j;K=Y;let{topSentinel:U,bottomSentinel:X}=$,_=t0(z,Y,Q),H=new Set(_.map((M)=>M.item.id)),B=new Set(j.keys());if(W(H,B,Y)){let M=_.filter((F)=>!B.has(F.item.id));if(Array.from(j.entries()).filter(([F])=>!H.has(F)).forEach(([F,N])=>{Z.recycleElement(N),j.delete(F),N.remove()}),M.length>0){let F=document.createDocumentFragment();M.forEach(({index:N,item:O,offset:P})=>{let L=G(O,N);L.style.position="absolute",L.style.top=`${P}px`,L.style.left="0",L.style.width="100%",F.appendChild(L),j.set(O.id,L)}),$.content.appendChild(F)}_.forEach(({item:F,offset:N})=>{if(j.has(F.id)){let O=j.get(F.id);if(parseInt(O.style.top,10)!==N)O.style.top=`${N}px`}})}else{let M=new Map;Array.from($.content.children).forEach((F)=>{if(F===U||F===X)return;let N=F.getAttribute("data-id");if(N)M.set(N,F),F.remove()});let V=document.createDocumentFragment();j.clear(),_.forEach(({index:F,item:N,offset:O})=>{let P;if(M.has(N.id)){if(P=M.get(N.id),M.delete(N.id),P.style.top=`${O}px`,J.dynamicItemSize===!0||j.size===0)P.dataset.needsMeasurement="true"}else P=G(N,F),P.style.position="absolute",P.style.top=`${O}px`,P.style.left="0",P.style.width="100%";V.appendChild(P),j.set(N.id,P)}),M.forEach((F)=>{Z.recycleElement(F)}),$.content.innerHTML="",$.content.appendChild(V)}if(U&&!U.parentNode)$.content.insertBefore(U,$.content.firstChild);if(X&&!X.parentNode)$.content.appendChild(X);return j},getItemElements:()=>{return new Map(j)}}};var $4=()=>{};function J4(J,$,Q,Z){let{scrollStrategy:q="scroll"}=Q;switch(q){case"intersection":return Q4(J,$,Z);case"hybrid":return Fq(J,$,Z);case"scroll":default:return D8(J,Q,Z)}}function D8(J,$,Q){let Z=null,q=0,j=5,K=$.throttleMs||16,G=0;return{setup:()=>{let W=(z)=>{let Y=z.target.scrollTop;if(Math.abs(Y-q)<j)return;let U=Date.now();if(U-G<K){if(Z)return;Z=requestAnimationFrame(()=>{q=Y,G=Date.now(),Q.onScroll(Y),Z=null});return}q=Y,G=U,Q.onScroll(Y)};return J.addEventListener("scroll",W,{passive:!0}),()=>{if(J.removeEventListener("scroll",W),Z)cancelAnimationFrame(Z),Z=null}},getScrollTop:()=>{return J.scrollTop}}}function Q4(J,$,Q){let Z=null,q=null,j=null,K=!1;return{setup:()=>{if(!("IntersectionObserver"in window))return console.warn("IntersectionObserver not supported, falling back to scroll events"),D8(J,{renderItem:()=>document.createElement("div")},Q).setup();if(!$.topSentinel||!$.bottomSentinel)Object.assign($,a0($));if(Z=new IntersectionObserver((z)=>{if(K)return;K=!0;let Y=!1,U=!1;if(z.forEach((X)=>{if(X.target===$.topSentinel&&X.isIntersecting)Y=!0;if(X.target===$.bottomSentinel&&X.isIntersecting)U=!0,Y=!0}),U){if(j!==null)clearTimeout(j);j=window.setTimeout(()=>{Q.onLoadMore(),j=null},100)}if(Y)Q.onScroll(J.scrollTop);setTimeout(()=>{K=!1},100)},{root:J,rootMargin:"400px 0px 400px 0px",threshold:0}),$.topSentinel)Z.observe($.topSentinel);if($.bottomSentinel)Z.observe($.bottomSentinel);let G=()=>{if(!K)Q.onScroll(J.scrollTop)},W=0;return q=()=>{let z=Date.now();if(z-W<200)return;W=z,G()},J.addEventListener("scroll",q,{passive:!0}),()=>{if(Z)Z.disconnect(),Z=null;if(q)J.removeEventListener("scroll",q),q=null;if(j!==null)clearTimeout(j),j=null}},getScrollTop:()=>{return J.scrollTop}}}function Fq(J,$,Q){let q=D8(J,{throttleMs:32,renderItem:()=>document.createElement("div")},{onScroll:Q.onScroll,onLoadMore:()=>{}}),j=Q4(J,$,{onScroll:(G)=>{let W=J.scrollTop;if(Math.abs(W-G)>50)Q.onScroll(W)},onLoadMore:Q.onLoadMore}),K=[];return{setup:()=>{return K.push(q.setup()),K.push(j.setup()),()=>{K.forEach((G)=>G()),K=[]}},getScrollTop:()=>{return q.getScrollTop()}}}var Z4=()=>{};var q4=()=>{let J=new Map,$=50;return{getRecycledElement:(Q)=>{let Z=Q.type||"default";if(!J.has(Z))return J.set(Z,[]),null;let q=J.get(Z);return q.length>0?q.pop():null},recycleElement:(Q,Z=!1)=>{if(!Q)return;if(!Z&&Q.innerHTML.length<100)return;let q=Q.dataset.itemType||"default";if(!J.has(q))J.set(q,[]);let j=J.get(q);if(j.length<50){Q.style.display="none",Q.style.top="-9999px";for(let K in Q.dataset)if(K!=="itemType")delete Q.dataset[K];j.push(Q)}},getPool:(Q)=>{return J.get(Q)||[]},clear:()=>{J.forEach((Q)=>{Q.length=0}),J.clear()},getSize:()=>{let Q=0;return J.forEach((Z)=>{Q+=Z.length}),Q}}};function j4(J){let $=Boolean(J.baseUrl),Q=!$,Z=Q?J.staticItems||J.items||[]:[],q=J.pagination?.strategy||"cursor";return{items:Z,visibleItems:[],visibleRange:{start:0,end:0},totalHeight:0,totalHeightDirty:!0,itemHeights:new Map,loading:!1,cursor:null,page:q==="page"?1:void 0,paginationStrategy:q,hasNext:$,itemElements:new Map,scrollTop:0,containerHeight:0,scrollRAF:null,resizeRAF:null,mounted:!1,itemCount:Z.length,useStatic:Q,renderHook:null}}function K4(J,$,Q,Z=!0){let q=Q.cursor??null,j=Q.hasNext??!1,K=J.page;if(Q.page!==void 0)K=Q.page;else if(q&&/^\d+$/.test(q))K=parseInt(q,10)-1;if(J.paginationStrategy==="page"&&Q.page===void 0&&!q)K=J.page;let G;if(J.paginationStrategy==="page"&&J.page===1)G=[...$];else{let z=$;if(Z&&$.length>0&&J.items.length>0){let Y=new Set;for(let U=0;U<J.items.length;U++){let X=J.items[U];if(X&&X.id)Y.add(X.id)}z=$.filter((U)=>U&&U.id&&!Y.has(U.id))}G=[...J.items,...z]}let W=Q.total!==void 0?Q.total:G.length;return{items:G,cursor:q,page:K,hasNext:j,totalHeightDirty:!0,itemCount:W}}function G4(J,$,Q){return{visibleItems:$,visibleRange:Q}}function O8(J,$){return{totalHeight:$,totalHeightDirty:!1}}function P8(J,$){return{loading:$}}function z4(J,$=[]){return{items:J.useStatic?[...$]:[],visibleItems:[],visibleRange:{start:0,end:0},itemElements:new Map,cursor:null,page:J.paginationStrategy==="page"?1:void 0,hasNext:!J.useStatic,totalHeightDirty:!0,itemCount:J.useStatic?$.length:0}}function W4(J,$){let Q={};switch($||J.paginationStrategy||"cursor"){case"page":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);else if(J.page!==void 0)Q.page=J.page;else Q.page=1;break}case"offset":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.offset=parseInt(J.cursor,10);else Q.offset=0;break}case"cursor":default:{if(J.cursor)Q.cursor=J.cursor;if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);break}}return Q}var R8=(J,$,Q)=>{Q.collection=J;let Z=l0(Q);if(!$||!($ instanceof HTMLElement))throw new Error("List manager requires a valid container element");let q=r0(Z),j=!q,K=j?p0(Z):[],G=j4(Z);G.useStatic=j;let W=m0($),z=i0(Z.itemHeight),Y=q4(),U=e0(Z,W,z,Y),X=M8({transform:Z.transform,initialCapacity:j?K.length:50}),_=q?V8({base:Z.baseUrl,endpoints:{list:`/${J}`},headers:{"Content-Type":"application/json"},cache:!0,pagination:Z.pagination?{strategy:Z.pagination.strategy||"cursor",...Z.pagination}:{strategy:"cursor"}}):null,H=[],B=async(L={})=>{try{if(Object.assign(G,P8(G,!0)),G.useStatic)return{items:[...G.items],meta:{cursor:null,hasNext:!1}};if(!_)throw new Error("Cannot load items: API adapter not initialized");let D=await _.read(L),R=Array.isArray(D.items)?D.items.map(Z.transform):[];if(Object.assign(G,K4(G,R,D.meta,Z.dedupeItems)),G.paginationStrategy==="page"&&L.page===1){if(await X.clear(),R.length>0)await X.add(R)}else if(Z.dedupeItems){let w=new Set(G.items.map((x)=>x.id).filter(Boolean)),A=R.filter((x)=>!w.has(x.id));if(A.length>0)await X.add(A)}else await X.add(R);if(G.totalHeightDirty=!0,Z.afterLoad){let w=[...G.items],A={loading:!1,hasNext:G.hasNext,hasPrev:!!L.cursor||L.page&&L.page>1,items:[...R],allItems:w};Z.afterLoad(A)}if(G.paginationStrategy==="cursor"&&D.meta?.cursor)G.cursor=D.meta.cursor;else if(G.paginationStrategy==="page"&&L.page)G.page=L.page;return{items:R,meta:D.meta}}catch(D){return console.error(`Error loading ${J}:`,D),{items:[],meta:{cursor:null,hasNext:!1}}}finally{Object.assign(G,P8(G,!1))}},k=(L=G.scrollTop)=>{if(!G.mounted)return;if(G.containerHeight===0)G.containerHeight=$.clientHeight;G.scrollTop=L;let D=o0(L,G.items,G.containerHeight,z,Z);if(D.start===G.visibleRange.start&&D.end===G.visibleRange.end)return;if(Object.assign(G,G4(G,G.items.slice(D.start,D.end).filter(Boolean),D)),typeof z.calculateOffsets==="function")z.calculateOffsets(G.items);if(G.totalHeightDirty){let w=z.calculateTotalHeight(G.items);Object.assign(G,O8(G,w)),L8(W,w)}if(U.renderVisibleItems(G.items,D),z.measureMarkedElements(W.content,G.items)){let w=z.calculateTotalHeight(G.items);Object.assign(G,O8(G,w)),L8(W,w)}M(L)},M=(L)=>{if(G.loading||!G.hasNext)return;if(n0(L,G.containerHeight,G.totalHeight,Z.loadThreshold))V()},V=async()=>{if(G.loading||!G.hasNext)return{hasNext:G.hasNext,items:[]};if(G.useStatic)return{hasNext:!1,items:[]};let L=Z.pagination?.strategy||"cursor";if(G.paginationStrategy=L,L==="page")if(G.cursor&&/^\d+$/.test(G.cursor))G.page=parseInt(G.cursor,10);else if(G.page!==void 0)G.page+=1;else G.page=1;let D=W4(G,L);if(!D.limit&&!D.per_page)if(L==="page"){let w=Z.pagination?.perPageParamName||"per_page";D[w]=Z.pageSize||20}else{let w=Z.pagination?.limitParamName||"limit";D[w]=Z.pageSize||20}let R=await B(D);return k(G.scrollTop),{hasNext:G.hasNext,items:R.items}},F=async()=>{if(Object.assign(G,z4(G,K)),Y.clear(),X.clear(),G.useStatic&&K&&K.length>0)G.items=[...K],await X.add(K);else await B();k(0)},N=(L,D="start")=>{if(typeof z.calculateOffsets==="function")z.calculateOffsets(G.items);let R=z.getItemOffset(G.items,L);if(R===-1)return;let w=R;if(D==="center")w=R-G.containerHeight/2;else if(D==="end"){let A=G.items.findIndex((I)=>I&&I.id===L);if(A===-1)return;let x=z.getItemHeight(G.items[A]);w=R-G.containerHeight+x}$.scrollTo({top:Math.max(0,w),behavior:"smooth"})},P=(()=>{G.mounted=!0;let D=J4($,W,Z,{onScroll:k,onLoadMore:V}).setup();H.push(D);let R=X.subscribe(({event:w})=>{if(w===Y6.CHANGE)G.totalHeightDirty=!0,requestAnimationFrame(()=>{k(G.scrollTop)})});if(H.push(R),G.useStatic&&K&&K.length>0)X.add(K).then(()=>{requestAnimationFrame(()=>{k(G.scrollTop)})}).catch((w)=>{console.error("Error adding static items to collection:",w)});else if(!G.useStatic)B().then(()=>{requestAnimationFrame(()=>{k(G.scrollTop)})}).catch((w)=>{console.error("Error loading items:",w)});if("ResizeObserver"in window){let w=new ResizeObserver((A)=>{for(let x of A)if(x.target===$){let I=$.clientHeight;if(I!==G.containerHeight){if(G.containerHeight=I,G.resizeRAF)cancelAnimationFrame(G.resizeRAF);G.resizeRAF=requestAnimationFrame(()=>{k(G.scrollTop),G.resizeRAF=null})}}});w.observe($),H.push(()=>{if(w.disconnect(),G.resizeRAF)cancelAnimationFrame(G.resizeRAF),G.resizeRAF=null})}else{let w=null,A=()=>{if(w)clearTimeout(w);w=window.setTimeout(()=>{let x=$.clientHeight;if(x!==G.containerHeight)G.containerHeight=x,k(G.scrollTop);w=null},100)};window.addEventListener("resize",A,{passive:!0}),H.push(()=>{if(window.removeEventListener("resize",A),w)clearTimeout(w),w=null})}return()=>{H.forEach((w)=>w()),H.length=0,G.mounted=!1}})();return{loadItems:B,loadMore:V,refresh:F,updateVisibleItems:k,scrollToItem:N,setItemHeights:(L)=>{let D=z.setItemHeights(L);if(D)G.totalHeightDirty=!0,k(G.scrollTop);return D},getCollection:()=>X,getVisibleItems:()=>G.visibleItems,getAllItems:()=>G.items,isLoading:()=>G.loading,hasNextPage:()=>G.hasNext,isApiMode:()=>q,setRenderHook:(L)=>{U.setRenderHook(L),k(G.scrollTop)},destroy:()=>{if(P(),X.clear(),typeof z.clear==="function")z.clear();if(Y.clear(),W.content)W.content.innerHTML="";if(c0(W),_&&typeof _.disconnect==="function")_.disconnect()}}},Hq;var A8=T(()=>{V7();_8();s0();$4();Z4();Hq={track:(J)=>({id:J._id,headline:J.title||"Untitled",supportingText:J.artist||"Unknown Artist",meta:J.year?.toString()||""}),playlist:(J)=>({id:J._id,headline:J.name||"Untitled Playlist",supportingText:`${J.tracks?.length||0} tracks`,meta:J.creator||""}),country:(J)=>({id:J._id,headline:J.name||J.code,supportingText:J.continent||"",meta:J.code||""})}});var Y4=T(()=>{V7();V7();V7();A8();N8();_8()});var U4=(J,$,Q,Z,q,j)=>{if(Z<0||q<0)return;let K=typeof j==="number"?[j,j,j,j]:j,[G,W,z,Y]=K;J.beginPath(),J.moveTo($+G,Q),J.lineTo($+Z-W,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+W),J.lineTo($+Z,Q+q-z),J.quadraticCurveTo($+Z,Q+q,$+Z-z,Q+q),J.lineTo($+Y,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-Y),J.lineTo($,Q+G),J.quadraticCurveTo($,Q,$+G,Q),J.closePath()},QX=(J,$,Q,Z,q,j,K)=>{if(J.save(),K)J.fillStyle=K;U4(J,$,Q,Z,q,j),J.fill(),J.restore()},X4=(J,$,Q,Z,q,j)=>{return J.save(),U4(J,$,Q,Z,q,j),J.clip(),()=>J.restore()},B4=(J,$,Q,Z,q,j,K,G)=>{if(Z<0||q<0)return;if(J.save(),G)J.fillStyle=G;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+Z-K,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+K),J.lineTo($+Z,Q+q-K),J.quadraticCurveTo($+Z,Q+q,$+Z-K,Q+q),J.lineTo($+j,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},F4=(J,$,Q,Z)=>{if(Z)J.fillStyle=Z,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var w8=(J)=>{let j=J;for(let U=0;U<4;U++){let B=j*j,M=1.6*(B*j)+-1.8000000000000003*B+1.2000000000000002*j-J,V=4.800000000000001*B+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(M)<0.00001)break;j=j-M/V}let K=0,G=3-K,W=1-K-G,z=j*j,Y=z*j;return W*Y+G*z+K*j},H4,qX;var M4=T(()=>{H4={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},qX={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:w8}});class Mq{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class kq{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var k4=(J,$,Q)=>{let Z=window.devicePixelRatio||1,q=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*Z),J.height=Math.round(Q*Z),q.setTransform(1,0,0,1,0,0),q.scale(Z,Z),{canvas:J,ctx:q,width:$,height:Q,pixelRatio:Z}},N4=(J,$,Q)=>{let{canvas:Z,ctx:q,pixelRatio:j}=J;Z.style.width=`${$}px`,Z.style.height=`${Q}px`,Z.width=Math.round($*j),Z.height=Math.round(Q*j),J.width=$,J.height=Q,q.setTransform(1,0,0,1,0,0),q.scale(j,j)},V4=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},x8=(J,$)=>{let Q=B6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},_4=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var L4=T(()=>{$9()});var y8=T(()=>{M4();L4()});var _7=T(()=>{J6();A9();v0();C0();Q$();Y4();y8();w6();J8();$9();p7()});var D4=({disabled:J,lifecycle:$})=>(Q)=>{let Z={setText:(K)=>{return Q.text.setText(K),Z},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},q={setIcon:(K)=>{return Q.icon.setIcon(K),q},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:Z,icon:q,disabled:J,lifecycle:$,getClass:Q.getClass,on:(K,G)=>{if(Q.on)Q.on(K,G);return j},off:(K,G)=>{if(Q.off)Q.off(K,G);return j},addClass:(...K)=>{if(Q.addClass)Q.addClass(...K);else g(Q.element,...K);return j},getValue:()=>Q.element.value,setValue(K){return Q.element.value=K,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(K){return Q.text.setText(K),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let K=Q.icon.getElement();return!!K&&!!K.innerHTML.trim()&&!!K.parentNode},setIcon(K){let G=Q.componentName||"button",W=Q.getClass(G);if(!K){let z=Q.icon.getElement();if(z&&z.parentNode)z.parentNode.removeChild(z),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${W}--icon`)}else if(!j.hasIcon()){let z=document.createElement("span");if(z.className=`${Q.getClass("button-icon")}`,z.innerHTML=K,Q.element.firstChild)Q.element.insertBefore(z,Q.element.firstChild);else Q.element.appendChild(z);Q.icon.getElement=()=>z,Q.icon.getIcon=()=>K,Q.element.classList.add(`${W}--icon`)}else{let z=Q.icon.getElement();if(z)z.innerHTML=K}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(K){let G=Q.componentName||"button",W=Q.getClass(G);return["filled","tonal","outlined","elevated","text"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},getVariant(){let K=Q.componentName||"button",G=Q.getClass(K),W=["filled","tonal","outlined","elevated","text"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"filled"},getSize(){let K=Q.componentName||"button",G=Q.getClass(K),W=["xs","s","m","l","xl"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"s"},setSize(K){let G=Q.componentName||"button",W=Q.getClass(G);return["xs","s","m","l","xl"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},getShape(){let K=Q.componentName||"button",G=Q.getClass(K),W=["round","square"];for(let z of W)if(Q.element.classList.contains(`${G}--${z}`))return z;return"round"},setShape(K){let G=Q.componentName||"button",W=Q.getClass(G);return["round","square"].map((Y)=>`${W}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${W}--${K}`),j},setActive(K){if(K)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(K){return Q.element.setAttribute("aria-label",K),j},destroy(){$.destroy()},updateCircularStyle(){let K=Q.text.getText()!=="",G=j.hasIcon();if(!K)g(Q.element,"button--circular"),j6(Q.element,"button--icon");else j6(Q.element,"button--circular");if(G&&K)g(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(K)=>{return await Q.setProgress(K),j};if(Q.setProgressSync)j.setProgressSync=(K)=>{return Q.setProgressSync(K),j};if(Q.setIndeterminate)j.setIndeterminate=async(K)=>{return await Q.setIndeterminate(K),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(K)=>{return Q.setIndeterminateSync(K),j};if(Q.setLoading)j.setLoading=async(K,G)=>{return await Q.setLoading(K,G),j};if(Q.setLoadingSync)j.setLoadingSync=(K,G)=>{return Q.setLoadingSync(K,G),j};return j};var O4=T(()=>{_7()});var Z$,q$,j$,K$,P4,m9;var T8=T(()=>{Z$={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},q$={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},j$={ROUND:"round",SQUARE:"square"},K$={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},P4={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},m9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Nq,R4=(J={})=>u(Nq,J,"button"),A4=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},w4=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var x4=T(()=>{t();T8();Nq={variant:Z$.FILLED,size:q$.S,shape:j$.ROUND,disabled:!1,type:K$.BUTTON,ripple:!0,rippleConfig:{duration:m9.DURATION,timing:m9.TIMING,opacity:m9.OPACITY}}});var Vq=(J={})=>{let $=R4(J);try{return b(S,d(),h(A4($)),K6($),f7($),Y9($),U9($),G6($),S0($),S6($),C(),(Z)=>{if($.shape&&Z.element){let q=`${$.prefix}-${$.componentName}--${$.shape}`;Z.element.classList.add(q)}return Z},(Z)=>D4(w4(Z))(Z))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},Q9;var y4=T(()=>{J6();c();o();b0();O4();x4();Q9=Vq});var T4={};KJ(T4,{default:()=>Q9});var T9=T(()=>{y4()});var G9={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},y$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},T$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},P9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},I$={START:"start",CENTER:"center",END:"end"},$6={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var E7={FILLED:"filled",OUTLINED:"outlined"},h7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},S$={MOUSE:"mouse",KEYBOARD:"keyboard"},b$={CHANGE:"change",OPEN:"open",CLOSE:"close"},v$={DROPDOWN:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},E9={VARIANT:E7.FILLED,PLACEMENT:h7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},C$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};K7();J6();t();var Z8={CENTER:"center",END:"end"},q8=300;var s3={tag:"div",hasFab:!1,fabPosition:Z8.END,autoHide:!1,transitionDuration:q8},Y0=(J={})=>u(s3,J,"bottom-app-bar");var U0=(J={})=>{let $=Y0(J),Q=S($),Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-actions`;let q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=h({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),K=d()(j),G=C()(K);G.element.appendChild(Z),G.element.appendChild(q);let W=!0,z=window.scrollY;if($.autoHide){let U=()=>{let _=window.scrollY;if(_>z+10){if(W)Y.hide(),$.onVisibilityChange?.(!1)}else if(_<z-10){if(!W)Y.show(),$.onVisibilityChange?.(!0)}z=_};window.addEventListener("scroll",U,{passive:!0});let X=G.lifecycle.destroy;G.lifecycle.destroy=()=>{window.removeEventListener("scroll",U),X()}}let Y={...G,addAction(U){return Z.appendChild(U),this},addFab(U){return q.innerHTML="",q.appendChild(U),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),W=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),W=!1,this},isVisible(){return W},getActionsContainer(){return Z}};if($.autoHide&&$.transitionDuration)Y.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return Y};var m3=U0;T9();J6();c();o();var I8=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let Z=$.element.querySelector(`.${$.getClass("card")}-header`);if(Z)Z.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),K=j[j.length-1];if(K.nextSibling)$.element.insertBefore(Q,K.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,Z="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(Z==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let Z=$.element.querySelector(`.${$.getClass("card")}-actions`);if(Z)Z.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(Z)=>{$.element.setAttribute("aria-grabbed","true"),Q(Z)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});t();w6();J6();c();A6();var G$=(J={})=>{let $={...J,componentName:"card-content",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${f}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((Z)=>{if(Z instanceof HTMLElement)Q.element.appendChild(Z)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},z$=(J={})=>{let $={...J,componentName:"card-header",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),Z=v({tag:"div",className:`${f}-card-header-text`,container:Q.element});if(J.title){v({tag:"h3",className:`${f}-card-header-title`,text:J.title,container:Z,attributes:{id:`${Q.element.id||"card-header"}-title`}});let q=Q.element.closest(`.${f}-card`);if(q&&!q.hasAttribute("aria-labelledby"))q.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)v({tag:"h4",className:`${f}-card-header-subtitle`,text:J.subtitle,container:Z});if(J.avatar){let q=typeof J.avatar==="string"?v({tag:"div",className:`${f}-card-header-avatar`,html:J.avatar}):J.avatar,j=q.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(q,Q.element.firstChild)}if(J.action){let q=typeof J.action==="string"?v({tag:"div",className:`${f}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},L7=(J={})=>{let $={...J,componentName:"card-actions",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${f}-card-actions--full-bleed`:null,J.vertical?`${f}-card-actions--vertical`:null,J.align?`${f}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((Z,q)=>{if(Z instanceof HTMLElement){if(!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby")&&Z.textContent?.trim()==="")Z.setAttribute("aria-label",`Action ${q+1}`);Q.element.appendChild(Z)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},D7=(J={})=>{let $={...J,componentName:"card-media",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${f}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${f}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let Z=document.createElement("img");if(Z.src=J.src,Z.className=`${f}-card-media-img`,Z.alt=J.alt||"",!J.alt)Z.setAttribute("aria-hidden","true");Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var I9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},O7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},S8={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},I4={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},b8={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},S4={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},b4={TOP:"top",BOTTOM:"bottom"},v4={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var _q={variant:I9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},C4=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},E4=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=z$($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=G$($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=L7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (T9(),T4)).then(({default:Q})=>{let Z=$.buttons.map((j)=>Q(j).element),q=L7({actions:Z,align:$.actionsConfig?.align||"end"});J.setActions(q)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},h4=(J={})=>u(_q,J,"card"),u4=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",Z={};if(J.aria)Object.entries(J.aria).forEach(([q,j])=>{if(j!==void 0){let K=q.startsWith("aria-")?q:`aria-${q}`;Z[K]=j}});if(!Z.role&&!J.aria?.role)Z.role=Q;if($&&!Z.tabindex)Z.tabindex="0";return p(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:Z,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},f4=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),S9=O7,g4=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL1))}),J.element.addEventListener("keydown",(Z)=>{if((Z.key==="Enter"||Z.key===" ")&&$.clickable)Z.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(Z)=>{if(J.element.style.setProperty("--card-elevation",String(S9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:Z}),Z.dataTransfer){let q=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";Z.dataTransfer.setData("text/plain",q)}}),J.element.addEventListener("dragend",(Z)=>{J.element.style.setProperty("--card-elevation",String(S9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:Z})});return J};w6();A6();var Lq=(J={})=>($)=>{let Q=J.initialState||!1,Z=null,q=Q;function j(K){if(q=K,K&&!Z)Z=v({tag:"div",className:`${f}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),v({tag:"div",className:`${f}-card-loading-spinner`,container:Z}),$.element.classList.add(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!K&&Z)Z.remove(),Z=null,$.element.classList.remove(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>q,setLoading:j}}},v8=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(S9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(S9.LEVEL0));return J},Dq=(J={})=>($)=>{let Q=J.initialExpanded||!1,Z=Q,q=J.expandableContent,j=v({tag:"button",className:`${f}-card-expand-button`,attributes:{"aria-expanded":Z?"true":"false","aria-label":Z?"Collapse content":"Expand content","aria-controls":q?.id||`${$.element.id||"card"}-expandable-content`}}),K=$.element.querySelector(`.${f}-card-actions`);if(K)K.appendChild(j);else v({tag:"div",className:`${f}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(q){if(q.classList.add(`${f}-card-expandable-content`),!q.id)q.id=`${$.element.id||"card"}-expandable-content`;if(!Q)q.style.display="none",q.setAttribute("aria-hidden","true");else q.setAttribute("aria-hidden","false");$.element.appendChild(q)}function G(z){if(Z=z,q)q.style.display=z?"block":"none",q.setAttribute("aria-hidden",z?"false":"true");if(j.setAttribute("aria-expanded",z?"true":"false"),j.setAttribute("aria-label",z?"Collapse content":"Expand content"),z)$.element.classList.add(`${f}-card--expanded`);else $.element.classList.remove(`${f}-card--expanded`);$.emit?.("expandedChanged",{expanded:z})}function W(){G(!Z)}return j.addEventListener("click",(z)=>{z.stopPropagation(),W()}),j.addEventListener("keydown",(z)=>{if(z.key==="Enter"||z.key===" ")z.preventDefault(),W()}),{...$,expandable:{isExpanded:()=>Z,setExpanded:G,toggleExpanded:W}}},Oq=(J={})=>($)=>{let Q=J.threshold||100,Z=0,q=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=v({tag:"button",className:`${f}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),K=v({tag:"button",className:`${f}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),K.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function G(Y){Z=Y.touches[0].clientX,$.element.style.transition="none"}function W(Y){if(!Z)return;q=Y.touches[0].clientX;let U=q-Z;$.element.style.transform=`translateX(${U}px)`}function z(){if(!Z)return;$.element.style.transition="transform 0.3s ease";let Y=q-Z;if(Math.abs(Y)>=Q)if(Y>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(Y<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";Z=0,q=0}return $.element.addEventListener("touchstart",G),$.element.addEventListener("touchmove",W),$.element.addEventListener("touchend",z),$.element.classList.add(`${f}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var Pq=(J={})=>{let $=C4(J),Q=h4($);try{let Z=b(S,d(),h(u4(Q)),K6(Q),Q.clickable?S6(Q):(q)=>q,C(),g4,v8,(q)=>I8(f4(q))(q))(Q);return E4(Z,$),Z}catch(Z){throw console.error("Card creation error:",Z instanceof Error?Z.message:String(Z)),new Error(`Failed to create card: ${Z instanceof Error?Z.message:String(Z)}`)}},d4=Pq;J6();c();o();var M9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},l4={DEFAULT:"default",SNAP:"snap"},Rq={LARGE:"large",MEDIUM:"medium",SMALL:"small"},W$={SLIDE:"slide",FADE:"fade",NONE:"none"},a9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},F6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:W$.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:M9.MULTI_BROWSE,SCROLL_BEHAVIOR:l4.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[M9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[M9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[M9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[M9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var C8=(J)=>($)=>{let Q={...$},Z=J.layout||F6.LAYOUT,q=()=>{let F=document.createElement("div");return F.className=`${$.getClass("carousel")}-wrapper`,F.dataset.layout=Z,$.element.appendChild(F),F},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||F6.GAP}`;let K=q();K.appendChild(j);let G=J.initialSlide||0,W=0,z=[],Y=[];function U(F){if(Y[F]?.size)return Y[F].size;switch(Z){case"multi-browse":if(F===0||F===1)return"large";if(F===2)return"medium";return"small";case"uncontained":return"large";case"hero":return F===0?"large":"small";case"full-screen":return"large";default:return"large"}}function X(){let F=j.clientWidth,N=typeof F6.ITEM_WIDTHS[Z].LARGE==="number"?F6.ITEM_WIDTHS[Z].LARGE:F,O=typeof F6.ITEM_WIDTHS[Z].MEDIUM==="number"?F6.ITEM_WIDTHS[Z].MEDIUM:F*0.75,P=typeof F6.ITEM_WIDTHS[Z].SMALL==="number"?F6.ITEM_WIDTHS[Z].SMALL:F6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")N=Math.min(N,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")P=J.smallItemWidth;if(Z==="full-screen")N=F,O=F,P=F;z.forEach((L,D)=>{let R=U(D);switch(R){case"large":L.style.width=`${N}px`;break;case"medium":L.style.width=`${O}px`;break;case"small":L.style.width=`${P}px`;break}L.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let w=L.querySelector(`.${$.getClass("carousel")}-slide-title`),A=L.querySelector(`.${$.getClass("carousel")}-slide-description`);if(w)if(R==="small"&&Z!=="uncontained")w.classList.add("visually-hidden");else w.classList.remove("visually-hidden");if(A)if(R==="small"||R==="medium"&&Z==="multi-browse")A.classList.add("visually-hidden");else A.classList.remove("visually-hidden")})}function _(F,N){let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide`,O.setAttribute("role","listitem"),O.setAttribute("aria-roledescription","slide"),O.dataset.borderRadius=`${J.borderRadius||F6.BORDER_RADIUS}`;let P=document.createElement("div");P.className=`${$.getClass("carousel")}-slide-image`;let L=document.createElement("img");if(L.src=F.image,L.alt=F.title||"Carousel slide",P.appendChild(L),F.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,F.accent)R.style.backgroundColor=F.accent;P.appendChild(R)}let D=document.createElement("div");if(D.className=`${$.getClass("carousel")}-slide-content`,F.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=F.title,Z==="full-screen")D.appendChild(R);else P.appendChild(R)}if(F.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=F.description,D.appendChild(R)}if(F.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=F.buttonText,F.buttonUrl)R.href=F.buttonUrl;if(F.accent)R.style.backgroundColor=F.accent;D.appendChild(R)}if(O.appendChild(P),O.appendChild(D),N!==void 0&&N>=0&&N<=Y.length)Y.splice(N,0,F);else Y.push(F);if(N!==void 0&&N>=0&&N<=z.length)if(N<z.length)j.insertBefore(O,z[N]),z.splice(N,0,O);else j.appendChild(O),z.push(O);else j.appendChild(O),z.push(O);return W++,X(),O}let H=()=>{if(J.showAllLink===!1)return;let F=document.createElement("div");F.className=`${$.getClass("carousel")}-show-all`,F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.setAttribute("aria-label","Show all items");let N=document.createElement("span");N.textContent="Show all",F.appendChild(N),K.appendChild(F),F.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),F.addEventListener("keydown",(O)=>{if(O.key==="Enter"||O.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();O.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((F)=>{_(F)});if(J.showAllLink!==!1&&Z!=="full-screen")H();let B=()=>{X();let F=new CustomEvent(a9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(F)};window.addEventListener("resize",B),setTimeout(X,0);let k=(F)=>{if(F<0||F>=W)if(J.loop)if(F<0)F=W-1;else F=0;else return Q;if(G!==F){let N=new CustomEvent(a9.SLIDE_CHANGE,{detail:{previousSlide:G,nextSlide:F}});$.element.dispatchEvent(N),G=F,z.forEach((L,D)=>{if(D===G)L.classList.add(`${$.getClass("carousel")}-slide--active`),L.setAttribute("aria-current","true");else L.classList.remove(`${$.getClass("carousel")}-slide--active`),L.removeAttribute("aria-current")});let O=J.scrollBehavior==="snap"?"smooth":"auto";if(z[F])if(Z==="hero"&&J.centered){let L=z[F].offsetWidth,D=j.clientWidth,R=z[F].offsetLeft;j.scrollTo({left:R-D/2+L/2,behavior:O})}else z[F].scrollIntoView({behavior:O,block:"nearest",inline:"start"});let P=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(P)}return Q};if(Object.assign(Q,{slides:{addSlide:(F,N)=>{return _(F,N),Q.slides},removeSlide:(F)=>{if(F>=0&&F<z.length){if(j.removeChild(z[F]),z.splice(F,1),Y.splice(F,1),W--,G>=W)G=W-1;if(G<0)G=0;X()}return Q.slides},updateSlide:(F,N)=>{if(F>=0&&F<z.length){Y[F]=N;let O=z[F],P=O.querySelector("img");if(P)P.src=N.image,P.alt=N.title||"Carousel slide";let L=O.querySelector(`.${$.getClass("carousel")}-slide-title`);if(L&&N.title)L.textContent=N.title;let D=O.querySelector(`.${$.getClass("carousel")}-slide-description`);if(D&&N.description)D.textContent=N.description;let R=O.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&N.accent)R.style.backgroundColor=N.accent;let w=O.querySelector(`.${$.getClass("carousel")}-slide-button`);if(w)if(N.buttonText){if(w.textContent=N.buttonText,N.buttonUrl)w.href=N.buttonUrl;if(N.accent)w.style.backgroundColor=N.accent}else w.parentElement?.removeChild(w);else if(N.buttonText){let A=O.querySelector(`.${$.getClass("carousel")}-slide-content`);if(A){let x=document.createElement("a");if(x.className=`${$.getClass("carousel")}-slide-button`,x.textContent=N.buttonText,N.buttonUrl)x.href=N.buttonUrl;if(N.accent)x.style.backgroundColor=N.accent;A.appendChild(x)}}if(N.size)X()}return Q.slides},getSlide:(F)=>{if(F>=0&&F<Y.length)return Y[F];return null},getCount:()=>W,getElements:()=>[...z]},slidesContainer:j,slideData:Y,wrapper:K,getCurrentSlide:()=>G,goTo:k,next:()=>k(G+1),prev:()=>k(G-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(F)=>{return J.borderRadius=F,z.forEach((N)=>{N.dataset.borderRadius=`${F}`}),Q},setGap:(F)=>{return J.gap=F,j.dataset.gap=`${F}`,Q},updateLayout:(F)=>{return J.layout=F,K.dataset.layout=F,$.element.dataset.layout=F,Object.values(M9).forEach((N)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${N}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${F}`),X(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let F=0,N=1/0,O=j.scrollLeft,P=j.clientWidth;if(z.forEach((L,D)=>{let w=L.offsetLeft+L.offsetWidth/2,A=O+P/2,x=Math.abs(w-A);if(x<N)N=x,F=D}),F!==G){G=F,z.forEach((D,R)=>{if(R===G)D.classList.add(`${$.getClass("carousel")}-slide--active`),D.setAttribute("aria-current","true");else D.classList.remove(`${$.getClass("carousel")}-slide--active`),D.removeAttribute("aria-current")});let L=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(L)}},150)});return Q};var E8=(J)=>($)=>{let Q,Z,q,j=!1,K=0,G=0,W,z=J.scrollBehavior||"default",Y=(N)=>{if(N.button!==0)return;cancelAnimationFrame(W),Q=N.clientX,Z=$.slidesContainer.scrollLeft,q=Q,j=!0,G=Date.now(),K=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(N.pointerId),N.preventDefault()},U=(N)=>{if(!j)return;let O=N.clientX-Q;$.slidesContainer.scrollLeft=Z-O;let P=Date.now(),L=P-G;if(L>0)K=(N.clientX-q)/L;q=N.clientX,G=P,N.preventDefault()},X=()=>{let N=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft,L=J.layout==="hero"&&J.centered,D=0,R=1/0;return N.forEach((w)=>{let A;if(L)A=w.offsetLeft+w.offsetWidth/2-O/2;else A=w.offsetLeft;let x=Math.abs(A-P);if(x<R)R=x,D=A}),D},_=(N,O,P)=>{let L=Date.now(),D=O-N,R=500;if(Math.abs(P)>0.5)R=Math.min(R,300);let w=()=>{let A=Date.now()-L,x=Math.min(A/R,1);x=1-Math.pow(1-x,3);let I=N+D*x;if($.slidesContainer.scrollLeft=I,x<1)W=requestAnimationFrame(w)};W=requestAnimationFrame(w)},H=(N)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(N.pointerId),z==="snap"){let O=X();_($.slidesContainer.scrollLeft,O,K)}else if(Math.abs(K)>0.5){let O=K*100,P=$.slidesContainer.scrollLeft-O;_($.slidesContainer.scrollLeft,P,K)}K=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},B=(N)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(N.pointerId),$.slidesContainer.style.scrollBehavior=""},k=(N)=>{if(J.layout==="full-screen")return;N.preventDefault();let P=(N.deltaY||N.deltaX)*0.5;if(z==="snap")$.slidesContainer.scrollLeft+=P,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let L=X();_($.slidesContainer.scrollLeft,L,0)},150);else $.slidesContainer.scrollLeft+=P},M=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let N=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft;N.forEach((L)=>{let{offsetLeft:D,offsetWidth:R}=L,w=D+R/2,A=P+O/2,x=w-A,I=Math.max(-1,Math.min(1,x/(O/2))),r=L.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${I*-5}%)`})},V=()=>{M()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",Y),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",B),$.slidesContainer.addEventListener("wheel",k,{passive:!1}),$.slidesContainer.addEventListener("scroll",V,{passive:!0});let F=(N)=>{if($.element!==document.activeElement)return;switch(N.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:z==="snap"?"smooth":"auto"});N.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:z==="snap"?"smooth":"auto"});N.preventDefault();break;case"Home":if($.goTo)$.goTo(0);N.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);N.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",F),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(W),$.slidesContainer.removeEventListener("pointerdown",Y),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",B),$.slidesContainer.removeEventListener("wheel",k),$.slidesContainer.removeEventListener("scroll",V),$.element.removeEventListener("keydown",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var r4=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(Z,q)=>{return J.slides.addSlide(Z,q),Q.slides},removeSlide:(Z)=>{return J.slides.removeSlide(Z),Q.slides},updateSlide:(Z,q)=>{return J.slides.updateSlide(Z,q),Q.slides},getSlide:(Z)=>{if($.slideData&&Z>=0&&Z<$.slideData.length)return $.slideData[Z];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(Z){return $.goTo(Z),this},getCurrentSlide:$.getCurrentSlide,addSlide(Z,q){return J.slides.addSlide(Z,q),this},removeSlide(Z){return J.slides.removeSlide(Z),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(Z){if($.setBorderRadius)$.setBorderRadius(Z);return this},setGap(Z){if($.setGap)$.setGap(Z);return this},destroy(){J.lifecycle.destroy()},on(Z,q){if($.on)$.on(Z,q);else if($.element.addEventListener)$.element.addEventListener(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);else if($.element.removeEventListener)$.element.removeEventListener(Z,q);return this},addClass(...Z){if($.addClass)$.addClass(...Z);else Z.forEach((q)=>$.element.classList.add(q));return this}};return Q};t();var Aq={initialSlide:F6.INITIAL_SLIDE,loop:F6.LOOP,transition:W$.SLIDE,transitionDuration:F6.TRANSITION_DURATION,borderRadius:F6.BORDER_RADIUS,gap:F6.GAP,prefix:"carousel",showAllLink:!0},p4=(J={})=>u(Aq,J,"carousel"),s4=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return p(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var wq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||xq(J.layout);let $=p4(J);try{let Z={...b(S,d(),h(s4($)))($)};yq(Z,J);let q=C8($)(Z),j=E8($)(q),K=C()(j),G={slides:{addSlide:K.slides.addSlide,removeSlide:K.slides.removeSlide,updateSlide:K.slides.updateSlide,getCount:K.slides.getCount,getElements:K.slides.getElements},lifecycle:{destroy:K.lifecycle.destroy}},W=r4(G)(K);return W.element.dataset.layout=J.layout,W.element.dataset.scrollBehavior=J.scrollBehavior,W}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function xq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function yq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var m4=wq;J6();c();o();var a4=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(q){return Z.setIndeterminate?.(q),this},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});t();var Tq={variant:"filled",labelPosition:"end"},c4=(J={})=>u(Tq,J,"checkbox"),i4=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),o4=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.innerHTML=`
10
10
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
11
11
  <path d="M9.55 14.6L6.35 11.4l-1.9 1.9L9.55 18.4l10.9-10.9-1.9-1.9z"/>
12
12
  </svg>
13
- `,$.element.appendChild(Q),$},t4=(J)=>($)=>{let Q=J.labelPosition||"end",Z=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(Z),$},n4=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var Iq=(J,$)=>{let Q=f9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(Z)=>{return Q.input.indeterminate=Z,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,Z),Q},Q},Sq=(J={})=>{let $=c4(J);try{return b(S,d(),h(i4($)),u9($),o4($),X9($),t4($),(Z)=>Iq(Z,$),G6($),C(),(Z)=>a4(n4(Z))(Z))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},e4=Sq;var h8={FILLED:"filled",OUTLINED:"outlined"},u8={START:"start",END:"end"},$5={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},J5={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};J6();c();o();var Q5=({disabled:J,lifecycle:$})=>(Q)=>{let Z=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),q=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return q=j,j;if(q!==null)return Q.element.setAttribute("data-value",q),q;let G=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(G&&G.textContent){let K=G.textContent;if(K.includes(" Theme"))q=K.replace(" Theme","").toLowerCase();else q=K.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",q),q}return null},setValue(j){if(j!==null&&j!==void 0)q=j,Q.element.setAttribute("data-value",j);else q=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let G=`.${Q.getClass("chip")}-content`,K=Q.element.querySelector(G)||Q.element,z=`.${Q.getClass("chip")}-text`,W=Q.element.querySelector(z);if(!W&&j){W=document.createElement("span"),W.className=`${Q.getClass("chip")}-text`;let Y=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(Y)K.insertBefore(W,Y.nextSibling);else K.insertBefore(W,K.firstChild)}if(W){if(W.textContent=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,K=`.${Q.getClass("chip")}-leading-icon`,z=Q.element.querySelector(K);if(!z&&j)z=document.createElement("span"),z.className=`${Q.getClass("chip")}-leading-icon`,G.insertBefore(z,G.firstChild);if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},setTrailingIcon(j,G){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,z=`.${Q.getClass("chip")}-trailing-icon`,W=Q.element.querySelector(z);if(!W&&j){if(W=document.createElement("span"),W.className=`${Q.getClass("chip")}-trailing-icon`,K.appendChild(W),G)W.addEventListener("click",(Y)=>{Y.stopPropagation(),G(this)})}if(W){if(W.innerHTML=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},isSelected(){return Z},setSelected(j){if(Z=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!Z)},destroy(){$.destroy()}}};t();var bq={variant:"filled",ripple:!0},Z5=(J={})=>u(bq,J,"chip"),q5=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return p(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(Z)=>Z.element.getAttribute("aria-disabled")!=="true",keydown:(Z,q)=>{if(q.key===" "||q.key==="Enter")return q.preventDefault(),Z.element.click(),!0;return!1},focus:!0,blur:!0}})},j5=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var vq=(J={})=>{let $=Z5(J);try{let Q=b(S,d(),h(q5($)),K6($),G6($),S6($),C())($),Z=document.createElement("div");if(Z.className=`${Q.getClass("chip")}-content`,Z.style.display="flex",Z.style.alignItems="center",Z.style.gap="8px",Z.style.width="100%",Q.element.appendChild(Z),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",Z.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,Z.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(G)=>{G.stopPropagation(),J.onTrailingIconClick(Q)});Z.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let q=Q5(j5(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)q.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(q.isDisabled())return;let j=q.isSelected();q.toggleSelected();let G=q.isSelected();if(J.onChange&&j!==G)J.onChange(G,q);if(J.onSelect)J.onSelect(q)});return q}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},Y$=vq;c();o();var P7=(J)=>($)=>{if(!J.schema)return console.warn("No schema definition found in component config"),$;return{...$,schema:J.schema}};A6();var f8=(J)=>($)=>{if(!J.icon||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.iconPosition||"start",G=q.element.options.className||[],K=`${Q}-${Z}--icon`;if(Array.isArray(G)){if(!G.includes(K))G.push(K)}else if(typeof G==="string"){if(!G.includes(K))q.element.options.className=`${G} ${K}`.trim()}else q.element.options.className=[K];let z={name:"icon",creator:v,options:{tag:"span",className:[`${Q}-${Z}-icon`,`${Q}-${Z}-icon--${j}`],html:J.icon}};if(J.iconSize){let W=z.options.className;if(Array.isArray(W))W.push(`${Q}-${Z}-icon--${J.iconSize}`)}if(j==="start"){let W={...q.element.children};q.element.children={icon:z,...W}}else q.element.children.icon=z;return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with icon:",Q),$}};A6();var R7=(J)=>($)=>{if(!J.label||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.labelPosition||"start",G=J.label,K=null;if(J.required)K={requiredIndicator:{name:"requiredIndicator",creator:v,options:{tag:"span",className:`${Q}-${Z}-label-required`,text:"*",attributes:{"aria-hidden":"true"}}}},G=J.label;let z={name:"label",creator:v,options:{tag:"label",className:[`${Q}-${Z}-label`,`${Q}-${Z}-label--${j}`],attributes:{for:J.id},text:G}};if(K)z.children=K;if(j==="end"||j==="bottom")q.element.children.label=z;else{let W={...q.element.children};q.element.children={label:z,...W}}return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with label:",Q),$}};Q$();var A7=()=>(J)=>{if(!J.schema)return J;try{let $=d0(J.schema),Q=$.getAll(),Z=J.config?.parent;if(typeof Z==="string")Z=document.querySelector(Z);if(Z&&$.element)Z.appendChild($.element);return{...J,element:$.element,components:Q}}catch($){throw console.error("Failed to create DOM structure:",$),new Error(`Failed to create component DOM: ${$.message}`)}};var g8=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(Z){if(Q.scrollable=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(Z){if(Q.vertical=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var d8=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((Z)=>{this.chips?.addChip?.(Z)})}}};var K5={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},G5={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},M9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var l8=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize chips controller: missing element or components"),$;let Q={change:[],add:[],remove:[]},Z=-1,q=(k,...N)=>{if(Q[k])Q[k].forEach((F)=>F(...N))},j=(k)=>{if(k.isSelected())k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true");else k.element.classList.remove(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((O)=>{if(O!==k&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false")}),!k.isSelected()&&U().length===0)k.setSelected(!0),k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true")}let F=$.chipInstances.filter((O)=>O.isSelected()).map((O)=>O.getValue()),V=k?k.getValue():null;if(typeof J.onChange==="function")J.onChange(F,V);q(M9.CHANGE,F,V)},G=(k)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(k.key))return;if(k.key==="Enter"||k.key===" "){if(Z>=0&&Z<$.chipInstances.length){k.preventDefault();let N=$.chipInstances[Z];if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(k.key)){k.preventDefault();let N=$.layout&&$.layout.isVertical(),F=Z;if(Z===-1)F=0;else if(N&&k.key==="ArrowUp"||!N&&k.key==="ArrowLeft")F=Math.max(0,Z-1);else if(N&&k.key==="ArrowDown"||!N&&k.key==="ArrowRight")F=Math.min($.chipInstances.length-1,Z+1);if(F!==Z){if(Z>=0&&Z<$.chipInstances.length)$.chipInstances[Z].element.blur();if(Z=F,$.chipInstances[Z].element.focus(),$.layout&&$.layout.isScrollable())K(Z)}}},K=(k)=>{if(!($.layout&&$.layout.isScrollable()))return;let F=typeof k==="number"?k:$.chipInstances.indexOf(k);if(F>=0&&F<$.chipInstances.length){let V=$.chipInstances[F].element,O=$.components.chipContainer||$.element,P=O.getBoundingClientRect(),L=V.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=V.offsetTop-O.offsetTop-P.height/2+L.height/2;O.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=V.offsetLeft-O.offsetLeft-P.width/2+L.width/2;O.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},z=(k)=>{let N=Y$({...k,onSelect:k.onSelect}),F=$.components.chipContainer||$.element,V=document.createDocumentFragment();return V.appendChild(N.element),F.appendChild(V),$.chipInstances.push(N),N.element.addEventListener("click",()=>{if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N),Z=$.chipInstances.indexOf(N)}}),N.element.addEventListener("keydown",G),q(M9.ADD,N),N},W=(k)=>{let N=typeof k==="number"?k:$.chipInstances.indexOf(k);if(N>=0&&N<$.chipInstances.length){let F=$.chipInstances[N];if(q(M9.REMOVE,F),F.destroy(),$.chipInstances.splice(N,1),N===Z)Z=-1;else if(N<Z)Z--}},Y=()=>{return[...$.chipInstances]},U=()=>{return $.chipInstances.filter((k)=>k.isSelected())},X=()=>{return U().map((k)=>k.getValue())},_=(k,N=!0,F=!J.multiSelect)=>{let V=Array.isArray(k)?k:[k],O=!1;if(F)$.chipInstances.forEach((P)=>{if(!V.includes(P.getValue())&&P.isSelected())P.setSelected(!1),P.element.classList.remove(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","false"),O=!0});if($.chipInstances.forEach((P)=>{if(V.includes(P.getValue())&&!P.isSelected())P.setSelected(!0),P.element.classList.add(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","true"),O=!0}),O&&N){let P=X();q(M9.CHANGE,P,null)}},H=(k=!0)=>{let F=X().length>0;if($.chipInstances.forEach((V)=>{V.setSelected(!1),V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false")}),F&&k)q(M9.CHANGE,[],null)},B=()=>{$.chipInstances.forEach((k)=>{k.element.addEventListener("keydown",G)})},M=()=>{$.chipInstances.forEach((k)=>{k.element.removeEventListener("keydown",G)})};if(B(),$.element)$.element.addEventListener("keydown",G);if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((N)=>{N.element.removeEventListener("keydown",G)}),$.chipInstances.forEach((N)=>N.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((N)=>{Q[N]=[]}),k()}}return{...$,chips:{addChip:z,removeChip:W,getChips:Y,getSelectedChips:U,getSelectedValues:X,selectByValue:_,clearSelection:H,scrollToChip:K},keyboard:{enable:B,disable:M},on(k,N){if(!Q[k])Q[k]=[];return Q[k].push(N),this},off(k,N){if(Q[k]){let F=Q[k].indexOf(N);if(F!==-1)Q[k].splice(F,1)}return this}}};var z5=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,Z=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,Z);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,Z){if(J.events&&typeof J.events.on==="function")J.events.on(Q,Z);return this},off(Q,Z){if(J.events&&typeof J.events.off==="function")J.events.off(Q,Z);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};t();function W5(J,$){let Q=(z)=>J.getClass(z),Z=$.scrollable===!0,q=$.vertical===!0,j=$.multiSelect===!0,G=$.label&&$.label.trim().length>0,K=$.labelPosition||"start";return{element:{options:{className:[Q("chips"),Z?Q("chips--scrollable"):null,q?Q("chips--vertical"):null,G?Q("chips--with-label"):null,G&&K==="end"?Q("chips--label-end"):null,$.class].filter(Boolean),attributes:{role:"group","aria-multiselectable":j?"true":"false"}},children:{...G?{label:{options:{tag:"label",className:Q("chips-label"),text:$.label}}}:{},chipContainer:{options:{className:Q("chips-container")}}}}}}var Cq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},Y5=(J={})=>{let $=u(Cq,J,"chips"),Q={componentName:"chips",config:$,getClass:(Z)=>{let q=$.prefix||"mtrl";return Z?`${q}-${Z}`:q}};return $.schema=W5(Q,$),$};var U5=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Eq=(J={})=>{let $=Y5(J);try{let Q=b(S,d(),P7($),g8($),R7($),d8($),A7(),l8($),C())($),Z=U5(Q),q=z5(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},hq=Eq;w6();J6();c();o();var X5=["S","M","T","W","T","F","S"],U$=["January","February","March","April","May","June","July","August","September","October","November","December"],X$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r8="MM/DD/YYYY",B5="today",B$="selected",F5="outside-month",H5="range-start",k5="range-end",M5="range-middle";var T6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},N9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",Z=0;while(Z<$.length)if($.substring(Z,Z+4)==="MMMM")Q+=U$[J.getMonth()],Z+=4;else if($.substring(Z,Z+3)==="MMM")Q+=X$[J.getMonth()],Z+=3;else if($.substring(Z,Z+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="M")Q+=J.getMonth()+1,Z+=1;else if($.substring(Z,Z+4)==="YYYY")Q+=J.getFullYear(),Z+=4;else if($.substring(Z,Z+2)==="YY")Q+=J.getFullYear().toString().slice(-2),Z+=2;else if($.substring(Z,Z+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="D")Q+=J.getDate(),Z+=1;else Q+=$[Z],Z+=1;return Q},V5=(J,$)=>{return new Date(J,$+1,0).getDate()},uq=(J,$)=>{return new Date(J,$,1).getDay()},V9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},fq=(J,$,Q)=>{let Z=J.getTime();return Z>=$.getTime()&&Z<=Q.getTime()},N5=(J,$,Q=null,Z=null,q=null,j=null)=>{let G=new Date;G.setHours(0,0,0,0);let K=[],z=uq(J,$),W=V5(J,$-1);for(let _=z-1;_>=0;_--){let H=new Date(J,$-1,W-_),B=q&&H<q||j&&H>j;K.push({date:H,day:H.getDate(),isCurrentMonth:!1,isToday:V9(H,G),isSelected:Q?V9(H,Q):!1,isDisabled:B})}let Y=V5(J,$);for(let _=1;_<=Y;_++){let H=new Date(J,$,_),B=Q?V9(H,Q):!1,M=q&&H<q||j&&H>j,k={date:H,day:_,isCurrentMonth:!0,isToday:V9(H,G),isSelected:B,isDisabled:M};if(Q&&Z)k.isRangeStart=V9(H,Q),k.isRangeEnd=V9(H,Z),k.isRangeMiddle=fq(H,Q,Z)&&!k.isRangeStart&&!k.isRangeEnd;K.push(k)}let X=42-K.length;for(let _=1;_<=X;_++){let H=new Date(J,$+1,_),B=q&&H<q||j&&H>j;K.push({date:H,day:_,isCurrentMonth:!1,isToday:V9(H,G),isSelected:Q?V9(H,Q):!1,isDisabled:B})}return K},_5=(J,$=10)=>{let Q=[],Z=J-$,q=J+$;for(let j=Z;j<=q;j++)Q.push(j);return Q};var p8=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var L5=(J,{disabled:$,lifecycle:Q,events:Z})=>(q)=>{let j={goToDate(G){let K=T6(G);if(!K)return;J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextMonth(){let G=p8(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},prevMonth(){let G=p8(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...q,element:q.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),Z.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),Z.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(G){if(Array.isArray(G)&&J.selectionMode==="range"){let z=T6(G[0]),W=T6(G[1]);if(z&&W){if(J.selectedDate=z,J.rangeEndDate=W,z>W)J.selectedDate=W,J.rangeEndDate=z;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let K=T6(G);if(K){if(J.selectedDate=K,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let G=N9(J.selectedDate,J.dateFormat),K=N9(J.rangeEndDate,J.dateFormat);return`${G} - ${K}`}return N9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return Z.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(G){let K=T6(G);if(K){if(J.minDate=K,J.isOpen)J.updateCalendar()}return this},setMaxDate(G){let K=T6(G);if(K){if(J.maxDate=K,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(G,K){return Z.on(G,K),this},off(G,K){return Z.off(G,K),this}}};t();var gq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:r8,animate:!0},D5=(J={})=>{let $=u(gq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},O5=(J)=>{return p(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},P5=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return p(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},R5=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},A5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});A6();var dq=({currentMonth:J,currentYear:$,currentView:Q,prefix:Z,emit:q})=>{let j=v({tag:"div",className:`${Z}-datepicker-header`}),G=v({tag:"button",className:`${Z}-datepicker-month-selector`,text:U$[J],attributes:{type:"button","aria-label":"Select month"}}),K=v({tag:"button",className:`${Z}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),z=v({tag:"div",className:`${Z}-datepicker-nav-controls`}),W=v({tag:"button",className:`${Z}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),Y=v({tag:"button",className:`${Z}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return G.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"month"})}),K.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"year"})}),W.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("prevMonth");else if(Q==="month")q("prevYear");else q("prevYearRange")}),Y.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("nextMonth");else if(Q==="month")q("nextYear");else q("nextYearRange")}),j.appendChild(G),j.appendChild(K),z.appendChild(W),z.appendChild(Y),j.appendChild(z),j},lq=(J)=>{let $=v({tag:"div",className:`${J}-datepicker-weekdays`});return X5.forEach((Q)=>{let Z=v({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(Z)}),$},rq=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:Z,minDate:q,maxDate:j,prefix:G,emit:K})=>{let z=v({tag:"div",className:`${G}-datepicker-days`});return N5(J,$,Q,Z,q,j).forEach((Y)=>{let U=[`${G}-datepicker-day`,Y.isCurrentMonth?"":F5,Y.isToday?B5:"",Y.isSelected?B$:"",Y.isDisabled?"disabled":"",Y.isRangeStart?H5:"",Y.isRangeEnd?k5:"",Y.isRangeMiddle?M5:""].filter(Boolean).join(" "),X=v({tag:"button",className:U,text:Y.day.toString(),attributes:{type:"button","aria-label":Y.date.toLocaleDateString(),"aria-selected":Y.isSelected?"true":"false","aria-disabled":Y.isDisabled?"true":"false","data-date":Y.date.toISOString(),disabled:Y.isDisabled}});X.addEventListener("click",(_)=>{if(_.stopPropagation(),!Y.isDisabled)K("dateSelected",{date:Y.date})}),z.appendChild(X)}),z},pq=({currentMonth:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-months`});return X$.forEach((q,j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-month ${G?B$:""}`,text:q,attributes:{type:"button","aria-selected":G?"true":"false","data-month":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("monthSelected",{month:j})}),Z.appendChild(K)}),Z},sq=({currentYear:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-years`});return _5(J,10).forEach((j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-year ${G?B$:""}`,text:j.toString(),attributes:{type:"button","aria-selected":G?"true":"false","data-year":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("yearSelected",{year:j})}),Z.appendChild(K)}),Z},mq=({prefix:J,emit:$})=>{let Q=v({tag:"div",className:`${J}-datepicker-footer`}),Z=v({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),q=v({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return Z.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),q.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(Z),Q.appendChild(q),Q},w5=(J,$)=>{let{prefix:Q,currentView:Z,currentMonth:q,currentYear:j,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,variant:Y}=J,U=v({tag:"div",className:`${Q}-datepicker-calendar-content`}),X=dq({currentMonth:q,currentYear:j,currentView:Z,prefix:Q,emit:$});if(U.appendChild(X),Z==="day"){let _=lq(Q);U.appendChild(_);let H=rq({currentYear:j,currentMonth:q,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,prefix:Q,emit:$});U.appendChild(H)}else if(Z==="month"){let _=pq({currentMonth:q,prefix:Q,emit:$});U.appendChild(_)}else if(Z==="year"){let _=sq({currentYear:j,prefix:Q,emit:$});U.appendChild(_)}if(Y!=="docked"){let _=mq({prefix:Q,emit:$});U.appendChild(_)}return U};A6();var aq=(J={})=>{let $=D5(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?T6($.minDate):null,maxDate:$.maxDate?T6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||f,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let G=N9(this.selectedDate,this.dateFormat),K=N9(this.rangeEndDate,this.dateFormat);this.input.value=`${G} - ${K}`;return}this.input.value=N9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let G=w5(this,(K,z)=>{switch(K){case"dateSelected":this.handleDateSelection(z.date);break;case"monthSelected":this.currentMonth=z.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=z.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=z.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(G)},handleDateSelection(G){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=G,this.rangeEndDate=null;else{if(G<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=G;else this.rangeEndDate=G;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=G,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),Z.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let G=T6($.value[0]),K=T6($.value[1]);if(G&&K)Q.selectedDate=G,Q.rangeEndDate=K,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}else{let G=T6($.value);if(G)Q.selectedDate=G,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}let Z=b(S,d(),h(O5($)),G6($),C())($),q=b(S,h(P5($)))($);Q.input=q.element,Z.element.appendChild(Q.input),Q.updateInputValue();let j=R5($);return Q.calendarElement=v({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",Z.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!Z.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)Z.emit("open",{value:Q.selectedDate});else Z.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(G)=>{G.stopPropagation()}),document.addEventListener("click",(G)=>{if(Q.isOpen&&!Z.element.contains(G.target))Q.isOpen=!1,Q.render(),Z.emit("close",{value:Q.selectedDate})}),L5(Q,A5(Z))(Z)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},x5=aq;J6();c();o();t();var cq={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},y5=(J={})=>u(cq,J,"dialog"),T5=(J)=>{return p(J,{tag:"div",attributes:{},className:J.class})},I5=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},S5=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});T9();J6();t();var iq={orientation:"horizontal",variant:"full-width",thickness:1},b5=(J={})=>{return u(iq,J,"divider")};var v5=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let Z=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%";else $.element.style.width=`${Z}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(q){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`),q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${Z}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},C5=(J)=>($)=>{let Q=J.variant||"full-width",Z=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(Z==="horizontal"){let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${q}px`,$.element.style.marginRight=`${j}px`}else{let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${q}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(q){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`);let j=$.getOrientation?$.getOrientation():Z;if(q==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let G=J.insetStart!==void 0?J.insetStart:16,K=J.insetEnd!==void 0?J.insetEnd:q==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${G}px`,$.element.style.marginRight=`${K}px`;else $.element.style.marginTop=`${G}px`,$.element.style.marginBottom=`${K}px`}return this},setInset(q,j){let G=$.getOrientation?$.getOrientation():Z;if(($.getVariant?$.getVariant():Q)!=="full-width")if(G==="horizontal"){if(q!==void 0)$.element.style.marginLeft=`${q}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(q!==void 0)$.element.style.marginTop=`${q}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},E5=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,Z=J.orientation||"horizontal";if(Z==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(q){if(($.getOrientation?$.getOrientation():Z)==="horizontal")$.element.style.height=`${q}px`;else $.element.style.width=`${q}px`;return this},setColor(q){return $.element.style.backgroundColor=q,this}}};var c9=(J={})=>{let $=b5(J);return b(S,h({tag:"hr",componentName:"divider",className:J.class}),v5($),K6($),C5($),E5($))($)};R9();var i9={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},h5=(J)=>($)=>{let Q=I5(J),Z=document.createElement(Q.tag||"div");if(Z.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([M,k])=>{if(M&&typeof M==="string"&&k!==void 0)Z.setAttribute(M,String(k))});if(J.zIndex)Z.style.zIndex=String(J.zIndex);let q=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-header"));let k=document.createElement("div");if(k.classList.add($.getClass("dialog-header-content")),M.appendChild(k),J.title){let N=document.createElement("h2");N.classList.add($.getClass("dialog-header-title")),N.textContent=J.title,k.appendChild(N)}if(J.subtitle){let N=document.createElement("p");N.classList.add($.getClass("dialog-header-subtitle")),N.textContent=J.subtitle,k.appendChild(N)}if(J.closeButton!==!1){let N=document.createElement("button");N.classList.add($.getClass("dialog-header-close")),N.setAttribute("aria-label","Close dialog"),N.innerHTML=`
13
+ `,$.element.appendChild(Q),$},t4=(J)=>($)=>{let Q=J.labelPosition||"end",Z=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(Z),$},n4=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var Iq=(J,$)=>{let Q=f9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(Z)=>{return Q.input.indeterminate=Z,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,Z),Q},Q},Sq=(J={})=>{let $=c4(J);try{return b(S,d(),h(i4($)),u9($),o4($),X9($),t4($),(Z)=>Iq(Z,$),G6($),C(),(Z)=>a4(n4(Z))(Z))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},e4=Sq;var h8={FILLED:"filled",OUTLINED:"outlined"},u8={START:"start",END:"end"},$5={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},J5={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};J6();c();o();var Q5=({disabled:J,lifecycle:$})=>(Q)=>{let Z=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),q=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return q=j,j;if(q!==null)return Q.element.setAttribute("data-value",q),q;let K=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(K&&K.textContent){let G=K.textContent;if(G.includes(" Theme"))q=G.replace(" Theme","").toLowerCase();else q=G.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",q),q}return null},setValue(j){if(j!==null&&j!==void 0)q=j,Q.element.setAttribute("data-value",j);else q=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let K=`.${Q.getClass("chip")}-content`,G=Q.element.querySelector(K)||Q.element,W=`.${Q.getClass("chip")}-text`,z=Q.element.querySelector(W);if(!z&&j){z=document.createElement("span"),z.className=`${Q.getClass("chip")}-text`;let Y=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(Y)G.insertBefore(z,Y.nextSibling);else G.insertBefore(z,G.firstChild)}if(z){if(z.textContent=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,G=`.${Q.getClass("chip")}-leading-icon`,W=Q.element.querySelector(G);if(!W&&j)W=document.createElement("span"),W.className=`${Q.getClass("chip")}-leading-icon`,K.insertBefore(W,K.firstChild);if(W){if(W.innerHTML=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},setTrailingIcon(j,K){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,W=`.${Q.getClass("chip")}-trailing-icon`,z=Q.element.querySelector(W);if(!z&&j){if(z=document.createElement("span"),z.className=`${Q.getClass("chip")}-trailing-icon`,G.appendChild(z),K)z.addEventListener("click",(Y)=>{Y.stopPropagation(),K(this)})}if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},isSelected(){return Z},setSelected(j){if(Z=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!Z)},destroy(){$.destroy()}}};t();var bq={variant:"filled",ripple:!0},Z5=(J={})=>u(bq,J,"chip"),q5=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return p(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(Z)=>Z.element.getAttribute("aria-disabled")!=="true",keydown:(Z,q)=>{if(q.key===" "||q.key==="Enter")return q.preventDefault(),Z.element.click(),!0;return!1},focus:!0,blur:!0}})},j5=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var vq=(J={})=>{let $=Z5(J);try{let Q=b(S,d(),h(q5($)),K6($),G6($),S6($),C())($),Z=document.createElement("div");if(Z.className=`${Q.getClass("chip")}-content`,Z.style.display="flex",Z.style.alignItems="center",Z.style.gap="8px",Z.style.width="100%",Q.element.appendChild(Z),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",Z.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,Z.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(K)=>{K.stopPropagation(),J.onTrailingIconClick(Q)});Z.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let q=Q5(j5(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)q.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(q.isDisabled())return;let j=q.isSelected();q.toggleSelected();let K=q.isSelected();if(J.onChange&&j!==K)J.onChange(K,q);if(J.onSelect)J.onSelect(q)});return q}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},Y$=vq;c();o();var P7=(J)=>($)=>{if(!J.schema)return console.warn("No schema definition found in component config"),$;return{...$,schema:J.schema}};A6();var f8=(J)=>($)=>{if(!J.icon||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.iconPosition||"start",K=q.element.options.className||[],G=`${Q}-${Z}--icon`;if(Array.isArray(K)){if(!K.includes(G))K.push(G)}else if(typeof K==="string"){if(!K.includes(G))q.element.options.className=`${K} ${G}`.trim()}else q.element.options.className=[G];let W={name:"icon",creator:v,options:{tag:"span",className:[`${Q}-${Z}-icon`,`${Q}-${Z}-icon--${j}`],html:J.icon}};if(J.iconSize){let z=W.options.className;if(Array.isArray(z))z.push(`${Q}-${Z}-icon--${J.iconSize}`)}if(j==="start"){let z={...q.element.children};q.element.children={icon:W,...z}}else q.element.children.icon=W;return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with icon:",Q),$}};A6();var R7=(J)=>($)=>{if(!J.label||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.labelPosition||"start",K=J.label,G=null;if(J.required)G={requiredIndicator:{name:"requiredIndicator",creator:v,options:{tag:"span",className:`${Q}-${Z}-label-required`,text:"*",attributes:{"aria-hidden":"true"}}}},K=J.label;let W={name:"label",creator:v,options:{tag:"label",className:[`${Q}-${Z}-label`,`${Q}-${Z}-label--${j}`],attributes:{for:J.id},text:K}};if(G)W.children=G;if(j==="end"||j==="bottom")q.element.children.label=W;else{let z={...q.element.children};q.element.children={label:W,...z}}return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with label:",Q),$}};Q$();var A7=()=>(J)=>{if(!J.schema)return J;try{let $=d0(J.schema),Q=$.getAll(),Z=J.config?.parent;if(typeof Z==="string")Z=document.querySelector(Z);if(Z&&$.element)Z.appendChild($.element);return{...J,element:$.element,components:Q}}catch($){throw console.error("Failed to create DOM structure:",$),new Error(`Failed to create component DOM: ${$.message}`)}};var g8=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(Z){if(Q.scrollable=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(Z){if(Q.vertical=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var d8=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((Z)=>{this.chips?.addChip?.(Z)})}}};var K5={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},G5={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},k9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var l8=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize chips controller: missing element or components"),$;let Q={change:[],add:[],remove:[]},Z=-1,q=(M,...V)=>{if(Q[M])Q[M].forEach((F)=>F(...V))},j=(M)=>{if(M.isSelected())M.element.classList.add(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","true");else M.element.classList.remove(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((O)=>{if(O!==M&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false")}),!M.isSelected()&&U().length===0)M.setSelected(!0),M.element.classList.add(`${$.getClass("chip")}--selected`),M.element.setAttribute("aria-selected","true")}let F=$.chipInstances.filter((O)=>O.isSelected()).map((O)=>O.getValue()),N=M?M.getValue():null;if(typeof J.onChange==="function")J.onChange(F,N);q(k9.CHANGE,F,N)},K=(M)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(M.key))return;if(M.key==="Enter"||M.key===" "){if(Z>=0&&Z<$.chipInstances.length){M.preventDefault();let V=$.chipInstances[Z];if(!V.isDisabled()){if(V.toggleSelected(),V.isSelected())V.element.classList.add(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","true");else V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false");j(V)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(M.key)){M.preventDefault();let V=$.layout&&$.layout.isVertical(),F=Z;if(Z===-1)F=0;else if(V&&M.key==="ArrowUp"||!V&&M.key==="ArrowLeft")F=Math.max(0,Z-1);else if(V&&M.key==="ArrowDown"||!V&&M.key==="ArrowRight")F=Math.min($.chipInstances.length-1,Z+1);if(F!==Z){if(Z>=0&&Z<$.chipInstances.length)$.chipInstances[Z].element.blur();if(Z=F,$.chipInstances[Z].element.focus(),$.layout&&$.layout.isScrollable())G(Z)}}},G=(M)=>{if(!($.layout&&$.layout.isScrollable()))return;let F=typeof M==="number"?M:$.chipInstances.indexOf(M);if(F>=0&&F<$.chipInstances.length){let N=$.chipInstances[F].element,O=$.components.chipContainer||$.element,P=O.getBoundingClientRect(),L=N.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=N.offsetTop-O.offsetTop-P.height/2+L.height/2;O.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=N.offsetLeft-O.offsetLeft-P.width/2+L.width/2;O.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},W=(M)=>{let V=Y$({...M,onSelect:M.onSelect}),F=$.components.chipContainer||$.element,N=document.createDocumentFragment();return N.appendChild(V.element),F.appendChild(N),$.chipInstances.push(V),V.element.addEventListener("click",()=>{if(!V.isDisabled()){if(V.toggleSelected(),V.isSelected())V.element.classList.add(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","true");else V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false");j(V),Z=$.chipInstances.indexOf(V)}}),V.element.addEventListener("keydown",K),q(k9.ADD,V),V},z=(M)=>{let V=typeof M==="number"?M:$.chipInstances.indexOf(M);if(V>=0&&V<$.chipInstances.length){let F=$.chipInstances[V];if(q(k9.REMOVE,F),F.destroy(),$.chipInstances.splice(V,1),V===Z)Z=-1;else if(V<Z)Z--}},Y=()=>{return[...$.chipInstances]},U=()=>{return $.chipInstances.filter((M)=>M.isSelected())},X=()=>{return U().map((M)=>M.getValue())},_=(M,V=!0,F=!J.multiSelect)=>{let N=Array.isArray(M)?M:[M],O=!1;if(F)$.chipInstances.forEach((P)=>{if(!N.includes(P.getValue())&&P.isSelected())P.setSelected(!1),P.element.classList.remove(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","false"),O=!0});if($.chipInstances.forEach((P)=>{if(N.includes(P.getValue())&&!P.isSelected())P.setSelected(!0),P.element.classList.add(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","true"),O=!0}),O&&V){let P=X();q(k9.CHANGE,P,null)}},H=(M=!0)=>{let F=X().length>0;if($.chipInstances.forEach((N)=>{N.setSelected(!1),N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false")}),F&&M)q(k9.CHANGE,[],null)},B=()=>{$.chipInstances.forEach((M)=>{M.element.addEventListener("keydown",K)})},k=()=>{$.chipInstances.forEach((M)=>{M.element.removeEventListener("keydown",K)})};if(B(),$.element)$.element.addEventListener("keydown",K);if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((V)=>{V.element.removeEventListener("keydown",K)}),$.chipInstances.forEach((V)=>V.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((V)=>{Q[V]=[]}),M()}}return{...$,chips:{addChip:W,removeChip:z,getChips:Y,getSelectedChips:U,getSelectedValues:X,selectByValue:_,clearSelection:H,scrollToChip:G},keyboard:{enable:B,disable:k},on(M,V){if(!Q[M])Q[M]=[];return Q[M].push(V),this},off(M,V){if(Q[M]){let F=Q[M].indexOf(V);if(F!==-1)Q[M].splice(F,1)}return this}}};var z5=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,Z=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,Z);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,Z){if(J.events&&typeof J.events.on==="function")J.events.on(Q,Z);return this},off(Q,Z){if(J.events&&typeof J.events.off==="function")J.events.off(Q,Z);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};t();function W5(J,$){let Q=(W)=>J.getClass(W),Z=$.scrollable===!0,q=$.vertical===!0,j=$.multiSelect===!0,K=$.label&&$.label.trim().length>0,G=$.labelPosition||"start";return{element:{options:{className:[Q("chips"),Z?Q("chips--scrollable"):null,q?Q("chips--vertical"):null,K?Q("chips--with-label"):null,K&&G==="end"?Q("chips--label-end"):null,$.class].filter(Boolean),attributes:{role:"group","aria-multiselectable":j?"true":"false"}},children:{...K?{label:{options:{tag:"label",className:Q("chips-label"),text:$.label}}}:{},chipContainer:{options:{className:Q("chips-container")}}}}}}var Cq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},Y5=(J={})=>{let $=u(Cq,J,"chips"),Q={componentName:"chips",config:$,getClass:(Z)=>{let q=$.prefix||"mtrl";return Z?`${q}-${Z}`:q}};return $.schema=W5(Q,$),$};var U5=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Eq=(J={})=>{let $=Y5(J);try{let Q=b(S,d(),P7($),g8($),R7($),d8($),A7(),l8($),C())($),Z=U5(Q),q=z5(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},hq=Eq;w6();J6();c();o();var X5=["S","M","T","W","T","F","S"],U$=["January","February","March","April","May","June","July","August","September","October","November","December"],X$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r8="MM/DD/YYYY",B5="today",B$="selected",F5="outside-month",H5="range-start",M5="range-end",k5="range-middle";var T6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},V9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",Z=0;while(Z<$.length)if($.substring(Z,Z+4)==="MMMM")Q+=U$[J.getMonth()],Z+=4;else if($.substring(Z,Z+3)==="MMM")Q+=X$[J.getMonth()],Z+=3;else if($.substring(Z,Z+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="M")Q+=J.getMonth()+1,Z+=1;else if($.substring(Z,Z+4)==="YYYY")Q+=J.getFullYear(),Z+=4;else if($.substring(Z,Z+2)==="YY")Q+=J.getFullYear().toString().slice(-2),Z+=2;else if($.substring(Z,Z+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="D")Q+=J.getDate(),Z+=1;else Q+=$[Z],Z+=1;return Q},N5=(J,$)=>{return new Date(J,$+1,0).getDate()},uq=(J,$)=>{return new Date(J,$,1).getDay()},N9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},fq=(J,$,Q)=>{let Z=J.getTime();return Z>=$.getTime()&&Z<=Q.getTime()},V5=(J,$,Q=null,Z=null,q=null,j=null)=>{let K=new Date;K.setHours(0,0,0,0);let G=[],W=uq(J,$),z=N5(J,$-1);for(let _=W-1;_>=0;_--){let H=new Date(J,$-1,z-_),B=q&&H<q||j&&H>j;G.push({date:H,day:H.getDate(),isCurrentMonth:!1,isToday:N9(H,K),isSelected:Q?N9(H,Q):!1,isDisabled:B})}let Y=N5(J,$);for(let _=1;_<=Y;_++){let H=new Date(J,$,_),B=Q?N9(H,Q):!1,k=q&&H<q||j&&H>j,M={date:H,day:_,isCurrentMonth:!0,isToday:N9(H,K),isSelected:B,isDisabled:k};if(Q&&Z)M.isRangeStart=N9(H,Q),M.isRangeEnd=N9(H,Z),M.isRangeMiddle=fq(H,Q,Z)&&!M.isRangeStart&&!M.isRangeEnd;G.push(M)}let X=42-G.length;for(let _=1;_<=X;_++){let H=new Date(J,$+1,_),B=q&&H<q||j&&H>j;G.push({date:H,day:_,isCurrentMonth:!1,isToday:N9(H,K),isSelected:Q?N9(H,Q):!1,isDisabled:B})}return G},_5=(J,$=10)=>{let Q=[],Z=J-$,q=J+$;for(let j=Z;j<=q;j++)Q.push(j);return Q};var p8=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var L5=(J,{disabled:$,lifecycle:Q,events:Z})=>(q)=>{let j={goToDate(K){let G=T6(K);if(!G)return;J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextMonth(){let K=p8(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},prevMonth(){let K=p8(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...q,element:q.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),Z.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),Z.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(K){if(Array.isArray(K)&&J.selectionMode==="range"){let W=T6(K[0]),z=T6(K[1]);if(W&&z){if(J.selectedDate=W,J.rangeEndDate=z,W>z)J.selectedDate=z,J.rangeEndDate=W;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let G=T6(K);if(G){if(J.selectedDate=G,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let K=V9(J.selectedDate,J.dateFormat),G=V9(J.rangeEndDate,J.dateFormat);return`${K} - ${G}`}return V9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return Z.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(K){let G=T6(K);if(G){if(J.minDate=G,J.isOpen)J.updateCalendar()}return this},setMaxDate(K){let G=T6(K);if(G){if(J.maxDate=G,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(K,G){return Z.on(K,G),this},off(K,G){return Z.off(K,G),this}}};t();var gq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:r8,animate:!0},D5=(J={})=>{let $=u(gq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},O5=(J)=>{return p(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},P5=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return p(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},R5=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},A5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});A6();var dq=({currentMonth:J,currentYear:$,currentView:Q,prefix:Z,emit:q})=>{let j=v({tag:"div",className:`${Z}-datepicker-header`}),K=v({tag:"button",className:`${Z}-datepicker-month-selector`,text:U$[J],attributes:{type:"button","aria-label":"Select month"}}),G=v({tag:"button",className:`${Z}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),W=v({tag:"div",className:`${Z}-datepicker-nav-controls`}),z=v({tag:"button",className:`${Z}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),Y=v({tag:"button",className:`${Z}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return K.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"month"})}),G.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"year"})}),z.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("prevMonth");else if(Q==="month")q("prevYear");else q("prevYearRange")}),Y.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("nextMonth");else if(Q==="month")q("nextYear");else q("nextYearRange")}),j.appendChild(K),j.appendChild(G),W.appendChild(z),W.appendChild(Y),j.appendChild(W),j},lq=(J)=>{let $=v({tag:"div",className:`${J}-datepicker-weekdays`});return X5.forEach((Q)=>{let Z=v({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(Z)}),$},rq=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:Z,minDate:q,maxDate:j,prefix:K,emit:G})=>{let W=v({tag:"div",className:`${K}-datepicker-days`});return V5(J,$,Q,Z,q,j).forEach((Y)=>{let U=[`${K}-datepicker-day`,Y.isCurrentMonth?"":F5,Y.isToday?B5:"",Y.isSelected?B$:"",Y.isDisabled?"disabled":"",Y.isRangeStart?H5:"",Y.isRangeEnd?M5:"",Y.isRangeMiddle?k5:""].filter(Boolean).join(" "),X=v({tag:"button",className:U,text:Y.day.toString(),attributes:{type:"button","aria-label":Y.date.toLocaleDateString(),"aria-selected":Y.isSelected?"true":"false","aria-disabled":Y.isDisabled?"true":"false","data-date":Y.date.toISOString(),disabled:Y.isDisabled}});X.addEventListener("click",(_)=>{if(_.stopPropagation(),!Y.isDisabled)G("dateSelected",{date:Y.date})}),W.appendChild(X)}),W},pq=({currentMonth:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-months`});return X$.forEach((q,j)=>{let K=j===J,G=v({tag:"button",className:`${$}-datepicker-month ${K?B$:""}`,text:q,attributes:{type:"button","aria-selected":K?"true":"false","data-month":j.toString()}});G.addEventListener("click",(W)=>{W.stopPropagation(),Q("monthSelected",{month:j})}),Z.appendChild(G)}),Z},sq=({currentYear:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-years`});return _5(J,10).forEach((j)=>{let K=j===J,G=v({tag:"button",className:`${$}-datepicker-year ${K?B$:""}`,text:j.toString(),attributes:{type:"button","aria-selected":K?"true":"false","data-year":j.toString()}});G.addEventListener("click",(W)=>{W.stopPropagation(),Q("yearSelected",{year:j})}),Z.appendChild(G)}),Z},mq=({prefix:J,emit:$})=>{let Q=v({tag:"div",className:`${J}-datepicker-footer`}),Z=v({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),q=v({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return Z.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),q.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(Z),Q.appendChild(q),Q},w5=(J,$)=>{let{prefix:Q,currentView:Z,currentMonth:q,currentYear:j,selectedDate:K,rangeEndDate:G,minDate:W,maxDate:z,variant:Y}=J,U=v({tag:"div",className:`${Q}-datepicker-calendar-content`}),X=dq({currentMonth:q,currentYear:j,currentView:Z,prefix:Q,emit:$});if(U.appendChild(X),Z==="day"){let _=lq(Q);U.appendChild(_);let H=rq({currentYear:j,currentMonth:q,selectedDate:K,rangeEndDate:G,minDate:W,maxDate:z,prefix:Q,emit:$});U.appendChild(H)}else if(Z==="month"){let _=pq({currentMonth:q,prefix:Q,emit:$});U.appendChild(_)}else if(Z==="year"){let _=sq({currentYear:j,prefix:Q,emit:$});U.appendChild(_)}if(Y!=="docked"){let _=mq({prefix:Q,emit:$});U.appendChild(_)}return U};A6();var aq=(J={})=>{let $=D5(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?T6($.minDate):null,maxDate:$.maxDate?T6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||f,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let K=V9(this.selectedDate,this.dateFormat),G=V9(this.rangeEndDate,this.dateFormat);this.input.value=`${K} - ${G}`;return}this.input.value=V9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let K=w5(this,(G,W)=>{switch(G){case"dateSelected":this.handleDateSelection(W.date);break;case"monthSelected":this.currentMonth=W.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=W.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=W.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(K)},handleDateSelection(K){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=K,this.rangeEndDate=null;else{if(K<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=K;else this.rangeEndDate=K;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=K,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),Z.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let K=T6($.value[0]),G=T6($.value[1]);if(K&&G)Q.selectedDate=K,Q.rangeEndDate=G,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}else{let K=T6($.value);if(K)Q.selectedDate=K,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}let Z=b(S,d(),h(O5($)),G6($),C())($),q=b(S,h(P5($)))($);Q.input=q.element,Z.element.appendChild(Q.input),Q.updateInputValue();let j=R5($);return Q.calendarElement=v({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",Z.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!Z.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)Z.emit("open",{value:Q.selectedDate});else Z.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(K)=>{K.stopPropagation()}),document.addEventListener("click",(K)=>{if(Q.isOpen&&!Z.element.contains(K.target))Q.isOpen=!1,Q.render(),Z.emit("close",{value:Q.selectedDate})}),L5(Q,A5(Z))(Z)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},x5=aq;J6();c();o();t();var cq={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},y5=(J={})=>u(cq,J,"dialog"),T5=(J)=>{return p(J,{tag:"div",attributes:{},className:J.class})},I5=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},S5=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});T9();J6();t();var iq={orientation:"horizontal",variant:"full-width",thickness:1},b5=(J={})=>{return u(iq,J,"divider")};var v5=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let Z=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%";else $.element.style.width=`${Z}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(q){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`),q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${Z}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},C5=(J)=>($)=>{let Q=J.variant||"full-width",Z=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(Z==="horizontal"){let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${q}px`,$.element.style.marginRight=`${j}px`}else{let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${q}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(q){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`);let j=$.getOrientation?$.getOrientation():Z;if(q==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let K=J.insetStart!==void 0?J.insetStart:16,G=J.insetEnd!==void 0?J.insetEnd:q==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${K}px`,$.element.style.marginRight=`${G}px`;else $.element.style.marginTop=`${K}px`,$.element.style.marginBottom=`${G}px`}return this},setInset(q,j){let K=$.getOrientation?$.getOrientation():Z;if(($.getVariant?$.getVariant():Q)!=="full-width")if(K==="horizontal"){if(q!==void 0)$.element.style.marginLeft=`${q}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(q!==void 0)$.element.style.marginTop=`${q}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},E5=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,Z=J.orientation||"horizontal";if(Z==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(q){if(($.getOrientation?$.getOrientation():Z)==="horizontal")$.element.style.height=`${q}px`;else $.element.style.width=`${q}px`;return this},setColor(q){return $.element.style.backgroundColor=q,this}}};var c9=(J={})=>{let $=b5(J);return b(S,h({tag:"hr",componentName:"divider",className:J.class}),v5($),K6($),C5($),E5($))($)};R9();var i9={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},h5=(J)=>($)=>{let Q=I5(J),Z=document.createElement(Q.tag||"div");if(Z.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([k,M])=>{if(k&&typeof k==="string"&&M!==void 0)Z.setAttribute(k,String(M))});if(J.zIndex)Z.style.zIndex=String(J.zIndex);let q=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-header"));let M=document.createElement("div");if(M.classList.add($.getClass("dialog-header-content")),k.appendChild(M),J.title){let V=document.createElement("h2");V.classList.add($.getClass("dialog-header-title")),V.textContent=J.title,M.appendChild(V)}if(J.subtitle){let V=document.createElement("p");V.classList.add($.getClass("dialog-header-subtitle")),V.textContent=J.subtitle,M.appendChild(V)}if(J.closeButton!==!1){let V=document.createElement("button");V.classList.add($.getClass("dialog-header-close")),V.setAttribute("aria-label","Close dialog"),V.innerHTML=`
14
14
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
15
15
  <line x1="18" y1="6" x2="6" y2="18"></line>
16
16
  <line x1="6" y1="6" x2="18" y2="18"></line>
17
17
  </svg>
18
- `,N.addEventListener("click",(F)=>{if(F.preventDefault(),F.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),M.appendChild(N)}return M},j=()=>{let M=document.createElement("div");if(M.classList.add($.getClass("dialog-content")),J.content)M.innerHTML=J.content;return M},G=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-footer"));let k=J.footerAlignment||"right";if(k!=="right")g(M,`${$.getClass("dialog-footer")}--${k}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((N)=>f5(M,N,$));return M},K=()=>{return c9({variant:"full-width",class:$.getClass("dialog-divider")})},z=q(),W=j(),Y=Array.isArray(J.buttons)&&J.buttons.length>0?G():null;g($.element,$.getClass("dialog"));let U=J.size||"medium";if(U!=="medium")g($.element,`${$.getClass("dialog")}--${U}`);let X=J.animation||"scale";if(X!=="scale")g($.element,`${$.getClass("dialog")}--${X}`);$.element.appendChild(z);let _=null,H=null;if(J.divider){if(_=K(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),Y)H=K(),H.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(W),H)$.element.appendChild(H.element);if(Y)$.element.appendChild(Y);Z.appendChild($.element);let B=J.container||document.body;return B.appendChild(Z),{...$,overlay:Z,structure:{header:z,content:W,footer:Y,headerDivider:_,footerDivider:H,container:B}}},u5=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let Z=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(Z.element,J.structure.footer),J.structure.footerDivider=Z}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},f5=(J,$,Q)=>{let{text:Z,variant:q="text",onClick:j,closeDialog:G=!0,autofocus:K=!1,attributes:z={}}=$,W=Q9({text:Z,variant:q,...z});if(W.on("click",(Y)=>{console.log("button click");let U=G;if(typeof j==="function")try{if(j(Y,Q)===!1)U=!1}catch(X){console.error("Error in onClick handler:",X)}if(U){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:Z})}}),K)W.element.setAttribute("autofocus","true");if(J.appendChild(W.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:W})},g5=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,Z='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',q=null,j=()=>{if(!J.config.trapFocus)return;let X=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;let _=X[0],H=X[X.length-1];if(J.config.autofocus){let M=J.element.querySelector("[autofocus]");if(M)M.focus();else _.focus()}J.element.addEventListener("keydown",B);function B(M){if(M.key!=="Tab")return;if(M.shiftKey){if(document.activeElement===_)H.focus(),M.preventDefault()}else if(document.activeElement===H)_.focus(),M.preventDefault()}},G=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",X),q)q.focus(),q=null;function X(){}},K=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",W);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",Y)},z=()=>{J.overlay.removeEventListener("click",W),document.removeEventListener("keydown",Y)};function W(X){if(X.target===J.overlay)U.close()}function Y(X){if(X.key==="Escape"&&U.isOpen())U.close()}if($)g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),g(J.element,`${J.getClass("dialog")}--visible`),j(),K();let U={open(){if(this.isOpen())return;q=document.activeElement;let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_OPEN,X);if(X.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(g(J.element,`${J.getClass("dialog")}--visible`),j(),K(),typeof J.emit==="function")J.emit(i9.OPEN,{dialog:J}),setTimeout(()=>{J.emit(i9.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_CLOSE,X);if(X.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,H=`${J.getClass("dialog-overlay")}--visible`;if(j6(J.element,_),j6(J.overlay,H),G(),z(),typeof J.emit==="function")J.emit(i9.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(i9.AFTER_CLOSE,{dialog:J})},Q)},toggle(X){if(X===void 0)this.isOpen()?this.close():this.open();else if(X)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{U.close()});return{...J,visibility:U}},d5=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,Z=J.structure.footer;return{...J,content:{setTitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&q)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getTitle(){let q=$.querySelector(`.${J.getClass("dialog-header-title")}`);return q?q.textContent||"":""},setSubtitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&q)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getSubtitle(){let q=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return q?q.textContent||"":""},setContent(q){Q.innerHTML=q},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return Z}}}},l5=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let Z=J.config.footerAlignment||"right";if(Z!=="right")g(Q,`${J.getClass("dialog-footer")}--${Z}`);J.element.appendChild(Q),J.structure.footer=Q}f5(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((Z)=>Z.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((Z)=>{if(Z!=="right")j6(J.structure.footer,`${J.getClass("dialog-footer")}--${Z}`)}),$!=="right")g(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},r5=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((Z)=>{j6(J.element,`${J.getClass("dialog")}--${Z}`)}),$!=="medium")g(J.element,`${J.getClass("dialog")}--${$}`)}}}},p5=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:Z="Confirm",message:q,confirmText:j="Yes",cancelText:G="No",confirmVariant:K="filled",cancelVariant:z="text",size:W="small"}=$;J.content.setTitle(Z),J.content.setContent(`<p>${q}</p>`),J.size.setSize(W),J._buttons.forEach((Y)=>Y.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:K,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:G,variant:z,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};R9();var s5=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,Z){return J.events.on(Q,Z),this},off(Q,Z){return J.events.off(Q,Z),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,Z=`${$.getClass("dialog-overlay")}--visible`;if(j6($.element,Q),j6($.overlay,Z),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var oq=(J={})=>{let $=y5(J);try{let Q=b(S,d(),h(T5($)),h5($),g5(),d5(),l5(),r5(),u5(),p5(),C(),(Z)=>s5(S5(Z))(Z))($);if($.on)Object.entries($.on).forEach(([Z,q])=>{if(typeof q==="function")Q.on(Z,q)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},m5=oq;J6();c();o();var a5=({disabled:J,lifecycle:$,className:Q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(q){return Z.element.value=q,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(q){return Z.icon.setIcon(q),this},getIcon(){return Z.icon.getIcon()},setPosition(q){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{Z.element.classList.remove(`${Q}--${G}`)}),Z.element.classList.add(`${Q}--${q}`),this},getPosition(){let q=["top-right","top-left","bottom-right","bottom-left"];for(let j of q)if(Z.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return Z.element.classList.add(`${Q}--lowered`),this},raise(){return Z.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});t();var tq={variant:"primary",size:"default",type:"button",ripple:!0},c5=(J={})=>u(tq,J,"fab"),i5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let Z={...J,className:Q};return p(Z,{tag:"button",attributes:$,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},o5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var nq=(J={})=>{let $=c5(J);try{return b(S,d(),h(i5($)),K6($),U9($),G6($),S6($),C(),(Z)=>a5(o5(Z))(Z))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},s8=nq;J6();c();o();var t5=({disabled:J,lifecycle:$,text:Q,className:Z})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(j){return q.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return q.icon.setIcon(j),this},getIcon(){return q.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{q.element.classList.remove(`${Z}--${K}`)}),q.element.classList.add(`${Z}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let G of j)if(q.element.classList.contains(`${Z}--${G}`))return G;return null},lower(){return q.element.classList.add(`${Z}--lowered`),this},raise(){return q.element.classList.remove(`${Z}--lowered`),this},collapse(){q.element.classList.add(`${Z}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},expand(){q.element.classList.remove(`${Z}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},destroy(){$.destroy()}});t();var eq={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},n5=(J={})=>u(eq,J,"extended-fab"),e5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return p(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},$Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var $j=(J={})=>{let $=n5(J),Q=(Z)=>{if($.collapseOnScroll){let q=window.scrollY,j=!1,G=10,K=()=>{if(!j)window.requestAnimationFrame(()=>{let W=window.scrollY,Y=W-q;if(Y>G)Z.collapse();else if(Y<-G)Z.expand();if(W<=0)Z.expand();q=W,j=!1}),j=!0};window.addEventListener("scroll",K,{passive:!0}),requestAnimationFrame(()=>{Z.expand()});let z=Z.destroy;Z.destroy=()=>{window.removeEventListener("scroll",K),z.call(Z)}}};try{let Z=b(S,d(),h(e5($)),K6($),U9($),Y9($),G6($),S6($),C(),(q)=>t5($Q(q))(q))($);return Q(Z),Z}catch(Z){throw console.error("Extended FAB creation error:",Z),new Error(`Failed to create Extended FAB: ${Z.message}`)}},m8=$j;J6();c();o();var JQ=!1,Jj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},Z={triggerEvent(F,V={},O){let P={menu:Q.component,...V,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return $.emit(F,P),P}},q=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:F}=J;if(typeof F==="string"){let V=document.querySelector(F);if(!V)return console.warn(`Menu opener not found: ${F}`),null;return V}if(typeof F==="object"&&F!==null&&"element"in F)return F.element;return F},j=(F,V)=>{let O=document.createElement("li"),P=`${$.getClass("menu-item")}`;if(O.className=P,O.setAttribute("role","menuitem"),O.setAttribute("tabindex","-1"),O.setAttribute("data-id",F.id),O.setAttribute("data-index",V.toString()),F.disabled)O.classList.add(`${P}--disabled`),O.setAttribute("aria-disabled","true");else O.setAttribute("aria-disabled","false");if(Q.selectedItemId&&F.id===Q.selectedItemId)O.classList.add(`${P}--selected`),O.setAttribute("aria-selected","true");else O.setAttribute("aria-selected","false");if(F.hasSubmenu)O.classList.add(`${P}--submenu`),O.setAttribute("aria-haspopup","true"),O.setAttribute("aria-expanded","false");let L=document.createElement("span");if(L.className=`${$.getClass("menu-item-content")}`,F.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=F.icon,L.appendChild(R)}let D=document.createElement("span");if(D.className=`${$.getClass("menu-item-text")}`,D.textContent=F.text,L.appendChild(D),F.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=F.shortcut,L.appendChild(R)}if(O.appendChild(L),!F.disabled){if(O.addEventListener("click",(R)=>W(R,F,V)),O.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),W(R,F,V)}),O.addEventListener("focus",()=>{Q.activeItemIndex=V}),F.hasSubmenu&&J.openSubmenuOnHover)O.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(F,V,O)}),O.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return O},G=(F,V)=>{let O=document.createElement("li");if(O.className=`${$.getClass("menu-divider")}`,O.setAttribute("role","separator"),O.setAttribute("data-index",V.toString()),F.id)O.setAttribute("id",F.id);return O},K=()=>{let F=document.createElement("ul");F.className=`${$.getClass("menu-list")}`,F.setAttribute("role","menu"),Q.items.forEach((V,O)=>{if("type"in V&&V.type==="divider")F.appendChild(G(V,O));else F.appendChild(j(V,O))}),$.element.innerHTML="",$.element.appendChild(F)},z=(F)=>{for(let V of Q.items){if("id"in V&&V.id===F)return V;if("submenu"in V&&Array.isArray(V.submenu)){for(let O of V.submenu)if("id"in O&&O.id===F)return O}}return null},W=(F,V,O)=>{if(F.preventDefault(),F.stopPropagation(),V.disabled)return;if(V.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(V,O,F.currentTarget);return}let P=Z.triggerEvent("select",{item:V,itemId:V.id,itemData:V.data},F);if(J.closeOnSelect&&!P.defaultPrevented)X(F,!0)},Y=(F)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((O)=>{if(O.getAttribute("data-id")===F)O.classList.add(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","true");else O.classList.remove(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","false")}),Q.selectedItemId=F},U=(F,V="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",H),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let O=q();if(O&&$.position)$.position.positionMenu(O);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,V);else if(V==="keyboard"){let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0,P[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M,{passive:!0}),window.addEventListener("scroll",k,{passive:!0})},0)},20),Z.triggerEvent("open",{},F)},X=(F,V=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:F,restoreFocus:V}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),Z.triggerEvent("close",{restoreFocus:V},F),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(F,V="mouse")=>{if(Q.visible)X(F);else{if(F){if(F instanceof KeyboardEvent)V="keyboard";else if(F instanceof MouseEvent)V="mouse"}U(F,V)}},H=(F)=>{if(JQ){JQ=!1;return}if($.element.contains(F.target))return;let V=q();if(V&&V.contains(F.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let O=$.submenu.getActiveSubmenus();for(let P of O)if(P.element.contains(F.target))return}X(F,!1)},B=(F)=>{let V=$.element.contains(F.target),O=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((P)=>P.element.contains(F.target));if(Q.visible){if(V||O){if(F.key==="Escape")F.preventDefault(),X(F,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(F,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},M=()=>{if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F)}},k=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let F=q();if(F&&$.position)$.position.positionMenu(F)})},N=()=>{if(K(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M),window.addEventListener("scroll",k)}};if($.on("create-menu-items",(F)=>{let{items:V,container:O,onItemCreated:P}=F;V.forEach((L,D)=>{let R;if("type"in L&&L.type==="divider")R=G(L,D);else R=j(L,D);if(O.appendChild(R),P)P(R)})}),setTimeout(N,0),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),F()}}return{...$,menu:{open:(F,V="mouse")=>{return U(F,V),$},close:(F,V=!0)=>{return X(F,V),$},toggle:(F,V="mouse")=>{return _(F,V),$},isOpen:()=>Q.visible,setItems:(F)=>{return Q.items=F,K(),$},getItems:()=>Q.items,setPosition:(F)=>{if(Q.position=F,Q.visible){let V=q();if(V&&$.position)$.position.positionMenu(V)}return $},getPosition:()=>Q.position,setSelected:(F)=>{return Y(F),$},getSelected:()=>Q.selectedItemId}}},a8=Jj;var Qj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(B)=>{Q=B.key==="Tab",setTimeout(()=>{Q=!1},100)});let Z={openerElement:null,openerComponent:null,activeClass:""},q=(B)=>{if(!B)return{element:null,component:null};if(typeof B==="string"){let M=document.querySelector(B);if(!M)return console.warn(`Menu opener not found: ${B}`),{element:null,component:null};return{element:M,component:null}}if(typeof B==="object"&&B!==null){if("element"in B&&B.element instanceof HTMLElement)return{element:B.element,component:B};if("getElement"in B&&typeof B.getElement==="function"){let M=B.getElement();if(M instanceof HTMLElement)return{element:M,component:B}}if("input"in B&&B.input instanceof HTMLElement)return{element:B.input,component:B};if(B instanceof HTMLElement)return{element:B,component:null}}return console.warn("Invalid opener type:",B),{element:null,component:null}},j=(B)=>{let M=$.getClass("").split("-")[0];if(B.tagName==="BUTTON")return`${M}-button--active`;else if(B.classList.contains(`${M}-chip`))return`${M}-chip--selected`;else if(B.classList.contains(`${M}-textfield`)||B.classList.contains(`${M}-select`))return`${M}-textfield--focused`;else return`${M}-menu-opener--active`},G=(B)=>{let{element:M,component:k}=B;if(!M)return;if(Z.openerElement&&Z.openerElement!==M)X();Z.openerElement=M,Z.openerComponent=k,Z.activeClass=j(M),M.addEventListener("click",W),M.addEventListener("keydown",Y),M.addEventListener("blur",U),M.setAttribute("aria-haspopup","true"),M.setAttribute("aria-expanded","false");let N=$.element.id;if(!N)N=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=N;M.setAttribute("aria-controls",N)},K=(B)=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.setActive==="function"){Z.openerComponent.setActive(B);return}if(Z.openerComponent&&"selected"in Z.openerComponent){Z.openerComponent.selected=B;return}if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"&&typeof Z.openerComponent.blur==="function"){if(B)Z.openerComponent.focus();else Z.openerComponent.blur();return}if(Z.openerElement.classList)if(B)Z.openerElement.classList.add(Z.activeClass);else Z.openerElement.classList.remove(Z.activeClass)},z=()=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"){requestAnimationFrame(()=>{Z.openerComponent.focus()});return}if(Z.openerComponent&&"input"in Z.openerComponent&&Z.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{Z.openerComponent.input.focus()});return}requestAnimationFrame(()=>{Z.openerElement.focus()})},W=(B)=>{if(B.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(B);else $.menu.open(B,"mouse")},Y=(B)=>{if(!$.menu)return;let M=$.menu.isOpen();switch(B.key){case"Enter":case" ":case"ArrowDown":case"Down":if(B.preventDefault(),!M)$.menu.open(B,"keyboard");break;case"Escape":if(M)B.preventDefault(),$.menu.close(B);break;case"ArrowUp":case"Up":if(B.preventDefault(),!M)$.menu.open(B,"keyboard"),setTimeout(()=>{let k=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(k.length>0){k.forEach((F)=>F.setAttribute("tabindex","-1"));let N=k[k.length-1];N.setAttribute("tabindex","0"),N.focus()}},100);break}},U=(B)=>{if(!$.menu||!$.menu.isOpen())return;let M=B.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},10);return}if(M){if($.element.contains(M))return;if(M.getAttribute("aria-haspopup")==="true"||M.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},50)},X=()=>{if(Z.openerElement)Z.openerElement.removeEventListener("click",W),Z.openerElement.removeEventListener("keydown",Y),Z.openerElement.removeEventListener("blur",U),Z.openerElement.removeAttribute("aria-haspopup"),Z.openerElement.removeAttribute("aria-expanded"),Z.openerElement.removeAttribute("aria-controls"),K(!1);Z.openerComponent=null,Z.openerElement=null,Z.activeClass=""},{element:_,component:H}=q(J.opener);if(G({element:_,component:H}),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{X(),B()}}return $.on("open",()=>{if(Z.openerElement)Z.openerElement.setAttribute("aria-expanded","true"),K(!0)}),$.on("close",(B)=>{if(Z.openerElement){if(Z.openerElement.setAttribute("aria-expanded","false"),K(!1),B.restoreFocus&&!Q)z()}}),{...$,opener:{setOpener(B){let M=q(B);if(M.element)G(M);return $},getOpener(){return Z.openerElement},getOpenerComponent(){return Z.openerComponent},setActive(B){return K(B),$},focus(){return z(),$}}}},c8=Qj;var Zj=(J,$)=>{let Q=(j,G,K,z=!1)=>{if(!j||!G)return;j.style.position="absolute";let W=window.pageXOffset||document.documentElement.scrollLeft,Y=window.pageYOffset||document.documentElement.scrollTop,U=j.cloneNode(!0);U.style.visibility="hidden",U.style.display="block",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.transform="none",U.style.opacity="0",U.style.pointerEvents="none",U.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(U);let X=G.getBoundingClientRect(),_=U.getBoundingClientRect(),H=window.innerWidth,B=window.innerHeight;document.body.removeChild(U);let M=$.offset!==void 0?$.offset:8,k=0,N=0,F=K;if(z){if(F=K||"right-start",F.startsWith("right")&&X.right+_.width+M>H-16)F=F.replace("right","left");else if(F.startsWith("left")&&X.left-_.width-M<16)F=F.replace("left","right");if(X.top+_.height>B-48){if(F==="right-start")F="right-end";else if(F==="left-start")F="left-end"}}else switch(K){case"top-start":case"top":case"top-end":if(X.top<_.height+M+48)F=K.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(X.bottom+_.height+M+48>B){if(X.top>B-X.bottom)F=K.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(X.bottom+_.height>B-48){if(K==="right-start")F="right-end";else if(K==="left-start")F="left-end";else if(K==="right")k=X.top-(_.height-X.height)-M;else if(K==="left")k=X.top-(_.height-X.height)-M}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),F.startsWith("top")||F==="right-end"||F==="left-end"||F==="right"&&k<X.top||F==="left"&&k<X.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(F.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(F.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(F){case"top-start":k=X.top+Y-_.height-M,N=X.left+W;break;case"top":k=X.top+Y-_.height-M,N=X.left+W+X.width/2-_.width/2;break;case"top-end":k=X.top+Y-_.height-M,N=X.right+W-_.width;break;case"right-start":k=X.top+Y,N=X.right+W+M;break;case"right":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.right+W+M;break;case"right-end":k=X.bottom+Y-_.height,N=X.right+W+M;break;case"bottom-start":k=X.bottom+Y+M,N=X.left+W;break;case"bottom":k=X.bottom+Y+M,N=X.left+W+X.width/2-_.width/2;break;case"bottom-end":k=X.bottom+Y+M,N=X.right+W-_.width;break;case"left-start":k=X.top+Y,N=X.left+W-_.width-M;break;case"left":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.left+W-_.width-M;break;case"left-end":k=X.bottom+Y-_.height,N=X.left+W-_.width-M;break}let P=48;if(k-Y<P)k=P+Y;let L=48;if(k-Y+_.height>B-L){let R=B-(k-Y)-L,w=Math.min(_.height,100),A=Math.max(R,w);if(j.style.maxHeight=`${A}px`,$.maxHeight){let x=parseInt($.maxHeight,10);if(!isNaN(x)&&x<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!z)j.style.width=`${X.width}px`;if(j.style.top=`${Math.max(P+Y,k)}px`,j.style.left=`${Math.max(16+W,N)}px`,N-W+_.width>H-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,G,K=1)=>{if(!j||!G)return;let z=K%2===1?"right-start":"left-start";j.style.zIndex=`${1000+K*10}`,Q(j,G,z,!0)},positionElement:Q}},qj=(J)=>($)=>{if(!$.element)return $;let Q=Zj($,J);return{...$,position:Q}},i8=qj;var jj=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(z)=>{$=z.key==="Tab",setTimeout(()=>{$=!1},100)})})();let Z=()=>{let W=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(W).filter((Y)=>{return Y.offsetParent!==null&&!Y.classList.contains("hidden")})},q=(z,W)=>{if(W==="keyboard"){let Y=Array.from(z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(Y.length>0)Y[0].setAttribute("tabindex","0"),Y[0].focus();else z.setAttribute("tabindex","0"),z.focus()}else{z.setAttribute("tabindex","-1");let Y=z.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(Y)Y.setAttribute("tabindex","0")}},j=(z,W,Y)=>{let U=W.activeSubmenu&&W.activeSubmenu.contains(z.target),X=U?W.activeSubmenu:J.element,_=Array.from(X.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let H=document.activeElement,B=-1;if(H&&_.includes(H))B=_.indexOf(H);let M=(k)=>{if(_[k])_[k].focus()};switch(z.key){case"ArrowDown":case"Down":if(z.preventDefault(),B<0)M(0);else if(B<_.length-1)M(B+1);else M(0);break;case"ArrowUp":case"Up":if(z.preventDefault(),B<0)M(_.length-1);else if(B>0)M(B-1);else M(_.length-1);break;case"Home":z.preventDefault(),M(0);break;case"End":z.preventDefault(),M(_.length-1);break;case"Enter":case" ":if(z.preventDefault(),B>=0)_[B].click();break;case"ArrowRight":case"Right":if(z.preventDefault(),U){if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),O=N.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),P=Y.findItemById(O);if(P&&P.submenu){let L=P.submenu[F];Y.handleNestedSubmenuClick(L,F,N)}}}else if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),V=W.items[F];Y.handleSubmenuClick(V,F,N)}break;case"ArrowLeft":case"Left":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);break;case"Escape":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);else Y.closeMenu(z,!0);break;case"Tab":z.preventDefault();let k=J.opener?.getOpener?.();if(Y.closeMenu(z,!0),k)setTimeout(()=>{if(z.shiftKey);else{let N=Z(),F=N.indexOf(k);if(F>=0&&F<N.length-1)N[F+1].focus()}},0);break}};return{handleInitialFocus:q,handleMenuKeydown:j,setupKeyboardHandlers:(z,W,Y)=>{let U=z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(U.forEach((X)=>{X.tabIndex=-1}),U.length>0)U[0].tabIndex=0;z.addEventListener("keydown",(X)=>j(X,W,Y))},isTabNavigationActive:()=>$,getFocusableElements:Z}},Kj=()=>(J)=>{if(!J.element)return J;let $=jj(J);return{...J,keyboard:$}},o8=Kj;var Gj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},Z=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},q=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(N,F,V)=>{if(!J.openSubmenuOnHover||!N.hasSubmenu)return;Z(),q(),Q.hoverIntent.activeItem=V,Q.hoverIntent.timer=setTimeout(()=>{if(V.matches(":hover")){if(Q.activeSubmenuItem!==V)W(N,F,V)}Q.hoverIntent.timer=null},100)},G=()=>{Z(),q(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:N,activeSubmenuItem:F}=Q;if(N&&F){let V=N.matches(":hover"),O=F.matches(":hover");if(!V&&!O)Y(Q.submenuLevel)}Q.submenuTimer=null},300)},K=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);Y(L+1),V.setAttribute("aria-expanded","false")}else W(N,F,V)},z=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);Y(L+1)}else W(N,F,V)},W=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.closest(`.${$.getClass("menu--submenu")}`)?parseInt(V.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(Y(O),Q.activeSubmenus.findIndex((w)=>w.menuItem===V&&w.isOpening)>=0)return;V.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",O.toString()),L.setAttribute("data-parent-item",N.id),L.style.zIndex=`${1000+O*10}`;let D=document.createElement("ul");D.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:N.submenu,container:D,level:O,onItemCreated:(w)=>{if(!w.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(w)}}),L.appendChild(D),document.body.appendChild(L),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(L,V,O);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(L,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:Y,handleNestedSubmenuClick:z});L.addEventListener("mouseenter",()=>{q()}),L.addEventListener("mouseleave",()=>{G()}),Q.activeSubmenu=L,Q.activeSubmenuItem=V,Q.activeSubmenus.push({element:L,menuItem:V,level:O,isOpening:!0}),Q.submenuLevel=O,document.addEventListener("click",X),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let w=Q.activeSubmenus.findIndex((A)=>A.element===L);if(w!==-1)Q.activeSubmenus[w].isOpening=!1;if(R.length>0){if(O>=2||document.activeElement===V)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:L,parentItem:V,level:O,item:N})},Y=(N)=>{Z(),q();let F=[];for(let V=Q.activeSubmenus.length-1;V>=0;V--)if(Q.activeSubmenus[V].level>=N){let O=Q.activeSubmenus[V];if(O.menuItem)O.menuItem.setAttribute("aria-expanded","false");O.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(O.element.parentNode)O.element.parentNode.removeChild(O.element)},200),F.push(V)}if(F.forEach((V)=>{Q.activeSubmenus.splice(V,1)}),Q.activeSubmenus.length>0){let V=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=V.element,Q.activeSubmenuItem=V.menuItem,Q.submenuLevel=V.level,V.menuItem)V.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:N})},U=()=>{if(Z(),q(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((N)=>{if(N.menuItem)N.menuItem.setAttribute("aria-expanded","false");N.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(N.element.parentNode)N.element.parentNode.removeChild(N.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),$.emit("all-submenus-closed",{})},X=(N)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:F,activeSubmenuItem:V}=Q;if(F.contains(N.target)||V&&V.contains(N.target))return;U()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},H=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},B=()=>{return Q.activeSubmenus.length>0},M=()=>{return Q.submenuLevel},k=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let N=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(Z(),q(),document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((F)=>{if(F.element.parentNode)F.element.parentNode.removeChild(F.element)});N()}}return $.on("menu-closing",()=>{U()}),{...$,submenu:{openSubmenu:W,closeSubmenu:Y,closeAllSubmenus:U,handleSubmenuClick:K,handleNestedSubmenuClick:z,handleSubmenuHover:j,handleSubmenuLeave:G,hasOpenSubmenu:B,getSubmenuLevel:M,getActiveSubmenus:k}}},t8=Gj;var QQ=({menu:J,opener:$,events:Q,lifecycle:Z})=>(q)=>{return{element:q.element,open(G,K="mouse"){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard"}return J.open(G,K),this},close(G,K=!0,z=!1){return J.close(G,K,z),this},toggle(G,K){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard";else if(G instanceof MouseEvent)K="mouse"}return J.toggle(G,K),this},isOpen(){return J.isOpen()},setItems(G){return J.setItems(G),this},getItems(){return J.getItems()},setOpener(G){return $.setOpener(G),this},getOpener(){return $.getOpener()},setPosition(G){return J.setPosition(G),this},getPosition(){return J.getPosition()},setSelected(G){return J.setSelected(G),this},getSelected(){return J.getSelected()},on(G,K){if(Q?.on)Q.on(G,K);else if(q.on)q.on(G,K);return this},off(G,K){if(Q?.off)Q.off(G,K);else if(q.off)q.off(G,K);return this},destroy(){Z.destroy()}}};t();var n8={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},c6={POSITION:n8.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0},ZQ={MOUSE:"mouse",KEYBOARD:"keyboard"},qQ={ITEM:"item",DIVIDER:"divider"},jQ={OPEN:"open",CLOSE:"close",SELECT:"select"},F$={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator"};var zj={items:[],position:c6.POSITION,closeOnSelect:c6.CLOSE_ON_SELECT,closeOnClickOutside:c6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:c6.CLOSE_ON_ESCAPE,openSubmenuOnHover:c6.OPEN_SUBMENU_ON_HOVER,offset:c6.OFFSET,autoFlip:c6.AUTO_FLIP,visible:!1},KQ=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return u(zj,J,"menu")},GQ=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([Z,q])=>`${Z}: ${q}`).join(";")};return p(J,{tag:"div",attributes:Q,className:[J.visible?F$.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},zQ=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,Z)=>J.menu?.close($,Q,Z),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var Wj=(J)=>{try{let $=KQ(J);return b(S,d(),h(GQ($)),i8($),o8(),t8($),a8($),c8($),C(),(Z)=>QQ(zQ(Z))(Z))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},H$=Wj;J6();c();o();var WQ=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(Z){if(typeof $.addItem==="function")$.addItem(Z);return this},removeItem(Z){if(typeof $.removeItem==="function")$.removeItem(Z);return this},getItem(Z){if(typeof $.getItem==="function")return $.getItem(Z);return this.items.get(Z)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(Z){if(typeof $.getItemPath==="function")return $.getItemPath(Z);return[]},setActive(Z){if(typeof $.handleItemClick==="function")$.handleItemClick(Z);else if(typeof $.setActive==="function")$.setActive(Z);else{let q=this.items.get(Z);if(q&&q.element){if($.emit)$.emit("change",{id:Z,item:q,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(Z,q){if($.on)$.on(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var e8={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},$1={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},J1={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},YQ={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},k$={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},_9={VARIANT:e8.STANDARD,POSITION:$1.LEFT,BEHAVIOR:J1.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},n={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var Yj=(J)=>{let $=document.createElement("span");return $.className=`${J}-${n.EXPAND_ICON}`,$.innerHTML=`
18
+ `,V.addEventListener("click",(F)=>{if(F.preventDefault(),F.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),k.appendChild(V)}return k},j=()=>{let k=document.createElement("div");if(k.classList.add($.getClass("dialog-content")),J.content)k.innerHTML=J.content;return k},K=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-footer"));let M=J.footerAlignment||"right";if(M!=="right")g(k,`${$.getClass("dialog-footer")}--${M}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((V)=>f5(k,V,$));return k},G=()=>{return c9({variant:"full-width",class:$.getClass("dialog-divider")})},W=q(),z=j(),Y=Array.isArray(J.buttons)&&J.buttons.length>0?K():null;g($.element,$.getClass("dialog"));let U=J.size||"medium";if(U!=="medium")g($.element,`${$.getClass("dialog")}--${U}`);let X=J.animation||"scale";if(X!=="scale")g($.element,`${$.getClass("dialog")}--${X}`);$.element.appendChild(W);let _=null,H=null;if(J.divider){if(_=G(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),Y)H=G(),H.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(z),H)$.element.appendChild(H.element);if(Y)$.element.appendChild(Y);Z.appendChild($.element);let B=J.container||document.body;return B.appendChild(Z),{...$,overlay:Z,structure:{header:W,content:z,footer:Y,headerDivider:_,footerDivider:H,container:B}}},u5=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let Z=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(Z.element,J.structure.footer),J.structure.footerDivider=Z}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},f5=(J,$,Q)=>{let{text:Z,variant:q="text",onClick:j,closeDialog:K=!0,autofocus:G=!1,attributes:W={}}=$,z=Q9({text:Z,variant:q,...W});if(z.on("click",(Y)=>{console.log("button click");let U=K;if(typeof j==="function")try{if(j(Y,Q)===!1)U=!1}catch(X){console.error("Error in onClick handler:",X)}if(U){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:Z})}}),G)z.element.setAttribute("autofocus","true");if(J.appendChild(z.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:z})},g5=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,Z='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',q=null,j=()=>{if(!J.config.trapFocus)return;let X=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;let _=X[0],H=X[X.length-1];if(J.config.autofocus){let k=J.element.querySelector("[autofocus]");if(k)k.focus();else _.focus()}J.element.addEventListener("keydown",B);function B(k){if(k.key!=="Tab")return;if(k.shiftKey){if(document.activeElement===_)H.focus(),k.preventDefault()}else if(document.activeElement===H)_.focus(),k.preventDefault()}},K=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",X),q)q.focus(),q=null;function X(){}},G=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",z);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",Y)},W=()=>{J.overlay.removeEventListener("click",z),document.removeEventListener("keydown",Y)};function z(X){if(X.target===J.overlay)U.close()}function Y(X){if(X.key==="Escape"&&U.isOpen())U.close()}if($)g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),g(J.element,`${J.getClass("dialog")}--visible`),j(),G();let U={open(){if(this.isOpen())return;q=document.activeElement;let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_OPEN,X);if(X.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(g(J.element,`${J.getClass("dialog")}--visible`),j(),G(),typeof J.emit==="function")J.emit(i9.OPEN,{dialog:J}),setTimeout(()=>{J.emit(i9.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_CLOSE,X);if(X.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,H=`${J.getClass("dialog-overlay")}--visible`;if(j6(J.element,_),j6(J.overlay,H),K(),W(),typeof J.emit==="function")J.emit(i9.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(i9.AFTER_CLOSE,{dialog:J})},Q)},toggle(X){if(X===void 0)this.isOpen()?this.close():this.open();else if(X)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{U.close()});return{...J,visibility:U}},d5=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,Z=J.structure.footer;return{...J,content:{setTitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&q)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getTitle(){let q=$.querySelector(`.${J.getClass("dialog-header-title")}`);return q?q.textContent||"":""},setSubtitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&q)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getSubtitle(){let q=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return q?q.textContent||"":""},setContent(q){Q.innerHTML=q},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return Z}}}},l5=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let Z=J.config.footerAlignment||"right";if(Z!=="right")g(Q,`${J.getClass("dialog-footer")}--${Z}`);J.element.appendChild(Q),J.structure.footer=Q}f5(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((Z)=>Z.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((Z)=>{if(Z!=="right")j6(J.structure.footer,`${J.getClass("dialog-footer")}--${Z}`)}),$!=="right")g(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},r5=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((Z)=>{j6(J.element,`${J.getClass("dialog")}--${Z}`)}),$!=="medium")g(J.element,`${J.getClass("dialog")}--${$}`)}}}},p5=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:Z="Confirm",message:q,confirmText:j="Yes",cancelText:K="No",confirmVariant:G="filled",cancelVariant:W="text",size:z="small"}=$;J.content.setTitle(Z),J.content.setContent(`<p>${q}</p>`),J.size.setSize(z),J._buttons.forEach((Y)=>Y.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:G,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:K,variant:W,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};R9();var s5=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,Z){return J.events.on(Q,Z),this},off(Q,Z){return J.events.off(Q,Z),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,Z=`${$.getClass("dialog-overlay")}--visible`;if(j6($.element,Q),j6($.overlay,Z),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var oq=(J={})=>{let $=y5(J);try{let Q=b(S,d(),h(T5($)),h5($),g5(),d5(),l5(),r5(),u5(),p5(),C(),(Z)=>s5(S5(Z))(Z))($);if($.on)Object.entries($.on).forEach(([Z,q])=>{if(typeof q==="function")Q.on(Z,q)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},m5=oq;J6();c();o();var a5=({disabled:J,lifecycle:$,className:Q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(q){return Z.element.value=q,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(q){return Z.icon.setIcon(q),this},getIcon(){return Z.icon.getIcon()},setPosition(q){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{Z.element.classList.remove(`${Q}--${K}`)}),Z.element.classList.add(`${Q}--${q}`),this},getPosition(){let q=["top-right","top-left","bottom-right","bottom-left"];for(let j of q)if(Z.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return Z.element.classList.add(`${Q}--lowered`),this},raise(){return Z.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});t();var tq={variant:"primary",size:"default",type:"button",ripple:!0},c5=(J={})=>u(tq,J,"fab"),i5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let Z={...J,className:Q};return p(Z,{tag:"button",attributes:$,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},o5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var nq=(J={})=>{let $=c5(J);try{return b(S,d(),h(i5($)),K6($),U9($),G6($),S6($),C(),(Z)=>a5(o5(Z))(Z))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},s8=nq;J6();c();o();var t5=({disabled:J,lifecycle:$,text:Q,className:Z})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(j){return q.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return q.icon.setIcon(j),this},getIcon(){return q.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{q.element.classList.remove(`${Z}--${G}`)}),q.element.classList.add(`${Z}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let K of j)if(q.element.classList.contains(`${Z}--${K}`))return K;return null},lower(){return q.element.classList.add(`${Z}--lowered`),this},raise(){return q.element.classList.remove(`${Z}--lowered`),this},collapse(){q.element.classList.add(`${Z}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},expand(){q.element.classList.remove(`${Z}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},destroy(){$.destroy()}});t();var eq={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},n5=(J={})=>u(eq,J,"extended-fab"),e5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return p(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},$Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var $j=(J={})=>{let $=n5(J),Q=(Z)=>{if($.collapseOnScroll){let q=window.scrollY,j=!1,K=10,G=()=>{if(!j)window.requestAnimationFrame(()=>{let z=window.scrollY,Y=z-q;if(Y>K)Z.collapse();else if(Y<-K)Z.expand();if(z<=0)Z.expand();q=z,j=!1}),j=!0};window.addEventListener("scroll",G,{passive:!0}),requestAnimationFrame(()=>{Z.expand()});let W=Z.destroy;Z.destroy=()=>{window.removeEventListener("scroll",G),W.call(Z)}}};try{let Z=b(S,d(),h(e5($)),K6($),U9($),Y9($),G6($),S6($),C(),(q)=>t5($Q(q))(q))($);return Q(Z),Z}catch(Z){throw console.error("Extended FAB creation error:",Z),new Error(`Failed to create Extended FAB: ${Z.message}`)}},m8=$j;J6();c();o();var JQ=!1,Jj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},Z={triggerEvent(F,N={},O){let P={menu:Q.component,...N,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return $.emit(F,P),P}},q=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:F}=J;if(typeof F==="string"){let N=document.querySelector(F);if(!N)return console.warn(`Menu opener not found: ${F}`),null;return N}if(typeof F==="object"&&F!==null&&"element"in F)return F.element;return F},j=(F,N)=>{let O=document.createElement("li"),P=`${$.getClass("menu-item")}`;if(O.className=P,O.setAttribute("role","menuitem"),O.setAttribute("tabindex","-1"),O.setAttribute("data-id",F.id),O.setAttribute("data-index",N.toString()),F.disabled)O.classList.add(`${P}--disabled`),O.setAttribute("aria-disabled","true");else O.setAttribute("aria-disabled","false");if(Q.selectedItemId&&F.id===Q.selectedItemId)O.classList.add(`${P}--selected`),O.setAttribute("aria-selected","true");else O.setAttribute("aria-selected","false");if(F.hasSubmenu)O.classList.add(`${P}--submenu`),O.setAttribute("aria-haspopup","true"),O.setAttribute("aria-expanded","false");let L=document.createElement("span");if(L.className=`${$.getClass("menu-item-content")}`,F.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=F.icon,L.appendChild(R)}let D=document.createElement("span");if(D.className=`${$.getClass("menu-item-text")}`,D.textContent=F.text,L.appendChild(D),F.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=F.shortcut,L.appendChild(R)}if(O.appendChild(L),!F.disabled){if(O.addEventListener("click",(R)=>z(R,F,N)),O.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),z(R,F,N)}),O.addEventListener("focus",()=>{Q.activeItemIndex=N}),F.hasSubmenu&&J.openSubmenuOnHover)O.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(F,N,O)}),O.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return O},K=(F,N)=>{let O=document.createElement("li");if(O.className=`${$.getClass("menu-divider")}`,O.setAttribute("role","separator"),O.setAttribute("data-index",N.toString()),F.id)O.setAttribute("id",F.id);return O},G=()=>{let F=document.createElement("ul");F.className=`${$.getClass("menu-list")}`,F.setAttribute("role","menu"),Q.items.forEach((N,O)=>{if("type"in N&&N.type==="divider")F.appendChild(K(N,O));else F.appendChild(j(N,O))}),$.element.innerHTML="",$.element.appendChild(F)},W=(F)=>{for(let N of Q.items){if("id"in N&&N.id===F)return N;if("submenu"in N&&Array.isArray(N.submenu)){for(let O of N.submenu)if("id"in O&&O.id===F)return O}}return null},z=(F,N,O)=>{if(F.preventDefault(),F.stopPropagation(),N.disabled)return;if(N.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(N,O,F.currentTarget);return}let P=Z.triggerEvent("select",{item:N,itemId:N.id,itemData:N.data},F);if(J.closeOnSelect&&!P.defaultPrevented)X(F,!0)},Y=(F)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((O)=>{if(O.getAttribute("data-id")===F)O.classList.add(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","true");else O.classList.remove(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","false")}),Q.selectedItemId=F},U=(F,N="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",H),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let O=q();if(O&&$.position)$.position.positionMenu(O);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,N);else if(N==="keyboard"){let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0,P[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",k,{passive:!0}),window.addEventListener("scroll",M,{passive:!0})},0)},20),Z.triggerEvent("open",{},F)},X=(F,N=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:F,restoreFocus:N}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",k),window.removeEventListener("scroll",M),Z.triggerEvent("close",{restoreFocus:N},F),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(F,N="mouse")=>{if(Q.visible)X(F);else{if(F){if(F instanceof KeyboardEvent)N="keyboard";else if(F instanceof MouseEvent)N="mouse"}U(F,N)}},H=(F)=>{if(JQ){JQ=!1;return}if($.element.contains(F.target))return;let N=q();if(N&&N.contains(F.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let O=$.submenu.getActiveSubmenus();for(let P of O)if(P.element.contains(F.target))return}X(F,!1)},B=(F)=>{let N=$.element.contains(F.target),O=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((P)=>P.element.contains(F.target));if(Q.visible){if(N||O){if(F.key==="Escape")F.preventDefault(),X(F,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(F,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:W,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},k=()=>{if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F)}},M=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let F=q();if(F&&$.position)$.position.positionMenu(F)})},V=()=>{if(G(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:W,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",k),window.addEventListener("scroll",M)}};if($.on("create-menu-items",(F)=>{let{items:N,container:O,onItemCreated:P}=F;N.forEach((L,D)=>{let R;if("type"in L&&L.type==="divider")R=K(L,D);else R=j(L,D);if(O.appendChild(R),P)P(R)})}),setTimeout(V,0),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",k),window.removeEventListener("scroll",M),F()}}return{...$,menu:{open:(F,N="mouse")=>{return U(F,N),$},close:(F,N=!0)=>{return X(F,N),$},toggle:(F,N="mouse")=>{return _(F,N),$},isOpen:()=>Q.visible,setItems:(F)=>{return Q.items=F,G(),$},getItems:()=>Q.items,setPosition:(F)=>{if(Q.position=F,Q.visible){let N=q();if(N&&$.position)$.position.positionMenu(N)}return $},getPosition:()=>Q.position,setSelected:(F)=>{return Y(F),$},getSelected:()=>Q.selectedItemId}}},a8=Jj;var Qj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(B)=>{Q=B.key==="Tab",setTimeout(()=>{Q=!1},100)});let Z={openerElement:null,openerComponent:null,activeClass:""},q=(B)=>{if(!B)return{element:null,component:null};if(typeof B==="string"){let k=document.querySelector(B);if(!k)return console.warn(`Menu opener not found: ${B}`),{element:null,component:null};return{element:k,component:null}}if(typeof B==="object"&&B!==null){if("element"in B&&B.element instanceof HTMLElement)return{element:B.element,component:B};if("getElement"in B&&typeof B.getElement==="function"){let k=B.getElement();if(k instanceof HTMLElement)return{element:k,component:B}}if("input"in B&&B.input instanceof HTMLElement)return{element:B.input,component:B};if(B instanceof HTMLElement)return{element:B,component:null}}return console.warn("Invalid opener type:",B),{element:null,component:null}},j=(B)=>{let k=$.getClass("").split("-")[0];if(B.tagName==="BUTTON")return`${k}-button--active`;else if(B.classList.contains(`${k}-chip`))return`${k}-chip--selected`;else if(B.classList.contains(`${k}-textfield`)||B.classList.contains(`${k}-select`))return`${k}-textfield--focused`;else return`${k}-menu-opener--active`},K=(B)=>{let{element:k,component:M}=B;if(!k)return;if(Z.openerElement&&Z.openerElement!==k)X();Z.openerElement=k,Z.openerComponent=M,Z.activeClass=j(k),k.addEventListener("click",z),k.addEventListener("keydown",Y),k.addEventListener("blur",U),k.setAttribute("aria-haspopup","true"),k.setAttribute("aria-expanded","false");let V=$.element.id;if(!V)V=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=V;k.setAttribute("aria-controls",V)},G=(B)=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.setActive==="function"){Z.openerComponent.setActive(B);return}if(Z.openerComponent&&"selected"in Z.openerComponent){Z.openerComponent.selected=B;return}if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"&&typeof Z.openerComponent.blur==="function"){if(B)Z.openerComponent.focus();else Z.openerComponent.blur();return}if(Z.openerElement.classList)if(B)Z.openerElement.classList.add(Z.activeClass);else Z.openerElement.classList.remove(Z.activeClass)},W=()=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"){requestAnimationFrame(()=>{Z.openerComponent.focus()});return}if(Z.openerComponent&&"input"in Z.openerComponent&&Z.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{Z.openerComponent.input.focus()});return}requestAnimationFrame(()=>{Z.openerElement.focus()})},z=(B)=>{if(B.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(B);else $.menu.open(B,"mouse")},Y=(B)=>{if(!$.menu)return;let k=$.menu.isOpen();switch(B.key){case"Enter":case" ":case"ArrowDown":case"Down":if(B.preventDefault(),!k)$.menu.open(B,"keyboard");break;case"Escape":if(k)B.preventDefault(),$.menu.close(B);break;case"ArrowUp":case"Up":if(B.preventDefault(),!k)$.menu.open(B,"keyboard"),setTimeout(()=>{let M=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(M.length>0){M.forEach((F)=>F.setAttribute("tabindex","-1"));let V=M[M.length-1];V.setAttribute("tabindex","0"),V.focus()}},100);break}},U=(B)=>{if(!$.menu||!$.menu.isOpen())return;let k=B.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},10);return}if(k){if($.element.contains(k))return;if(k.getAttribute("aria-haspopup")==="true"||k.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},50)},X=()=>{if(Z.openerElement)Z.openerElement.removeEventListener("click",z),Z.openerElement.removeEventListener("keydown",Y),Z.openerElement.removeEventListener("blur",U),Z.openerElement.removeAttribute("aria-haspopup"),Z.openerElement.removeAttribute("aria-expanded"),Z.openerElement.removeAttribute("aria-controls"),G(!1);Z.openerComponent=null,Z.openerElement=null,Z.activeClass=""},{element:_,component:H}=q(J.opener);if(K({element:_,component:H}),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{X(),B()}}return $.on("open",()=>{if(Z.openerElement)Z.openerElement.setAttribute("aria-expanded","true"),G(!0)}),$.on("close",(B)=>{if(Z.openerElement){if(Z.openerElement.setAttribute("aria-expanded","false"),G(!1),B.restoreFocus&&!Q)W()}}),{...$,opener:{setOpener(B){let k=q(B);if(k.element)K(k);return $},getOpener(){return Z.openerElement},getOpenerComponent(){return Z.openerComponent},setActive(B){return G(B),$},focus(){return W(),$}}}},c8=Qj;var Zj=(J,$)=>{let Q=(j,K,G,W=!1)=>{if(!j||!K)return;j.style.position="absolute";let z=window.pageXOffset||document.documentElement.scrollLeft,Y=window.pageYOffset||document.documentElement.scrollTop,U=j.cloneNode(!0);U.style.visibility="hidden",U.style.display="block",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.transform="none",U.style.opacity="0",U.style.pointerEvents="none",U.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(U);let X=K.getBoundingClientRect(),_=U.getBoundingClientRect(),H=window.innerWidth,B=window.innerHeight;document.body.removeChild(U);let k=$.offset!==void 0?$.offset:8,M=0,V=0,F=G;if(W){if(F=G||"right-start",F.startsWith("right")&&X.right+_.width+k>H-16)F=F.replace("right","left");else if(F.startsWith("left")&&X.left-_.width-k<16)F=F.replace("left","right");if(X.top+_.height>B-48){if(F==="right-start")F="right-end";else if(F==="left-start")F="left-end"}}else switch(G){case"top-start":case"top":case"top-end":if(X.top<_.height+k+48)F=G.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(X.bottom+_.height+k+48>B){if(X.top>B-X.bottom)F=G.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(X.bottom+_.height>B-48){if(G==="right-start")F="right-end";else if(G==="left-start")F="left-end";else if(G==="right")M=X.top-(_.height-X.height)-k;else if(G==="left")M=X.top-(_.height-X.height)-k}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),F.startsWith("top")||F==="right-end"||F==="left-end"||F==="right"&&M<X.top||F==="left"&&M<X.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(F.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(F.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(F){case"top-start":M=X.top+Y-_.height-k,V=X.left+z;break;case"top":M=X.top+Y-_.height-k,V=X.left+z+X.width/2-_.width/2;break;case"top-end":M=X.top+Y-_.height-k,V=X.right+z-_.width;break;case"right-start":M=X.top+Y,V=X.right+z+k;break;case"right":if(M===0)M=X.top+Y+X.height/2-_.height/2;else M+=Y;V=X.right+z+k;break;case"right-end":M=X.bottom+Y-_.height,V=X.right+z+k;break;case"bottom-start":M=X.bottom+Y+k,V=X.left+z;break;case"bottom":M=X.bottom+Y+k,V=X.left+z+X.width/2-_.width/2;break;case"bottom-end":M=X.bottom+Y+k,V=X.right+z-_.width;break;case"left-start":M=X.top+Y,V=X.left+z-_.width-k;break;case"left":if(M===0)M=X.top+Y+X.height/2-_.height/2;else M+=Y;V=X.left+z-_.width-k;break;case"left-end":M=X.bottom+Y-_.height,V=X.left+z-_.width-k;break}let P=48;if(M-Y<P)M=P+Y;let L=48;if(M-Y+_.height>B-L){let R=B-(M-Y)-L,w=Math.min(_.height,100),A=Math.max(R,w);if(j.style.maxHeight=`${A}px`,$.maxHeight){let x=parseInt($.maxHeight,10);if(!isNaN(x)&&x<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!W)j.style.width=`${X.width}px`;if(j.style.top=`${Math.max(P+Y,M)}px`,j.style.left=`${Math.max(16+z,V)}px`,V-z+_.width>H-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,K,G=1)=>{if(!j||!K)return;let W=G%2===1?"right-start":"left-start";j.style.zIndex=`${1000+G*10}`,Q(j,K,W,!0)},positionElement:Q}},qj=(J)=>($)=>{if(!$.element)return $;let Q=Zj($,J);return{...$,position:Q}},i8=qj;var jj=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(W)=>{$=W.key==="Tab",setTimeout(()=>{$=!1},100)})})();let Z=()=>{let z=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(z).filter((Y)=>{return Y.offsetParent!==null&&!Y.classList.contains("hidden")})},q=(W,z)=>{if(z==="keyboard"){let Y=Array.from(W.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(Y.length>0)Y[0].setAttribute("tabindex","0"),Y[0].focus();else W.setAttribute("tabindex","0"),W.focus()}else{W.setAttribute("tabindex","-1");let Y=W.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(Y)Y.setAttribute("tabindex","0")}},j=(W,z,Y)=>{let U=z.activeSubmenu&&z.activeSubmenu.contains(W.target),X=U?z.activeSubmenu:J.element,_=Array.from(X.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let H=document.activeElement,B=-1;if(H&&_.includes(H))B=_.indexOf(H);let k=(M)=>{if(_[M])_[M].focus()};switch(W.key){case"ArrowDown":case"Down":if(W.preventDefault(),B<0)k(0);else if(B<_.length-1)k(B+1);else k(0);break;case"ArrowUp":case"Up":if(W.preventDefault(),B<0)k(_.length-1);else if(B>0)k(B-1);else k(_.length-1);break;case"Home":W.preventDefault(),k(0);break;case"End":W.preventDefault(),k(_.length-1);break;case"Enter":case" ":if(W.preventDefault(),B>=0)_[B].click();break;case"ArrowRight":case"Right":if(W.preventDefault(),U){if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let V=_[B],F=parseInt(V.getAttribute("data-index"),10),O=V.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),P=Y.findItemById(O);if(P&&P.submenu){let L=P.submenu[F];Y.handleNestedSubmenuClick(L,F,V)}}}else if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let V=_[B],F=parseInt(V.getAttribute("data-index"),10),N=z.items[F];Y.handleSubmenuClick(N,F,V)}break;case"ArrowLeft":case"Left":if(W.preventDefault(),U)if(z.activeSubmenuItem){let V=z.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),V)V.focus()}else Y.closeSubmenu(1);break;case"Escape":if(W.preventDefault(),U)if(z.activeSubmenuItem){let V=z.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),V)V.focus()}else Y.closeSubmenu(1);else Y.closeMenu(W,!0);break;case"Tab":W.preventDefault();let M=J.opener?.getOpener?.();if(Y.closeMenu(W,!0),M)setTimeout(()=>{if(W.shiftKey);else{let V=Z(),F=V.indexOf(M);if(F>=0&&F<V.length-1)V[F+1].focus()}},0);break}};return{handleInitialFocus:q,handleMenuKeydown:j,setupKeyboardHandlers:(W,z,Y)=>{let U=W.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(U.forEach((X)=>{X.tabIndex=-1}),U.length>0)U[0].tabIndex=0;W.addEventListener("keydown",(X)=>j(X,z,Y))},isTabNavigationActive:()=>$,getFocusableElements:Z}},Kj=()=>(J)=>{if(!J.element)return J;let $=jj(J);return{...J,keyboard:$}},o8=Kj;var Gj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},Z=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},q=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(V,F,N)=>{if(!J.openSubmenuOnHover||!V.hasSubmenu)return;Z(),q(),Q.hoverIntent.activeItem=N,Q.hoverIntent.timer=setTimeout(()=>{if(N.matches(":hover")){if(Q.activeSubmenuItem!==N)z(V,F,N)}Q.hoverIntent.timer=null},100)},K=()=>{Z(),q(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:V,activeSubmenuItem:F}=Q;if(V&&F){let N=V.matches(":hover"),O=F.matches(":hover");if(!N&&!O)Y(Q.submenuLevel)}Q.submenuTimer=null},300)},G=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(N.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);Y(L+1),N.setAttribute("aria-expanded","false")}else z(V,F,N)},W=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(N.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);Y(L+1)}else z(V,F,N)},z=(V,F,N)=>{if(!V.submenu||!V.hasSubmenu)return;let O=N.closest(`.${$.getClass("menu--submenu")}`)?parseInt(N.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(Y(O),Q.activeSubmenus.findIndex((w)=>w.menuItem===N&&w.isOpening)>=0)return;N.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",O.toString()),L.setAttribute("data-parent-item",V.id),L.style.zIndex=`${1000+O*10}`;let D=document.createElement("ul");D.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:V.submenu,container:D,level:O,onItemCreated:(w)=>{if(!w.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(w)}}),L.appendChild(D),document.body.appendChild(L),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(L,N,O);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(L,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:Y,handleNestedSubmenuClick:W});L.addEventListener("mouseenter",()=>{q()}),L.addEventListener("mouseleave",()=>{K()}),Q.activeSubmenu=L,Q.activeSubmenuItem=N,Q.activeSubmenus.push({element:L,menuItem:N,level:O,isOpening:!0}),Q.submenuLevel=O,document.addEventListener("click",X),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let w=Q.activeSubmenus.findIndex((A)=>A.element===L);if(w!==-1)Q.activeSubmenus[w].isOpening=!1;if(R.length>0){if(O>=2||document.activeElement===N)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:L,parentItem:N,level:O,item:V})},Y=(V)=>{Z(),q();let F=[];for(let N=Q.activeSubmenus.length-1;N>=0;N--)if(Q.activeSubmenus[N].level>=V){let O=Q.activeSubmenus[N];if(O.menuItem)O.menuItem.setAttribute("aria-expanded","false");O.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(O.element.parentNode)O.element.parentNode.removeChild(O.element)},200),F.push(N)}if(F.forEach((N)=>{Q.activeSubmenus.splice(N,1)}),Q.activeSubmenus.length>0){let N=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=N.element,Q.activeSubmenuItem=N.menuItem,Q.submenuLevel=N.level,N.menuItem)N.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:V})},U=()=>{if(Z(),q(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((V)=>{if(V.menuItem)V.menuItem.setAttribute("aria-expanded","false");V.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(V.element.parentNode)V.element.parentNode.removeChild(V.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),$.emit("all-submenus-closed",{})},X=(V)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:F,activeSubmenuItem:N}=Q;if(F.contains(V.target)||N&&N.contains(V.target))return;U()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},H=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},B=()=>{return Q.activeSubmenus.length>0},k=()=>{return Q.submenuLevel},M=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let V=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(Z(),q(),document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((F)=>{if(F.element.parentNode)F.element.parentNode.removeChild(F.element)});V()}}return $.on("menu-closing",()=>{U()}),{...$,submenu:{openSubmenu:z,closeSubmenu:Y,closeAllSubmenus:U,handleSubmenuClick:G,handleNestedSubmenuClick:W,handleSubmenuHover:j,handleSubmenuLeave:K,hasOpenSubmenu:B,getSubmenuLevel:k,getActiveSubmenus:M}}},t8=Gj;var QQ=({menu:J,opener:$,events:Q,lifecycle:Z})=>(q)=>{return{element:q.element,open(K,G="mouse"){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard"}return J.open(K,G),this},close(K,G=!0,W=!1){return J.close(K,G,W),this},toggle(K,G){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard";else if(K instanceof MouseEvent)G="mouse"}return J.toggle(K,G),this},isOpen(){return J.isOpen()},setItems(K){return J.setItems(K),this},getItems(){return J.getItems()},setOpener(K){return $.setOpener(K),this},getOpener(){return $.getOpener()},setPosition(K){return J.setPosition(K),this},getPosition(){return J.getPosition()},setSelected(K){return J.setSelected(K),this},getSelected(){return J.getSelected()},on(K,G){if(Q?.on)Q.on(K,G);else if(q.on)q.on(K,G);return this},off(K,G){if(Q?.off)Q.off(K,G);else if(q.off)q.off(K,G);return this},destroy(){Z.destroy()}}};t();var n8={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},c6={POSITION:n8.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0},ZQ={MOUSE:"mouse",KEYBOARD:"keyboard"},qQ={ITEM:"item",DIVIDER:"divider"},jQ={OPEN:"open",CLOSE:"close",SELECT:"select"},F$={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator"};var zj={items:[],position:c6.POSITION,closeOnSelect:c6.CLOSE_ON_SELECT,closeOnClickOutside:c6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:c6.CLOSE_ON_ESCAPE,openSubmenuOnHover:c6.OPEN_SUBMENU_ON_HOVER,offset:c6.OFFSET,autoFlip:c6.AUTO_FLIP,visible:!1},KQ=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return u(zj,J,"menu")},GQ=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([Z,q])=>`${Z}: ${q}`).join(";")};return p(J,{tag:"div",attributes:Q,className:[J.visible?F$.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},zQ=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,Z)=>J.menu?.close($,Q,Z),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var Wj=(J)=>{try{let $=KQ(J);return b(S,d(),h(GQ($)),i8($),o8(),t8($),a8($),c8($),C(),(Z)=>QQ(zQ(Z))(Z))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},H$=Wj;J6();c();o();var WQ=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(Z){if(typeof $.addItem==="function")$.addItem(Z);return this},removeItem(Z){if(typeof $.removeItem==="function")$.removeItem(Z);return this},getItem(Z){if(typeof $.getItem==="function")return $.getItem(Z);return this.items.get(Z)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(Z){if(typeof $.getItemPath==="function")return $.getItemPath(Z);return[]},setActive(Z){if(typeof $.handleItemClick==="function")$.handleItemClick(Z);else if(typeof $.setActive==="function")$.setActive(Z);else{let q=this.items.get(Z);if(q&&q.element){if($.emit)$.emit("change",{id:Z,item:q,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(Z,q){if($.on)$.on(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var e8={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},$1={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},J1={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},YQ={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},M$={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},_9={VARIANT:e8.STANDARD,POSITION:$1.LEFT,BEHAVIOR:J1.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},n={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var Yj=(J)=>{let $=document.createElement("span");return $.className=`${J}-${n.EXPAND_ICON}`,$.innerHTML=`
19
19
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
20
20
  <polyline points="9 18 15 12 9 6"></polyline>
21
21
  </svg>
22
- `,$},Uj=(J,$,Q)=>{let Z=document.createElement("div");return Z.className=`${$}-${n.NESTED_CONTAINER}`,Z.setAttribute("role","menu"),Z.hidden=!0,J.forEach((q)=>{Q(q,Z,$)}),Z},M$=(J,$,Q)=>{let Z=document.createElement("div");Z.className=`${Q}-${n.ITEM_CONTAINER}`;let q=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",G=$.closest(`.${Q}-nav--drawer, .${Q}-nav--drawer-modal, .${Q}-nav--drawer-standard`)!==null,K=document.createElement("button");if(K.className=`${Q}-${n.ITEM}`,K.type="button",J.items?.length)if(G)K.setAttribute("role","button"),K.setAttribute("aria-expanded",J.expanded?"true":"false"),K.setAttribute("aria-haspopup","menu");else K.setAttribute("role","button");else if(q)K.setAttribute("role","menuitem");else if(j)K.setAttribute("role","tab"),K.setAttribute("aria-selected",J.active?"true":"false"),K.setAttribute("tabindex",J.active?"0":"-1");if(J.id)K.dataset.id=J.id;if(J.disabled)K.disabled=!0,K.setAttribute("aria-disabled","true");if(J.icon){let z=document.createElement("span");z.className=`${Q}-${n.ICON}`,z.innerHTML=J.icon,K.appendChild(z)}if(J.label){let z=document.createElement("a");z.className=`${Q}-${n.LABEL}`,z.textContent=J.label,z.href=`/${J.id}`,z.style.textDecoration="none",z.style.color="inherit",z.style.pointerEvents="none",z.setAttribute("title",J.label),K.appendChild(z),K.setAttribute("aria-label",J.label)}if(J.badge){let z=document.createElement("span");z.className=`${Q}-${n.BADGE}`,z.textContent=J.badge,z.setAttribute("aria-label",`${J.badge} notifications`),K.appendChild(z)}if(J.active&&!J.items?.length){if(K.classList.add(`${Q}-${n.ACTIVE}`),!j)K.setAttribute("aria-current","page")}if(Z.appendChild(K),J.items?.length&&G){let z=Yj(Q);K.appendChild(z);let W=Uj(J.items,Q,M$);W.hidden=!J.expanded,Z.appendChild(W),K.addEventListener("click",(Y)=>{Y.stopPropagation();let U=K.getAttribute("aria-expanded")==="true";if(K.setAttribute("aria-expanded",(!U).toString()),W.hidden=U,z.style)z.style.transform=U?"":"rotate(90deg)"})}return $.appendChild(Z),K},Q1=(J,$)=>{let Q=J.closest(`.${$}-${n.ITEM_CONTAINER}`);if(!Q)return[];let Z=Q.querySelector(`.${$}-${n.NESTED_CONTAINER}`);if(!Z)return[];return Array.from(Z.querySelectorAll(`.${$}-${n.ITEM}`)).reduce((j,G)=>{return[...j,G,...Q1(G,$)]},[])};function Xj(J,$){if(!J)return null;let Q=J.getAttribute("data-id");if(Q)return Q;if(J.classList.contains(`${$}-nav--rail`))return"rail";if(J.classList.contains(`${$}-nav--drawer`))return"drawer";return null}var UQ=(J)=>($)=>{let Q=new Map,Z=null,q=J.prefix||"mtrl",j=(z,W)=>{if(Q.set(z.id,{element:W,config:z}),z.items?.length)z.items.forEach((Y)=>{let U=W.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U){let X=U.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(X){let _=X.querySelector(`[data-id="${Y.id}"]`);if(_)j(Y,_)}}})},G=(z,W,Y)=>{let U=z.getAttribute("role");if(Y){if(z.classList.add(`${q}-${n.ACTIVE}`),U==="tab")z.setAttribute("aria-selected","true"),z.setAttribute("tabindex","0");else if(!z.getAttribute("aria-haspopup"))z.setAttribute("aria-current","page")}else if(z.classList.remove(`${q}-${n.ACTIVE}`),U==="tab")z.setAttribute("aria-selected","false"),z.setAttribute("tabindex","-1");else if(z.hasAttribute("aria-current"))z.removeAttribute("aria-current")};if(J.items)J.items.forEach((z)=>{let W=M$(z,$.element,q);if(j(z,W),z.active)Z={element:W,config:z},G(W,Z,!0)});if($.emit)$.element.addEventListener("mouseover",(z)=>{let Y=z.target.closest("[data-id]");if(Y){let U=Y.dataset.id;if(U)$.emit("mouseover",{id:U,clientX:z.clientX,clientY:z.clientY,target:Y,item:Q.get(U)})}},{passive:!0}),$.element.addEventListener("mouseenter",(z)=>{let W=$.element.dataset.id||$.componentName||"nav";$.emit("mouseenter",{clientX:z.clientX,clientY:z.clientY,id:W})},{passive:!0}),$.element.addEventListener("mouseleave",(z)=>{let W=z.relatedTarget,Y=Xj(W,q),U=$.element.dataset.id||$.componentName||"nav";$.emit("mouseleave",{clientX:z.clientX,clientY:z.clientY,relatedTargetId:Y,id:U})});if($.lifecycle){let z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Q.clear(),z)z()}}let K=(z)=>{let W=[z],Y=Q.get(z);if(!Y)return W;let U=Y.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(!U)return W;let X=U.parentElement;if(!X||!X.classList.contains(`${q}-${n.NESTED_CONTAINER}`))return W;let _=X;while(_){let H=_.parentElement;if(!H||!H.classList.contains(`${q}-${n.ITEM_CONTAINER}`))break;let B=H.querySelector(`.${q}-${n.ITEM}[data-id]`);if(!B)break;let M=B.getAttribute("data-id");if(!M)break;W.unshift(M);let k=H.parentElement;if(!k||!k.classList.contains(`${q}-${n.NESTED_CONTAINER}`))break;_=k}return W};return{...$,items:Q,addItem(z){if(Q.has(z.id))return this;let W=M$(z,$.element,q);if(j(z,W),z.active)this.setActive(z.id);if($.emit)$.emit("itemAdded",{id:z.id,item:{element:W,config:z}});return this},removeItem(z){let W=Q.get(z);if(!W)return this;if(Q1(W.element,q).forEach((X)=>{let _=X.dataset.id;if(_)Q.delete(_)}),Z?.config.id===z)Z=null;let U=W.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U)U.remove();if(Q.delete(z),$.emit)$.emit("itemRemoved",{id:z,item:W});return this},getItem:(z)=>Q.get(z),getAllItems:()=>Array.from(Q.values()),getActive:()=>Z,getItemPath:(z)=>K(z),setActive(z){let W=Q.get(z);if(!W||W.config.disabled)return this;if(Z)G(Z.element,Z,!1);if(G(W.element,W,!0),Z=W,K(z).forEach((U)=>{let X=Q.get(U);if(X){let _=X.element,H=_.closest(`.${q}-${n.ITEM_CONTAINER}`);if(H){let B=H.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(B)_.setAttribute("aria-expanded","true"),B.hidden=!1}}}),$.emit)$.emit(k$.CHANGE,{id:z,item:W,previousItem:Z,path:K(z)});return this}}};var i6={ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon"};var XQ=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=(G,K)=>{if(!G)return;let z=G.getAttribute("role");if(K){if(G.classList.add(`${Q}-${i6.ITEM}--active`),z==="tab")G.setAttribute("aria-selected","true"),G.setAttribute("tabindex","0");else if(!G.getAttribute("aria-haspopup"))G.setAttribute("aria-current","page")}else if(G.classList.remove(`${Q}-${i6.ITEM}--active`),z==="tab")G.setAttribute("aria-selected","false"),G.setAttribute("tabindex","-1");else if(G.hasAttribute("aria-current"))G.removeAttribute("aria-current")},q=(G)=>{if(G.getAttribute("aria-expanded")===null)return!1;let z=G.getAttribute("aria-expanded")==="true";G.setAttribute("aria-expanded",(!z).toString());let W=G.closest(`.${Q}-${i6.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(W){let U=W.querySelector(`.${Q}-${i6.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(U){U.hidden=z;let X=G.querySelector(`.${Q}-${i6.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(X&&X.style)X.style.transform=z?"":"rotate(90deg)"}}let Y=G.dataset.id;if(Y&&$.emit)$.emit("expandToggle",{id:Y,expanded:!z});return!0},j={...$,handleItemClick(G){if(!$.items)return;let K=$.items.get(G);if(!K)return;let z=$.element.querySelector(`.${Q}-${i6.ITEM}--active, .mtrl-nav-item--active`);if(z)Z(z,!1);if(K.element)Z(K.element,!0);if($.emit){let W=$.getItemPath?$.getItemPath(G):[];$.emit("change",{id:G,item:K,previousItem:z?{element:z,config:{id:z.dataset.id}}:null,path:W,source:"userAction"})}}};return $.element.addEventListener("click",(G)=>{let K=G.target,z=K.closest(`.${Q}-${i6.ITEM}, .mtrl-nav-item`);if(!z){if(!K.closest("[data-id]"))return}let W=z||K.closest("[data-id]");if(W.hasAttribute("disabled")||W.getAttribute("aria-disabled")==="true")return;let Y=W.dataset.id;if(!Y)return;if(q(W))return;j.handleItemClick(Y)}),$.element.addEventListener("keydown",(G)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(G.key))return;let K=["rail","drawer"].includes($.variant||""),z=["bar"].includes($.variant||"");if(G.key==="Enter"||G.key===" "){let _=document.activeElement;if(_&&_.classList.contains(`${Q}-${i6.ITEM}`)){if(G.preventDefault(),_.dataset.id)_.click()}return}let W=Array.from($.element.querySelectorAll(`.${Q}-${i6.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
- .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(W.length===0)return;let Y=document.activeElement,U=W.indexOf(Y),X=-1;if(K&&(G.key==="ArrowDown"||G.key==="ArrowRight")||z&&G.key==="ArrowRight")X=U<0?0:(U+1)%W.length;else if(K&&(G.key==="ArrowUp"||G.key==="ArrowLeft")||z&&G.key==="ArrowLeft")X=U<0?W.length-1:(U-1+W.length)%W.length;else if(G.key==="Home")X=0;else if(G.key==="End")X=W.length-1;if(X>=0)G.preventDefault(),W[X].focus()}),j};t();var Bj={variant:_9.VARIANT,position:_9.POSITION,behavior:_9.BEHAVIOR,items:[],showLabels:_9.SHOW_LABELS,scrimEnabled:_9.SCRIM_ENABLED},BQ=(J={})=>u(Bj,J,"nav"),FQ=(J)=>{let $=J.variant?`${J.prefix}-${n.VARIANT_PREFIX}${J.variant}`:"",Q=J.position?`${J.prefix}-${n.POSITION_PREFIX}${J.position}`:"",Z=J.class||"",q=[$,Q,Z].filter(Boolean);return p(J,{tag:"nav",attributes:{role:"navigation","aria-label":J.ariaLabel||"Main Navigation"},className:q})},HQ=(J)=>({disabled:{enable:J.disabled?.enable||(()=>{}),disable:J.disabled?.disable||(()=>{})},lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})}});var Fj=(J,$)=>{let{element:Q}=J,Z=$.variant||"rail",q=$.prefix||"mtrl";if(Q.setAttribute("aria-label",$.ariaLabel||"Main Navigation"),Z==="bar")if(!$.items?.some((G)=>G.items?.length))Q.setAttribute("role","tablist"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","menubar"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","navigation");if((Z==="modal"||Z==="drawer"&&$.behavior==="dismissible")&&!$.expanded)Q.classList.add(`${q}-nav--hidden`)},Hj=(J={})=>{let $=BQ(J);try{let Z=b(S,d(),h(FQ($)),K6($),g7($),UQ($),XQ($),G6($),C(),(q)=>WQ(HQ(q))(q))($);if(Fj(Z,$),$.disabled)Z.disable();if(Z.element.dataset.componentType="navigation",$.variant)Z.element.dataset.variant=$.variant;return Z}catch(Q){throw new Error(`Failed to create navigation: ${Q instanceof Error?Q.message:String(Q)}`)}},w7=Hj;m6();J6();c();o();var kQ=(J)=>($)=>{let Q=[],Z=$.getClass("radios"),q=J.value||"";if($.element.classList.add(`${Z}--${J.direction||"vertical"}`),J.disabled)$.element.classList.add(`${Z}--disabled`);let j=(z)=>{let W=document.createElement("div");W.classList.add(`${Z}-item`);let Y=document.createElement("input");if(Y.type="radio",Y.name=J.name,Y.value=z.value,Y.classList.add(`${Z}-input`),q===z.value)Y.checked=!0;if(J.disabled||z.disabled)Y.disabled=!0,W.classList.add(`${Z}-item--disabled`);let U=document.createElement("label");U.classList.add(`${Z}-label`);let X=document.createElement("span");X.classList.add(`${Z}-control`);let _=document.createElement("span");if(_.classList.add(`${Z}-circle`),J.ripple!==!1){let k=document.createElement("span");k.classList.add(`${Z}-ripple`),X.appendChild(k)}X.appendChild(_);let H=document.createElement("span");if(H.classList.add(`${Z}-text`),H.textContent=z.label,z.labelBefore)U.classList.add(`${Z}-label--before`),U.appendChild(H),U.appendChild(X);else U.appendChild(X),U.appendChild(H);let B=`${Z}-${z.value}-${Math.random().toString(36).substring(2,9)}`;Y.id=B,U.htmlFor=B,W.appendChild(Y),W.appendChild(U);let M=(k)=>{if(Y.checked){if(q=z.value,Q.forEach((N)=>{if(N.input!==Y)N.input.checked=!1}),$.events&&typeof $.events.emit==="function")$.events.emit("change",{value:z.value,originalEvent:k,option:z});else if(typeof $.on==="function"){let N=new CustomEvent("change",{detail:{value:z.value,originalEvent:k,option:z}});$.element.dispatchEvent(N)}}};return Y.addEventListener("change",M),{element:W,input:Y,label:U,config:z,destroy:()=>{if(Y.removeEventListener("change",M),W.parentNode)W.parentNode.removeChild(W)}}},G=(z)=>{let W=j(z);return $.element.appendChild(W.element),Q.push(W),$},K=(z)=>{let W=Q.findIndex((Y)=>Y.config.value===z);if(W!==-1){if(Q[W].destroy(),Q.splice(W,1),q===z)q=""}return $};if(J.options&&Array.isArray(J.options))J.options.forEach((z)=>G(z));if(!$.events)$.events={on:(z,W)=>{$.element.addEventListener(z,(Y)=>W(Y.detail))},off:(z,W)=>{$.element.removeEventListener(z,W)},emit:(z,W)=>{let Y=new CustomEvent(z,{detail:W});$.element.dispatchEvent(Y)}};return{...$,radios:Q,getValue:()=>q,setValue:(z)=>{return q=z,Q.forEach((W)=>{W.input.checked=W.config.value===z}),$},getSelected:()=>{let z=Q.find((W)=>W.config.value===q);return z?z.config:null},addOption:G,removeOption:K,enable:()=>{return $.element.classList.remove(`${Z}--disabled`),Q.forEach((z)=>{if(z.input.disabled=z.config.disabled||!1,!z.config.disabled)z.element.classList.remove(`${Z}-item--disabled`)}),$},disable:()=>{return $.element.classList.add(`${Z}--disabled`),Q.forEach((z)=>{z.input.disabled=!0,z.element.classList.add(`${Z}-item--disabled`)}),$},enableOption:(z)=>{let W=Q.find((Y)=>Y.config.value===z);if(W){if(W.config.disabled=!1,W.input.disabled=$.element.classList.contains(`${Z}--disabled`),!W.input.disabled)W.element.classList.remove(`${Z}-item--disabled`)}return $},disableOption:(z)=>{let W=Q.find((Y)=>Y.config.value===z);if(W)W.config.disabled=!0,W.input.disabled=!0,W.element.classList.add(`${Z}-item--disabled`);return $}}};var MQ=({disabled:J,lifecycle:$})=>(Q)=>{if(!Q.events)Q.events={on:(q,j)=>{Q.element.addEventListener(q,(G)=>j(G.detail))},off:(q,j)=>{Q.element.removeEventListener(q,j)},emit:(q,j)=>{let G=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(G)}};else if(!Q.events.emit)Q.events.emit=(q,j)=>{let G=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(G)};return{element:Q.element,radios:Q.radios,lifecycle:{destroy:$.destroy},getClass:Q.getClass,getValue:()=>Q.getValue(),setValue(q){return Q.setValue(q),this},getSelected:()=>Q.getSelected(),addOption(q){return Q.addOption(q),this},removeOption(q){return Q.removeOption(q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},enableOption(q){return Q.enableOption(q),this},disableOption(q){return Q.disableOption(q),this},on(q,j){return Q.events.on(q,j),this},off(q,j){return Q.events.off(q,j),this},destroy(){Q.radios.forEach((q)=>q.destroy()),$.destroy()}}};t();var kj={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},VQ=(J)=>u(kj,J,"radios"),NQ=(J)=>{return p(J,{tag:"div",attributes:{role:"radiogroup"},className:J.class})},_Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Mj=(J)=>{if(!J.name)J.name=`radios-${Math.random().toString(36).substring(2,9)}`;let $=VQ(J);try{return b(S,d(),h(NQ($)),kQ($),G6($),C(),(Z)=>MQ(_Q(Z))(Z))($)}catch(Q){throw console.error("Radios creation error:",Q),new Error(`Failed to create radios component: ${Q.message}`)}},LQ=Mj;var DQ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",FOCUSED:"focused"},Z1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},q1={STANDARD:"standard",FILLED:"filled",OUTLINED:"outlined"},j1={RIGHT:"right",LEFT:"left"},K1={SMALL:"small",MEDIUM:"medium",LARGE:"large"},OQ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},PQ={VARIANT:q1.STANDARD,DIRECTION:Z1.VERTICAL,LABEL_POSITION:j1.RIGHT,SIZE:K1.MEDIUM},RQ={GROUP:"radio-group",RADIO:"radio",INPUT:"radio__input",LABEL:"radio__label",CONTROL:"radio__control",DOT:"radio__dot",FOCUS_RING:"radio__focus-ring",RIPPLE:"radio__ripple",CHECKED:"radio--checked",DISABLED:"radio--disabled",FOCUSED:"radio--focused",LABEL_RIGHT:"radio--label-right",LABEL_LEFT:"radio--label-left",SMALL:"radio--small",MEDIUM:"radio--medium",LARGE:"radio--large"};c();o();A6();var G1=(J)=>($)=>{let Q=J.disabled===!0,q=(J.variant||"bar")==="view",j=J.placeholder||"Search",G=J.value||"",K=(F)=>$.getClass(F),z={type:"text",placeholder:j,value:G,"aria-label":j};if(Q)z.disabled="disabled";let W=v({tag:"div",className:K("search-container"),container:$.element,attributes:{style:`
22
+ `,$},Uj=(J,$,Q)=>{let Z=document.createElement("div");return Z.className=`${$}-${n.NESTED_CONTAINER}`,Z.setAttribute("role","menu"),Z.hidden=!0,J.forEach((q)=>{Q(q,Z,$)}),Z},k$=(J,$,Q)=>{let Z=document.createElement("div");Z.className=`${Q}-${n.ITEM_CONTAINER}`;let q=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",K=$.closest(`.${Q}-nav--drawer, .${Q}-nav--drawer-modal, .${Q}-nav--drawer-standard`)!==null,G=document.createElement("button");if(G.className=`${Q}-${n.ITEM}`,G.type="button",J.items?.length)if(K)G.setAttribute("role","button"),G.setAttribute("aria-expanded",J.expanded?"true":"false"),G.setAttribute("aria-haspopup","menu");else G.setAttribute("role","button");else if(q)G.setAttribute("role","menuitem");else if(j)G.setAttribute("role","tab"),G.setAttribute("aria-selected",J.active?"true":"false"),G.setAttribute("tabindex",J.active?"0":"-1");if(J.id)G.dataset.id=J.id;if(J.disabled)G.disabled=!0,G.setAttribute("aria-disabled","true");if(J.icon){let W=document.createElement("span");W.className=`${Q}-${n.ICON}`,W.innerHTML=J.icon,G.appendChild(W)}if(J.label){let W=document.createElement("a");W.className=`${Q}-${n.LABEL}`,W.textContent=J.label,W.href=`/${J.id}`,W.style.textDecoration="none",W.style.color="inherit",W.style.pointerEvents="none",W.setAttribute("title",J.label),G.appendChild(W),G.setAttribute("aria-label",J.label)}if(J.badge){let W=document.createElement("span");W.className=`${Q}-${n.BADGE}`,W.textContent=J.badge,W.setAttribute("aria-label",`${J.badge} notifications`),G.appendChild(W)}if(J.active&&!J.items?.length){if(G.classList.add(`${Q}-${n.ACTIVE}`),!j)G.setAttribute("aria-current","page")}if(Z.appendChild(G),J.items?.length&&K){let W=Yj(Q);G.appendChild(W);let z=Uj(J.items,Q,k$);z.hidden=!J.expanded,Z.appendChild(z),G.addEventListener("click",(Y)=>{Y.stopPropagation();let U=G.getAttribute("aria-expanded")==="true";if(G.setAttribute("aria-expanded",(!U).toString()),z.hidden=U,W.style)W.style.transform=U?"":"rotate(90deg)"})}return $.appendChild(Z),G},Q1=(J,$)=>{let Q=J.closest(`.${$}-${n.ITEM_CONTAINER}`);if(!Q)return[];let Z=Q.querySelector(`.${$}-${n.NESTED_CONTAINER}`);if(!Z)return[];return Array.from(Z.querySelectorAll(`.${$}-${n.ITEM}`)).reduce((j,K)=>{return[...j,K,...Q1(K,$)]},[])};function Xj(J,$){if(!J)return null;let Q=J.getAttribute("data-id");if(Q)return Q;if(J.classList.contains(`${$}-nav--rail`))return"rail";if(J.classList.contains(`${$}-nav--drawer`))return"drawer";return null}var UQ=(J)=>($)=>{let Q=new Map,Z=null,q=J.prefix||"mtrl",j=(W,z)=>{if(Q.set(W.id,{element:z,config:W}),W.items?.length)W.items.forEach((Y)=>{let U=z.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U){let X=U.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(X){let _=X.querySelector(`[data-id="${Y.id}"]`);if(_)j(Y,_)}}})},K=(W,z,Y)=>{let U=W.getAttribute("role");if(Y){if(W.classList.add(`${q}-${n.ACTIVE}`),U==="tab")W.setAttribute("aria-selected","true"),W.setAttribute("tabindex","0");else if(!W.getAttribute("aria-haspopup"))W.setAttribute("aria-current","page")}else if(W.classList.remove(`${q}-${n.ACTIVE}`),U==="tab")W.setAttribute("aria-selected","false"),W.setAttribute("tabindex","-1");else if(W.hasAttribute("aria-current"))W.removeAttribute("aria-current")};if(J.items)J.items.forEach((W)=>{let z=k$(W,$.element,q);if(j(W,z),W.active)Z={element:z,config:W},K(z,Z,!0)});if($.emit)$.element.addEventListener("mouseover",(W)=>{let Y=W.target.closest("[data-id]");if(Y){let U=Y.dataset.id;if(U)$.emit("mouseover",{id:U,clientX:W.clientX,clientY:W.clientY,target:Y,item:Q.get(U)})}},{passive:!0}),$.element.addEventListener("mouseenter",(W)=>{let z=$.element.dataset.id||$.componentName||"nav";$.emit("mouseenter",{clientX:W.clientX,clientY:W.clientY,id:z})},{passive:!0}),$.element.addEventListener("mouseleave",(W)=>{let z=W.relatedTarget,Y=Xj(z,q),U=$.element.dataset.id||$.componentName||"nav";$.emit("mouseleave",{clientX:W.clientX,clientY:W.clientY,relatedTargetId:Y,id:U})});if($.lifecycle){let W=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Q.clear(),W)W()}}let G=(W)=>{let z=[W],Y=Q.get(W);if(!Y)return z;let U=Y.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(!U)return z;let X=U.parentElement;if(!X||!X.classList.contains(`${q}-${n.NESTED_CONTAINER}`))return z;let _=X;while(_){let H=_.parentElement;if(!H||!H.classList.contains(`${q}-${n.ITEM_CONTAINER}`))break;let B=H.querySelector(`.${q}-${n.ITEM}[data-id]`);if(!B)break;let k=B.getAttribute("data-id");if(!k)break;z.unshift(k);let M=H.parentElement;if(!M||!M.classList.contains(`${q}-${n.NESTED_CONTAINER}`))break;_=M}return z};return{...$,items:Q,addItem(W){if(Q.has(W.id))return this;let z=k$(W,$.element,q);if(j(W,z),W.active)this.setActive(W.id);if($.emit)$.emit("itemAdded",{id:W.id,item:{element:z,config:W}});return this},removeItem(W){let z=Q.get(W);if(!z)return this;if(Q1(z.element,q).forEach((X)=>{let _=X.dataset.id;if(_)Q.delete(_)}),Z?.config.id===W)Z=null;let U=z.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U)U.remove();if(Q.delete(W),$.emit)$.emit("itemRemoved",{id:W,item:z});return this},getItem:(W)=>Q.get(W),getAllItems:()=>Array.from(Q.values()),getActive:()=>Z,getItemPath:(W)=>G(W),setActive(W){let z=Q.get(W);if(!z||z.config.disabled)return this;if(Z)K(Z.element,Z,!1);if(K(z.element,z,!0),Z=z,G(W).forEach((U)=>{let X=Q.get(U);if(X){let _=X.element,H=_.closest(`.${q}-${n.ITEM_CONTAINER}`);if(H){let B=H.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(B)_.setAttribute("aria-expanded","true"),B.hidden=!1}}}),$.emit)$.emit(M$.CHANGE,{id:W,item:z,previousItem:Z,path:G(W)});return this}}};var i6={ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon"};var XQ=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=(K,G)=>{if(!K)return;let W=K.getAttribute("role");if(G){if(K.classList.add(`${Q}-${i6.ITEM}--active`),W==="tab")K.setAttribute("aria-selected","true"),K.setAttribute("tabindex","0");else if(!K.getAttribute("aria-haspopup"))K.setAttribute("aria-current","page")}else if(K.classList.remove(`${Q}-${i6.ITEM}--active`),W==="tab")K.setAttribute("aria-selected","false"),K.setAttribute("tabindex","-1");else if(K.hasAttribute("aria-current"))K.removeAttribute("aria-current")},q=(K)=>{if(K.getAttribute("aria-expanded")===null)return!1;let W=K.getAttribute("aria-expanded")==="true";K.setAttribute("aria-expanded",(!W).toString());let z=K.closest(`.${Q}-${i6.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(z){let U=z.querySelector(`.${Q}-${i6.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(U){U.hidden=W;let X=K.querySelector(`.${Q}-${i6.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(X&&X.style)X.style.transform=W?"":"rotate(90deg)"}}let Y=K.dataset.id;if(Y&&$.emit)$.emit("expandToggle",{id:Y,expanded:!W});return!0},j={...$,handleItemClick(K){if(!$.items)return;let G=$.items.get(K);if(!G)return;let W=$.element.querySelector(`.${Q}-${i6.ITEM}--active, .mtrl-nav-item--active`);if(W)Z(W,!1);if(G.element)Z(G.element,!0);if($.emit){let z=$.getItemPath?$.getItemPath(K):[];$.emit("change",{id:K,item:G,previousItem:W?{element:W,config:{id:W.dataset.id}}:null,path:z,source:"userAction"})}}};return $.element.addEventListener("click",(K)=>{let G=K.target,W=G.closest(`.${Q}-${i6.ITEM}, .mtrl-nav-item`);if(!W){if(!G.closest("[data-id]"))return}let z=W||G.closest("[data-id]");if(z.hasAttribute("disabled")||z.getAttribute("aria-disabled")==="true")return;let Y=z.dataset.id;if(!Y)return;if(q(z))return;j.handleItemClick(Y)}),$.element.addEventListener("keydown",(K)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(K.key))return;let G=["rail","drawer"].includes($.variant||""),W=["bar"].includes($.variant||"");if(K.key==="Enter"||K.key===" "){let _=document.activeElement;if(_&&_.classList.contains(`${Q}-${i6.ITEM}`)){if(K.preventDefault(),_.dataset.id)_.click()}return}let z=Array.from($.element.querySelectorAll(`.${Q}-${i6.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
+ .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(z.length===0)return;let Y=document.activeElement,U=z.indexOf(Y),X=-1;if(G&&(K.key==="ArrowDown"||K.key==="ArrowRight")||W&&K.key==="ArrowRight")X=U<0?0:(U+1)%z.length;else if(G&&(K.key==="ArrowUp"||K.key==="ArrowLeft")||W&&K.key==="ArrowLeft")X=U<0?z.length-1:(U-1+z.length)%z.length;else if(K.key==="Home")X=0;else if(K.key==="End")X=z.length-1;if(X>=0)K.preventDefault(),z[X].focus()}),j};t();var Bj={variant:_9.VARIANT,position:_9.POSITION,behavior:_9.BEHAVIOR,items:[],showLabels:_9.SHOW_LABELS,scrimEnabled:_9.SCRIM_ENABLED},BQ=(J={})=>u(Bj,J,"nav"),FQ=(J)=>{let $=J.variant?`${J.prefix}-${n.VARIANT_PREFIX}${J.variant}`:"",Q=J.position?`${J.prefix}-${n.POSITION_PREFIX}${J.position}`:"",Z=J.class||"",q=[$,Q,Z].filter(Boolean);return p(J,{tag:"nav",attributes:{role:"navigation","aria-label":J.ariaLabel||"Main Navigation"},className:q})},HQ=(J)=>({disabled:{enable:J.disabled?.enable||(()=>{}),disable:J.disabled?.disable||(()=>{})},lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})}});var Fj=(J,$)=>{let{element:Q}=J,Z=$.variant||"rail",q=$.prefix||"mtrl";if(Q.setAttribute("aria-label",$.ariaLabel||"Main Navigation"),Z==="bar")if(!$.items?.some((K)=>K.items?.length))Q.setAttribute("role","tablist"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","menubar"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","navigation");if((Z==="modal"||Z==="drawer"&&$.behavior==="dismissible")&&!$.expanded)Q.classList.add(`${q}-nav--hidden`)},Hj=(J={})=>{let $=BQ(J);try{let Z=b(S,d(),h(FQ($)),K6($),g7($),UQ($),XQ($),G6($),C(),(q)=>WQ(HQ(q))(q))($);if(Fj(Z,$),$.disabled)Z.disable();if(Z.element.dataset.componentType="navigation",$.variant)Z.element.dataset.variant=$.variant;return Z}catch(Q){throw new Error(`Failed to create navigation: ${Q instanceof Error?Q.message:String(Q)}`)}},w7=Hj;m6();J6();c();o();var MQ=(J)=>($)=>{let Q=[],Z=$.getClass("radios"),q=J.value||"";if($.element.classList.add(`${Z}--${J.direction||"vertical"}`),J.disabled)$.element.classList.add(`${Z}--disabled`);let j=(W)=>{let z=document.createElement("div");z.classList.add(`${Z}-item`);let Y=document.createElement("input");if(Y.type="radio",Y.name=J.name,Y.value=W.value,Y.classList.add(`${Z}-input`),q===W.value)Y.checked=!0;if(J.disabled||W.disabled)Y.disabled=!0,z.classList.add(`${Z}-item--disabled`);let U=document.createElement("label");U.classList.add(`${Z}-label`);let X=document.createElement("span");X.classList.add(`${Z}-control`);let _=document.createElement("span");if(_.classList.add(`${Z}-circle`),J.ripple!==!1){let M=document.createElement("span");M.classList.add(`${Z}-ripple`),X.appendChild(M)}X.appendChild(_);let H=document.createElement("span");if(H.classList.add(`${Z}-text`),H.textContent=W.label,W.labelBefore)U.classList.add(`${Z}-label--before`),U.appendChild(H),U.appendChild(X);else U.appendChild(X),U.appendChild(H);let B=`${Z}-${W.value}-${Math.random().toString(36).substring(2,9)}`;Y.id=B,U.htmlFor=B,z.appendChild(Y),z.appendChild(U);let k=(M)=>{if(Y.checked){if(q=W.value,Q.forEach((V)=>{if(V.input!==Y)V.input.checked=!1}),$.events&&typeof $.events.emit==="function")$.events.emit("change",{value:W.value,originalEvent:M,option:W});else if(typeof $.on==="function"){let V=new CustomEvent("change",{detail:{value:W.value,originalEvent:M,option:W}});$.element.dispatchEvent(V)}}};return Y.addEventListener("change",k),{element:z,input:Y,label:U,config:W,destroy:()=>{if(Y.removeEventListener("change",k),z.parentNode)z.parentNode.removeChild(z)}}},K=(W)=>{let z=j(W);return $.element.appendChild(z.element),Q.push(z),$},G=(W)=>{let z=Q.findIndex((Y)=>Y.config.value===W);if(z!==-1){if(Q[z].destroy(),Q.splice(z,1),q===W)q=""}return $};if(J.options&&Array.isArray(J.options))J.options.forEach((W)=>K(W));if(!$.events)$.events={on:(W,z)=>{$.element.addEventListener(W,(Y)=>z(Y.detail))},off:(W,z)=>{$.element.removeEventListener(W,z)},emit:(W,z)=>{let Y=new CustomEvent(W,{detail:z});$.element.dispatchEvent(Y)}};return{...$,radios:Q,getValue:()=>q,setValue:(W)=>{return q=W,Q.forEach((z)=>{z.input.checked=z.config.value===W}),$},getSelected:()=>{let W=Q.find((z)=>z.config.value===q);return W?W.config:null},addOption:K,removeOption:G,enable:()=>{return $.element.classList.remove(`${Z}--disabled`),Q.forEach((W)=>{if(W.input.disabled=W.config.disabled||!1,!W.config.disabled)W.element.classList.remove(`${Z}-item--disabled`)}),$},disable:()=>{return $.element.classList.add(`${Z}--disabled`),Q.forEach((W)=>{W.input.disabled=!0,W.element.classList.add(`${Z}-item--disabled`)}),$},enableOption:(W)=>{let z=Q.find((Y)=>Y.config.value===W);if(z){if(z.config.disabled=!1,z.input.disabled=$.element.classList.contains(`${Z}--disabled`),!z.input.disabled)z.element.classList.remove(`${Z}-item--disabled`)}return $},disableOption:(W)=>{let z=Q.find((Y)=>Y.config.value===W);if(z)z.config.disabled=!0,z.input.disabled=!0,z.element.classList.add(`${Z}-item--disabled`);return $}}};var kQ=({disabled:J,lifecycle:$})=>(Q)=>{if(!Q.events)Q.events={on:(q,j)=>{Q.element.addEventListener(q,(K)=>j(K.detail))},off:(q,j)=>{Q.element.removeEventListener(q,j)},emit:(q,j)=>{let K=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(K)}};else if(!Q.events.emit)Q.events.emit=(q,j)=>{let K=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(K)};return{element:Q.element,radios:Q.radios,lifecycle:{destroy:$.destroy},getClass:Q.getClass,getValue:()=>Q.getValue(),setValue(q){return Q.setValue(q),this},getSelected:()=>Q.getSelected(),addOption(q){return Q.addOption(q),this},removeOption(q){return Q.removeOption(q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},enableOption(q){return Q.enableOption(q),this},disableOption(q){return Q.disableOption(q),this},on(q,j){return Q.events.on(q,j),this},off(q,j){return Q.events.off(q,j),this},destroy(){Q.radios.forEach((q)=>q.destroy()),$.destroy()}}};t();var Mj={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},NQ=(J)=>u(Mj,J,"radios"),VQ=(J)=>{return p(J,{tag:"div",attributes:{role:"radiogroup"},className:J.class})},_Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var kj=(J)=>{if(!J.name)J.name=`radios-${Math.random().toString(36).substring(2,9)}`;let $=NQ(J);try{return b(S,d(),h(VQ($)),MQ($),G6($),C(),(Z)=>kQ(_Q(Z))(Z))($)}catch(Q){throw console.error("Radios creation error:",Q),new Error(`Failed to create radios component: ${Q.message}`)}},LQ=kj;var DQ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",FOCUSED:"focused"},Z1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},q1={STANDARD:"standard",FILLED:"filled",OUTLINED:"outlined"},j1={RIGHT:"right",LEFT:"left"},K1={SMALL:"small",MEDIUM:"medium",LARGE:"large"},OQ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},PQ={VARIANT:q1.STANDARD,DIRECTION:Z1.VERTICAL,LABEL_POSITION:j1.RIGHT,SIZE:K1.MEDIUM},RQ={GROUP:"radio-group",RADIO:"radio",INPUT:"radio__input",LABEL:"radio__label",CONTROL:"radio__control",DOT:"radio__dot",FOCUS_RING:"radio__focus-ring",RIPPLE:"radio__ripple",CHECKED:"radio--checked",DISABLED:"radio--disabled",FOCUSED:"radio--focused",LABEL_RIGHT:"radio--label-right",LABEL_LEFT:"radio--label-left",SMALL:"radio--small",MEDIUM:"radio--medium",LARGE:"radio--large"};c();o();A6();var G1=(J)=>($)=>{let Q=J.disabled===!0,q=(J.variant||"bar")==="view",j=J.placeholder||"Search",K=J.value||"",G=(F)=>$.getClass(F),W={type:"text",placeholder:j,value:K,"aria-label":j};if(Q)W.disabled="disabled";let z=v({tag:"div",className:G("search-container"),container:$.element,attributes:{style:`
24
24
  ${J.minWidth?`min-width: ${J.minWidth}px;`:""}
25
25
  ${J.maxWidth?`max-width: ${J.maxWidth}px;`:""}
26
26
  ${J.fullWidth?"width: 100%;":""}
27
- `}}),Y=v({tag:"div",className:K("search-leading-icon"),container:W,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),U=v({tag:"div",className:K("search-input-wrapper"),container:W}),X=v({tag:"input",className:K("search-input"),container:U,attributes:z}),_=v({tag:"div",className:[K("search-clear-button"),G?"":K("search-clear-button--hidden")],container:W,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!G?"-1":"0","aria-label":"Clear search"}}),H,B,M;if(J.trailingIcon)H=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)B=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)M=v({tag:"div",className:K("search-avatar"),container:W,html:J.avatar});let k,N;if(q||J.suggestions)k=v({tag:"div",className:K("search-divider")}),N=v({tag:"div",className:K("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),Vj($,J,q,Q),{...$,structure:{container:W,input:X,inputWrapper:U,leadingIcon:Y,clearButton:_,trailingIcon:H,trailingIcon2:B,avatar:M,divider:k,suggestionsContainer:N}}};function Vj(J,$,Q,Z){let q=J.getClass("search");if(J.element.classList.add(`${q}--${$.variant||"bar"}`),Z)J.element.classList.add(`${q}--disabled`);if(Q)J.element.classList.add(`${q}--expanded`);if($.fullWidth)J.element.classList.add(`${q}--fullwidth`)}var V$={BAR:"bar",VIEW:"view"},z1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=-1,K.setAttribute("aria-disabled","true")})}function q(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=0,K.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(V$).find((G)=>$.element.classList.contains(`${$.getClass("search")}--${G}`))||V$.BAR}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(G){if(j()===G)return this;if(Object.values(V$).forEach((z)=>{$.element.classList.remove(`${$.getClass("search")}--${z}`)}),$.element.classList.add(`${$.getClass("search")}--${G}`),G===V$.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var W1=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:Z,clearButton:q,trailingIcon:j,trailingIcon2:G,avatar:K,divider:z,suggestionsContainer:W}=$.structure,Y={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},U={triggerEvent(L,D=null){let R={search:Y.component,value:Y.value,originalEvent:D,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(L,R);let w=`on${L.charAt(0).toUpperCase()+L.slice(1)}`;if(J[w]&&typeof J[w]==="function")J[w](Y.value);return R}},X=(L,D=!0)=>{if(Y.value=L,Q)Q.value=L;if(q)if(L){if(q.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())q.tabIndex=0}else q.classList.add(`${$.getClass("search-clear-button")}--hidden`),q.tabIndex=-1;if(D)U.triggerEvent("input")},_=()=>{if(Y.value){if(U.triggerEvent("submit"),!Y.isExpanded)M()}},H=(L=!0)=>{if(X("",L),Q)Q.focus();if(L)U.triggerEvent("clear")},B=()=>{if(W)F()},M=()=>{if(W)W.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},k=()=>{if(Y.isExpanded)return;if(Y.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(B(),Q)setTimeout(()=>{Q.focus()},50)},N=()=>{if(!Y.isExpanded)return;if(Y.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(M(),Q)Q.blur()},F=()=>{if(!W||!Y.suggestions||!Y.suggestions.length)return;W.innerHTML="";let L=document.createElement("ul");if(L.className=$.getClass("search-suggestions-list"),L.setAttribute("role","listbox"),Y.suggestions.forEach((D)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof D==="string"){if(R.textContent=D,Y.value&&D.toLowerCase().includes(Y.value.toLowerCase())){let w=D.toLowerCase().indexOf(Y.value.toLowerCase()),A=D.slice(0,w),x=D.slice(w,w+Y.value.length),I=D.slice(w+Y.value.length);R.innerHTML=`${A}<strong>${x}</strong>${I}`}}else{if(D.icon){let A=document.createElement("span");A.className=$.getClass("search-suggestion-icon"),A.innerHTML=D.icon,R.appendChild(A)}let w=document.createElement("span");if(w.className=$.getClass("search-suggestion-text"),w.textContent=D.text,Y.value&&D.text.toLowerCase().includes(Y.value.toLowerCase())){let A=D.text.toLowerCase().indexOf(Y.value.toLowerCase()),x=D.text.slice(0,A),I=D.text.slice(A,A+Y.value.length),r=D.text.slice(A+Y.value.length);w.innerHTML=`${x}<strong>${I}</strong>${r}`}if(R.appendChild(w),D.value)R.dataset.value=D.value}R.addEventListener("click",(w)=>{w.preventDefault(),w.stopPropagation();let A=R.dataset.value||(typeof D==="string"?D:D.text);X(A),_()}),L.appendChild(R)}),J.showDividers&&z&&z.parentElement!==W){let D=z.cloneNode(!0);W.appendChild(D)}W.appendChild(L),W.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},V=()=>{if(Q)Q.addEventListener("input",(L)=>{if(X(L.target.value),Y.isExpanded)B()}),Q.addEventListener("focus",(L)=>{if(Y.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!Y.isExpanded&&J.variant==="bar")k();U.triggerEvent("focus",L)}),Q.addEventListener("blur",(L)=>{if($.element.contains(L.relatedTarget))return;Y.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!Y.isFocused){if(M(),Y.isExpanded&&J.variant==="bar")N()}},200),U.triggerEvent("blur",L)}),Q.addEventListener("keydown",(L)=>{if(L.key==="Enter")L.preventDefault(),_();else if(L.key==="Escape"){if(L.preventDefault(),Y.value)H();else if(Y.isExpanded&&J.variant==="bar")N()}});if(Z)Z.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;if(Y.isExpanded)N();else k();U.triggerEvent("iconClick",L)}),Z.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),Z.click()});if(q)q.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;H()}),q.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),q.click()});if(j)j.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),j.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),j.click()});if(G)G.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),G.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),G.click()});document.addEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},O=()=>{if(!$.element)return;document.removeEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},P=()=>{if(J.value&&Q){if(Q.value=J.value,q&&J.showClearButton!==!1)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",Y.placeholder||"Search");if(V(),Y.isExpanded&&J.suggestions&&J.suggestions.length>0)B()};if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{O(),L()}}return P(),{...$,search:{setValue(L,D=!0){return X(L,D),this},getValue(){return Y.value},setPlaceholder(L){if(Y.placeholder=L,Q)Q.placeholder=L,Q.setAttribute("aria-label",L);return this},getPlaceholder(){return Y.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return k(),this},collapse(){return N(),this},clear(){return H(),this},submit(){return _(),this},setSuggestions(L){if(Y.suggestions=L,Y.isExpanded)F();return this},showSuggestions(L){if(L)B();else M();return this}},icons:{setLeadingIcon(L){if(Z)Z.innerHTML=L||"";return this},setTrailingIcon(L){if(j)j.innerHTML=L||"";return this},setTrailingIcon2(L){if(G)G.innerHTML=L||"";return this},setAvatar(L){if(K)K.innerHTML=L||"";return this},showClearButton(L){if(q)if(L)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else q.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var AQ=(J)=>($)=>{return{element:$.element,setValue(Z,q=!0){return J.search.setValue(Z,q),this},getValue(){return J.search.getValue()},setPlaceholder(Z){return J.search.setPlaceholder(Z),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(Z){return J.icons.setLeadingIcon(Z),this},setTrailingIcon(Z){return J.icons.setTrailingIcon(Z),this},setTrailingIcon2(Z){return J.icons.setTrailingIcon2(Z),this},setAvatar(Z){return J.icons.setAvatar(Z),this},showClearButton(Z){return J.icons.showClearButton(Z),this},setSuggestions(Z){return J.search.setSuggestions(Z),this},showSuggestions(Z){return J.search.showSuggestions(Z),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(Z,q){return J.events.on(Z,q),this},off(Z,q){return J.events.off(Z,q),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();var x7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},wQ={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},xQ={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},y7={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',SETTINGS:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},o6={VARIANT:x7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:y7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},yQ={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var Nj={variant:x7.BAR,disabled:!1,placeholder:o6.PLACEHOLDER,value:o6.VALUE,leadingIcon:y7.SEARCH,showClearButton:o6.SHOW_CLEAR_BUTTON,minWidth:o6.MIN_WIDTH,maxWidth:o6.MAX_WIDTH,fullWidth:o6.FULL_WIDTH,showDividers:o6.SHOW_DIVIDERS},TQ=(J={})=>u(Nj,J,"search"),IQ=(J)=>p(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),SQ=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var _j=(J={})=>{let $=TQ(J);try{let Q=b(S,d(),h(IQ($)),G1($),z1($),W1($),C())($),Z=SQ(Q),q=AQ(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},bQ=_j;c();o();var N$;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(N$||={});var _$;((Z)=>{Z.DEFAULT="default";Z.COMFORTABLE="comfortable";Z.COMPACT="compact"})(_$||={});t();var Y1={SINGLE:"single",MULTI:"multi"},U1={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},vQ={CHANGE:"change"},o9={MODE:Y1.SINGLE,DENSITY:U1.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},CQ=`
27
+ `}}),Y=v({tag:"div",className:G("search-leading-icon"),container:z,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),U=v({tag:"div",className:G("search-input-wrapper"),container:z}),X=v({tag:"input",className:G("search-input"),container:U,attributes:W}),_=v({tag:"div",className:[G("search-clear-button"),K?"":G("search-clear-button--hidden")],container:z,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!K?"-1":"0","aria-label":"Clear search"}}),H,B,k;if(J.trailingIcon)H=v({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)B=v({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)k=v({tag:"div",className:G("search-avatar"),container:z,html:J.avatar});let M,V;if(q||J.suggestions)M=v({tag:"div",className:G("search-divider")}),V=v({tag:"div",className:G("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),Nj($,J,q,Q),{...$,structure:{container:z,input:X,inputWrapper:U,leadingIcon:Y,clearButton:_,trailingIcon:H,trailingIcon2:B,avatar:k,divider:M,suggestionsContainer:V}}};function Nj(J,$,Q,Z){let q=J.getClass("search");if(J.element.classList.add(`${q}--${$.variant||"bar"}`),Z)J.element.classList.add(`${q}--disabled`);if(Q)J.element.classList.add(`${q}--expanded`);if($.fullWidth)J.element.classList.add(`${q}--fullwidth`)}var N$={BAR:"bar",VIEW:"view"},z1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=-1,G.setAttribute("aria-disabled","true")})}function q(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=0,G.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(N$).find((K)=>$.element.classList.contains(`${$.getClass("search")}--${K}`))||N$.BAR}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(K){if(j()===K)return this;if(Object.values(N$).forEach((W)=>{$.element.classList.remove(`${$.getClass("search")}--${W}`)}),$.element.classList.add(`${$.getClass("search")}--${K}`),K===N$.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var W1=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:Z,clearButton:q,trailingIcon:j,trailingIcon2:K,avatar:G,divider:W,suggestionsContainer:z}=$.structure,Y={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},U={triggerEvent(L,D=null){let R={search:Y.component,value:Y.value,originalEvent:D,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(L,R);let w=`on${L.charAt(0).toUpperCase()+L.slice(1)}`;if(J[w]&&typeof J[w]==="function")J[w](Y.value);return R}},X=(L,D=!0)=>{if(Y.value=L,Q)Q.value=L;if(q)if(L){if(q.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())q.tabIndex=0}else q.classList.add(`${$.getClass("search-clear-button")}--hidden`),q.tabIndex=-1;if(D)U.triggerEvent("input")},_=()=>{if(Y.value){if(U.triggerEvent("submit"),!Y.isExpanded)k()}},H=(L=!0)=>{if(X("",L),Q)Q.focus();if(L)U.triggerEvent("clear")},B=()=>{if(z)F()},k=()=>{if(z)z.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},M=()=>{if(Y.isExpanded)return;if(Y.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(B(),Q)setTimeout(()=>{Q.focus()},50)},V=()=>{if(!Y.isExpanded)return;if(Y.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(k(),Q)Q.blur()},F=()=>{if(!z||!Y.suggestions||!Y.suggestions.length)return;z.innerHTML="";let L=document.createElement("ul");if(L.className=$.getClass("search-suggestions-list"),L.setAttribute("role","listbox"),Y.suggestions.forEach((D)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof D==="string"){if(R.textContent=D,Y.value&&D.toLowerCase().includes(Y.value.toLowerCase())){let w=D.toLowerCase().indexOf(Y.value.toLowerCase()),A=D.slice(0,w),x=D.slice(w,w+Y.value.length),I=D.slice(w+Y.value.length);R.innerHTML=`${A}<strong>${x}</strong>${I}`}}else{if(D.icon){let A=document.createElement("span");A.className=$.getClass("search-suggestion-icon"),A.innerHTML=D.icon,R.appendChild(A)}let w=document.createElement("span");if(w.className=$.getClass("search-suggestion-text"),w.textContent=D.text,Y.value&&D.text.toLowerCase().includes(Y.value.toLowerCase())){let A=D.text.toLowerCase().indexOf(Y.value.toLowerCase()),x=D.text.slice(0,A),I=D.text.slice(A,A+Y.value.length),r=D.text.slice(A+Y.value.length);w.innerHTML=`${x}<strong>${I}</strong>${r}`}if(R.appendChild(w),D.value)R.dataset.value=D.value}R.addEventListener("click",(w)=>{w.preventDefault(),w.stopPropagation();let A=R.dataset.value||(typeof D==="string"?D:D.text);X(A),_()}),L.appendChild(R)}),J.showDividers&&W&&W.parentElement!==z){let D=W.cloneNode(!0);z.appendChild(D)}z.appendChild(L),z.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},N=()=>{if(Q)Q.addEventListener("input",(L)=>{if(X(L.target.value),Y.isExpanded)B()}),Q.addEventListener("focus",(L)=>{if(Y.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!Y.isExpanded&&J.variant==="bar")M();U.triggerEvent("focus",L)}),Q.addEventListener("blur",(L)=>{if($.element.contains(L.relatedTarget))return;Y.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!Y.isFocused){if(k(),Y.isExpanded&&J.variant==="bar")V()}},200),U.triggerEvent("blur",L)}),Q.addEventListener("keydown",(L)=>{if(L.key==="Enter")L.preventDefault(),_();else if(L.key==="Escape"){if(L.preventDefault(),Y.value)H();else if(Y.isExpanded&&J.variant==="bar")V()}});if(Z)Z.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;if(Y.isExpanded)V();else M();U.triggerEvent("iconClick",L)}),Z.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),Z.click()});if(q)q.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;H()}),q.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),q.click()});if(j)j.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),j.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),j.click()});if(K)K.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),K.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),K.click()});document.addEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(k(),Y.isExpanded&&J.variant==="bar")V()}})},O=()=>{if(!$.element)return;document.removeEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(k(),Y.isExpanded&&J.variant==="bar")V()}})},P=()=>{if(J.value&&Q){if(Q.value=J.value,q&&J.showClearButton!==!1)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",Y.placeholder||"Search");if(N(),Y.isExpanded&&J.suggestions&&J.suggestions.length>0)B()};if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{O(),L()}}return P(),{...$,search:{setValue(L,D=!0){return X(L,D),this},getValue(){return Y.value},setPlaceholder(L){if(Y.placeholder=L,Q)Q.placeholder=L,Q.setAttribute("aria-label",L);return this},getPlaceholder(){return Y.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return M(),this},collapse(){return V(),this},clear(){return H(),this},submit(){return _(),this},setSuggestions(L){if(Y.suggestions=L,Y.isExpanded)F();return this},showSuggestions(L){if(L)B();else k();return this}},icons:{setLeadingIcon(L){if(Z)Z.innerHTML=L||"";return this},setTrailingIcon(L){if(j)j.innerHTML=L||"";return this},setTrailingIcon2(L){if(K)K.innerHTML=L||"";return this},setAvatar(L){if(G)G.innerHTML=L||"";return this},showClearButton(L){if(q)if(L)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else q.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var AQ=(J)=>($)=>{return{element:$.element,setValue(Z,q=!0){return J.search.setValue(Z,q),this},getValue(){return J.search.getValue()},setPlaceholder(Z){return J.search.setPlaceholder(Z),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(Z){return J.icons.setLeadingIcon(Z),this},setTrailingIcon(Z){return J.icons.setTrailingIcon(Z),this},setTrailingIcon2(Z){return J.icons.setTrailingIcon2(Z),this},setAvatar(Z){return J.icons.setAvatar(Z),this},showClearButton(Z){return J.icons.showClearButton(Z),this},setSuggestions(Z){return J.search.setSuggestions(Z),this},showSuggestions(Z){return J.search.showSuggestions(Z),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(Z,q){return J.events.on(Z,q),this},off(Z,q){return J.events.off(Z,q),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();var x7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},wQ={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},xQ={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},y7={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',SETTINGS:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},o6={VARIANT:x7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:y7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},yQ={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var Vj={variant:x7.BAR,disabled:!1,placeholder:o6.PLACEHOLDER,value:o6.VALUE,leadingIcon:y7.SEARCH,showClearButton:o6.SHOW_CLEAR_BUTTON,minWidth:o6.MIN_WIDTH,maxWidth:o6.MAX_WIDTH,fullWidth:o6.FULL_WIDTH,showDividers:o6.SHOW_DIVIDERS},TQ=(J={})=>u(Vj,J,"search"),IQ=(J)=>p(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),SQ=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var _j=(J={})=>{let $=TQ(J);try{let Q=b(S,d(),h(IQ($)),G1($),z1($),W1($),C())($),Z=SQ(Q),q=AQ(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},bQ=_j;c();o();var V$;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(V$||={});var _$;((Z)=>{Z.DEFAULT="default";Z.COMFORTABLE="comfortable";Z.COMPACT="compact"})(_$||={});t();var Y1={SINGLE:"single",MULTI:"multi"},U1={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},vQ={CHANGE:"change"},o9={MODE:Y1.SINGLE,DENSITY:U1.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},CQ=`
28
28
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
29
29
  <polyline points="20 6 9 17 4 12"></polyline>
30
- </svg>`,EQ={CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},hQ={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var Lj={mode:o9.MODE,ripple:o9.RIPPLE,density:o9.DENSITY},uQ=(J={})=>u(Lj,J,"segmented-button"),fQ=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},X1=(J)=>{switch(J){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};T9();var B1=(J,$,Q,Z=!1,q={ripple:!0,rippleConfig:{}})=>{let j=Z||J.disabled,G=J.icon,K=J.checkmarkIcon||CQ,z=Q9({text:J.text,icon:J.selected&&J.text&&G?K:G,value:J.value||J.text||"",disabled:j,ripple:q.ripple,rippleConfig:q.rippleConfig,class:J.class});if(z.element.classList.add(`${Q}-segmented-button-segment`),J.selected)z.element.classList.add(`${Q}-segment--selected`),z.element.setAttribute("aria-pressed","true");else z.element.setAttribute("aria-pressed","false");$.appendChild(z.element);let W=(U)=>{if(z.element.classList.toggle(`${Q}-segment--selected`,U),z.element.setAttribute("aria-pressed",U?"true":"false"),J.text&&G)if(U)z.setIcon(K);else z.setIcon(G)},Y=J.selected||!1;return{element:z.element,value:J.value||J.text||"",isSelected(){return Y},setSelected(U){Y=U,W(U)},isDisabled(){return z.disabled?.isDisabled?.()||!1},setDisabled(U){if(U)z.disable();else z.enable()},destroy(){z.destroy()}}};var Dj=(J={})=>{let $=uQ(J),Q=$.mode||"single",Z=$.density||"default",q=f6();try{let j=b(S,d(),h(fQ($)),C())($),G=X1(Z);Object.entries(G).forEach(([H,B])=>{j.element.style.setProperty(H,B)});let K=[];if($.segments&&$.segments.length)$.segments.forEach((H)=>{let B=B1(H,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});K.push(B)});if(Q==="single"&&!K.some((H)=>H.isSelected())){let H=K.find((B)=>!B.isDisabled());if(H)H.setSelected(!0)}let z=(H)=>{let B=H.currentTarget,M=K.find((F)=>F.element===B);if(!M||M.isDisabled())return;let k=Y();if(Q==="single")K.forEach((F)=>{F.setSelected(F===M)});else M.setSelected(!M.isSelected());let N=Y();if(k.length!==N.length||k.some((F)=>!N.includes(F))||N.some((F)=>!k.includes(F)))q.emit("change",{selected:W(),value:N,oldValue:k})};K.forEach((H)=>{H.element.addEventListener("click",z)});let W=()=>K.filter((H)=>H.isSelected()),Y=()=>W().map((H)=>H.value),U=(H)=>K.find((B)=>B.value===H),X=(H)=>{if(["default","comfortable","compact"].forEach((M)=>{if(M!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${M}`)}),H!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${H}`);j.element.setAttribute("data-density",H);let B=X1(H);Object.entries(B).forEach(([M,k])=>{j.element.style.setProperty(M,k)})};return{element:j.element,segments:K,getSelected:W,getValue(){return Y()},select(H){let B=U(H);if(B&&!B.isDisabled()){let M=Y();if(Q==="single")K.forEach((N)=>N.setSelected(N===B));else B.setSelected(!0);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},deselect(H){let B=U(H);if(B&&!B.isDisabled())if(Q==="single"){if(W().length>1||!B.isSelected()){let k=Y();B.setSelected(!1);let N=Y();if(k.join(",")!==N.join(","))q.emit("change",{selected:W(),value:N,oldValue:k})}}else{let M=Y();B.setSelected(!1);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{if(!$.segments?.find((B)=>B.value===H.value)?.disabled)H.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{H.setDisabled(!0)}),this},enableSegment(H){let B=U(H);if(B)B.setDisabled(!1);return this},disableSegment(H){let B=U(H);if(B)B.setDisabled(!0);return this},setDensity(H){return X(H),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(H,B){return q.on(H,B),this},off(H,B){return q.off(H,B),this},destroy(){K.forEach((H)=>{H.element.removeEventListener("click",z),H.destroy()}),q.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},F1=Dj;J6();c();o();var C6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},t9={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var H1=(J)=>($)=>{let{position:Q=C6.BOTTOM}=J,Z=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(Z),{...$,position:{setPosition(q){$.element.classList.remove(Z);let j=`${$.getClass("sheet")}--${q.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var k1=(J)=>($)=>{let{content:Q=""}=J,Z=document.createElement("div");return Z.className=`${$.getClass("sheet")}-content`,Z.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(Z),$.element.appendChild($.container),{...$,content:{setContent(q){return Z.innerHTML=q,this},getContent(){return Z.innerHTML},getElement(){return Z}}}};var M1=(J)=>($)=>{let{title:Q=""}=J,Z=null;if(Q||J.dragHandle){if(Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,Q)Z.textContent=Q;if($.container.insertBefore(Z,$.container.firstChild),J.dragHandle){let q=document.createElement("div");q.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(q,$.container.firstChild),$.dragHandle={element:q,setVisible(j){q.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(q){if(!Z&&q)Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(Z,$.content.getElement());if(Z)Z.textContent=q;return this},getTitle(){return Z?Z.textContent||"":""},getElement(){return Z}}}};var V1=(J)=>($)=>{let{open:Q=!1,dismissible:Z=!0}=J,q=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),Z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(Z)K()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(z)=>{if(z.key==="Escape"&&q&&Z)K()});function G(){if(!q){if(q=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(t9.OPEN),J.onOpen)J.onOpen()}}function K(){if(q){if(q=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(t9.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:G,close:K,isOpen(){return q},setDismissible(z){if(z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var N1=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||C6.BOTTOM,Z=0,q=0,j=!1,G=$.dragHandle?.element||$.element,K=(X)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",X.type==="touchstart")Z=X.touches[0].clientY,q=X.touches[0].clientX;else Z=X.clientY,q=X.clientX,document.addEventListener("mousemove",z),document.addEventListener("mouseup",W);$.events.emit(t9.DRAG_START)},z=(X)=>{if(!j)return;let _,H;if(X.type==="touchmove")_=X.touches[0].clientY,H=X.touches[0].clientX;else _=X.clientY,H=X.clientX;let B=0;switch(Q){case C6.BOTTOM:if(B=_-Z,B<0)B=0;$.element.style.transform=`translateY(${B}px)`;break;case C6.TOP:if(B=Z-_,B<0)B=0;$.element.style.transform=`translateY(-${B}px)`;break;case C6.LEFT:if(B=q-H,B<0)B=0;$.element.style.transform=`translateX(-${B}px)`;break;case C6.RIGHT:if(B=H-q,B<0)B=0;$.element.style.transform=`translateX(${B}px)`;break}let M=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,k=Math.min(B/M,1),N=$.element.nextElementSibling;if(N&&N.classList.contains(`${$.getClass("sheet")}-scrim`))N.style.opacity=`${0.32*(1-k)}`},W=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W);let X=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let H=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=H?parseFloat(H[1]):0}if(_>X*0.3)$.state.close();else{$.element.style.transform="";let H=$.element.nextElementSibling;if(H&&H.classList.contains(`${$.getClass("sheet")}-scrim`))H.style.opacity=""}$.events.emit(t9.DRAG_END)};G.addEventListener("touchstart",K),G.addEventListener("touchmove",z),G.addEventListener("touchend",W),G.addEventListener("mousedown",K);let Y=()=>{G.removeEventListener("touchstart",K),G.removeEventListener("touchmove",z),G.removeEventListener("touchend",W),G.removeEventListener("mousedown",K),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W)},U=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{Y(),U()}},$};var gQ=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(Z){return Q.content.setContent(Z),this},getContent(){return Q.content.getContent()},setTitle(Z){return Q.title.setTitle(Z),this},getTitle(){return Q.title.getTitle()},setDragHandle(Z){if(Q.dragHandle)Q.dragHandle.setVisible(Z);return this},setMaxHeight(Z){return Q.container.style.maxHeight=Z,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});t();var b9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},n9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},dQ={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},_1={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},L9={VARIANT:b9.STANDARD,POSITION:n9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:_1.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},lQ={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},rQ={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},pQ={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var Oj={variant:b9.STANDARD,position:n9.BOTTOM,open:L9.OPEN,dismissible:L9.DISMISSIBLE,dragHandle:L9.DRAG_HANDLE,elevation:L9.ELEVATION,enableGestures:L9.ENABLE_GESTURES},sQ=(J={})=>u(Oj,J,"sheet"),mQ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===b9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},aQ=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Pj=(J={})=>{let $=sQ(J);try{let Q=b(S,d(),h(mQ($)),K6($),H1($),k1($),M1($),V1($),N1($),C(),(Z)=>gQ(aQ(Z))(Z))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},cQ=Pj;c();o();A6();var L1=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,Z=J.max||100,q=J.secondValue,j=(q-Q)/(Z-Q)*100,G=J.valueFormatter||((X)=>X.toString()),K=J.disabled===!0,z=$.getClass,W=JSON.parse(JSON.stringify($.schema)),Y=W.element.options.className||[];if(Array.isArray(Y))Y.push(z("slider--range"));else W.element.options.className=`${Y} ${z("slider--range")}`.trim();let U=W.element.children.container.children;return U.secondHandle={name:"secondHandle",creator:v,options:{tag:"div",className:z("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(Z),"aria-valuenow":String(q),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(q),"data-handle-index":"1"},style:{left:`${j}%`}}},U.secondValueBubble={name:"secondValueBubble",creator:v,options:{tag:"div",className:z("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:G(q),style:{left:`${j}%`}}},{...$,schema:W}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var Z9={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},D6={XS:16,S:24,M:40,L:56,XL:80},Z6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},H6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},L$={START:"start",END:"end"},V6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Z9.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:L$.START,LABEL_POSITION:L$.START},iQ={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var D1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function q(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(Z9).find((K)=>$.element.classList.contains(`${$.getClass("slider")}--${K}`))||Z9.PRIMARY}function G(){return Object.keys(D6).find((W)=>$.element.classList.contains(`${$.getClass("slider")}--${W.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(K){if(Object.values(Z9).forEach((z)=>{$.element.classList.remove(`${$.getClass("slider")}--${z}`)}),K!==Z9.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${K}`);return this},getColor(){return j()},setSize(K){Object.keys(D6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y.toLowerCase()}`)});let W;if(typeof K==="string"&&K in D6)W=K;else if(typeof K==="number"){let Y=Object.entries(D6).find(([,U])=>U===K);W=Y?Y[0]:"XS"}else W="XS";return $.element.classList.add(`${$.getClass("slider")}--${W.toLowerCase()}`),this},getSize(){return G()},showTicks(K){if(J.ticks=K,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(K){return J.showValue=K,this}}}};var oQ=(J,$,Q,Z)=>{let q=$.component?.components||{},{container:j=null,handle:G=null,valueBubble:K=null,secondHandle:z=null,secondValueBubble:W=null}=q,{getValueFromPosition:Y=()=>0,roundToStep:U=(y)=>y,clamp:X=(y)=>y,showValueBubble:_=()=>{},render:H=()=>{}}=Q,{triggerEvent:B=()=>({defaultPrevented:!1})}=Z,M=!1,k=0,N=3,F=null,V=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(V(),K)_(K,!1);if(W)_(W,!1)},P=(y)=>{if(O(),y&&J.showValue)_(y,!0)},L=(y,l=0)=>{if(V(),!y||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{_(y,!1)},l);else _(y,!1)},D=()=>{if(G)G.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(z)z.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let y=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${y}`).forEach((l)=>{l.classList.remove(y)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(y){console.warn("Error clearing keyboard focus:",y)}},R=(y,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;y.preventDefault(),y.stopPropagation(),O(),D(),k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,$.dragging=!1,$.pressed=!0,M=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?W:K,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},w=(y)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!j)return;y.preventDefault(),O(),D();let l=!1;try{let m=y.type.includes("touch")?y.touches[0].clientX:y.clientX,s=Y(m);if(J.snapToSteps&&$.step>0)s=U(s);if(s=X(s,$.min,$.max),J.range&&$.secondValue!==null){let K9=Math.abs(s-$.value);l=Math.abs(s-$.secondValue)<K9,l?$.secondValue=s:$.value=s}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(s,!1);else $.value=s;H(),B(H6.INPUT,y)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?W:K,k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,J.centered&&!J.range)P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),$.pressed=!1,B(H6.START,y);else $.dragging=!1,$.pressed=!1,M=!1,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},A=(y)=>{if(!$.activeHandle||!j)return;y.preventDefault();try{let l=y.type.includes("touch")?y.touches[0].clientX:y.clientX;if(!M&&Math.abs(l-k)>=N)M=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=Y(l);if(J.snapToSteps&&$.step>0)m=U(m);m=X(m,$.min,$.max);let s=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(s)if(m>=$.value)$.secondValue=m;else L($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=K,P($.activeBubble);else if(m<=$.secondValue)$.value=m;else L($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=W,P($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}H(),B(H6.INPUT,y)}catch(l){console.warn("Error during slider drag:",l)}},x=(y)=>{if(!$.activeHandle)return;y.preventDefault(),$.dragging=!1,$.pressed=!1,M=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),L($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x),$.activeHandle=null,H(),B(H6.CHANGE,y),B(H6.END,y)},I=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,s=l?$.secondValue:$.value,K9=y.shiftKey?m*10:m;if(y.key==="Tab")return;let N6=!1;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),s=Math.min(s+K9,$.max),N6=!0;break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),s=Math.max(s-K9,$.min),N6=!0;break;case"Home":y.preventDefault(),s=$.min,N6=!0;break;case"End":y.preventDefault(),s=$.max,N6=!0;break;case"PageUp":y.preventDefault(),s=Math.min(s+m*10,$.max),N6=!0;break;case"PageDown":y.preventDefault(),s=Math.max(s-m*10,$.min),N6=!0;break;default:return}if(!N6)return;if($.activeBubble=l?W:K,P($.activeBubble),l)$.secondValue=s;else{if(J.centered)$.previousValue=$.value;$.value=s}H(),B(H6.INPUT,y),B(H6.CHANGE,y)},r=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?z:G;if(F&&F!==m)O();F=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),P(l?W:K),$.activeBubble=l?W:K,B(H6.FOCUS,y)},a=(y,l=!1)=>{(l?z:G).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let s=y.relatedTarget;if(!s||s!==(l?G:z))L(l?W:K,200);B(H6.BLUR,y)};return{handleHandleMouseDown:R,handleTrackMouseDown:w,handleMouseMove:A,handleMouseUp:x,handleKeyDown:I,handleFocus:r,handleBlur:a,setupEventListeners:()=>{if(!$.component||!$.component.components){console.warn("Cannot set up event listeners: missing component structure");return}if(j.addEventListener("mousedown",w),j.addEventListener("touchstart",w,{passive:!1}),G.addEventListener("mousedown",(y)=>R(y,!1)),G.addEventListener("touchstart",(y)=>R(y,!1),{passive:!1}),G.addEventListener("keydown",(y)=>I(y,!1)),G.addEventListener("focus",(y)=>r(y,!1)),G.addEventListener("blur",(y)=>a(y,!1)),J.range&&z)z.addEventListener("mousedown",(y)=>R(y,!0)),z.addEventListener("touchstart",(y)=>R(y,!0),{passive:!1}),z.addEventListener("keydown",(y)=>I(y,!0)),z.addEventListener("focus",(y)=>r(y,!0)),z.addEventListener("blur",(y)=>a(y,!0))},cleanupEventListeners:()=>{if(!$.component||!$.component.components)return;if(j)j.removeEventListener("mousedown",w),j.removeEventListener("touchstart",w);if(G)G.removeEventListener("mousedown",(y)=>R(y,!1)),G.removeEventListener("touchstart",(y)=>R(y,!1)),G.removeEventListener("keydown",(y)=>I(y,!1)),G.removeEventListener("focus",(y)=>r(y,!1)),G.removeEventListener("blur",(y)=>a(y,!1));if(J.range&&z)z.removeEventListener("mousedown",(y)=>R(y,!0)),z.removeEventListener("touchstart",(y)=>R(y,!0)),z.removeEventListener("keydown",(y)=>I(y,!0)),z.removeEventListener("focus",(y)=>r(y,!0)),z.removeEventListener("blur",(y)=>a(y,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x)},showActiveBubble:P,hideActiveBubble:L,hideAllBubbles:O,clearKeyboardFocus:D}};var O1=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize slider controller: missing element or components"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},Z={triggerEvent(V,O=null){let P={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(V,P),P}},q=()=>{if(!Q.component?.components)return{};return Q.component.components},j=(V)=>{let O=Q.max-Q.min;return O===0?0:(V-Q.min)/O*100},G=()=>{let V=q(),{handle:O,container:P}=V;if(!O||!P)return null;try{let L=O.getBoundingClientRect(),D=P.getBoundingClientRect(),R=L.width||Z6.HANDLE_SIZE,w=D.width,A=Z6.EDGE_PADDING/w*100,I=(Q.activeHandle?6:8)/w*100;return{handleSize:R,trackSize:w,edgeConstraint:A,paddingPercent:I}}catch(L){return console.warn("Error calculating track dimensions:",L),{handleSize:Z6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},K=(V,O=200)=>{let P=Z6.EDGE_PADDING/O*100,L=P,D=100-P,R=D-L;if(V<=0)return L;if(V>=100)return D;return L+V/100*R},z=(V)=>{let O=q(),{handle:P,container:L}=O;if(!P||!L)return Q.min;try{let D=L.getBoundingClientRect(),R=Q.max-Q.min,w=D.left+Z6.EDGE_PADDING,A=D.right-Z6.EDGE_PADDING,x=A-w,r=(Math.max(w,Math.min(A,V))-w)/x;return Q.min+r*R}catch(D){return console.warn("Error calculating value from position:",D),Q.min}},W=(V)=>{let O=Q.step;if(!O||O<=0)return V;let P=Math.round((V-Q.min)/O);return Q.min+P*O},Y=(V,O,P)=>Math.min(Math.max(V,O),P),U=()=>{let V=q(),{handle:O,container:P,valueBubble:L,secondHandle:D,secondValueBubble:R}=V;if(!O||!P)return;let w=G();if(!w)return;let{trackSize:A}=w,x=j(Q.value),I=K(x,A);if(O.style.left=`${I}%`,O.style.transform="translate(-50%, -50%)",L)L.style.left=`${I}%`,L.style.transform="translateX(-50%)";if(J.range&&D&&Q.secondValue!==null){let r=j(Q.secondValue),a=K(r,A);if(D.style.left=`${a}%`,D.style.transform="translate(-50%, -50%)",R)R.style.left=`${a}%`,R.style.transform="translateX(-50%)"}if(O)O.setAttribute("aria-valuenow",String(Q.value))},X=()=>{let V=q(),{valueBubble:O,secondValueBubble:P}=V;if(!O)return;let L=J.valueFormatter||((D)=>D.toString());if(O.textContent=L(Q.value),J.range&&P&&Q.secondValue!==null)P.textContent=L(Q.secondValue)},_=(V,O)=>{if(!V||!J.showValue)return;let P=Q.component.getClass("slider-value");V.classList[O?"add":"remove"](`${P}--visible`)},H=()=>{},B=()=>{},M=()=>{try{if(U(),X(),$.drawCanvas)$.drawCanvas(Q)}catch(V){console.warn("Error rendering UI:",V)}},N=oQ(J,Q,{getPercentage:j,getValueFromPosition:z,roundToStep:W,clamp:Y,showValueBubble:_,updateUi:M,render:M},Z),F=()=>{try{if(!$.components||!$.components.handle){console.warn("Cannot initialize slider controller: missing required components");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:V,secondHandle:O}=$.components;if(V){if(V.setAttribute("aria-valuemin",String(Q.min)),V.setAttribute("aria-valuemax",String(Q.max)),V.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}N.setupEventListeners(),M()}catch(V){console.error("Error initializing slider controller:",V)}};if($.lifecycle){let V=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{N.cleanupEventListeners(),V()}}return setTimeout(()=>{F()},0),{...$,slider:{setValue(V,O=!0){let P=Y(V,Q.min,Q.max);if(Q.value=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getValue(){return Q.value},setSecondValue(V,O=!0){if(!J.range)return this;let P=Y(V,Q.min,Q.max);if(Q.secondValue=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(V){if(Q.min=V,$.element.setAttribute("aria-valuemin",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemin",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemin",String(V));if(Q.value<V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue<V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMin(){return Q.min},setMax(V){if(Q.max=V,$.element.setAttribute("aria-valuemax",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemax",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemax",String(V));if(Q.value>V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue>V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMax(){return Q.max},setStep(V){if(Q.step=V,$.element.classList[V>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)H(),B();return this},getStep(){return Q.step},regenerateTicks(){return M(),this},updateUi(){return M(),this}}}};$9();y8();var Rj=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,R1=(J,$,Q="track")=>{let Z=Rj($),q=J.color||"primary";if(Z){let G=B6("sys-color-on-surface",{fallback:"#000000"});return{primary:U7(G,0.38),secondary:U7(G,0.12)}}if(Q==="tick")return{primary:B6(`sys-color-on-${q}`,{fallback:"#ffffff"}),secondary:B6(`sys-color-${q}`,{fallback:"#1976d2"})};let j=B6(`sys-color-${q}`,{fallback:"#1976d2"});return{primary:j,secondary:U7(j,0.24)}},D$=(J,$,Q)=>(J-$)/(Q-$)*100,I6=(J,$,Q,Z,q,j,G)=>{if(Z>0)B4(J,$,Q,Z,q,j,j,G)},T7=(J)=>{if(typeof J==="number")return Math.max(J,D6.XS);if(typeof J==="string"&&J in D6)return D6[J];return D6.XS},A1=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_HANDLE_HEIGHT;return $+Z6.HANDLE_HEIGHT_OFFSET},Aj=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_TRACK_EXTERNAL_RADIUS;return $*Z6.LARGE_TRACK_RADIUS_RATIO},tQ=(J,$,Q)=>{let Z=T7(Q?.size),q=A1(Q?.size),j=J.parentElement;if(!j)return;let G=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),K=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);j.style.height=`${K}px`,V4($,G,K)},nQ=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let Z=T7($?.size),q=A1($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),G=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);return Q.style.height=`${G}px`,M4(J,j,G)},O$=(J,$)=>{let Q=Z6.EDGE_PADDING/$*100,Z=Q,q=100-Q,j=q-Z;if(J<=0)return Z;if(J>=100)return q;return Z+J/100*j},wj=(J,$,Q,Z,q,j)=>{let G=Q/2,K=T7(Z.size),z=Aj(Z.size),W=Z6.TRACK_RADIUS,Y=X4(J,0,G-K/2,$,K,z),{primary:U,secondary:X}=R1(Z,j),_=D$(q.value,q.min,q.max),H=O$(_,$),B=q.pressed?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,M=Z6.HANDLE_GAP-B,N=Z6.CENTER_GAP/2/$*100,F=M/$*100;if(Z.centered){let V=D$(0,q.min,q.max),O=O$(V,$),P=Math.abs(H-O)<F,L=q.value>=0;if(P){let D=(H-F)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=$-R;if(w>0)I6(J,R,G-K/2,w,K,W,X)}else if(L){let D=(O-N)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(O+N)/100*$,w=(H-F)/100*$-R;if(w>0)I6(J,R,G-K/2,w,K,W,U);let A=(H+F)/100*$,x=$-A;if(x>0)I6(J,A,G-K/2,x,K,W,X)}else{let D=(H-F)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=(O-N)/100*$-R;if(w>0)I6(J,R,G-K/2,w,K,W,U);let A=(O+N)/100*$,x=$-A;if(x>0)I6(J,A,G-K/2,x,K,W,X)}}else if(Z.range&&q.secondValue!==null){let V=D$(q.secondValue,q.min,q.max),O=O$(V,$),P=Math.min(H,O),L=Math.max(H,O),D=H<=O,R=q.pressed&&q.activeHandle==="first"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,w=q.pressed&&q.activeHandle==="second"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,A=Z6.HANDLE_GAP-R,x=Z6.HANDLE_GAP-w,I=D?A/$*100:x/$*100,r=D?x/$*100:A/$*100,a=(P-I)/100*$;if(a>0)I6(J,0,G-K/2,a,K,W,X);let k6=(P+I)/100*$,i=(L-r)/100*$-k6;if(i>K)I6(J,k6,G-K/2,i,K,W,U);let y=(L+r)/100*$,l=$-y;if(l>0)I6(J,y,G-K/2,l,K,W,X)}else{let V=(H-F)/100*$;if(V>0)I6(J,0,G-K/2,V,K,W,U);let O=(H+F)/100*$,P=$-O;if(P>0)I6(J,O,G-K/2,P,K,W,X)}Y()},xj=(J,$,Q,Z,q,j)=>{if(!Z.ticks)return;let G=Z6.TICK_SIZE,K=Q/2,{primary:z,secondary:W}=R1(Z,j,"tick"),Y=Math.floor((q.max-q.min)/q.step);for(let U=0;U<=Y;U++){let X=q.min+U*q.step;if(X>q.max)continue;let _=D$(X,q.min,q.max),B=O$(_,$)/100*$,M=Math.abs(X-q.value)<q.step*0.1,k=Z.range&&q.secondValue!==null&&Math.abs(X-q.secondValue)<q.step*0.1;if(M||k)continue;let N=!1;if(Z.centered)N=q.value>=0?X>=0&&X<=q.value:X>=q.value&&X<=0;else if(Z.range&&q.secondValue!==null){let F=Math.min(q.value,q.secondValue),V=Math.max(q.value,q.secondValue);N=X>=F&&X<=V}else N=X<=q.value;J.fillStyle=N?z:W,J.globalAlpha=N?1:0.5,J.beginPath(),J.arc(B,K,G/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},yj=(J,$,Q,Z,q)=>{if(Z.ticks)return;let j=Z6.DOT_SIZE,G=Q/2,K=Z6.EDGE_PADDING,{primary:z}=R1(Z,q,"dot");J.fillStyle=z,J.beginPath(),J.arc($-K,G,j/2,0,Math.PI*2),J.fill()},P1=(J,$,Q,Z)=>{let{ctx:q,width:j,height:G}=J;if(j===0||G===0)return;F4(q,j,G),yj(q,j,G,$,Z),wj(q,j,G,$,Q,Z),xj(q,j,G,$,Q,Z)},eQ=(J,$)=>{let Q=A1($),{handle:Z,secondHandle:q}=J.components||{};if(Z)Z.style.height=`${Q}px`;if(q)q.style.height=`${Q}px`},Tj=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},w1=(J)=>($)=>{let Q=_4(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),Z=$.components?.container;if(Z)Z.insertBefore(Q,Z.firstChild);else $.element.appendChild(Q);let q=null,j=null,G=null,K=J.size||"XS",z=Tj(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),W={animatedValue:z.value,animatedSecondValue:z.secondValue,targetValue:z.value,targetSecondValue:z.secondValue,startValue:z.value,startSecondValue:z.secondValue,startTime:0,duration:H4.MEDIUM,animationFrame:null};if($.animationState=W,N4(()=>{try{return q=nQ(Q,{...J,size:K}),$.ctx=q.ctx,!0}catch(M){return console.warn("Slider canvas initialization failed:",M),!1}},()=>{eQ($,K)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let Y=()=>{if(!q)return;P1(q,{...J,size:K},{...z,value:W.animatedValue,secondValue:W.animatedSecondValue},$)},U=(M)=>{if(!q)return;let N=(M||performance.now())-W.startTime,F=Math.min(N/W.duration,1),V=w8(F),O=W.startValue,P=W.targetValue;if(W.animatedValue=O+(P-O)*V,W.targetSecondValue!==null&&W.animatedSecondValue!==null){let{startSecondValue:L,targetSecondValue:D}=W;W.animatedSecondValue=L+(D-L)*V}if(Y(),F<1)W.animationFrame=requestAnimationFrame((L)=>U(L));else W.animationFrame=null},X=(M)=>{if(!q){console.warn("Canvas context not ready");return}tQ(Q,q,{...J,size:K});let k,N=!1;if(M)k={value:M.value,secondValue:M.secondValue,min:M.min,max:M.max,step:M.step,pressed:M.pressed||!1,activeHandle:M.activeHandle||null},N=M.dragging||!1,z={...k};else if($.slider)k={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},z={...k};else k={...z};let F=k.value!==W.targetValue,V=k.secondValue!==W.targetSecondValue;if((F||V)&&!N){if(W.startValue=W.animatedValue,W.startSecondValue=W.animatedSecondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame);W.startTime=performance.now(),U()}else if(N){if(W.animatedValue=k.value,W.animatedSecondValue=k.secondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.startValue=k.value,W.startSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame),W.animationFrame=null;P1(q,{...J,size:K},M||k,$)}else P1(q,{...J,size:K},M||k,$)},_=()=>{if(!q)return;try{let M=nQ(Q,{...J,size:K});$.ctx=M.ctx,Object.assign(q,M),Y()}catch(M){console.warn("Slider canvas resize failed:",M)}};j=t7($.element,Q,_);let H=()=>Y();G=x8(J.color||"primary",H),requestAnimationFrame(()=>{X()}),$.drawCanvas=X,$.resize=_,$.setSize=(M)=>{if(K=M,q)tQ(Q,q,{...J,size:K}),Y();eQ($,K)},$.getSize=()=>K;let B=$.appearance?.setColor;if(B)$.appearance.setColor=(M)=>{if(B(M),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(M&&M!=="primary")$.element.classList.add(`${$.getClass("slider")}--${M}`);if(J.color=M,G)G(),G=null;G=x8(M,H),X()};if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(G)G();if(W.animationFrame)cancelAnimationFrame(W.animationFrame);M()}}return $};var $Z=(J)=>($)=>{return{...$,element:$.element,setValue(Q,Z=!0){return J.slider.setValue(Q,Z),this},getValue(){return J.slider.getValue()},setSecondValue(Q,Z=!0){return J.slider.setSecondValue(Q,Z),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();function JZ(J,$){let Q=(W)=>J.getClass(W),Z=$.min||0,q=$.max||100,j=$.value!==void 0?$.value:Z,G=$.disabled===!0,K=$.valueFormatter||((W)=>W.toString()),z=(j-Z)/(q-Z)*100;return{element:{options:{className:[Q("slider"),$.class].filter(Boolean),attributes:{tabindex:"-1",role:"none","aria-disabled":G?"true":"false"}},children:{container:{options:{className:Q("slider-container"),style:{position:"relative"}},children:{handle:{options:{className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Z),"aria-valuemax":String(q),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(j),"data-handle-index":"0"},style:{left:`${z}%`}}},valueBubble:{options:{className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:K(j),style:{left:`${z}%`}}}}}}}}}var Ij={min:V6.MIN,max:V6.MAX,value:V6.VALUE,step:V6.STEP,disabled:V6.DISABLED,color:V6.COLOR,size:V6.SIZE,ticks:V6.TICKS,showValue:V6.SHOW_VALUE,snapToSteps:V6.SNAP_TO_STEPS,range:V6.RANGE,centered:V6.CENTERED,iconPosition:V6.ICON_POSITION,labelPosition:V6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},QZ=(J={})=>{let $=u(Ij,J,"slider"),Q={componentName:"slider",config:$,getClass:(Z)=>{return`${$.prefix||"mtrl"}-${Z}`}};return $.schema=JZ(Q,$),$};var ZZ=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Sj=(J={})=>{let $=QZ(J);try{let Q=b(S,d(),P7($),f8($),R7($),L1($),A7(),w1($),D1($),O1($),C())($),Z=ZZ(Q),q=$Z(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},qZ=Sj;J6();c();var jZ=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},KZ=(J)=>($)=>{let Q=null,Z=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},q=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(q(),j)j.call($.lifecycle)};return{...$,timer:{start:Z,stop:q}}};var x1={BASIC:"basic",ACTION:"action"},q9={CENTER:"center",START:"start",END:"end"},GZ={VISIBLE:"visible",HIDDEN:"hidden"},zZ={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},e9={VARIANT:x1.BASIC,POSITION:q9.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},WZ={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var YZ=(J)=>($)=>{let Q=J.position||q9.CENTER,Z=J.prefix||"mtrl",q=`${Z}-snackbar--${Q}`;$.element.classList.add(q);let j=(G)=>{$.element.classList.remove(q);let K=`${Z}-snackbar--${G}`;if($.element.classList.add(K),$.element.classList.contains(`${Z}-snackbar--visible`))if(G===q9.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(G)=>{if(Object.values(q9).includes(G))return j(G),$;else return console.warn(`Invalid position: ${G}. Using default: ${q9.CENTER}`),j(q9.CENTER),$}}}};o();var UZ=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let Z=!1,q={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:Z?"visible":"hidden",show(){if(Z)return this;return Z=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!Z)return this;if(Z=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(G)=>{if(G.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,G){return Q.on?.(j,G),this},off(j,G){return Q.off?.(j,G),this},destroy(){if(Z&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(Z)q.hide()};Q.on("dismiss",j);let G=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),G?.call(J)}}return q};var XZ=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let Z=J[0],q=()=>{if(J.shift(),Z.off?.("dismiss",q),J.length===0)$=!1;else setTimeout(Q,200)};Z.on?.("dismiss",q),Z._show()};return{add(Z){if(!Z._show)throw new Error("Snackbar must implement _show method");if(J.push(Z),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};t();var bj={variant:e9.VARIANT,position:e9.POSITION,duration:e9.DURATION},BZ=(J)=>u(bj,J,"snackbar"),FZ=(J)=>p(J,{tag:"div",className:J.class}),HZ=(J)=>({...J,text:J.message}),kZ=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var vj=XZ(),Cj=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=BZ(J);try{return b(S,d(),h(FZ($)),K6($),YZ($),Y9(HZ($)),jZ($),C(),KZ($),(Z)=>UZ(kZ(Z,vj))(Z))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},MZ=Cj;J6();c();o();var VZ=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},supportingTextElement:Z.supportingTextElement||null,setSupportingText(q,j){if(Z.setSupportingText)Z.setSupportingText(q,j);return this},removeSupportingText(){if(Z.removeSupportingText)Z.removeSupportingText();return this},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});o();var NZ=(J,$,Q)=>{let Z=$||"mtrl",q=Q||"switch",j=J.element.querySelector(`.${Z}-${q}-container`);if(!j){j=document.createElement("div"),j.className=`${Z}-${q}-container`;let K=J.element.querySelector(`.${Z}-${q}-input`),z=J.element.querySelector(`.${Z}-${q}-track`),W=[];if(K)W.push(K);if(z)W.push(z);let Y=document.createElement("div");Y.className=`${Z}-${q}-content`;let U=J.element.querySelector(`.${Z}-${q}-label`);if(U)Y.appendChild(U);return j.appendChild(Y),W.forEach((X)=>j.appendChild(X)),J.element.appendChild(j),{container:j,contentWrapper:Y}}let G=J.element.querySelector(`.${Z}-${q}-content`);if(!G){G=document.createElement("div"),G.className=`${Z}-${q}-content`;let K=J.element.querySelector(`.${Z}-${q}-label`);if(K)G.appendChild(K);j.insertBefore(G,j.firstChild)}return{container:j,contentWrapper:G}},y1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"switch",{contentWrapper:q}=NZ($,Q,Z),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${Z}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${Z}-helper--error`),$.element.classList.add(`${Q}-${Z}--error`);q.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();G.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(G,K=!1){let{contentWrapper:z}=NZ($,Q,Z),W=this.supportingTextElement;if(!W)W=document.createElement("div"),W.className=`${Q}-${Z}-helper`,z.appendChild(W),this.supportingTextElement=W;return W.textContent=G,W.classList.toggle(`${Q}-${Z}-helper--error`,K),$.element.classList.toggle(`${Q}-${Z}--error`,K),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${Z}--error`);return this}}},_Z=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return l7(Q)($)};t();var Ej={prefix:"mtrl",componentName:"switch"},LZ=(J={})=>u(Ej,J,"switch"),DZ=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),OZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var hj=(J={})=>{let $=LZ(J);try{return b(S,d(),h(DZ($)),X9($),u9($),_Z($),y1($),f9($),G6($),C(),(Z)=>VZ(OZ(Z))(Z))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},PZ=hj;var T1={START:"start",END:"end"},RZ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},AZ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},wZ={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:T1.END,VALUE:"on"},xZ={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};J6();c();o();J6();c();o();var P$={PRIMARY:"primary",SECONDARY:"secondary"},I7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},I1={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},yZ={CLICK:"click",FOCUS:"focus",BLUR:"blur"},S1={CHANGE:"change"},v9={VARIANT:P$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:I1.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},$7={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},TZ={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},IZ={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};t();c();var uj={state:I7.INACTIVE,componentName:"tab",ripple:v9.RIPPLE},fj={variant:v9.VARIANT,scrollable:v9.SCROLLABLE,showDivider:v9.SHOW_DIVIDER,componentName:"tabs"},SZ=(J={})=>u(fj,J,"tabs"),bZ=(J={})=>u(uj,J,"tab"),vZ=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>h($)(Q)};T9();K7();var S7=(J={})=>{let $=bZ(J);try{let Q=b(S,d(),C())($),Z=Q9({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=Z.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);Z.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let q={...Q,button:Z,element:Z.element,badge:null,getValue(){return Z.getValue()},setValue(j){let G=j||"";return Z.setValue(G),this.element.setAttribute("id",`tab-${G}`),this.element.setAttribute("aria-controls",`tabpanel-${G}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return Z.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return Z.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return Z.setText(j),this.updateLayoutStyle(),this},getText(){return Z.getText()},setIcon(j){return Z.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return Z.getIcon()},setBadge(j){if(!this.badge){let G={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=j7(G)}else this.badge.setContent(j),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(Z.destroy)Z.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),G=!!this.getIcon(),K="";if(j&&G)K=$7.ICON_AND_TEXT;else if(G)K=$7.ICON_ONLY;else K=$7.TEXT_ONLY;if(Object.values($7).forEach((z)=>{this.element.classList.remove(`${this.getClass("tab")}--${z}`)}),this.element.classList.add(`${this.getClass("tab")}--${K}`),K===$7.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)q.setBadge($.badge);return q.updateLayoutStyle(),q}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var CZ=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let Z={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(Z.value===void 0)Z.value="";let q=S7(Z);if($.tabs.push(q),$.tabsContainer.appendChild(q.element),q.on&&typeof q.on==="function")q.on("click",(G)=>$.handleTabClick(G,q));return q.element.addEventListener("click",(G)=>{$.handleTabClick(G,q)}),q},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(q)=>$.handleTabClick(q,Q));return Q.element.addEventListener("click",(q)=>{$.handleTabClick(q,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let Z=typeof Q==="string"?$.tabs.find((q)=>q.getValue()===Q):Q;if(!Z)return this;if($.tabs.forEach((q)=>q.deactivate()),Z.activate(),$.emit)$.emit("change",{tab:Z,value:Z.getValue()});return this},removeTab(Q){let Z=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!Z)return this;let q=$.tabs.indexOf(Z);if(q!==-1)$.tabs.splice(q,1);if(Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);return Z.destroy(),this},on(Q,Z){if($.on)$.on(Q,Z);return this},off(Q,Z){if($.off)$.off(Q,Z);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),EZ=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function hZ(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function b1(J){let $=hZ(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((q)=>{if(q.getAttribute("aria-labelledby")?.replace("tab-","")===Q)q.removeAttribute("hidden"),q.setAttribute("tabindex","0");else q.setAttribute("hidden","true"),q.setAttribute("tabindex","-1")})}function v1(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),Z=hZ(J),q=Z?Q.indexOf(Z):-1,j=q;switch($.key){case"ArrowRight":case"ArrowDown":j=q<Q.length-1?q+1:0;break;case"ArrowLeft":case"ArrowUp":j=q>0?q-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==q&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var gj={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},C1=(J={})=>{let $={...gj,...J},Q=$.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-tabs-indicator`,Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
31
- width ${$.animationDuration}ms ${$.animationTiming}`,Z.style.width=`${$.fixedWidth}px`,!$.visible)Z.style.opacity="0";let q=null,j=(H)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return H.element.offsetWidth;let B=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(B)return B.clientWidth;return Math.max(H.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(H.element.offsetWidth/2,30);case"content":let B=H.element.querySelector(`.${Q}-button-text`)||H.element.querySelector(`.${Q}-tab-text`);if(B)return Math.max(B.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},G=(H)=>{let B=H.parentElement;if(!B)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:H.offsetWidth};let M=H.getBoundingClientRect(),k=B.getBoundingClientRect();return{left:M.left-k.left,width:M.width}},K=(H,B)=>{let{left:M,width:k}=G(H.element);if($.variant!=="secondary"&&($.widthStrategy==="auto"||$.widthStrategy==="content")){let N=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(N){let F=N.getBoundingClientRect(),V=H.element.getBoundingClientRect(),O=F.left-V.left;return{left:M+O}}}if(B<k)return{left:M+(k-B)/2};return{left:M}},z=(H,B=!1)=>{if(!H||!H.element){console.error("Invalid tab or tab has no element");return}q=H;let M=j(H),{left:k}=K(H,M);if(B)Z.style.transition="none",Z.offsetHeight;if(Z.style.width=`${M}px`,Z.style.transform=`translateX(${k}px)`,B)setTimeout(()=>{Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
32
- width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:Z,moveToTab:z,show:()=>{Z.style.opacity="1"},hide:()=>{Z.style.opacity="0"},setColor:(H)=>{Z.style.backgroundColor=H},update:()=>{if(q)z(q,!0)},destroy:()=>{if(Z.parentNode)Z.parentNode.removeChild(Z);q=null}}};var E1=(J)=>($)=>{let Q=[],Z=$.scrollContainer||$.element;if(Array.isArray(J.tabs))J.tabs.forEach((K)=>{let z={...K,prefix:J.prefix,variant:K.variant||J.variant},W=S7(z);Q.push(W),Z.appendChild(W.element)});let q=()=>{return[...Q]},j=()=>{return Q.find((K)=>K.isActive())||null},G=(K,z)=>{if(K&&typeof K.preventDefault==="function")K.preventDefault();if(z.disabled&&z.disabled.isDisabled&&z.disabled.isDisabled())return;Q.forEach((Y)=>Y.deactivate()),z.activate();let W=z.getValue();if(b1({tabs:Q,getActiveTab:()=>Q.find((Y)=>Y.isActive())||null}),typeof $.emit==="function")$.emit("change",{tab:z,value:W})};return Q.forEach((K)=>{if(K.on&&typeof K.on==="function")K.on("click",(z)=>G(z,K));K.element.addEventListener("click",(z)=>G(z,K))}),{...$,tabs:Q,tabsContainer:Z,handleTabClick:G,getTabs:q,getActiveTab:j}},h1=(J)=>($)=>{if(J.scrollable===!1)return $;$.element.classList.add(`${$.getClass("tabs")}--scrollable`);let Q=document.createElement("div");Q.className=`${$.getClass("tabs")}-scroll`;while($.element.firstChild)Q.appendChild($.element.firstChild);return $.element.appendChild(Q),{...$,scrollContainer:Q}},u1=(J)=>($)=>{if(J.showDivider===!1)return $;let Q=document.createElement("div");return Q.className=`${$.getClass("tabs")}-divider`,$.element.appendChild(Q),$},f1=(J)=>($)=>{let Q=J.indicator||{},Z=C1({prefix:J.prefix,widthStrategy:Q.widthStrategy||J.indicatorWidthStrategy||"auto",height:Q.height||J.indicatorHeight||3,fixedWidth:Q.fixedWidth||40,animationDuration:Q.animationDuration||250,animationTiming:Q.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:Q.color,variant:J.variant??"primary"}),q=$.scrollContainer||$.element;if(!q)throw console.error("No scroll container found - cannot add indicator"),new Error("Failed to create tabs: No scroll container found");q.appendChild(Z.element);let j=$.handleTabClick;$.handleTabClick=function(Y,U){if(U.disabled&&U.disabled.isDisabled&&U.disabled.isDisabled())return;j.call(this,Y,U),setTimeout(()=>{Z.moveToTab(U)},10)},setTimeout(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)},50);let G=()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)};if(q)q.addEventListener("scroll",G);let K=new ResizeObserver(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)});K.observe(q);let z=new MutationObserver((Y)=>{for(let U of Y)if(U.type==="attributes"&&U.attributeName==="class"&&U.target.classList.contains(`${J.prefix}-tab--active`)){let X=U.target,_=$.tabs.find((H)=>H.element===X);if(_)Z.moveToTab(_)}});if(Array.isArray($.tabs))$.tabs.forEach((Y)=>{if(Y.element)z.observe(Y.element,{attributes:!0})});let W=$.destroy||(()=>{});return $.destroy=function(){if(Z.destroy(),K.disconnect(),z.disconnect(),q)q.removeEventListener("scroll",G);if(typeof W==="function")W.call(this)},{...$,indicator:Z,getIndicator:()=>Z}};var dj=(J)=>{let{tabs:$=[],onChange:Q,indicator:Z}=J,q=null,j=$.find((Y)=>Y.isActive());if(j){if(q=j,Z)setTimeout(()=>{Z.moveToTab(j,!0)},50)}let G=(Y)=>{if(!Y.element)return;let U=Y.element.querySelector(`.${Y.getClass("tab")}-ripple`);if(!U)return;let X=document.createElement("span");X.className="ripple",X.style.width="100%",X.style.height="100%",X.style.left="0",X.style.top="0",X.style.animation="ripple-effect 0.4s cubic-bezier(0.4, 0, 0.2, 1)",U.appendChild(X),setTimeout(()=>{X.remove()},400)};return{activateTab:(Y,U=!1)=>{if(!Y||q===Y)return;if(q)q.deactivate();if(Y.activate(),q=Y,Z)setTimeout(()=>{Z.moveToTab(Y,U)},10);if(!U)G(Y);if(Q)Q({tab:Y,value:Y.getValue()})},getActiveTab:()=>{return q},destroy:()=>{q=null}}},uZ=()=>{if(document.getElementById("tab-state-styles"))return;let J=document.createElement("style");J.id="tab-state-styles",J.textContent=`
30
+ </svg>`,EQ={CHECKMARK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},hQ={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var Lj={mode:o9.MODE,ripple:o9.RIPPLE,density:o9.DENSITY},uQ=(J={})=>u(Lj,J,"segmented-button"),fQ=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},X1=(J)=>{switch(J){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};T9();var B1=(J,$,Q,Z=!1,q={ripple:!0,rippleConfig:{}})=>{let j=Z||J.disabled,K=J.icon,G=J.checkmarkIcon||CQ,W=Q9({text:J.text,icon:J.selected&&J.text&&K?G:K,value:J.value||J.text||"",disabled:j,ripple:q.ripple,rippleConfig:q.rippleConfig,class:J.class});if(W.element.classList.add(`${Q}-segmented-button-segment`),J.selected)W.element.classList.add(`${Q}-segment--selected`),W.element.setAttribute("aria-pressed","true");else W.element.setAttribute("aria-pressed","false");$.appendChild(W.element);let z=(U)=>{if(W.element.classList.toggle(`${Q}-segment--selected`,U),W.element.setAttribute("aria-pressed",U?"true":"false"),J.text&&K)if(U)W.setIcon(G);else W.setIcon(K)},Y=J.selected||!1;return{element:W.element,value:J.value||J.text||"",isSelected(){return Y},setSelected(U){Y=U,z(U)},isDisabled(){return W.disabled?.isDisabled?.()||!1},setDisabled(U){if(U)W.disable();else W.enable()},destroy(){W.destroy()}}};var Dj=(J={})=>{let $=uQ(J),Q=$.mode||"single",Z=$.density||"default",q=f6();try{let j=b(S,d(),h(fQ($)),C())($),K=X1(Z);Object.entries(K).forEach(([H,B])=>{j.element.style.setProperty(H,B)});let G=[];if($.segments&&$.segments.length)$.segments.forEach((H)=>{let B=B1(H,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});G.push(B)});if(Q==="single"&&!G.some((H)=>H.isSelected())){let H=G.find((B)=>!B.isDisabled());if(H)H.setSelected(!0)}let W=(H)=>{let B=H.currentTarget,k=G.find((F)=>F.element===B);if(!k||k.isDisabled())return;let M=Y();if(Q==="single")G.forEach((F)=>{F.setSelected(F===k)});else k.setSelected(!k.isSelected());let V=Y();if(M.length!==V.length||M.some((F)=>!V.includes(F))||V.some((F)=>!M.includes(F)))q.emit("change",{selected:z(),value:V,oldValue:M})};G.forEach((H)=>{H.element.addEventListener("click",W)});let z=()=>G.filter((H)=>H.isSelected()),Y=()=>z().map((H)=>H.value),U=(H)=>G.find((B)=>B.value===H),X=(H)=>{if(["default","comfortable","compact"].forEach((k)=>{if(k!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${k}`)}),H!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${H}`);j.element.setAttribute("data-density",H);let B=X1(H);Object.entries(B).forEach(([k,M])=>{j.element.style.setProperty(k,M)})};return{element:j.element,segments:G,getSelected:z,getValue(){return Y()},select(H){let B=U(H);if(B&&!B.isDisabled()){let k=Y();if(Q==="single")G.forEach((V)=>V.setSelected(V===B));else B.setSelected(!0);let M=Y();if(k.join(",")!==M.join(","))q.emit("change",{selected:z(),value:M,oldValue:k})}return this},deselect(H){let B=U(H);if(B&&!B.isDisabled())if(Q==="single"){if(z().length>1||!B.isSelected()){let M=Y();B.setSelected(!1);let V=Y();if(M.join(",")!==V.join(","))q.emit("change",{selected:z(),value:V,oldValue:M})}}else{let k=Y();B.setSelected(!1);let M=Y();if(k.join(",")!==M.join(","))q.emit("change",{selected:z(),value:M,oldValue:k})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),G.forEach((H)=>{if(!$.segments?.find((B)=>B.value===H.value)?.disabled)H.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),G.forEach((H)=>{H.setDisabled(!0)}),this},enableSegment(H){let B=U(H);if(B)B.setDisabled(!1);return this},disableSegment(H){let B=U(H);if(B)B.setDisabled(!0);return this},setDensity(H){return X(H),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(H,B){return q.on(H,B),this},off(H,B){return q.off(H,B),this},destroy(){G.forEach((H)=>{H.element.removeEventListener("click",W),H.destroy()}),q.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},F1=Dj;J6();c();o();var C6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},t9={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var H1=(J)=>($)=>{let{position:Q=C6.BOTTOM}=J,Z=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(Z),{...$,position:{setPosition(q){$.element.classList.remove(Z);let j=`${$.getClass("sheet")}--${q.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var M1=(J)=>($)=>{let{content:Q=""}=J,Z=document.createElement("div");return Z.className=`${$.getClass("sheet")}-content`,Z.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(Z),$.element.appendChild($.container),{...$,content:{setContent(q){return Z.innerHTML=q,this},getContent(){return Z.innerHTML},getElement(){return Z}}}};var k1=(J)=>($)=>{let{title:Q=""}=J,Z=null;if(Q||J.dragHandle){if(Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,Q)Z.textContent=Q;if($.container.insertBefore(Z,$.container.firstChild),J.dragHandle){let q=document.createElement("div");q.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(q,$.container.firstChild),$.dragHandle={element:q,setVisible(j){q.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(q){if(!Z&&q)Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(Z,$.content.getElement());if(Z)Z.textContent=q;return this},getTitle(){return Z?Z.textContent||"":""},getElement(){return Z}}}};var N1=(J)=>($)=>{let{open:Q=!1,dismissible:Z=!0}=J,q=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),Z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(Z)G()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(W)=>{if(W.key==="Escape"&&q&&Z)G()});function K(){if(!q){if(q=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(t9.OPEN),J.onOpen)J.onOpen()}}function G(){if(q){if(q=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(t9.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:K,close:G,isOpen(){return q},setDismissible(W){if(W)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var V1=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||C6.BOTTOM,Z=0,q=0,j=!1,K=$.dragHandle?.element||$.element,G=(X)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",X.type==="touchstart")Z=X.touches[0].clientY,q=X.touches[0].clientX;else Z=X.clientY,q=X.clientX,document.addEventListener("mousemove",W),document.addEventListener("mouseup",z);$.events.emit(t9.DRAG_START)},W=(X)=>{if(!j)return;let _,H;if(X.type==="touchmove")_=X.touches[0].clientY,H=X.touches[0].clientX;else _=X.clientY,H=X.clientX;let B=0;switch(Q){case C6.BOTTOM:if(B=_-Z,B<0)B=0;$.element.style.transform=`translateY(${B}px)`;break;case C6.TOP:if(B=Z-_,B<0)B=0;$.element.style.transform=`translateY(-${B}px)`;break;case C6.LEFT:if(B=q-H,B<0)B=0;$.element.style.transform=`translateX(-${B}px)`;break;case C6.RIGHT:if(B=H-q,B<0)B=0;$.element.style.transform=`translateX(${B}px)`;break}let k=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,M=Math.min(B/k,1),V=$.element.nextElementSibling;if(V&&V.classList.contains(`${$.getClass("sheet")}-scrim`))V.style.opacity=`${0.32*(1-M)}`},z=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",z);let X=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let H=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=H?parseFloat(H[1]):0}if(_>X*0.3)$.state.close();else{$.element.style.transform="";let H=$.element.nextElementSibling;if(H&&H.classList.contains(`${$.getClass("sheet")}-scrim`))H.style.opacity=""}$.events.emit(t9.DRAG_END)};K.addEventListener("touchstart",G),K.addEventListener("touchmove",W),K.addEventListener("touchend",z),K.addEventListener("mousedown",G);let Y=()=>{K.removeEventListener("touchstart",G),K.removeEventListener("touchmove",W),K.removeEventListener("touchend",z),K.removeEventListener("mousedown",G),document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",z)},U=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{Y(),U()}},$};var gQ=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(Z){return Q.content.setContent(Z),this},getContent(){return Q.content.getContent()},setTitle(Z){return Q.title.setTitle(Z),this},getTitle(){return Q.title.getTitle()},setDragHandle(Z){if(Q.dragHandle)Q.dragHandle.setVisible(Z);return this},setMaxHeight(Z){return Q.container.style.maxHeight=Z,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});t();var b9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},n9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},dQ={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},_1={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},L9={VARIANT:b9.STANDARD,POSITION:n9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:_1.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},lQ={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},rQ={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},pQ={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var Oj={variant:b9.STANDARD,position:n9.BOTTOM,open:L9.OPEN,dismissible:L9.DISMISSIBLE,dragHandle:L9.DRAG_HANDLE,elevation:L9.ELEVATION,enableGestures:L9.ENABLE_GESTURES},sQ=(J={})=>u(Oj,J,"sheet"),mQ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===b9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},aQ=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Pj=(J={})=>{let $=sQ(J);try{let Q=b(S,d(),h(mQ($)),K6($),H1($),M1($),k1($),N1($),V1($),C(),(Z)=>gQ(aQ(Z))(Z))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},cQ=Pj;c();o();A6();var L1=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,Z=J.max||100,q=J.secondValue,j=(q-Q)/(Z-Q)*100,K=J.valueFormatter||((X)=>X.toString()),G=J.disabled===!0,W=$.getClass,z=JSON.parse(JSON.stringify($.schema)),Y=z.element.options.className||[];if(Array.isArray(Y))Y.push(W("slider--range"));else z.element.options.className=`${Y} ${W("slider--range")}`.trim();let U=z.element.children.container.children;return U.secondHandle={name:"secondHandle",creator:v,options:{tag:"div",className:W("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(Z),"aria-valuenow":String(q),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(q),"data-handle-index":"1"},style:{left:`${j}%`}}},U.secondValueBubble={name:"secondValueBubble",creator:v,options:{tag:"div",className:W("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:K(q),style:{left:`${j}%`}}},{...$,schema:z}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var Z9={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},D6={XS:16,S:24,M:40,L:56,XL:80},Z6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},H6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},L$={START:"start",END:"end"},V6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Z9.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:L$.START,LABEL_POSITION:L$.START},iQ={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var D1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function q(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(Z9).find((G)=>$.element.classList.contains(`${$.getClass("slider")}--${G}`))||Z9.PRIMARY}function K(){return Object.keys(D6).find((z)=>$.element.classList.contains(`${$.getClass("slider")}--${z.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(G){if(Object.values(Z9).forEach((W)=>{$.element.classList.remove(`${$.getClass("slider")}--${W}`)}),G!==Z9.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${G}`);return this},getColor(){return j()},setSize(G){Object.keys(D6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y.toLowerCase()}`)});let z;if(typeof G==="string"&&G in D6)z=G;else if(typeof G==="number"){let Y=Object.entries(D6).find(([,U])=>U===G);z=Y?Y[0]:"XS"}else z="XS";return $.element.classList.add(`${$.getClass("slider")}--${z.toLowerCase()}`),this},getSize(){return K()},showTicks(G){if(J.ticks=G,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(G){return J.showValue=G,this}}}};var oQ=(J,$,Q,Z)=>{let q=$.component?.components||{},{container:j=null,handle:K=null,valueBubble:G=null,secondHandle:W=null,secondValueBubble:z=null}=q,{getValueFromPosition:Y=()=>0,roundToStep:U=(y)=>y,clamp:X=(y)=>y,showValueBubble:_=()=>{},render:H=()=>{}}=Q,{triggerEvent:B=()=>({defaultPrevented:!1})}=Z,k=!1,M=0,V=3,F=null,N=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(N(),G)_(G,!1);if(z)_(z,!1)},P=(y)=>{if(O(),y&&J.showValue)_(y,!0)},L=(y,l=0)=>{if(N(),!y||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{_(y,!1)},l);else _(y,!1)},D=()=>{if(K)K.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(W)W.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let y=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${y}`).forEach((l)=>{l.classList.remove(y)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(y){console.warn("Error clearing keyboard focus:",y)}},R=(y,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;y.preventDefault(),y.stopPropagation(),O(),D(),M=y.type.includes("touch")?y.touches[0].clientX:y.clientX,$.dragging=!1,$.pressed=!0,k=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?z:G,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},w=(y)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!j)return;y.preventDefault(),O(),D();let l=!1;try{let m=y.type.includes("touch")?y.touches[0].clientX:y.clientX,s=Y(m);if(J.snapToSteps&&$.step>0)s=U(s);if(s=X(s,$.min,$.max),J.range&&$.secondValue!==null){let K9=Math.abs(s-$.value);l=Math.abs(s-$.secondValue)<K9,l?$.secondValue=s:$.value=s}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(s,!1);else $.value=s;H(),B(H6.INPUT,y)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?z:G,M=y.type.includes("touch")?y.touches[0].clientX:y.clientX,J.centered&&!J.range)P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),$.pressed=!1,B(H6.START,y);else $.dragging=!1,$.pressed=!1,k=!1,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},A=(y)=>{if(!$.activeHandle||!j)return;y.preventDefault();try{let l=y.type.includes("touch")?y.touches[0].clientX:y.clientX;if(!k&&Math.abs(l-M)>=V)k=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=Y(l);if(J.snapToSteps&&$.step>0)m=U(m);m=X(m,$.min,$.max);let s=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(s)if(m>=$.value)$.secondValue=m;else L($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=G,P($.activeBubble);else if(m<=$.secondValue)$.value=m;else L($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=z,P($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}H(),B(H6.INPUT,y)}catch(l){console.warn("Error during slider drag:",l)}},x=(y)=>{if(!$.activeHandle)return;y.preventDefault(),$.dragging=!1,$.pressed=!1,k=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),L($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x),$.activeHandle=null,H(),B(H6.CHANGE,y),B(H6.END,y)},I=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,s=l?$.secondValue:$.value,K9=y.shiftKey?m*10:m;if(y.key==="Tab")return;let _6=!1;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),s=Math.min(s+K9,$.max),_6=!0;break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),s=Math.max(s-K9,$.min),_6=!0;break;case"Home":y.preventDefault(),s=$.min,_6=!0;break;case"End":y.preventDefault(),s=$.max,_6=!0;break;case"PageUp":y.preventDefault(),s=Math.min(s+m*10,$.max),_6=!0;break;case"PageDown":y.preventDefault(),s=Math.max(s-m*10,$.min),_6=!0;break;default:return}if(!_6)return;if($.activeBubble=l?z:G,P($.activeBubble),l)$.secondValue=s;else{if(J.centered)$.previousValue=$.value;$.value=s}H(),B(H6.INPUT,y),B(H6.CHANGE,y)},r=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?W:K;if(F&&F!==m)O();F=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),P(l?z:G),$.activeBubble=l?z:G,B(H6.FOCUS,y)},a=(y,l=!1)=>{(l?W:K).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let s=y.relatedTarget;if(!s||s!==(l?K:W))L(l?z:G,200);B(H6.BLUR,y)};return{handleHandleMouseDown:R,handleTrackMouseDown:w,handleMouseMove:A,handleMouseUp:x,handleKeyDown:I,handleFocus:r,handleBlur:a,setupEventListeners:()=>{if(!$.component||!$.component.components){console.warn("Cannot set up event listeners: missing component structure");return}if(j.addEventListener("mousedown",w),j.addEventListener("touchstart",w,{passive:!1}),K.addEventListener("mousedown",(y)=>R(y,!1)),K.addEventListener("touchstart",(y)=>R(y,!1),{passive:!1}),K.addEventListener("keydown",(y)=>I(y,!1)),K.addEventListener("focus",(y)=>r(y,!1)),K.addEventListener("blur",(y)=>a(y,!1)),J.range&&W)W.addEventListener("mousedown",(y)=>R(y,!0)),W.addEventListener("touchstart",(y)=>R(y,!0),{passive:!1}),W.addEventListener("keydown",(y)=>I(y,!0)),W.addEventListener("focus",(y)=>r(y,!0)),W.addEventListener("blur",(y)=>a(y,!0))},cleanupEventListeners:()=>{if(!$.component||!$.component.components)return;if(j)j.removeEventListener("mousedown",w),j.removeEventListener("touchstart",w);if(K)K.removeEventListener("mousedown",(y)=>R(y,!1)),K.removeEventListener("touchstart",(y)=>R(y,!1)),K.removeEventListener("keydown",(y)=>I(y,!1)),K.removeEventListener("focus",(y)=>r(y,!1)),K.removeEventListener("blur",(y)=>a(y,!1));if(J.range&&W)W.removeEventListener("mousedown",(y)=>R(y,!0)),W.removeEventListener("touchstart",(y)=>R(y,!0)),W.removeEventListener("keydown",(y)=>I(y,!0)),W.removeEventListener("focus",(y)=>r(y,!0)),W.removeEventListener("blur",(y)=>a(y,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x)},showActiveBubble:P,hideActiveBubble:L,hideAllBubbles:O,clearKeyboardFocus:D}};var O1=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize slider controller: missing element or components"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},Z={triggerEvent(N,O=null){let P={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(N,P),P}},q=()=>{if(!Q.component?.components)return{};return Q.component.components},j=(N)=>{let O=Q.max-Q.min;return O===0?0:(N-Q.min)/O*100},K=()=>{let N=q(),{handle:O,container:P}=N;if(!O||!P)return null;try{let L=O.getBoundingClientRect(),D=P.getBoundingClientRect(),R=L.width||Z6.HANDLE_SIZE,w=D.width,A=Z6.EDGE_PADDING/w*100,I=(Q.activeHandle?6:8)/w*100;return{handleSize:R,trackSize:w,edgeConstraint:A,paddingPercent:I}}catch(L){return console.warn("Error calculating track dimensions:",L),{handleSize:Z6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},G=(N,O=200)=>{let P=Z6.EDGE_PADDING/O*100,L=P,D=100-P,R=D-L;if(N<=0)return L;if(N>=100)return D;return L+N/100*R},W=(N)=>{let O=q(),{handle:P,container:L}=O;if(!P||!L)return Q.min;try{let D=L.getBoundingClientRect(),R=Q.max-Q.min,w=D.left+Z6.EDGE_PADDING,A=D.right-Z6.EDGE_PADDING,x=A-w,r=(Math.max(w,Math.min(A,N))-w)/x;return Q.min+r*R}catch(D){return console.warn("Error calculating value from position:",D),Q.min}},z=(N)=>{let O=Q.step;if(!O||O<=0)return N;let P=Math.round((N-Q.min)/O);return Q.min+P*O},Y=(N,O,P)=>Math.min(Math.max(N,O),P),U=()=>{let N=q(),{handle:O,container:P,valueBubble:L,secondHandle:D,secondValueBubble:R}=N;if(!O||!P)return;let w=K();if(!w)return;let{trackSize:A}=w,x=j(Q.value),I=G(x,A);if(O.style.left=`${I}%`,O.style.transform="translate(-50%, -50%)",L)L.style.left=`${I}%`,L.style.transform="translateX(-50%)";if(J.range&&D&&Q.secondValue!==null){let r=j(Q.secondValue),a=G(r,A);if(D.style.left=`${a}%`,D.style.transform="translate(-50%, -50%)",R)R.style.left=`${a}%`,R.style.transform="translateX(-50%)"}if(O)O.setAttribute("aria-valuenow",String(Q.value))},X=()=>{let N=q(),{valueBubble:O,secondValueBubble:P}=N;if(!O)return;let L=J.valueFormatter||((D)=>D.toString());if(O.textContent=L(Q.value),J.range&&P&&Q.secondValue!==null)P.textContent=L(Q.secondValue)},_=(N,O)=>{if(!N||!J.showValue)return;let P=Q.component.getClass("slider-value");N.classList[O?"add":"remove"](`${P}--visible`)},H=()=>{},B=()=>{},k=()=>{try{if(U(),X(),$.drawCanvas)$.drawCanvas(Q)}catch(N){console.warn("Error rendering UI:",N)}},V=oQ(J,Q,{getPercentage:j,getValueFromPosition:W,roundToStep:z,clamp:Y,showValueBubble:_,updateUi:k,render:k},Z),F=()=>{try{if(!$.components||!$.components.handle){console.warn("Cannot initialize slider controller: missing required components");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:N,secondHandle:O}=$.components;if(N){if(N.setAttribute("aria-valuemin",String(Q.min)),N.setAttribute("aria-valuemax",String(Q.max)),N.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}V.setupEventListeners(),k()}catch(N){console.error("Error initializing slider controller:",N)}};if($.lifecycle){let N=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{V.cleanupEventListeners(),N()}}return setTimeout(()=>{F()},0),{...$,slider:{setValue(N,O=!0){let P=Y(N,Q.min,Q.max);if(Q.value=P,k(),O)Z.triggerEvent(H6.CHANGE);return this},getValue(){return Q.value},setSecondValue(N,O=!0){if(!J.range)return this;let P=Y(N,Q.min,Q.max);if(Q.secondValue=P,k(),O)Z.triggerEvent(H6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(N){if(Q.min=N,$.element.setAttribute("aria-valuemin",String(N)),$.components?.handle)$.components.handle.setAttribute("aria-valuemin",String(N));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemin",String(N));if(Q.value<N)Q.value=N;if(J.range&&Q.secondValue!==null&&Q.secondValue<N)Q.secondValue=N;if(J.ticks||J.tickLabels)H();return k(),this},getMin(){return Q.min},setMax(N){if(Q.max=N,$.element.setAttribute("aria-valuemax",String(N)),$.components?.handle)$.components.handle.setAttribute("aria-valuemax",String(N));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemax",String(N));if(Q.value>N)Q.value=N;if(J.range&&Q.secondValue!==null&&Q.secondValue>N)Q.secondValue=N;if(J.ticks||J.tickLabels)H();return k(),this},getMax(){return Q.max},setStep(N){if(Q.step=N,$.element.classList[N>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)H(),B();return this},getStep(){return Q.step},regenerateTicks(){return k(),this},updateUi(){return k(),this}}}};$9();y8();var Rj=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,R1=(J,$,Q="track")=>{let Z=Rj($),q=J.color||"primary";if(Z){let K=B6("sys-color-on-surface",{fallback:"#000000"});return{primary:U7(K,0.38),secondary:U7(K,0.12)}}if(Q==="tick")return{primary:B6(`sys-color-on-${q}`,{fallback:"#ffffff"}),secondary:B6(`sys-color-${q}`,{fallback:"#1976d2"})};let j=B6(`sys-color-${q}`,{fallback:"#1976d2"});return{primary:j,secondary:U7(j,0.24)}},D$=(J,$,Q)=>(J-$)/(Q-$)*100,I6=(J,$,Q,Z,q,j,K)=>{if(Z>0)B4(J,$,Q,Z,q,j,j,K)},T7=(J)=>{if(typeof J==="number")return Math.max(J,D6.XS);if(typeof J==="string"&&J in D6)return D6[J];return D6.XS},A1=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_HANDLE_HEIGHT;return $+Z6.HANDLE_HEIGHT_OFFSET},Aj=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_TRACK_EXTERNAL_RADIUS;return $*Z6.LARGE_TRACK_RADIUS_RATIO},tQ=(J,$,Q)=>{let Z=T7(Q?.size),q=A1(Q?.size),j=J.parentElement;if(!j)return;let K=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),G=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);j.style.height=`${G}px`,N4($,K,G)},nQ=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let Z=T7($?.size),q=A1($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),K=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);return Q.style.height=`${K}px`,k4(J,j,K)},O$=(J,$)=>{let Q=Z6.EDGE_PADDING/$*100,Z=Q,q=100-Q,j=q-Z;if(J<=0)return Z;if(J>=100)return q;return Z+J/100*j},wj=(J,$,Q,Z,q,j)=>{let K=Q/2,G=T7(Z.size),W=Aj(Z.size),z=Z6.TRACK_RADIUS,Y=X4(J,0,K-G/2,$,G,W),{primary:U,secondary:X}=R1(Z,j),_=D$(q.value,q.min,q.max),H=O$(_,$),B=q.pressed?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,k=Z6.HANDLE_GAP-B,V=Z6.CENTER_GAP/2/$*100,F=k/$*100;if(Z.centered){let N=D$(0,q.min,q.max),O=O$(N,$),P=Math.abs(H-O)<F,L=q.value>=0;if(P){let D=(H-F)/100*$;if(D>0)I6(J,0,K-G/2,D,G,z,X);let R=(H+F)/100*$,w=$-R;if(w>0)I6(J,R,K-G/2,w,G,z,X)}else if(L){let D=(O-V)/100*$;if(D>0)I6(J,0,K-G/2,D,G,z,X);let R=(O+V)/100*$,w=(H-F)/100*$-R;if(w>0)I6(J,R,K-G/2,w,G,z,U);let A=(H+F)/100*$,x=$-A;if(x>0)I6(J,A,K-G/2,x,G,z,X)}else{let D=(H-F)/100*$;if(D>0)I6(J,0,K-G/2,D,G,z,X);let R=(H+F)/100*$,w=(O-V)/100*$-R;if(w>0)I6(J,R,K-G/2,w,G,z,U);let A=(O+V)/100*$,x=$-A;if(x>0)I6(J,A,K-G/2,x,G,z,X)}}else if(Z.range&&q.secondValue!==null){let N=D$(q.secondValue,q.min,q.max),O=O$(N,$),P=Math.min(H,O),L=Math.max(H,O),D=H<=O,R=q.pressed&&q.activeHandle==="first"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,w=q.pressed&&q.activeHandle==="second"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,A=Z6.HANDLE_GAP-R,x=Z6.HANDLE_GAP-w,I=D?A/$*100:x/$*100,r=D?x/$*100:A/$*100,a=(P-I)/100*$;if(a>0)I6(J,0,K-G/2,a,G,z,X);let M6=(P+I)/100*$,i=(L-r)/100*$-M6;if(i>G)I6(J,M6,K-G/2,i,G,z,U);let y=(L+r)/100*$,l=$-y;if(l>0)I6(J,y,K-G/2,l,G,z,X)}else{let N=(H-F)/100*$;if(N>0)I6(J,0,K-G/2,N,G,z,U);let O=(H+F)/100*$,P=$-O;if(P>0)I6(J,O,K-G/2,P,G,z,X)}Y()},xj=(J,$,Q,Z,q,j)=>{if(!Z.ticks)return;let K=Z6.TICK_SIZE,G=Q/2,{primary:W,secondary:z}=R1(Z,j,"tick"),Y=Math.floor((q.max-q.min)/q.step);for(let U=0;U<=Y;U++){let X=q.min+U*q.step;if(X>q.max)continue;let _=D$(X,q.min,q.max),B=O$(_,$)/100*$,k=Math.abs(X-q.value)<q.step*0.1,M=Z.range&&q.secondValue!==null&&Math.abs(X-q.secondValue)<q.step*0.1;if(k||M)continue;let V=!1;if(Z.centered)V=q.value>=0?X>=0&&X<=q.value:X>=q.value&&X<=0;else if(Z.range&&q.secondValue!==null){let F=Math.min(q.value,q.secondValue),N=Math.max(q.value,q.secondValue);V=X>=F&&X<=N}else V=X<=q.value;J.fillStyle=V?W:z,J.globalAlpha=V?1:0.5,J.beginPath(),J.arc(B,G,K/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},yj=(J,$,Q,Z,q)=>{if(Z.ticks)return;let j=Z6.DOT_SIZE,K=Q/2,G=Z6.EDGE_PADDING,{primary:W}=R1(Z,q,"dot");J.fillStyle=W,J.beginPath(),J.arc($-G,K,j/2,0,Math.PI*2),J.fill()},P1=(J,$,Q,Z)=>{let{ctx:q,width:j,height:K}=J;if(j===0||K===0)return;F4(q,j,K),yj(q,j,K,$,Z),wj(q,j,K,$,Q,Z),xj(q,j,K,$,Q,Z)},eQ=(J,$)=>{let Q=A1($),{handle:Z,secondHandle:q}=J.components||{};if(Z)Z.style.height=`${Q}px`;if(q)q.style.height=`${Q}px`},Tj=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},w1=(J)=>($)=>{let Q=_4(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),Z=$.components?.container;if(Z)Z.insertBefore(Q,Z.firstChild);else $.element.appendChild(Q);let q=null,j=null,K=null,G=J.size||"XS",W=Tj(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),z={animatedValue:W.value,animatedSecondValue:W.secondValue,targetValue:W.value,targetSecondValue:W.secondValue,startValue:W.value,startSecondValue:W.secondValue,startTime:0,duration:H4.MEDIUM,animationFrame:null};if($.animationState=z,V4(()=>{try{return q=nQ(Q,{...J,size:G}),$.ctx=q.ctx,!0}catch(k){return console.warn("Slider canvas initialization failed:",k),!1}},()=>{eQ($,G)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let Y=()=>{if(!q)return;P1(q,{...J,size:G},{...W,value:z.animatedValue,secondValue:z.animatedSecondValue},$)},U=(k)=>{if(!q)return;let V=(k||performance.now())-z.startTime,F=Math.min(V/z.duration,1),N=w8(F),O=z.startValue,P=z.targetValue;if(z.animatedValue=O+(P-O)*N,z.targetSecondValue!==null&&z.animatedSecondValue!==null){let{startSecondValue:L,targetSecondValue:D}=z;z.animatedSecondValue=L+(D-L)*N}if(Y(),F<1)z.animationFrame=requestAnimationFrame((L)=>U(L));else z.animationFrame=null},X=(k)=>{if(!q){console.warn("Canvas context not ready");return}tQ(Q,q,{...J,size:G});let M,V=!1;if(k)M={value:k.value,secondValue:k.secondValue,min:k.min,max:k.max,step:k.step,pressed:k.pressed||!1,activeHandle:k.activeHandle||null},V=k.dragging||!1,W={...M};else if($.slider)M={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},W={...M};else M={...W};let F=M.value!==z.targetValue,N=M.secondValue!==z.targetSecondValue;if((F||N)&&!V){if(z.startValue=z.animatedValue,z.startSecondValue=z.animatedSecondValue,z.targetValue=M.value,z.targetSecondValue=M.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame);z.startTime=performance.now(),U()}else if(V){if(z.animatedValue=M.value,z.animatedSecondValue=M.secondValue,z.targetValue=M.value,z.targetSecondValue=M.secondValue,z.startValue=M.value,z.startSecondValue=M.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame),z.animationFrame=null;P1(q,{...J,size:G},k||M,$)}else P1(q,{...J,size:G},k||M,$)},_=()=>{if(!q)return;try{let k=nQ(Q,{...J,size:G});$.ctx=k.ctx,Object.assign(q,k),Y()}catch(k){console.warn("Slider canvas resize failed:",k)}};j=t7($.element,Q,_);let H=()=>Y();K=x8(J.color||"primary",H),requestAnimationFrame(()=>{X()}),$.drawCanvas=X,$.resize=_,$.setSize=(k)=>{if(G=k,q)tQ(Q,q,{...J,size:G}),Y();eQ($,G)},$.getSize=()=>G;let B=$.appearance?.setColor;if(B)$.appearance.setColor=(k)=>{if(B(k),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(k&&k!=="primary")$.element.classList.add(`${$.getClass("slider")}--${k}`);if(J.color=k,K)K(),K=null;K=x8(k,H),X()};if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(K)K();if(z.animationFrame)cancelAnimationFrame(z.animationFrame);k()}}return $};var $Z=(J)=>($)=>{return{...$,element:$.element,setValue(Q,Z=!0){return J.slider.setValue(Q,Z),this},getValue(){return J.slider.getValue()},setSecondValue(Q,Z=!0){return J.slider.setSecondValue(Q,Z),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();function JZ(J,$){let Q=(z)=>J.getClass(z),Z=$.min||0,q=$.max||100,j=$.value!==void 0?$.value:Z,K=$.disabled===!0,G=$.valueFormatter||((z)=>z.toString()),W=(j-Z)/(q-Z)*100;return{element:{options:{className:[Q("slider"),$.class].filter(Boolean),attributes:{tabindex:"-1",role:"none","aria-disabled":K?"true":"false"}},children:{container:{options:{className:Q("slider-container"),style:{position:"relative"}},children:{handle:{options:{className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Z),"aria-valuemax":String(q),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(j),"data-handle-index":"0"},style:{left:`${W}%`}}},valueBubble:{options:{className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:G(j),style:{left:`${W}%`}}}}}}}}}var Ij={min:V6.MIN,max:V6.MAX,value:V6.VALUE,step:V6.STEP,disabled:V6.DISABLED,color:V6.COLOR,size:V6.SIZE,ticks:V6.TICKS,showValue:V6.SHOW_VALUE,snapToSteps:V6.SNAP_TO_STEPS,range:V6.RANGE,centered:V6.CENTERED,iconPosition:V6.ICON_POSITION,labelPosition:V6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},QZ=(J={})=>{let $=u(Ij,J,"slider"),Q={componentName:"slider",config:$,getClass:(Z)=>{return`${$.prefix||"mtrl"}-${Z}`}};return $.schema=JZ(Q,$),$};var ZZ=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Sj=(J={})=>{let $=QZ(J);try{let Q=b(S,d(),P7($),f8($),R7($),L1($),A7(),w1($),D1($),O1($),C())($),Z=ZZ(Q),q=$Z(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")q.on(j,K)});return q}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},qZ=Sj;J6();c();var jZ=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},KZ=(J)=>($)=>{let Q=null,Z=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},q=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(q(),j)j.call($.lifecycle)};return{...$,timer:{start:Z,stop:q}}};var x1={BASIC:"basic",ACTION:"action"},q9={CENTER:"center",START:"start",END:"end"},GZ={VISIBLE:"visible",HIDDEN:"hidden"},zZ={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},e9={VARIANT:x1.BASIC,POSITION:q9.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},WZ={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var YZ=(J)=>($)=>{let Q=J.position||q9.CENTER,Z=J.prefix||"mtrl",q=`${Z}-snackbar--${Q}`;$.element.classList.add(q);let j=(K)=>{$.element.classList.remove(q);let G=`${Z}-snackbar--${K}`;if($.element.classList.add(G),$.element.classList.contains(`${Z}-snackbar--visible`))if(K===q9.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(K)=>{if(Object.values(q9).includes(K))return j(K),$;else return console.warn(`Invalid position: ${K}. Using default: ${q9.CENTER}`),j(q9.CENTER),$}}}};o();var UZ=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let Z=!1,q={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:Z?"visible":"hidden",show(){if(Z)return this;return Z=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!Z)return this;if(Z=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(K)=>{if(K.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,K){return Q.on?.(j,K),this},off(j,K){return Q.off?.(j,K),this},destroy(){if(Z&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(Z)q.hide()};Q.on("dismiss",j);let K=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),K?.call(J)}}return q};var XZ=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let Z=J[0],q=()=>{if(J.shift(),Z.off?.("dismiss",q),J.length===0)$=!1;else setTimeout(Q,200)};Z.on?.("dismiss",q),Z._show()};return{add(Z){if(!Z._show)throw new Error("Snackbar must implement _show method");if(J.push(Z),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};t();var bj={variant:e9.VARIANT,position:e9.POSITION,duration:e9.DURATION},BZ=(J)=>u(bj,J,"snackbar"),FZ=(J)=>p(J,{tag:"div",className:J.class}),HZ=(J)=>({...J,text:J.message}),MZ=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var vj=XZ(),Cj=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=BZ(J);try{return b(S,d(),h(FZ($)),K6($),YZ($),Y9(HZ($)),jZ($),C(),KZ($),(Z)=>UZ(MZ(Z,vj))(Z))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},kZ=Cj;J6();c();o();var NZ=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},supportingTextElement:Z.supportingTextElement||null,setSupportingText(q,j){if(Z.setSupportingText)Z.setSupportingText(q,j);return this},removeSupportingText(){if(Z.removeSupportingText)Z.removeSupportingText();return this},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});o();var VZ=(J,$,Q)=>{let Z=$||"mtrl",q=Q||"switch",j=J.element.querySelector(`.${Z}-${q}-container`);if(!j){j=document.createElement("div"),j.className=`${Z}-${q}-container`;let G=J.element.querySelector(`.${Z}-${q}-input`),W=J.element.querySelector(`.${Z}-${q}-track`),z=[];if(G)z.push(G);if(W)z.push(W);let Y=document.createElement("div");Y.className=`${Z}-${q}-content`;let U=J.element.querySelector(`.${Z}-${q}-label`);if(U)Y.appendChild(U);return j.appendChild(Y),z.forEach((X)=>j.appendChild(X)),J.element.appendChild(j),{container:j,contentWrapper:Y}}let K=J.element.querySelector(`.${Z}-${q}-content`);if(!K){K=document.createElement("div"),K.className=`${Z}-${q}-content`;let G=J.element.querySelector(`.${Z}-${q}-label`);if(G)K.appendChild(G);j.insertBefore(K,j.firstChild)}return{container:j,contentWrapper:K}},y1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"switch",{contentWrapper:q}=VZ($,Q,Z),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${Z}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${Z}-helper--error`),$.element.classList.add(`${Q}-${Z}--error`);q.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();K.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(K,G=!1){let{contentWrapper:W}=VZ($,Q,Z),z=this.supportingTextElement;if(!z)z=document.createElement("div"),z.className=`${Q}-${Z}-helper`,W.appendChild(z),this.supportingTextElement=z;return z.textContent=K,z.classList.toggle(`${Q}-${Z}-helper--error`,G),$.element.classList.toggle(`${Q}-${Z}--error`,G),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${Z}--error`);return this}}},_Z=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return l7(Q)($)};t();var Ej={prefix:"mtrl",componentName:"switch"},LZ=(J={})=>u(Ej,J,"switch"),DZ=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),OZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var hj=(J={})=>{let $=LZ(J);try{return b(S,d(),h(DZ($)),X9($),u9($),_Z($),y1($),f9($),G6($),C(),(Z)=>NZ(OZ(Z))(Z))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},PZ=hj;var T1={START:"start",END:"end"},RZ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},AZ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},wZ={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:T1.END,VALUE:"on"},xZ={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};J6();c();o();J6();c();o();var P$={PRIMARY:"primary",SECONDARY:"secondary"},I7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},I1={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},yZ={CLICK:"click",FOCUS:"focus",BLUR:"blur"},S1={CHANGE:"change"},v9={VARIANT:P$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:I1.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},$7={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},TZ={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},IZ={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};t();c();var uj={state:I7.INACTIVE,componentName:"tab",ripple:v9.RIPPLE},fj={variant:v9.VARIANT,scrollable:v9.SCROLLABLE,showDivider:v9.SHOW_DIVIDER,componentName:"tabs"},SZ=(J={})=>u(fj,J,"tabs"),bZ=(J={})=>u(uj,J,"tab"),vZ=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>h($)(Q)};T9();K7();var S7=(J={})=>{let $=bZ(J);try{let Q=b(S,d(),C())($),Z=Q9({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=Z.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);Z.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let q={...Q,button:Z,element:Z.element,badge:null,getValue(){return Z.getValue()},setValue(j){let K=j||"";return Z.setValue(K),this.element.setAttribute("id",`tab-${K}`),this.element.setAttribute("aria-controls",`tabpanel-${K}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return Z.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return Z.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return Z.setText(j),this.updateLayoutStyle(),this},getText(){return Z.getText()},setIcon(j){return Z.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return Z.getIcon()},setBadge(j){if(!this.badge){let K={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=j7(K)}else this.badge.setContent(j),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(Z.destroy)Z.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),K=!!this.getIcon(),G="";if(j&&K)G=$7.ICON_AND_TEXT;else if(K)G=$7.ICON_ONLY;else G=$7.TEXT_ONLY;if(Object.values($7).forEach((W)=>{this.element.classList.remove(`${this.getClass("tab")}--${W}`)}),this.element.classList.add(`${this.getClass("tab")}--${G}`),G===$7.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)q.setBadge($.badge);return q.updateLayoutStyle(),q}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var CZ=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let Z={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(Z.value===void 0)Z.value="";let q=S7(Z);if($.tabs.push(q),$.tabsContainer.appendChild(q.element),q.on&&typeof q.on==="function")q.on("click",(K)=>$.handleTabClick(K,q));return q.element.addEventListener("click",(K)=>{$.handleTabClick(K,q)}),q},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(q)=>$.handleTabClick(q,Q));return Q.element.addEventListener("click",(q)=>{$.handleTabClick(q,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let Z=typeof Q==="string"?$.tabs.find((q)=>q.getValue()===Q):Q;if(!Z)return this;if($.tabs.forEach((q)=>q.deactivate()),Z.activate(),$.emit)$.emit("change",{tab:Z,value:Z.getValue()});return this},removeTab(Q){let Z=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!Z)return this;let q=$.tabs.indexOf(Z);if(q!==-1)$.tabs.splice(q,1);if(Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);return Z.destroy(),this},on(Q,Z){if($.on)$.on(Q,Z);return this},off(Q,Z){if($.off)$.off(Q,Z);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),EZ=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function hZ(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function b1(J){let $=hZ(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((q)=>{if(q.getAttribute("aria-labelledby")?.replace("tab-","")===Q)q.removeAttribute("hidden"),q.setAttribute("tabindex","0");else q.setAttribute("hidden","true"),q.setAttribute("tabindex","-1")})}function v1(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),Z=hZ(J),q=Z?Q.indexOf(Z):-1,j=q;switch($.key){case"ArrowRight":case"ArrowDown":j=q<Q.length-1?q+1:0;break;case"ArrowLeft":case"ArrowUp":j=q>0?q-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==q&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var gj={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},C1=(J={})=>{let $={...gj,...J},Q=$.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-tabs-indicator`,Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
31
+ width ${$.animationDuration}ms ${$.animationTiming}`,Z.style.width=`${$.fixedWidth}px`,!$.visible)Z.style.opacity="0";let q=null,j=(H)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return H.element.offsetWidth;let B=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(B)return B.clientWidth;return Math.max(H.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(H.element.offsetWidth/2,30);case"content":let B=H.element.querySelector(`.${Q}-button-text`)||H.element.querySelector(`.${Q}-tab-text`);if(B)return Math.max(B.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},K=(H)=>{let B=H.parentElement;if(!B)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:H.offsetWidth};let k=H.getBoundingClientRect(),M=B.getBoundingClientRect();return{left:k.left-M.left,width:k.width}},G=(H,B)=>{let{left:k,width:M}=K(H.element);if($.variant!=="secondary"&&($.widthStrategy==="auto"||$.widthStrategy==="content")){let V=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(V){let F=V.getBoundingClientRect(),N=H.element.getBoundingClientRect(),O=F.left-N.left;return{left:k+O}}}if(B<M)return{left:k+(M-B)/2};return{left:k}},W=(H,B=!1)=>{if(!H||!H.element){console.error("Invalid tab or tab has no element");return}q=H;let k=j(H),{left:M}=G(H,k);if(B)Z.style.transition="none",Z.offsetHeight;if(Z.style.width=`${k}px`,Z.style.transform=`translateX(${M}px)`,B)setTimeout(()=>{Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
32
+ width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:Z,moveToTab:W,show:()=>{Z.style.opacity="1"},hide:()=>{Z.style.opacity="0"},setColor:(H)=>{Z.style.backgroundColor=H},update:()=>{if(q)W(q,!0)},destroy:()=>{if(Z.parentNode)Z.parentNode.removeChild(Z);q=null}}};var E1=(J)=>($)=>{let Q=[],Z=$.scrollContainer||$.element;if(Array.isArray(J.tabs))J.tabs.forEach((G)=>{let W={...G,prefix:J.prefix,variant:G.variant||J.variant},z=S7(W);Q.push(z),Z.appendChild(z.element)});let q=()=>{return[...Q]},j=()=>{return Q.find((G)=>G.isActive())||null},K=(G,W)=>{if(G&&typeof G.preventDefault==="function")G.preventDefault();if(W.disabled&&W.disabled.isDisabled&&W.disabled.isDisabled())return;Q.forEach((Y)=>Y.deactivate()),W.activate();let z=W.getValue();if(b1({tabs:Q,getActiveTab:()=>Q.find((Y)=>Y.isActive())||null}),typeof $.emit==="function")$.emit("change",{tab:W,value:z})};return Q.forEach((G)=>{if(G.on&&typeof G.on==="function")G.on("click",(W)=>K(W,G));G.element.addEventListener("click",(W)=>K(W,G))}),{...$,tabs:Q,tabsContainer:Z,handleTabClick:K,getTabs:q,getActiveTab:j}},h1=(J)=>($)=>{if(J.scrollable===!1)return $;$.element.classList.add(`${$.getClass("tabs")}--scrollable`);let Q=document.createElement("div");Q.className=`${$.getClass("tabs")}-scroll`;while($.element.firstChild)Q.appendChild($.element.firstChild);return $.element.appendChild(Q),{...$,scrollContainer:Q}},u1=(J)=>($)=>{if(J.showDivider===!1)return $;let Q=document.createElement("div");return Q.className=`${$.getClass("tabs")}-divider`,$.element.appendChild(Q),$},f1=(J)=>($)=>{let Q=J.indicator||{},Z=C1({prefix:J.prefix,widthStrategy:Q.widthStrategy||J.indicatorWidthStrategy||"auto",height:Q.height||J.indicatorHeight||3,fixedWidth:Q.fixedWidth||40,animationDuration:Q.animationDuration||250,animationTiming:Q.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:Q.color,variant:J.variant??"primary"}),q=$.scrollContainer||$.element;if(!q)throw console.error("No scroll container found - cannot add indicator"),new Error("Failed to create tabs: No scroll container found");q.appendChild(Z.element);let j=$.handleTabClick;$.handleTabClick=function(Y,U){if(U.disabled&&U.disabled.isDisabled&&U.disabled.isDisabled())return;j.call(this,Y,U),setTimeout(()=>{Z.moveToTab(U)},10)},setTimeout(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)},50);let K=()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)};if(q)q.addEventListener("scroll",K);let G=new ResizeObserver(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)});G.observe(q);let W=new MutationObserver((Y)=>{for(let U of Y)if(U.type==="attributes"&&U.attributeName==="class"&&U.target.classList.contains(`${J.prefix}-tab--active`)){let X=U.target,_=$.tabs.find((H)=>H.element===X);if(_)Z.moveToTab(_)}});if(Array.isArray($.tabs))$.tabs.forEach((Y)=>{if(Y.element)W.observe(Y.element,{attributes:!0})});let z=$.destroy||(()=>{});return $.destroy=function(){if(Z.destroy(),G.disconnect(),W.disconnect(),q)q.removeEventListener("scroll",K);if(typeof z==="function")z.call(this)},{...$,indicator:Z,getIndicator:()=>Z}};var dj=(J)=>{let{tabs:$=[],onChange:Q,indicator:Z}=J,q=null,j=$.find((Y)=>Y.isActive());if(j){if(q=j,Z)setTimeout(()=>{Z.moveToTab(j,!0)},50)}let K=(Y)=>{if(!Y.element)return;let U=Y.element.querySelector(`.${Y.getClass("tab")}-ripple`);if(!U)return;let X=document.createElement("span");X.className="ripple",X.style.width="100%",X.style.height="100%",X.style.left="0",X.style.top="0",X.style.animation="ripple-effect 0.4s cubic-bezier(0.4, 0, 0.2, 1)",U.appendChild(X),setTimeout(()=>{X.remove()},400)};return{activateTab:(Y,U=!1)=>{if(!Y||q===Y)return;if(q)q.deactivate();if(Y.activate(),q=Y,Z)setTimeout(()=>{Z.moveToTab(Y,U)},10);if(!U)K(Y);if(Q)Q({tab:Y,value:Y.getValue()})},getActiveTab:()=>{return q},destroy:()=>{q=null}}},uZ=()=>{if(document.getElementById("tab-state-styles"))return;let J=document.createElement("style");J.id="tab-state-styles",J.textContent=`
33
33
  @keyframes ripple-effect {
34
34
  0% {
35
35
  transform: scale(0);
@@ -40,7 +40,7 @@ var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enum
40
40
  opacity: 0;
41
41
  }
42
42
  }
43
- `,document.head.appendChild(J)};var lj=(J={})=>{let $=SZ(J);uZ();try{let Q=b(S,d(),vZ($),h1($),E1($),u1($),f1($),C(),(Z)=>CZ(EZ(Z))(Z))($);return v1(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},fZ=lj;var rj=(J,$={})=>{let{enabled:Q=!0,showButtons:Z=!1,appearance:q="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let G=document.createElement("div");G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`);let K=document.createElement("div");if(K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`),J.element.appendChild(G),J.element.appendChild(K),Z){let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,U.setAttribute("aria-label","Scroll tabs left"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,X.setAttribute("aria-label","Scroll tabs right"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(U),J.element.appendChild(X),U.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),X.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let z=()=>{let{scrollLeft:U,scrollWidth:X,clientWidth:_}=j;if(G.classList.toggle("visible",U>0),K.classList.toggle("visible",U+_<X-1),Z){let H=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),B=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(H)H.disabled=U<=0;if(B)B.disabled=U+_>=X-1}};z(),j.addEventListener("scroll",z);let W=new ResizeObserver(z);W.observe(j);let Y=J.destroy;J.destroy=function(){if(W)W.disconnect();if(j.removeEventListener("scroll",z),G.parentNode)G.parentNode.removeChild(G);if(K.parentNode)K.parentNode.removeChild(K);if(Z){let U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(U&&U.parentNode)U.parentNode.removeChild(U);if(X&&X.parentNode)X.parentNode.removeChild(X)}Y.call(this)}};var g1={SMALL:600,MEDIUM:904,LARGE:1240},pj=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||g1.SMALL,medium:$.breakpoints?.medium||g1.MEDIUM,large:$.breakpoints?.large||g1.LARGE},Z={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},q=new Map,j=J.getTabs();j.forEach((W)=>{let Y="text-only";if(W.getIcon()&&W.getText())Y="icon-and-text";else if(W.getIcon())Y="icon-only";q.set(W,Y)});let G=()=>{if(window.innerWidth<Q.small)j.forEach((Y)=>{if(Z.layout==="icon-only"&&!Y.getIcon())return;if(Z.layout==="icon-only"&&Y.getIcon())Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.add(`${Y.getClass("tab")}--icon-only`);else if(Z.layout==="text-only")Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.add(`${Y.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((Y)=>{let U=q.get(Y)||"text-only";Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.add(`${Y.getClass("tab")}--${U}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};G();let K=new ResizeObserver(G);K.observe(document.body),J._resizeObserver=K;let z=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();z.call(this)}};var sj=fZ;J6();c();o();var gZ=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(Z){return Q.setValue?.(Z),this},setAttribute(Z,q){return Q.setAttribute?.(Z,q),this},getAttribute(Z){return Q.getAttribute?.(Z)||null},removeAttribute(Z){return Q.removeAttribute?.(Z),this},setVariant(Z){let q=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${q}-${j}--filled`,`${q}-${j}--outlined`),Q.element.classList.add(`${q}-${j}--${Z}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let Z=Q.config?.prefix||"mtrl",q=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${Z}-${q}--outlined`))return"outlined";return"filled"},setLabel(Z){if(Q.label?.setText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(Z){if(Q.setLeadingIcon){if(Q.setLeadingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(Z){if(Q.setTrailingIcon){if(Q.setTrailingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(Z,q){if(Q.setSupportingText)Q.setSupportingText(Z,q);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(Z){if(Q.setPrefixText){if(Q.setPrefixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(Z){if(Q.setSuffixText){if(Q.setSuffixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.updateElementPositions)Q.updateElementPositions();return this},setDensity(Z){if(Q.density?.set)Q.density.set(Z);return this},getDensity(){return Q.density?.current||"default"},on(Z,q){return Q.on?.(Z,q),this},off(Z,q){return Q.off?.(Z,q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var d1=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,Z.innerHTML=J.leadingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return setTimeout(()=>{let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))q.style.left="44px"}},10),{...$,leadingIcon:Z,setLeadingIcon(q){return Z.innerHTML=q,this},removeLeadingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left=""}this.leadingIcon=null}return this}}};var l1=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,Z.innerHTML=J.trailingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,trailingIcon:Z,setTrailingIcon(q){return Z.innerHTML=q,this},removeTrailingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var r1=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-prefix`,Z.textContent=J.prefixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,prefixTextElement:Z,setPrefixText(q){return Z.textContent=q,this},removePrefixText(){if(Z.parentNode){Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left="";this.prefixTextElement=null}return this}}};var p1=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-suffix`,Z.textContent=J.suffixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,suffixTextElement:Z,setSuffixText(q){return Z.textContent=q,this},removeSuffixText(){if(Z.parentNode)Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var s1=(J)=>($)=>{if(!J.supportingText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-${J.componentName||"textfield"}-helper`,Z.textContent=J.supportingText,J.error)Z.classList.add(`${Q}-${J.componentName||"textfield"}-helper--error`),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--error`);if($.element.appendChild(Z),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(q,j=!1){return Z.textContent=q,Z.classList.toggle(`${Q}-${J.componentName||"textfield"}-helper--error`,j),$.element.classList.toggle(`${Q}-${J.componentName||"textfield"}--error`,j),this},removeSupportingText(){if(Z.parentNode)Z.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--error`);return this}}};j8();var m1=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",Z=new WeakMap,q=new WeakMap,j=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),W=J.element.querySelector(`.${$}-${Q}-prefix`),Y=J.element.querySelector(`.${$}-${Q}-suffix`),U=J.element.classList.contains(`${$}-${Q}--outlined`),X=J.element.classList.contains(`${$}-${Q}--focused`),_=J.element.classList.contains(`${$}-${Q}--empty`),H=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(U&&z){let{color:B,element:M}=w9(J.element);if(X||!_){if(z.style.backgroundColor=B,z.style.paddingLeft="4px",z.style.paddingRight="4px",M&&!Z.has(J.element)){let k=new MutationObserver(()=>{let{color:V}=w9(J.element);z.style.backgroundColor=V});k.observe(M,{attributes:!0,attributeFilter:["style","class"]}),Z.set(J.element,k);let N=M.parentElement,F=[];while(N&&N!==document.documentElement){let V=new MutationObserver(()=>{let{color:O}=w9(J.element);z.style.backgroundColor=O});V.observe(N,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),F.push(V),N=N.parentElement}if(F.length)q.set(J.element,F)}if(!j.has(J.element)){let k=()=>{let{color:N}=w9(J.element);if(X||!_)z.style.backgroundColor=N};document.addEventListener("themechange",k),j.set(J.element,k)}}else z.style.backgroundColor="",z.style.padding=""}if(W&&J.input){let M=W.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${M}px`,z){let k=M;if(H)k=Math.max(k,44);if(!X&&_)z.style.left=`${k}px`;else z.style.left="12px"}}else if(H&&z){if(U)if(!X&&_)z.style.left="44px";else z.style.left="12px"}if(Y&&J.input){let M=Y.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${M}px`}return J},K=()=>{if(J.input){if(J.input.addEventListener("focus",()=>{J.element.classList.add(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("blur",()=>{J.element.classList.remove(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("input",()=>{let W=!J.input.value;J.element.classList.toggle(`${$}-${Q}--empty`,W),setTimeout(G,10)}),!J.input.value)J.element.classList.add(`${$}-${Q}--empty`)}window.addEventListener("resize",G),new MutationObserver(()=>{if(J.element.isConnected)G()}).observe(document.body,{childList:!0,subtree:!0})};if(setTimeout(()=>{K(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let W=Z.get(J.element);if(W)W.disconnect(),Z.delete(J.element);let Y=q.get(J.element);if(Y)Y.forEach((X)=>X.disconnect()),q.delete(J.element);let U=j.get(J.element);if(U)document.removeEventListener("themechange",U),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var a1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"textfield",q=J.density||"default";if(q!=="default")$.element.classList.add(`${Q}-${Z}--density-${q}`);if($.element.setAttribute("data-density",q),$.input)j($.input,q);function j(K,z){K.setAttribute("data-density",z)}let G=(K)=>{if(["default","compact"].forEach((z)=>{$.element.classList.remove(`${Q}-${Z}--density-${z}`)}),K!=="default")$.element.classList.add(`${Q}-${Z}--density-${K}`);if($.element.setAttribute("data-density",K),$.input)$.input.setAttribute("data-density",K);if($.density)$.density.current=K;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:q,set:G},$};t();var R$={FILLED:"filled",OUTLINED:"outlined"},dZ={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},c1={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},lZ={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},rZ={DEFAULT:"default",COMPACT:"compact"},b7={TYPE:c1.TEXT,VARIANT:R$.FILLED,DENSITY:rZ.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},pZ={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var mj={type:b7.TYPE,variant:b7.VARIANT},sZ=(J={})=>u(mj,J,"textfield"),mZ=(J)=>p(J,{tag:"div",className:J.class}),aZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var aj=(J={})=>{let $=sZ(J);try{return b(S,d(),h(mZ($)),K6($),a1($),d7($),X9($),d1($),l1($),r1($),p1($),s1($),G6($),C(),m1(),(Z)=>gZ(aZ(Z))(Z))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},A$=aj;w6();J6();c();o();var v7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(v7||={});var w$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(w$||={});var J7;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(J7||={});var Q7;((Q)=>{Q.AM="AM";Q.PM="PM"})(Q7||={});t();var i1={DIAL:"dial",INPUT:"input"},o1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},t1={AMPM:"12h",MILITARY:"24h"},cZ={AM:"AM",PM:"PM"},L6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},j9={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},iZ={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},C7={MODAL:1050,DIALOG:1051},Q6={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},l6={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
43
+ `,document.head.appendChild(J)};var lj=(J={})=>{let $=SZ(J);uZ();try{let Q=b(S,d(),vZ($),h1($),E1($),u1($),f1($),C(),(Z)=>CZ(EZ(Z))(Z))($);return v1(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},fZ=lj;var rj=(J,$={})=>{let{enabled:Q=!0,showButtons:Z=!1,appearance:q="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let K=document.createElement("div");K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`);let G=document.createElement("div");if(G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`),J.element.appendChild(K),J.element.appendChild(G),Z){let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,U.setAttribute("aria-label","Scroll tabs left"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,X.setAttribute("aria-label","Scroll tabs right"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(U),J.element.appendChild(X),U.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),X.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let W=()=>{let{scrollLeft:U,scrollWidth:X,clientWidth:_}=j;if(K.classList.toggle("visible",U>0),G.classList.toggle("visible",U+_<X-1),Z){let H=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),B=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(H)H.disabled=U<=0;if(B)B.disabled=U+_>=X-1}};W(),j.addEventListener("scroll",W);let z=new ResizeObserver(W);z.observe(j);let Y=J.destroy;J.destroy=function(){if(z)z.disconnect();if(j.removeEventListener("scroll",W),K.parentNode)K.parentNode.removeChild(K);if(G.parentNode)G.parentNode.removeChild(G);if(Z){let U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(U&&U.parentNode)U.parentNode.removeChild(U);if(X&&X.parentNode)X.parentNode.removeChild(X)}Y.call(this)}};var g1={SMALL:600,MEDIUM:904,LARGE:1240},pj=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||g1.SMALL,medium:$.breakpoints?.medium||g1.MEDIUM,large:$.breakpoints?.large||g1.LARGE},Z={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},q=new Map,j=J.getTabs();j.forEach((z)=>{let Y="text-only";if(z.getIcon()&&z.getText())Y="icon-and-text";else if(z.getIcon())Y="icon-only";q.set(z,Y)});let K=()=>{if(window.innerWidth<Q.small)j.forEach((Y)=>{if(Z.layout==="icon-only"&&!Y.getIcon())return;if(Z.layout==="icon-only"&&Y.getIcon())Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.add(`${Y.getClass("tab")}--icon-only`);else if(Z.layout==="text-only")Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.add(`${Y.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((Y)=>{let U=q.get(Y)||"text-only";Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.add(`${Y.getClass("tab")}--${U}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};K();let G=new ResizeObserver(K);G.observe(document.body),J._resizeObserver=G;let W=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();W.call(this)}};var sj=fZ;J6();c();o();var gZ=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(Z){return Q.setValue?.(Z),this},setAttribute(Z,q){return Q.setAttribute?.(Z,q),this},getAttribute(Z){return Q.getAttribute?.(Z)||null},removeAttribute(Z){return Q.removeAttribute?.(Z),this},setVariant(Z){let q=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${q}-${j}--filled`,`${q}-${j}--outlined`),Q.element.classList.add(`${q}-${j}--${Z}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let Z=Q.config?.prefix||"mtrl",q=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${Z}-${q}--outlined`))return"outlined";return"filled"},setLabel(Z){if(Q.label?.setText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(Z){if(Q.setLeadingIcon){if(Q.setLeadingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(Z){if(Q.setTrailingIcon){if(Q.setTrailingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(Z,q){if(Q.setSupportingText)Q.setSupportingText(Z,q);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(Z){if(Q.setPrefixText){if(Q.setPrefixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(Z){if(Q.setSuffixText){if(Q.setSuffixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.input&&Q.element){let Z=Q.input.value&&Q.input.value.length>0,q=Q.input.matches?.(":-webkit-autofill")||!1;if(Z||q)Q.element.classList.remove(`${Q.config?.prefix||"mtrl"}-textfield--empty`);else Q.element.classList.add(`${Q.config?.prefix||"mtrl"}-textfield--empty`)}if(Q.updateElementPositions)Q.updateElementPositions();return this},setDensity(Z){if(Q.density?.set)Q.density.set(Z);return this},getDensity(){return Q.density?.current||"default"},on(Z,q){return Q.on?.(Z,q),this},off(Z,q){return Q.off?.(Z,q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var d1=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,Z.innerHTML=J.leadingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return setTimeout(()=>{let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))q.style.left="44px"}},10),{...$,leadingIcon:Z,setLeadingIcon(q){return Z.innerHTML=q,this},removeLeadingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left=""}this.leadingIcon=null}return this}}};var l1=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,Z.innerHTML=J.trailingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,trailingIcon:Z,setTrailingIcon(q){return Z.innerHTML=q,this},removeTrailingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var r1=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-prefix`,Z.textContent=J.prefixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,prefixTextElement:Z,setPrefixText(q){return Z.textContent=q,this},removePrefixText(){if(Z.parentNode){Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left="";this.prefixTextElement=null}return this}}};var p1=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-suffix`,Z.textContent=J.suffixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,suffixTextElement:Z,setSuffixText(q){return Z.textContent=q,this},removeSuffixText(){if(Z.parentNode)Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var s1=(J)=>($)=>{if(!J.supportingText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-${J.componentName||"textfield"}-helper`,Z.textContent=J.supportingText,J.error)Z.classList.add(`${Q}-${J.componentName||"textfield"}-helper--error`),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--error`);if($.element.appendChild(Z),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(q,j=!1){return Z.textContent=q,Z.classList.toggle(`${Q}-${J.componentName||"textfield"}-helper--error`,j),$.element.classList.toggle(`${Q}-${J.componentName||"textfield"}--error`,j),this},removeSupportingText(){if(Z.parentNode)Z.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--error`);return this}}};j8();var m1=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",Z=new WeakMap,q=new WeakMap,j=new WeakMap,K=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),Y=J.element.querySelector(`.${$}-${Q}-prefix`),U=J.element.querySelector(`.${$}-${Q}-suffix`),X=J.element.classList.contains(`${$}-${Q}--outlined`),_=J.element.classList.contains(`${$}-${Q}--focused`),H=J.element.classList.contains(`${$}-${Q}--empty`),B=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(X&&z){let{color:k,element:M}=w9(J.element);if(_||!H){if(z.style.backgroundColor=k,z.style.paddingLeft="4px",z.style.paddingRight="4px",M&&!Z.has(J.element)){let V=new MutationObserver(()=>{let{color:O}=w9(J.element);z.style.backgroundColor=O});V.observe(M,{attributes:!0,attributeFilter:["style","class"]}),Z.set(J.element,V);let F=M.parentElement,N=[];while(F&&F!==document.documentElement){let O=new MutationObserver(()=>{let{color:P}=w9(J.element);z.style.backgroundColor=P});O.observe(F,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),N.push(O),F=F.parentElement}if(N.length)q.set(J.element,N)}if(!j.has(J.element)){let V=()=>{let{color:F}=w9(J.element);if(_||!H)z.style.backgroundColor=F};document.addEventListener("themechange",V),j.set(J.element,V)}}else z.style.backgroundColor="",z.style.padding=""}if(Y&&J.input){let M=Y.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${M}px`,z){let V=M;if(B)V=Math.max(V,44);if(!_&&H)z.style.left=`${V}px`;else z.style.left="12px"}}else if(B&&z){if(X)if(!_&&H)z.style.left="44px";else z.style.left="12px"}if(U&&J.input){let M=U.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${M}px`}return J},W=()=>{let z=new MutationObserver((Y)=>{Y.forEach((U)=>{if(U.type==="attributes"&&U.attributeName==="class")setTimeout(G,10)})});z.observe(J.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",G),K.set(J.element,z)};if(setTimeout(()=>{W(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let Y=K.get(J.element);if(Y)Y.disconnect(),K.delete(J.element);let U=Z.get(J.element);if(U)U.disconnect(),Z.delete(J.element);let X=q.get(J.element);if(X)X.forEach((H)=>H.disconnect()),q.delete(J.element);let _=j.get(J.element);if(_)document.removeEventListener("themechange",_),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var a1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"textfield",q=J.density||"default";if(q!=="default")$.element.classList.add(`${Q}-${Z}--density-${q}`);if($.element.setAttribute("data-density",q),$.input)j($.input,q);function j(G,W){G.setAttribute("data-density",W)}let K=(G)=>{if(["default","compact"].forEach((W)=>{$.element.classList.remove(`${Q}-${Z}--density-${W}`)}),G!=="default")$.element.classList.add(`${Q}-${Z}--density-${G}`);if($.element.setAttribute("data-density",G),$.input)$.input.setAttribute("data-density",G);if($.density)$.density.current=G;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:q,set:K},$};t();var R$={FILLED:"filled",OUTLINED:"outlined"},dZ={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},c1={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},lZ={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},rZ={DEFAULT:"default",COMPACT:"compact"},b7={TYPE:c1.TEXT,VARIANT:R$.FILLED,DENSITY:rZ.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},pZ={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var mj={type:b7.TYPE,variant:b7.VARIANT},sZ=(J={})=>u(mj,J,"textfield"),mZ=(J)=>p(J,{tag:"div",className:J.class}),aZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var aj=(J={})=>{let $=sZ(J);try{return b(S,d(),h(mZ($)),K6($),a1($),d7($),X9($),d1($),l1($),r1($),p1($),s1($),G6($),C(),m1(),(Z)=>gZ(aZ(Z))(Z))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},A$=aj;w6();J6();c();o();var v7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(v7||={});var w$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(w$||={});var J7;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(J7||={});var Q7;((Q)=>{Q.AM="AM";Q.PM="PM"})(Q7||={});t();var i1={DIAL:"dial",INPUT:"input"},o1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},t1={AMPM:"12h",MILITARY:"24h"},cZ={AM:"AM",PM:"PM"},L6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},j9={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},iZ={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},C7={MODAL:1050,DIALOG:1051},Q6={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},l6={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
44
44
  <circle cx="12" cy="12" r="10"></circle>
45
45
  <polyline points="12 6 12 12 16 14"></polyline>
46
46
  </svg>`,KEYBOARD:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -54,11 +54,11 @@ var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enum
54
54
  <line x1="14" y1="12" x2="14" y2="12"></line>
55
55
  <line x1="18" y1="12" x2="18" y2="12"></line>
56
56
  <line x1="6" y1="16" x2="18" y2="16"></line>
57
- </svg>`},t6={TYPE:i1.DIAL,FORMAT:t1.AMPM,ORIENTATION:o1.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:l6.CLOCK,KEYBOARD_ICON:l6.KEYBOARD},oZ={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var cj={type:"dial",format:"12h",orientation:"vertical",showSeconds:t6.SHOW_SECONDS,closeOnSelect:t6.CLOSE_ON_SELECT,minuteStep:t6.MINUTE_STEP,secondStep:t6.SECOND_STEP,cancelText:t6.CANCEL_TEXT,confirmText:t6.CONFIRM_TEXT,isOpen:t6.IS_OPEN,clockIcon:l6.CLOCK,keyboardIcon:l6.KEYBOARD},tZ=(J={})=>u(cj,J,"time-picker"),nZ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var eZ=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var e=(J)=>{return J.toString().padStart(2,"0")},$2=(J,$)=>{try{let Q=J.split(":"),Z=parseInt(Q[0],10),q=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(Z)||Z<0||Z>23||isNaN(q)||q<0||q>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let G=Z>=12?"PM":"AM";return{hours:Z,minutes:q,seconds:j,period:G}}catch(Q){console.error("Error parsing time:",Q);let Z=new Date,q=Z.getHours(),j=Z.getMinutes(),G=Z.getSeconds(),K=q>=12?"PM":"AM";return{hours:q,minutes:j,seconds:G,period:K}}},J2=(J,$)=>{let{hours:Q,minutes:Z,seconds:q}=J;if($){if(q!==void 0)return`${e(Q)}:${e(Z)}:${e(q)}`;return`${e(Q)}:${e(Z)}`}else{let j=Q%12;if(j===0)j=12;if(q!==void 0)return`${e(j)}:${e(Z)}:${e(q)} ${J.period}`;return`${e(j)}:${e(Z)} ${J.period}`}};var Q2=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var q6={...j9,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function ij(J){let $=document.documentElement,Q=getComputedStyle($),Z=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",q=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",G=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",z=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,W=`rgba(${G}, 0.1)`;return{primaryColor:Z,onPrimaryColor:q,onSurfaceColor:j,bgColor:z,selectedBgColor:W}}var O6=(J,$,Q)=>{let Z=J.getContext("2d");if(!Z){console.error("Could not get canvas context");return}let q=ij(Q.prefix),j=window.devicePixelRatio||1;J.width=q6.DIAMETER*j,J.height=q6.DIAMETER*j,Z.scale(j,j);let G=q6.DIAMETER/2,K=q6.DIAMETER/2,z=q6.DIAMETER/2;if(Z.clearRect(0,0,J.width,J.height),Z.beginPath(),Z.arc(G,K,z-2,0,2*Math.PI),Z.fillStyle=q.bgColor,Z.fill(),Z.beginPath(),Z.arc(G,K,q6.CENTER_SIZE/2,0,2*Math.PI),Z.fillStyle=q.primaryColor,Z.fill(),Q.activeSelector==="hour")if(Q.format==="24h")tj(Z,G,K,z,$.hours,q);else oj(Z,G,K,z,$.hours%12||12,q);else if(Q.activeSelector==="minute")Z2(Z,G,K,z,$.minutes,q);else if(Q.activeSelector==="second"&&Q.showSeconds)Z2(Z,G,K,z,$.seconds||0,q);nj(Z,G,K,$,Q,q)},oj=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let K=1;K<=12;K++){let z=K/6*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(K.toString(),W,Y+2)}},tj=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let z=1;z<=12;z++){let W=z/6*Math.PI-Math.PI/2,Y=$+G*Math.cos(W),U=Q+G*Math.sin(W),X=z===q;if(X)J.beginPath(),J.arc(Y,U,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(z.toString(),Y,U+2)}let K=q6.INNER_RADIUS;for(let z=13;z<=24;z++){let W=z===24?0:z,Y=(z-12)/6*Math.PI-Math.PI/2,U=$+K*Math.cos(Y),X=Q+K*Math.sin(Y),_=W===q;if(_)J.beginPath(),J.arc(U,X,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(W),U,X+2)}},Z2=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let K=0;K<60;K+=5){let z=K/30*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(K),W,Y)}if(q%5!==0){let K=q/30*Math.PI-Math.PI/2,z=$+G*Math.cos(K),W=Q+G*Math.sin(K);J.beginPath(),J.arc(z,W,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(q),z,W)}},nj=(J,$,Q,Z,q,j)=>{let G,K;if(q.activeSelector==="hour")if(q.format==="24h")if(Z.hours>=12)G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=q6.INNER_RADIUS;else{let U=Z.hours;if(U===0)U=12;G=U/6*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS}else G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else if(q.activeSelector==="minute")G=Z.minutes/30*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else if(q.activeSelector==="second")G=(Z.seconds||0)/30*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+K*Math.cos(G),Q+K*Math.sin(G)),J.lineWidth=q6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let z=$+K*Math.cos(G),W=Q+K*Math.sin(G);J.beginPath(),J.arc(z,W,q6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let Y="";if(q.activeSelector==="hour")if(q.format==="24h")Y=e(Z.hours);else Y=String(Z.hours%12||12);else if(q.activeSelector==="minute")Y=e(Z.minutes);else if(q.activeSelector==="second")Y=e(Z.seconds||0);J.fillText(Y,z,W)},x$=(J,$,Q,Z)=>{let q=q6.DIAMETER/2,j=q6.DIAMETER/2,G=$-q,K=Q-j,z=Math.sqrt(G*G+K*K),W=Math.atan2(K,G)+Math.PI/2;if(W<0)W+=2*Math.PI;if(Z.activeSelector==="hour")if(Z.format==="24h"){let Y=(q6.INNER_RADIUS+q6.OUTER_RADIUS)/2,U=z<Y,X=Math.round(W/(Math.PI/6))%12;if(U&&X!==0)X+=12;else if(!U&&X===0)X=12;else if(U&&X===0)X=0;return X}else{let Y=Math.round(W/(Math.PI/6))%12;if(Y===0)Y=12;return Y}else if(Z.activeSelector==="minute"||Z.activeSelector==="second")return Math.round(W/(Math.PI/30))%60;return null};var E6=(J,$,Q,Z)=>{if(J.innerHTML="",Q.title){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-title`,L.textContent=Q.title,L.id=`${Q.prefix}-time-picker-title`,J.appendChild(L)}let q=document.createElement("div");q.className=`${Q.prefix}-time-picker-content`,J.appendChild(q);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,q.appendChild(j);let{hours:G}=Q.format==="24h"?{hours:$.hours}:Q2($.hours),K=document.createElement("div");K.className=`${Q.prefix}-time-picker-time-input-field`;let z=document.createElement("input");z.type="number",z.className=`${Q.prefix}-time-picker-hours`,z.min=Q.format==="24h"?"0":"1",z.max=Q.format==="24h"?"23":"12",z.value=e(G),z.setAttribute("data-type","hour"),z.setAttribute("inputmode","numeric"),z.setAttribute("pattern","[0-9]*"),K.appendChild(z),j.appendChild(K);let W=document.createElement("div");W.className=`${Q.prefix}-time-picker-separator`,W.textContent=":",j.appendChild(W);let Y=document.createElement("div");Y.className=`${Q.prefix}-time-picker-time-input-field`;let U=document.createElement("input");U.type="number",U.className=`${Q.prefix}-time-picker-minutes`,U.min="0",U.max="59",U.value=e($.minutes),U.setAttribute("data-type","minute"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*"),Y.appendChild(U),j.appendChild(Y);let X;if(Q.showSeconds){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-separator`,L.textContent=":",j.appendChild(L);let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-time-input-field`,X=document.createElement("input"),X.type="number",X.className=`${Q.prefix}-time-picker-seconds`,X.min="0",X.max="59",X.value=e($.seconds||0),X.setAttribute("data-type","second"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",D.appendChild(X),D.appendChild(R),j.appendChild(D)}if(Q.format==="12h"){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-period`;let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,D.textContent="AM",D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),L.appendChild(D),L.appendChild(R),j.appendChild(L)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",q.appendChild(_);let H=document.createElement("canvas");H.className=`${Q.prefix}-time-picker-dial-canvas`,H.width=j9.DIAMETER,H.height=j9.DIAMETER,H.style.width=`${j9.DIAMETER}px`,H.style.height=`${j9.DIAMETER}px`,_.appendChild(H);let B=document.createElement("div");B.className=`${Q.prefix}-time-picker-actions`,J.appendChild(B);let M=document.createElement("button");M.className=`${Q.prefix}-time-picker-toggle-type`,M.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),M.innerHTML=Q.type==="dial"?Q.keyboardIcon||l6.KEYBOARD:Q.clockIcon||l6.CLOCK,B.appendChild(M);let k=document.createElement("div");k.className=`${Q.prefix}-time-picker-action-buttons`,B.appendChild(k);let N=document.createElement("button");N.className=`${Q.prefix}-time-picker-cancel`,N.textContent=Q.cancelText||"Cancel",N.setAttribute("type","button"),k.appendChild(N);let F=document.createElement("button");F.className=`${Q.prefix}-time-picker-confirm`,F.textContent=Q.confirmText||"OK",F.setAttribute("type","button"),k.appendChild(F);let V="hour";if(Q.type==="dial")setTimeout(()=>{O6(H,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})},0);M.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",M.innerHTML=Q.keyboardIcon||l6.KEYBOARD,M.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{H.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((w)=>w.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((w)=>w.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((w)=>w.setAttribute("data-active","false")),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",M.innerHTML=Q.clockIcon||l6.CLOCK,M.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{z.focus(),z.select()},50)});let O=(L)=>{let D=L.target,R=D.getAttribute("data-type"),w=D.value;if(w==="")return;let A=parseInt(w,10);if(isNaN(A))return;if(R==="hour"){let x=A;if(Q.format==="12h"){if(A<0)x=1;if(A>12)x=12;if($.period==="PM"&&x!==12)x+=12;else if($.period==="AM"&&x===12)x=0}else{if(A<0)x=0;if(A>23)x=23}if($.hours=x,V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("hours",x)}else if(R==="minute"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.minutes=x,V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("minutes",x)}else if(R==="second"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.seconds=x,V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","true");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("seconds",x)}};if(z.addEventListener("input",O),U.addEventListener("input",O),X)X.addEventListener("input",O);if(z.addEventListener("keyup",(L)=>{if(L.key==="Enter")U.focus(),U.select()}),U.addEventListener("keyup",(L)=>{if(L.key==="Enter")if(Q.showSeconds&&X)X.focus(),X.select();else F.focus()}),X)X.addEventListener("keyup",(L)=>{if(L.key==="Enter")F.focus()});let P=(L)=>{if($.period!==L){let D=$.period;if($.period=L,D==="AM"&&L==="PM"){if($.hours<12)$.hours+=12}else if(D==="PM"&&L==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let w=$.hours===0?12:$.hours>12?$.hours-12:$.hours;z.value=e(w)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((w)=>{w.classList.remove(`${Q.prefix}-time-picker-period--selected`),w.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${L.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(Z)Z("hours",$.hours)}};if(Q.format==="12h"){let L=document.querySelector(`.${Q.prefix}-time-picker-period-am`),D=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(L)L.addEventListener("click",()=>{P("AM")});if(D)D.addEventListener("click",()=>{P("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(H.addEventListener("click",(L)=>{let D=H.getBoundingClientRect(),R=L.clientX-D.left,w=L.clientY-D.top,A=x$(H,R,w,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(A!==null){if(V==="hour"){let x=A;if(Q.format==="12h"){if($.period==="PM"&&A!==12)x+=12;else if($.period==="AM"&&A===12)x=0}if($.hours=x,Q.format==="12h"){let I=x===0?12:x>12?x-12:x;z.value=e(I)}else z.value=e(x);if(Z)Z("hours",x)}else if(V==="minute"){if($.minutes=A,U.value=e(A),Z)Z("minutes",A)}else if(V==="second"&&X){if($.seconds=A,X.value=e(A),Z)Z("seconds",A)}O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),z.addEventListener("click",()=>{if(_.style.display==="block"){if(V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),U.addEventListener("click",()=>{if(_.style.display==="block"){if(V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),X)X.addEventListener("click",()=>{if(_.style.display==="block")V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X.setAttribute("data-active","true"),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})})}};var q2=(J,$,Q,Z,q,j)=>{let G=!!q.isOpen,K=(U)=>{if(U.key==="Escape")W.close(),j.events.emit(L6.CANCEL)},z=(U)=>{if(U.target===$)W.close()},W={element:J.element,modalElement:$,dialogElement:Q,isOpen:G,open(){if(G)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",K),$.addEventListener("click",z),G=!0,J.element.classList.add(`${q.prefix}-time-picker--open`),setTimeout(()=>{E6(Q,Z,q)},50),j.events.emit(L6.OPEN),q.onOpen)q.onOpen();return this},close(){if(!G)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",K),$.removeEventListener("click",z),G=!1,J.element.classList.remove(`${q.prefix}-time-picker--open`),j.events.emit(L6.CLOSE),q.onClose)q.onClose();return this},toggle(){return G?this.close():this.open()},getValue(){return J2(Z,q.format==="24h")},getTimeObject(){return{...Z}},setValue(U){try{let X=U.split(":"),_=parseInt(X[0],10),H=parseInt(X[1],10),B=X[2]?parseInt(X[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(H)||H<0||H>59||isNaN(B)||B<0||B>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(Z.hours=_,Z.minutes=H,Z.seconds=B,Z.period=_>=12?"PM":"AM",E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),q.onChange)q.onChange(this.getValue())}catch(X){console.error("Error setting time value:",X)}return this},setType(U){if(q.type===U)return this;return q.type=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"dial"}`,`${q.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getType(){return q.type},setFormat(U){if(q.format===U)return this;if(q.format=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"12h"}`,`${q.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),U==="24h")Z.period=Z.hours>=12?"PM":"AM";else Z.period=Z.hours>=12?"PM":"AM";return E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),this},getFormat(){return q.format},setOrientation(U){if(q.orientation===U)return this;return q.orientation=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"vertical"}`,`${q.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getOrientation(){return q.orientation},setTitle(U){q.title=U;let X=Q.querySelector(Q6.TITLE);if(X)X.textContent=U;else E6(Q,Z,q);return this},getTitle(){return q.title||""},destroy(){if(G)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(U,X){return j.events.on(U,X),this},off(U,X){return j.events.off(U,X),this}};Q.addEventListener("click",(U)=>{let X=U.target;if(X.closest(Q6.CANCEL_BUTTON)){if(W.close(),j.events.emit(L6.CANCEL),q.onCancel)q.onCancel()}if(X.closest(Q6.CONFIRM_BUTTON)){if(W.close(),j.events.emit(L6.CONFIRM,W.getValue()),q.onConfirm)q.onConfirm(W.getValue())}if(X.closest(Q6.TOGGLE_TYPE_BUTTON)){let _=q.type==="dial"?"input":"dial";W.setType(_)}if(X.closest(Q6.PERIOD_AM)){if(Z.period!=="AM"){if(Z.period="AM",Z.hours>=12)Z.hours-=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.PERIOD_PM)){if(Z.period!=="PM"){if(Z.period="PM",Z.hours<12)Z.hours+=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.DIAL_CANVAS)){if(q.type==="dial"){let _=X,H=_.getBoundingClientRect(),B=U.clientX-H.left,M=U.clientY-H.top,k="hour",N=Q.querySelector(Q6.HOURS_INPUT),F=Q.querySelector(Q6.MINUTES_INPUT),V=Q.querySelector(Q6.SECONDS_INPUT);if(N&&N.getAttribute("data-active")==="true")k="hour";else if(F&&F.getAttribute("data-active")==="true")k="minute";else if(q.showSeconds&&V&&V.getAttribute("data-active")==="true")k="second";let O=x$(_,B,M,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(O!==null){if(k==="hour"){let P=O;if(q.format==="12h"){if(Z.period==="PM"&&O!==12)P+=12;else if(Z.period==="AM"&&O===12)P=0}if(Z.hours!==P){Z.hours=P;let L=N;if(L)L.textContent=e(q.format==="24h"?P:P%12||12);let D=Q.querySelector(Q6.DIAL_CANVAS);if(D)O6(D,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="minute"){if(Z.minutes!==O){Z.minutes=O;let P=F;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="second"&&q.showSeconds){if(Z.seconds!==O){Z.seconds=O;let P=V;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}}}}});let Y=(U)=>{let X=U.target,_=X.getAttribute("data-type"),H=parseInt(X.value,10);if(isNaN(H))return;if(_==="hour"){let B=H;if(q.format==="12h"){if(H<1)B=12;if(H>12)B=1;if(Z.period==="PM"&&B!==12)B+=12;else if(Z.period==="AM"&&B===12)B=0}else{if(H<0)B=0;if(H>23)B=23}Z.hours=B}else if(_==="minute"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.minutes=B}else if(_==="second"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.seconds=B}if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())};return Q.addEventListener("change",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT))Y(U)}),Q.addEventListener("keyup",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT)){if(U.key==="Enter"){if(Y(U),X.matches(Q6.HOURS_INPUT)){let _=Q.querySelector(Q6.MINUTES_INPUT);if(_)_.focus()}else if(X.matches(Q6.MINUTES_INPUT))if(q.showSeconds){let _=Q.querySelector(Q6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}else if(X.matches(Q6.SECONDS_INPUT)){let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}}}}),W};var ej=(J={})=>{let $=tZ(J);try{let Q=b(S,d(),h(nZ($)),C())($),Z=document.createElement("div");Z.className=`${f}-time-picker-modal`,Z.style.display="none",Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="100%",Z.style.height="100%",Z.style.backgroundColor="rgba(0, 0, 0, 0.4)",Z.style.zIndex=C7.MODAL.toString(),Z.setAttribute("role","presentation");let q=document.createElement("div");q.className=[`${f}-time-picker-dialog`,`${f}-time-picker-dialog--${$.type}`,`${f}-time-picker-dialog--${$.orientation}`,`${f}-time-picker-dialog--${$.format}`].join(" "),q.style.position="absolute",q.style.top="50%",q.style.left="50%",q.style.transform="translate(-50%, -50%)",q.style.zIndex=C7.DIALOG.toString(),Z.appendChild(q),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(Z);let G;if($.value)G=$2($.value,$.format);else{let z=new Date;G={hours:z.getHours(),minutes:z.getMinutes(),seconds:$.showSeconds?z.getSeconds():0,period:z.getHours()>=12?"PM":"AM"}}E6(q,G,$);let K=q2(Q,Z,q,G,$,eZ(Q));if($.isOpen)setTimeout(()=>K.open(),0);return K}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},j2=ej;J6();t();var n1={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},K2={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},D9={TAG:"header",TYPE:n1.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},G2={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var $K={tag:D9.TAG,type:D9.TYPE,scrollable:D9.SCROLLABLE,compressible:D9.COMPRESSIBLE,scrollThreshold:D9.SCROLL_THRESHOLD},z2=(J={})=>u($K,J,"top-app-bar");var W2=(J={})=>{let $=z2(J),Q=S($),Z=()=>{let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-leading`;let M=document.createElement("h1");if(M.className=`${Q.getClass("top-app-bar")}-headline`,$.title)M.textContent=$.title;let k=document.createElement("div");return k.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:B,headlineElement:M,trailingContainer:k}},{leadingContainer:q,headlineElement:j,trailingContainer:G}=Z(),K=()=>{let B=[$.class];if($.type!=="small")B.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))B.push(`${Q.getClass("top-app-bar")}--compressible`);return B.filter(Boolean)},z=h({tag:$.tag,componentName:"top-app-bar",className:K(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),W=d()(z),Y=C()(W);(()=>{if($.type==="medium"||$.type==="large"){let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-row`,B.appendChild(q),B.appendChild(G);let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(j),Y.element.appendChild(B),Y.element.appendChild(M)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)})();let X=!1;if($.scrollable){let B=()=>{let k=window.scrollY>$.scrollThreshold;if(X!==k){if(X=k,X)Y.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else Y.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(X)}};window.addEventListener("scroll",B,{passive:!0}),B();let M=Y.lifecycle.destroy;Y.lifecycle.destroy=()=>{window.removeEventListener("scroll",B),M()}}let _=(B)=>{while(Y.element.firstChild)Y.element.removeChild(Y.element.firstChild);if(["small","medium","large","center"].forEach((M)=>{Y.element.classList.remove(`${Q.getClass("top-app-bar")}--${M}`)}),B!=="small")Y.element.classList.add(`${Q.getClass("top-app-bar")}--${B}`);if(Y.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(B==="medium"||B==="large")),B==="medium"||B==="large"){let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(q),M.appendChild(G);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),Y.element.appendChild(M),Y.element.appendChild(k)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)};return{...Y,setTitle(B){return j.textContent=B,this},getTitle(){return j.textContent||""},addLeadingElement(B){return q.appendChild(B),this},addTrailingElement(B){return G.appendChild(B),this},setType(B){return $.type=B,_(B),this},setScrollState(B){if(X=B,B)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return q},getTrailingContainer(){return G}}};var JK=W2;w6();J6();c();o();var P6={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var Y2=8;var U2=({lifecycle:J})=>($)=>{let Q=null,Z=P6.BOTTOM,q=!1,j=null,G=null,K=300,z=100,W=!0,Y=!0,U=document.createElement("div");U.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(U),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let X=()=>{if(!Q)return{top:0,left:0};let P=$.element.getBoundingClientRect(),L=Q.getBoundingClientRect(),D=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,w=Y2,A=0,x=0,I;switch(Z){case P6.TOP:A=L.top+D-P.height-w,x=L.left+R+L.width/2-P.width/2,I="bottom";break;case P6.TOP_START:A=L.top+D-P.height-w,x=L.left+R,I="bottom-start";break;case P6.TOP_END:A=L.top+D-P.height-w,x=L.left+R+L.width-P.width,I="bottom-end";break;case P6.RIGHT:A=L.top+D+L.height/2-P.height/2,x=L.left+R+L.width+w,I="left";break;case P6.RIGHT_START:A=L.top+D,x=L.left+R+L.width+w,I="left-start";break;case P6.RIGHT_END:A=L.top+D+L.height-P.height,x=L.left+R+L.width+w,I="left-end";break;case P6.BOTTOM:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top";break;case P6.BOTTOM_START:A=L.top+D+L.height+w,x=L.left+R,I="top-start";break;case P6.BOTTOM_END:A=L.top+D+L.height+w,x=L.left+R+L.width-P.width,I="top-end";break;case P6.LEFT:A=L.top+D+L.height/2-P.height/2,x=L.left+R-P.width-w,I="right";break;case P6.LEFT_START:A=L.top+D,x=L.left+R-P.width-w,I="right-start";break;case P6.LEFT_END:A=L.top+D+L.height-P.height,x=L.left+R-P.width-w,I="right-end";break;default:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top"}let r=window.innerWidth;if(x<0)x=0;else if(x+P.width>r)x=r-P.width;return{top:A,left:x,arrowPosition:I}},_=(P)=>{if(Y)P.addEventListener("mouseenter",B),P.addEventListener("mouseleave",M);if(W)P.addEventListener("focus",k),P.addEventListener("blur",N)},H=(P)=>{if(P)P.removeEventListener("mouseenter",B),P.removeEventListener("mouseleave",M),P.removeEventListener("focus",k),P.removeEventListener("blur",N)},B=()=>F.show(),M=()=>F.hide(),k=()=>F.show(),N=()=>F.hide(),F={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(P){let L=document.createTextNode(P);while($.element.firstChild!==U)$.element.removeChild($.element.firstChild);if($.element.insertBefore(L,U),q)this.updatePosition();return this},getText(){let P=$.element.cloneNode(!0),L=P.querySelector(`.${$.getClass("tooltip")}__arrow`);if(L)L.remove();return P.textContent||""},setPosition(P){Z=P;let L=$.getClass("tooltip"),D=Object.values(P6).map((R)=>`${L}--${R}`);if($.element.classList.remove(...D),$.element.classList.add(`${L}--${P}`),q)this.updatePosition();return this},getPosition(){return Z},setTarget(P){if(Q)H(Q);if(Q=P,this.target=P,Q.setAttribute("aria-describedby",$.element.id),_(Q),q)this.updatePosition();return this},show(P=!1){if(j!==null)window.clearTimeout(j),j=null;if(G!==null)window.clearTimeout(G),G=null;let L=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),q=!0,this.updatePosition(),window.addEventListener("resize",V),window.addEventListener("scroll",O)};if(P)L();else j=window.setTimeout(L,K);return this},hide(P=!1){if(G!==null)window.clearTimeout(G),G=null;if(j!==null)window.clearTimeout(j),j=null;let L=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),q=!1,window.removeEventListener("resize",V),window.removeEventListener("scroll",O)};if(P)L();else G=window.setTimeout(L,z);return this},isVisible(){return q},updatePosition(){if(!Q)return this;let{top:P,left:L,arrowPosition:D}=X();if($.element.style.top=`${Math.round(P)}px`,$.element.style.left=`${Math.round(L)}px`,D)U.className=`${$.getClass("tooltip")}__arrow`,U.classList.add(`${$.getClass("tooltip")}__arrow--${D}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(G!==null)window.clearTimeout(G);if(Q)H(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",V),window.removeEventListener("scroll",O),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},V=()=>{F.updatePosition()},O=()=>{F.updatePosition()};return F};t();var e1={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},$J={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},X2={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},r6={POSITION:e1.BOTTOM,VARIANT:$J.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},B2={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var QK={position:r6.POSITION,variant:r6.VARIANT,visible:r6.VISIBLE,showDelay:r6.SHOW_DELAY,hideDelay:r6.HIDE_DELAY,showOnFocus:r6.SHOW_ON_FOCUS,showOnHover:r6.SHOW_ON_HOVER,rich:r6.RICH},F2=(J={})=>u(QK,J,"tooltip"),H2=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return p(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},k2=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var ZK=()=>{return`${f}-tooltip-${Math.random().toString(36).substring(2,9)}`},qK=(J={})=>{let $=F2(J);try{let Q=b(S,h(H2($)),C(),(Z)=>U2(k2(Z))(Z))($);if(Q.element.id=ZK(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},M2=qK;K7();T9();c();o();A8();var jK=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list manager: missing element"),$;let Q=J.renderItem,Z=null,q=(K,z,W)=>{let Y=Q?Q(K,z,W):j(K,W);if(Y&&K.id&&!Y.hasAttribute("data-id"))Y.setAttribute("data-id",K.id);if(Z)Z(K,Y);return Y};function j(K,z){let W=z||document.createElement("div");return W.className=$6.ITEM,W.textContent=K.text||K.title||K.headline||K.name||K.id,W}let G=R8(J.collection,$.element,{...J,renderItem:q,afterLoad:(K)=>{if($.emit(P9.LOAD,K),J.afterLoad)J.afterLoad(K)}});if(G.setRenderHook=(K)=>{Z=K},$.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{G.destroy(),K()}}return{...$,list:G}},JJ=jK;A9();_7();var KK=(J)=>($)=>{if(!$.element||!J.trackSelection)return $;let Q=new Set;if(Array.isArray(J.items))J.items.forEach((K)=>{if(K.selected)Q.add(K.id)});if(Array.isArray(J.initialSelection))J.initialSelection.forEach((K)=>{Q.add(K)});let Z=()=>{if(!$.list){setTimeout(Z,0);return}if(typeof $.list.setRenderHook==="function")$.list.setRenderHook((K,z)=>{if(Q.has(K.id)){if(!R6(z,$6.SELECTED))g(z,$6.SELECTED)}else if(R6(z,$6.SELECTED))j6(z,$6.SELECTED)})};Z();let q=(K)=>{if(!K.target.closest("[data-id]"))return;let z=K.target.closest("[data-id]"),W=z.getAttribute("data-id");if(!W)return;let Y=$.list?.getAllItems().find((X)=>X.id===W);if(!Y)return;let U={item:Y,element:z,originalEvent:K,component:$,preventDefault:()=>{U.defaultPrevented=!0},defaultPrevented:!1};if($.emit(P9.SELECT,U),U.defaultPrevented)return;if(J.multiSelect)if(Q.has(W))Q.delete(W),j6(z,$6.SELECTED);else Q.add(W),g(z,$6.SELECTED);else if(R6(z,$6.SELECTED))Q.clear(),j6(z,$6.SELECTED);else $.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((H)=>{j6(H,$6.SELECTED)}),Q.clear(),Q.add(W),g(z,$6.SELECTED)};$.element.addEventListener("click",q);let j=()=>{$.element.querySelectorAll("[data-id]").forEach((z)=>{let W=z.getAttribute("data-id"),Y=Q.has(W);if(Y&&!R6(z,$6.SELECTED))g(z,$6.SELECTED);else if(!Y&&R6(z,$6.SELECTED))j6(z,$6.SELECTED)})},G=(K,z)=>{if(z)Q.add(K);else Q.delete(K);let W=$.element.querySelector(`[data-id="${K}"]`);if(W){if(z&&!R6(W,$6.SELECTED))g(W,$6.SELECTED);else if(!z&&R6(W,$6.SELECTED))j6(W,$6.SELECTED)}};if($.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",q),K()}}return{...$,getSelectedItems:()=>{return($.list?.getAllItems()||[]).filter((z)=>Q.has(z.id))},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(K)=>Q.has(K),selectItem:(K)=>{return G(K,!0),$},deselectItem:(K)=>{return G(K,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((z)=>j6(z,$6.SELECTED));return $},setSelection:(K)=>{if(!K?.length&&Q.size===0)return $;if(Q.clear(),Array.isArray(K))K.forEach((z)=>Q.add(z));return j(),$}}},QJ=KK;var V2=({list:J,events:$,lifecycle:Q})=>(Z)=>({...Z,element:Z.element,refresh:async()=>{return await J.refresh(),Z},loadMore:async()=>{return await J.loadMore()},scrollToItem:(q,j="start")=>{return J.scrollToItem(q,j),Z},getVisibleItems:()=>J.getVisibleItems(),getAllItems:()=>J.getAllItems(),isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),on:(q,j)=>{return $.on(q,j),Z},off:(q,j)=>{return $.off(q,j),Z},destroy:()=>{Q.destroy()}});t();var GK={collection:G9.COLLECTION,transform:(J)=>J,baseUrl:G9.BASE_URL,items:[],pageSize:G9.PAGE_SIZE,renderBufferSize:G9.RENDER_BUFFER_SIZE,renderItem:null,trackSelection:!0,multiSelect:!1},N2=(J={})=>{if(!J.renderItem&&!Array.isArray(J.items))throw new Error("List requires either static items or a renderItem function");if(Array.isArray(J.items)&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id,Q};return u(GK,J,"list")},_2=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"div",attributes:$,className:[$6.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},L2=(J)=>({list:{refresh:J.list?.refresh,loadMore:J.list?.loadMore,scrollToItem:J.list?.scrollToItem,getVisibleItems:J.list?.getVisibleItems,getAllItems:J.list?.getAllItems,isLoading:J.list?.isLoading,hasNextPage:J.list?.hasNextPage},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy}});var zK=(J={})=>{try{let $=N2(J);return b(S,d(),h(_2($)),JJ($),QJ($),C(),(Z)=>V2(L2(Z))(Z))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},D2=zK;var O2=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},ZJ=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},qJ=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};q7();var P2=(J,$,Q,Z)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){Z();return}let G=J.drawer.getAllItems();if(G?.length>0)G.forEach((K)=>{J.drawer.removeItem(K.config.id)});j.forEach((K)=>{J.drawer.addItem(K)}),Q()},R2=(J,$)=>{let Q=Object.keys(J.items||{}).map((q)=>({id:q,label:J.items[q]?.label||q,icon:J.items[q]?.icon||"",active:q===J.activeSection})),Z=w7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(Z.element),Z},A2=(J,$)=>{let Q=w7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},w2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},x2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},y2=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},T2=(J,$,Q,Z,q)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||kJ(),j!==J.isMobile){if(J.isMobile)Q();else Z();if(q.onViewChange)q.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},I2=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},S2=(J,$,Q,Z)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,Z);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,Z)};var b2=(J,$,Q,Z,q,j)=>{let G=J.rail;if(!G)return;G.on("change",(K)=>{let z=K?.id;if(!z||J.processingChange)return;let W=K?.source==="userAction";if(J.processingChange=!0,J.activeSection=z,Q(z),j.onSectionChange&&W)j.onSectionChange(z,{source:W?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),G.on("mouseover",(K)=>{let z=K?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,z)if(J.items[z]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(z)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)q()},$.hoverDelay)}),G.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),G.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)q()},$.closeDelay)})},v2=(J,$,Q,Z)=>{let q=J.drawer;if(!q)return;if(typeof q.on==="function")q.on("change",(j)=>{let G=j.id;if(J.activeSubsection=G,$.hideDrawerOnClick)Q();if(Z.onItemSelect)Z.onItemSelect(j)}),q.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),q.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},C2=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},E2=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};q7();var WK=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(Z)=>{if(Z.target===J.overlayElement)Q()}),J.overlayElement},YK=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
57
+ </svg>`},t6={TYPE:i1.DIAL,FORMAT:t1.AMPM,ORIENTATION:o1.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:l6.CLOCK,KEYBOARD_ICON:l6.KEYBOARD},oZ={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var cj={type:"dial",format:"12h",orientation:"vertical",showSeconds:t6.SHOW_SECONDS,closeOnSelect:t6.CLOSE_ON_SELECT,minuteStep:t6.MINUTE_STEP,secondStep:t6.SECOND_STEP,cancelText:t6.CANCEL_TEXT,confirmText:t6.CONFIRM_TEXT,isOpen:t6.IS_OPEN,clockIcon:l6.CLOCK,keyboardIcon:l6.KEYBOARD},tZ=(J={})=>u(cj,J,"time-picker"),nZ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var eZ=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var e=(J)=>{return J.toString().padStart(2,"0")},$2=(J,$)=>{try{let Q=J.split(":"),Z=parseInt(Q[0],10),q=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(Z)||Z<0||Z>23||isNaN(q)||q<0||q>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let K=Z>=12?"PM":"AM";return{hours:Z,minutes:q,seconds:j,period:K}}catch(Q){console.error("Error parsing time:",Q);let Z=new Date,q=Z.getHours(),j=Z.getMinutes(),K=Z.getSeconds(),G=q>=12?"PM":"AM";return{hours:q,minutes:j,seconds:K,period:G}}},J2=(J,$)=>{let{hours:Q,minutes:Z,seconds:q}=J;if($){if(q!==void 0)return`${e(Q)}:${e(Z)}:${e(q)}`;return`${e(Q)}:${e(Z)}`}else{let j=Q%12;if(j===0)j=12;if(q!==void 0)return`${e(j)}:${e(Z)}:${e(q)} ${J.period}`;return`${e(j)}:${e(Z)} ${J.period}`}};var Q2=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var q6={...j9,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function ij(J){let $=document.documentElement,Q=getComputedStyle($),Z=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",q=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",K=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",W=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,z=`rgba(${K}, 0.1)`;return{primaryColor:Z,onPrimaryColor:q,onSurfaceColor:j,bgColor:W,selectedBgColor:z}}var O6=(J,$,Q)=>{let Z=J.getContext("2d");if(!Z){console.error("Could not get canvas context");return}let q=ij(Q.prefix),j=window.devicePixelRatio||1;J.width=q6.DIAMETER*j,J.height=q6.DIAMETER*j,Z.scale(j,j);let K=q6.DIAMETER/2,G=q6.DIAMETER/2,W=q6.DIAMETER/2;if(Z.clearRect(0,0,J.width,J.height),Z.beginPath(),Z.arc(K,G,W-2,0,2*Math.PI),Z.fillStyle=q.bgColor,Z.fill(),Z.beginPath(),Z.arc(K,G,q6.CENTER_SIZE/2,0,2*Math.PI),Z.fillStyle=q.primaryColor,Z.fill(),Q.activeSelector==="hour")if(Q.format==="24h")tj(Z,K,G,W,$.hours,q);else oj(Z,K,G,W,$.hours%12||12,q);else if(Q.activeSelector==="minute")Z2(Z,K,G,W,$.minutes,q);else if(Q.activeSelector==="second"&&Q.showSeconds)Z2(Z,K,G,W,$.seconds||0,q);nj(Z,K,G,$,Q,q)},oj=(J,$,Q,Z,q,j)=>{let K=q6.OUTER_RADIUS;for(let G=1;G<=12;G++){let W=G/6*Math.PI-Math.PI/2,z=$+K*Math.cos(W),Y=Q+K*Math.sin(W),U=G===q;if(U)J.beginPath(),J.arc(z,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(G.toString(),z,Y+2)}},tj=(J,$,Q,Z,q,j)=>{let K=q6.OUTER_RADIUS;for(let W=1;W<=12;W++){let z=W/6*Math.PI-Math.PI/2,Y=$+K*Math.cos(z),U=Q+K*Math.sin(z),X=W===q;if(X)J.beginPath(),J.arc(Y,U,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(W.toString(),Y,U+2)}let G=q6.INNER_RADIUS;for(let W=13;W<=24;W++){let z=W===24?0:W,Y=(W-12)/6*Math.PI-Math.PI/2,U=$+G*Math.cos(Y),X=Q+G*Math.sin(Y),_=z===q;if(_)J.beginPath(),J.arc(U,X,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(z),U,X+2)}},Z2=(J,$,Q,Z,q,j)=>{let K=q6.OUTER_RADIUS;for(let G=0;G<60;G+=5){let W=G/30*Math.PI-Math.PI/2,z=$+K*Math.cos(W),Y=Q+K*Math.sin(W),U=G===q;if(U)J.beginPath(),J.arc(z,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(G),z,Y)}if(q%5!==0){let G=q/30*Math.PI-Math.PI/2,W=$+K*Math.cos(G),z=Q+K*Math.sin(G);J.beginPath(),J.arc(W,z,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(q),W,z)}},nj=(J,$,Q,Z,q,j)=>{let K,G;if(q.activeSelector==="hour")if(q.format==="24h")if(Z.hours>=12)K=(Z.hours%12||12)/6*Math.PI-Math.PI/2,G=q6.INNER_RADIUS;else{let U=Z.hours;if(U===0)U=12;K=U/6*Math.PI-Math.PI/2,G=q6.OUTER_RADIUS}else K=(Z.hours%12||12)/6*Math.PI-Math.PI/2,G=q6.OUTER_RADIUS;else if(q.activeSelector==="minute")K=Z.minutes/30*Math.PI-Math.PI/2,G=q6.OUTER_RADIUS;else if(q.activeSelector==="second")K=(Z.seconds||0)/30*Math.PI-Math.PI/2,G=q6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+G*Math.cos(K),Q+G*Math.sin(K)),J.lineWidth=q6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let W=$+G*Math.cos(K),z=Q+G*Math.sin(K);J.beginPath(),J.arc(W,z,q6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let Y="";if(q.activeSelector==="hour")if(q.format==="24h")Y=e(Z.hours);else Y=String(Z.hours%12||12);else if(q.activeSelector==="minute")Y=e(Z.minutes);else if(q.activeSelector==="second")Y=e(Z.seconds||0);J.fillText(Y,W,z)},x$=(J,$,Q,Z)=>{let q=q6.DIAMETER/2,j=q6.DIAMETER/2,K=$-q,G=Q-j,W=Math.sqrt(K*K+G*G),z=Math.atan2(G,K)+Math.PI/2;if(z<0)z+=2*Math.PI;if(Z.activeSelector==="hour")if(Z.format==="24h"){let Y=(q6.INNER_RADIUS+q6.OUTER_RADIUS)/2,U=W<Y,X=Math.round(z/(Math.PI/6))%12;if(U&&X!==0)X+=12;else if(!U&&X===0)X=12;else if(U&&X===0)X=0;return X}else{let Y=Math.round(z/(Math.PI/6))%12;if(Y===0)Y=12;return Y}else if(Z.activeSelector==="minute"||Z.activeSelector==="second")return Math.round(z/(Math.PI/30))%60;return null};var E6=(J,$,Q,Z)=>{if(J.innerHTML="",Q.title){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-title`,L.textContent=Q.title,L.id=`${Q.prefix}-time-picker-title`,J.appendChild(L)}let q=document.createElement("div");q.className=`${Q.prefix}-time-picker-content`,J.appendChild(q);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,q.appendChild(j);let{hours:K}=Q.format==="24h"?{hours:$.hours}:Q2($.hours),G=document.createElement("div");G.className=`${Q.prefix}-time-picker-time-input-field`;let W=document.createElement("input");W.type="number",W.className=`${Q.prefix}-time-picker-hours`,W.min=Q.format==="24h"?"0":"1",W.max=Q.format==="24h"?"23":"12",W.value=e(K),W.setAttribute("data-type","hour"),W.setAttribute("inputmode","numeric"),W.setAttribute("pattern","[0-9]*"),G.appendChild(W),j.appendChild(G);let z=document.createElement("div");z.className=`${Q.prefix}-time-picker-separator`,z.textContent=":",j.appendChild(z);let Y=document.createElement("div");Y.className=`${Q.prefix}-time-picker-time-input-field`;let U=document.createElement("input");U.type="number",U.className=`${Q.prefix}-time-picker-minutes`,U.min="0",U.max="59",U.value=e($.minutes),U.setAttribute("data-type","minute"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*"),Y.appendChild(U),j.appendChild(Y);let X;if(Q.showSeconds){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-separator`,L.textContent=":",j.appendChild(L);let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-time-input-field`,X=document.createElement("input"),X.type="number",X.className=`${Q.prefix}-time-picker-seconds`,X.min="0",X.max="59",X.value=e($.seconds||0),X.setAttribute("data-type","second"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",D.appendChild(X),D.appendChild(R),j.appendChild(D)}if(Q.format==="12h"){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-period`;let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,D.textContent="AM",D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),L.appendChild(D),L.appendChild(R),j.appendChild(L)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",q.appendChild(_);let H=document.createElement("canvas");H.className=`${Q.prefix}-time-picker-dial-canvas`,H.width=j9.DIAMETER,H.height=j9.DIAMETER,H.style.width=`${j9.DIAMETER}px`,H.style.height=`${j9.DIAMETER}px`,_.appendChild(H);let B=document.createElement("div");B.className=`${Q.prefix}-time-picker-actions`,J.appendChild(B);let k=document.createElement("button");k.className=`${Q.prefix}-time-picker-toggle-type`,k.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),k.innerHTML=Q.type==="dial"?Q.keyboardIcon||l6.KEYBOARD:Q.clockIcon||l6.CLOCK,B.appendChild(k);let M=document.createElement("div");M.className=`${Q.prefix}-time-picker-action-buttons`,B.appendChild(M);let V=document.createElement("button");V.className=`${Q.prefix}-time-picker-cancel`,V.textContent=Q.cancelText||"Cancel",V.setAttribute("type","button"),M.appendChild(V);let F=document.createElement("button");F.className=`${Q.prefix}-time-picker-confirm`,F.textContent=Q.confirmText||"OK",F.setAttribute("type","button"),M.appendChild(F);let N="hour";if(Q.type==="dial")setTimeout(()=>{O6(H,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})},0);k.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",k.innerHTML=Q.keyboardIcon||l6.KEYBOARD,k.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{H.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((w)=>w.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((w)=>w.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((w)=>w.setAttribute("data-active","false")),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",k.innerHTML=Q.clockIcon||l6.CLOCK,k.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{W.focus(),W.select()},50)});let O=(L)=>{let D=L.target,R=D.getAttribute("data-type"),w=D.value;if(w==="")return;let A=parseInt(w,10);if(isNaN(A))return;if(R==="hour"){let x=A;if(Q.format==="12h"){if(A<0)x=1;if(A>12)x=12;if($.period==="PM"&&x!==12)x+=12;else if($.period==="AM"&&x===12)x=0}else{if(A<0)x=0;if(A>23)x=23}if($.hours=x,N="hour",W.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("hours",x)}else if(R==="minute"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.minutes=x,N="minute",W.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("minutes",x)}else if(R==="second"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.seconds=x,N="second",W.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","true");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N}),Z)Z("seconds",x)}};if(W.addEventListener("input",O),U.addEventListener("input",O),X)X.addEventListener("input",O);if(W.addEventListener("keyup",(L)=>{if(L.key==="Enter")U.focus(),U.select()}),U.addEventListener("keyup",(L)=>{if(L.key==="Enter")if(Q.showSeconds&&X)X.focus(),X.select();else F.focus()}),X)X.addEventListener("keyup",(L)=>{if(L.key==="Enter")F.focus()});let P=(L)=>{if($.period!==L){let D=$.period;if($.period=L,D==="AM"&&L==="PM"){if($.hours<12)$.hours+=12}else if(D==="PM"&&L==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let w=$.hours===0?12:$.hours>12?$.hours-12:$.hours;W.value=e(w)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((w)=>{w.classList.remove(`${Q.prefix}-time-picker-period--selected`),w.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${L.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N});if(Z)Z("hours",$.hours)}};if(Q.format==="12h"){let L=document.querySelector(`.${Q.prefix}-time-picker-period-am`),D=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(L)L.addEventListener("click",()=>{P("AM")});if(D)D.addEventListener("click",()=>{P("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(H.addEventListener("click",(L)=>{let D=H.getBoundingClientRect(),R=L.clientX-D.left,w=L.clientY-D.top,A=x$(H,R,w,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N});if(A!==null){if(N==="hour"){let x=A;if(Q.format==="12h"){if($.period==="PM"&&A!==12)x+=12;else if($.period==="AM"&&A===12)x=0}if($.hours=x,Q.format==="12h"){let I=x===0?12:x>12?x-12:x;W.value=e(I)}else W.value=e(x);if(Z)Z("hours",x)}else if(N==="minute"){if($.minutes=A,U.value=e(A),Z)Z("minutes",A)}else if(N==="second"&&X){if($.seconds=A,X.value=e(A),Z)Z("seconds",A)}O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),W.addEventListener("click",()=>{if(_.style.display==="block"){if(N="hour",W.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),U.addEventListener("click",()=>{if(_.style.display==="block"){if(N="minute",W.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})}}),X)X.addEventListener("click",()=>{if(_.style.display==="block")N="second",W.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X.setAttribute("data-active","true"),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:N})})}};var q2=(J,$,Q,Z,q,j)=>{let K=!!q.isOpen,G=(U)=>{if(U.key==="Escape")z.close(),j.events.emit(L6.CANCEL)},W=(U)=>{if(U.target===$)z.close()},z={element:J.element,modalElement:$,dialogElement:Q,isOpen:K,open(){if(K)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",G),$.addEventListener("click",W),K=!0,J.element.classList.add(`${q.prefix}-time-picker--open`),setTimeout(()=>{E6(Q,Z,q)},50),j.events.emit(L6.OPEN),q.onOpen)q.onOpen();return this},close(){if(!K)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",G),$.removeEventListener("click",W),K=!1,J.element.classList.remove(`${q.prefix}-time-picker--open`),j.events.emit(L6.CLOSE),q.onClose)q.onClose();return this},toggle(){return K?this.close():this.open()},getValue(){return J2(Z,q.format==="24h")},getTimeObject(){return{...Z}},setValue(U){try{let X=U.split(":"),_=parseInt(X[0],10),H=parseInt(X[1],10),B=X[2]?parseInt(X[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(H)||H<0||H>59||isNaN(B)||B<0||B>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(Z.hours=_,Z.minutes=H,Z.seconds=B,Z.period=_>=12?"PM":"AM",E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),q.onChange)q.onChange(this.getValue())}catch(X){console.error("Error setting time value:",X)}return this},setType(U){if(q.type===U)return this;return q.type=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"dial"}`,`${q.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getType(){return q.type},setFormat(U){if(q.format===U)return this;if(q.format=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"12h"}`,`${q.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),U==="24h")Z.period=Z.hours>=12?"PM":"AM";else Z.period=Z.hours>=12?"PM":"AM";return E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),this},getFormat(){return q.format},setOrientation(U){if(q.orientation===U)return this;return q.orientation=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"vertical"}`,`${q.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getOrientation(){return q.orientation},setTitle(U){q.title=U;let X=Q.querySelector(Q6.TITLE);if(X)X.textContent=U;else E6(Q,Z,q);return this},getTitle(){return q.title||""},destroy(){if(K)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(U,X){return j.events.on(U,X),this},off(U,X){return j.events.off(U,X),this}};Q.addEventListener("click",(U)=>{let X=U.target;if(X.closest(Q6.CANCEL_BUTTON)){if(z.close(),j.events.emit(L6.CANCEL),q.onCancel)q.onCancel()}if(X.closest(Q6.CONFIRM_BUTTON)){if(z.close(),j.events.emit(L6.CONFIRM,z.getValue()),q.onConfirm)q.onConfirm(z.getValue())}if(X.closest(Q6.TOGGLE_TYPE_BUTTON)){let _=q.type==="dial"?"input":"dial";z.setType(_)}if(X.closest(Q6.PERIOD_AM)){if(Z.period!=="AM"){if(Z.period="AM",Z.hours>=12)Z.hours-=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}if(X.closest(Q6.PERIOD_PM)){if(Z.period!=="PM"){if(Z.period="PM",Z.hours<12)Z.hours+=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}if(X.closest(Q6.DIAL_CANVAS)){if(q.type==="dial"){let _=X,H=_.getBoundingClientRect(),B=U.clientX-H.left,k=U.clientY-H.top,M="hour",V=Q.querySelector(Q6.HOURS_INPUT),F=Q.querySelector(Q6.MINUTES_INPUT),N=Q.querySelector(Q6.SECONDS_INPUT);if(V&&V.getAttribute("data-active")==="true")M="hour";else if(F&&F.getAttribute("data-active")==="true")M="minute";else if(q.showSeconds&&N&&N.getAttribute("data-active")==="true")M="second";let O=x$(_,B,k,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(O!==null){if(M==="hour"){let P=O;if(q.format==="12h"){if(Z.period==="PM"&&O!==12)P+=12;else if(Z.period==="AM"&&O===12)P=0}if(Z.hours!==P){Z.hours=P;let L=V;if(L)L.textContent=e(q.format==="24h"?P:P%12||12);let D=Q.querySelector(Q6.DIAL_CANVAS);if(D)O6(D,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}else if(M==="minute"){if(Z.minutes!==O){Z.minutes=O;let P=F;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}else if(M==="second"&&q.showSeconds){if(Z.seconds!==O){Z.seconds=O;let P=N;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:M});if(j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())}}}}}});let Y=(U)=>{let X=U.target,_=X.getAttribute("data-type"),H=parseInt(X.value,10);if(isNaN(H))return;if(_==="hour"){let B=H;if(q.format==="12h"){if(H<1)B=12;if(H>12)B=1;if(Z.period==="PM"&&B!==12)B+=12;else if(Z.period==="AM"&&B===12)B=0}else{if(H<0)B=0;if(H>23)B=23}Z.hours=B}else if(_==="minute"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.minutes=B}else if(_==="second"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.seconds=B}if(E6(Q,Z,q),j.events.emit(L6.CHANGE,z.getValue()),q.onChange)q.onChange(z.getValue())};return Q.addEventListener("change",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT))Y(U)}),Q.addEventListener("keyup",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT)){if(U.key==="Enter"){if(Y(U),X.matches(Q6.HOURS_INPUT)){let _=Q.querySelector(Q6.MINUTES_INPUT);if(_)_.focus()}else if(X.matches(Q6.MINUTES_INPUT))if(q.showSeconds){let _=Q.querySelector(Q6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}else if(X.matches(Q6.SECONDS_INPUT)){let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}}}}),z};var ej=(J={})=>{let $=tZ(J);try{let Q=b(S,d(),h(nZ($)),C())($),Z=document.createElement("div");Z.className=`${f}-time-picker-modal`,Z.style.display="none",Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="100%",Z.style.height="100%",Z.style.backgroundColor="rgba(0, 0, 0, 0.4)",Z.style.zIndex=C7.MODAL.toString(),Z.setAttribute("role","presentation");let q=document.createElement("div");q.className=[`${f}-time-picker-dialog`,`${f}-time-picker-dialog--${$.type}`,`${f}-time-picker-dialog--${$.orientation}`,`${f}-time-picker-dialog--${$.format}`].join(" "),q.style.position="absolute",q.style.top="50%",q.style.left="50%",q.style.transform="translate(-50%, -50%)",q.style.zIndex=C7.DIALOG.toString(),Z.appendChild(q),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(Z);let K;if($.value)K=$2($.value,$.format);else{let W=new Date;K={hours:W.getHours(),minutes:W.getMinutes(),seconds:$.showSeconds?W.getSeconds():0,period:W.getHours()>=12?"PM":"AM"}}E6(q,K,$);let G=q2(Q,Z,q,K,$,eZ(Q));if($.isOpen)setTimeout(()=>G.open(),0);return G}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},j2=ej;J6();t();var n1={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},K2={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},D9={TAG:"header",TYPE:n1.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},G2={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var $K={tag:D9.TAG,type:D9.TYPE,scrollable:D9.SCROLLABLE,compressible:D9.COMPRESSIBLE,scrollThreshold:D9.SCROLL_THRESHOLD},z2=(J={})=>u($K,J,"top-app-bar");var W2=(J={})=>{let $=z2(J),Q=S($),Z=()=>{let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-leading`;let k=document.createElement("h1");if(k.className=`${Q.getClass("top-app-bar")}-headline`,$.title)k.textContent=$.title;let M=document.createElement("div");return M.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:B,headlineElement:k,trailingContainer:M}},{leadingContainer:q,headlineElement:j,trailingContainer:K}=Z(),G=()=>{let B=[$.class];if($.type!=="small")B.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))B.push(`${Q.getClass("top-app-bar")}--compressible`);return B.filter(Boolean)},W=h({tag:$.tag,componentName:"top-app-bar",className:G(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),z=d()(W),Y=C()(z);(()=>{if($.type==="medium"||$.type==="large"){let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-row`,B.appendChild(q),B.appendChild(K);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),Y.element.appendChild(B),Y.element.appendChild(k)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(K)})();let X=!1;if($.scrollable){let B=()=>{let M=window.scrollY>$.scrollThreshold;if(X!==M){if(X=M,X)Y.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else Y.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(X)}};window.addEventListener("scroll",B,{passive:!0}),B();let k=Y.lifecycle.destroy;Y.lifecycle.destroy=()=>{window.removeEventListener("scroll",B),k()}}let _=(B)=>{while(Y.element.firstChild)Y.element.removeChild(Y.element.firstChild);if(["small","medium","large","center"].forEach((k)=>{Y.element.classList.remove(`${Q.getClass("top-app-bar")}--${k}`)}),B!=="small")Y.element.classList.add(`${Q.getClass("top-app-bar")}--${B}`);if(Y.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(B==="medium"||B==="large")),B==="medium"||B==="large"){let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(q),k.appendChild(K);let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(j),Y.element.appendChild(k),Y.element.appendChild(M)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(K)};return{...Y,setTitle(B){return j.textContent=B,this},getTitle(){return j.textContent||""},addLeadingElement(B){return q.appendChild(B),this},addTrailingElement(B){return K.appendChild(B),this},setType(B){return $.type=B,_(B),this},setScrollState(B){if(X=B,B)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return q},getTrailingContainer(){return K}}};var JK=W2;w6();J6();c();o();var P6={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var Y2=8;var U2=({lifecycle:J})=>($)=>{let Q=null,Z=P6.BOTTOM,q=!1,j=null,K=null,G=300,W=100,z=!0,Y=!0,U=document.createElement("div");U.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(U),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let X=()=>{if(!Q)return{top:0,left:0};let P=$.element.getBoundingClientRect(),L=Q.getBoundingClientRect(),D=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,w=Y2,A=0,x=0,I;switch(Z){case P6.TOP:A=L.top+D-P.height-w,x=L.left+R+L.width/2-P.width/2,I="bottom";break;case P6.TOP_START:A=L.top+D-P.height-w,x=L.left+R,I="bottom-start";break;case P6.TOP_END:A=L.top+D-P.height-w,x=L.left+R+L.width-P.width,I="bottom-end";break;case P6.RIGHT:A=L.top+D+L.height/2-P.height/2,x=L.left+R+L.width+w,I="left";break;case P6.RIGHT_START:A=L.top+D,x=L.left+R+L.width+w,I="left-start";break;case P6.RIGHT_END:A=L.top+D+L.height-P.height,x=L.left+R+L.width+w,I="left-end";break;case P6.BOTTOM:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top";break;case P6.BOTTOM_START:A=L.top+D+L.height+w,x=L.left+R,I="top-start";break;case P6.BOTTOM_END:A=L.top+D+L.height+w,x=L.left+R+L.width-P.width,I="top-end";break;case P6.LEFT:A=L.top+D+L.height/2-P.height/2,x=L.left+R-P.width-w,I="right";break;case P6.LEFT_START:A=L.top+D,x=L.left+R-P.width-w,I="right-start";break;case P6.LEFT_END:A=L.top+D+L.height-P.height,x=L.left+R-P.width-w,I="right-end";break;default:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top"}let r=window.innerWidth;if(x<0)x=0;else if(x+P.width>r)x=r-P.width;return{top:A,left:x,arrowPosition:I}},_=(P)=>{if(Y)P.addEventListener("mouseenter",B),P.addEventListener("mouseleave",k);if(z)P.addEventListener("focus",M),P.addEventListener("blur",V)},H=(P)=>{if(P)P.removeEventListener("mouseenter",B),P.removeEventListener("mouseleave",k),P.removeEventListener("focus",M),P.removeEventListener("blur",V)},B=()=>F.show(),k=()=>F.hide(),M=()=>F.show(),V=()=>F.hide(),F={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(P){let L=document.createTextNode(P);while($.element.firstChild!==U)$.element.removeChild($.element.firstChild);if($.element.insertBefore(L,U),q)this.updatePosition();return this},getText(){let P=$.element.cloneNode(!0),L=P.querySelector(`.${$.getClass("tooltip")}__arrow`);if(L)L.remove();return P.textContent||""},setPosition(P){Z=P;let L=$.getClass("tooltip"),D=Object.values(P6).map((R)=>`${L}--${R}`);if($.element.classList.remove(...D),$.element.classList.add(`${L}--${P}`),q)this.updatePosition();return this},getPosition(){return Z},setTarget(P){if(Q)H(Q);if(Q=P,this.target=P,Q.setAttribute("aria-describedby",$.element.id),_(Q),q)this.updatePosition();return this},show(P=!1){if(j!==null)window.clearTimeout(j),j=null;if(K!==null)window.clearTimeout(K),K=null;let L=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),q=!0,this.updatePosition(),window.addEventListener("resize",N),window.addEventListener("scroll",O)};if(P)L();else j=window.setTimeout(L,G);return this},hide(P=!1){if(K!==null)window.clearTimeout(K),K=null;if(j!==null)window.clearTimeout(j),j=null;let L=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),q=!1,window.removeEventListener("resize",N),window.removeEventListener("scroll",O)};if(P)L();else K=window.setTimeout(L,W);return this},isVisible(){return q},updatePosition(){if(!Q)return this;let{top:P,left:L,arrowPosition:D}=X();if($.element.style.top=`${Math.round(P)}px`,$.element.style.left=`${Math.round(L)}px`,D)U.className=`${$.getClass("tooltip")}__arrow`,U.classList.add(`${$.getClass("tooltip")}__arrow--${D}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(K!==null)window.clearTimeout(K);if(Q)H(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",N),window.removeEventListener("scroll",O),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},N=()=>{F.updatePosition()},O=()=>{F.updatePosition()};return F};t();var e1={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},$J={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},X2={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},r6={POSITION:e1.BOTTOM,VARIANT:$J.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},B2={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var QK={position:r6.POSITION,variant:r6.VARIANT,visible:r6.VISIBLE,showDelay:r6.SHOW_DELAY,hideDelay:r6.HIDE_DELAY,showOnFocus:r6.SHOW_ON_FOCUS,showOnHover:r6.SHOW_ON_HOVER,rich:r6.RICH},F2=(J={})=>u(QK,J,"tooltip"),H2=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return p(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},M2=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var ZK=()=>{return`${f}-tooltip-${Math.random().toString(36).substring(2,9)}`},qK=(J={})=>{let $=F2(J);try{let Q=b(S,h(H2($)),C(),(Z)=>U2(M2(Z))(Z))($);if(Q.element.id=ZK(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},k2=qK;K7();T9();c();o();A8();var jK=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list manager: missing element"),$;let Q=J.renderItem,Z=null,q=(G,W,z)=>{let Y=Q?Q(G,W,z):j(G,z);if(Y&&G.id&&!Y.hasAttribute("data-id"))Y.setAttribute("data-id",G.id);if(Z)Z(G,Y);return Y};function j(G,W){let z=W||document.createElement("div");return z.className=$6.ITEM,z.textContent=G.text||G.title||G.headline||G.name||G.id,z}let K=R8(J.collection,$.element,{...J,renderItem:q,afterLoad:(G)=>{if($.emit(P9.LOAD,G),J.afterLoad)J.afterLoad(G)}});if(K.setRenderHook=(G)=>{Z=G},$.lifecycle&&$.lifecycle.destroy){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{K.destroy(),G()}}return{...$,list:K}},JJ=jK;A9();_7();var KK=(J)=>($)=>{if(!$.element||!J.trackSelection)return $;let Q=new Set;if(Array.isArray(J.items))J.items.forEach((G)=>{if(G.selected)Q.add(G.id)});if(Array.isArray(J.initialSelection))J.initialSelection.forEach((G)=>{Q.add(G)});let Z=()=>{if(!$.list){setTimeout(Z,0);return}if(typeof $.list.setRenderHook==="function")$.list.setRenderHook((G,W)=>{if(Q.has(G.id)){if(!R6(W,$6.SELECTED))g(W,$6.SELECTED)}else if(R6(W,$6.SELECTED))j6(W,$6.SELECTED)})};Z();let q=(G)=>{if(!G.target.closest("[data-id]"))return;let W=G.target.closest("[data-id]"),z=W.getAttribute("data-id");if(!z)return;let Y=$.list?.getAllItems().find((X)=>X.id===z);if(!Y)return;let U={item:Y,element:W,originalEvent:G,component:$,preventDefault:()=>{U.defaultPrevented=!0},defaultPrevented:!1};if($.emit(P9.SELECT,U),U.defaultPrevented)return;if(J.multiSelect)if(Q.has(z))Q.delete(z),j6(W,$6.SELECTED);else Q.add(z),g(W,$6.SELECTED);else if(R6(W,$6.SELECTED))Q.clear(),j6(W,$6.SELECTED);else $.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((H)=>{j6(H,$6.SELECTED)}),Q.clear(),Q.add(z),g(W,$6.SELECTED)};$.element.addEventListener("click",q);let j=()=>{$.element.querySelectorAll("[data-id]").forEach((W)=>{let z=W.getAttribute("data-id"),Y=Q.has(z);if(Y&&!R6(W,$6.SELECTED))g(W,$6.SELECTED);else if(!Y&&R6(W,$6.SELECTED))j6(W,$6.SELECTED)})},K=(G,W)=>{if(W)Q.add(G);else Q.delete(G);let z=$.element.querySelector(`[data-id="${G}"]`);if(z){if(W&&!R6(z,$6.SELECTED))g(z,$6.SELECTED);else if(!W&&R6(z,$6.SELECTED))j6(z,$6.SELECTED)}};if($.lifecycle&&$.lifecycle.destroy){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",q),G()}}return{...$,getSelectedItems:()=>{return($.list?.getAllItems()||[]).filter((W)=>Q.has(W.id))},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(G)=>Q.has(G),selectItem:(G)=>{return K(G,!0),$},deselectItem:(G)=>{return K(G,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((W)=>j6(W,$6.SELECTED));return $},setSelection:(G)=>{if(!G?.length&&Q.size===0)return $;if(Q.clear(),Array.isArray(G))G.forEach((W)=>Q.add(W));return j(),$}}},QJ=KK;var N2=({list:J,events:$,lifecycle:Q})=>(Z)=>({...Z,element:Z.element,refresh:async()=>{return await J.refresh(),Z},loadMore:async()=>{return await J.loadMore()},scrollToItem:(q,j="start")=>{return J.scrollToItem(q,j),Z},getVisibleItems:()=>J.getVisibleItems(),getAllItems:()=>J.getAllItems(),isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),on:(q,j)=>{return $.on(q,j),Z},off:(q,j)=>{return $.off(q,j),Z},destroy:()=>{Q.destroy()}});t();var GK={collection:G9.COLLECTION,transform:(J)=>J,baseUrl:G9.BASE_URL,items:[],pageSize:G9.PAGE_SIZE,renderBufferSize:G9.RENDER_BUFFER_SIZE,renderItem:null,trackSelection:!0,multiSelect:!1},V2=(J={})=>{if(!J.renderItem&&!Array.isArray(J.items))throw new Error("List requires either static items or a renderItem function");if(Array.isArray(J.items)&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id,Q};return u(GK,J,"list")},_2=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"div",attributes:$,className:[$6.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},L2=(J)=>({list:{refresh:J.list?.refresh,loadMore:J.list?.loadMore,scrollToItem:J.list?.scrollToItem,getVisibleItems:J.list?.getVisibleItems,getAllItems:J.list?.getAllItems,isLoading:J.list?.isLoading,hasNextPage:J.list?.hasNextPage},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy}});var zK=(J={})=>{try{let $=V2(J);return b(S,d(),h(_2($)),JJ($),QJ($),C(),(Z)=>N2(L2(Z))(Z))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},D2=zK;var O2=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},ZJ=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},qJ=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};q7();var P2=(J,$,Q,Z)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){Z();return}let K=J.drawer.getAllItems();if(K?.length>0)K.forEach((G)=>{J.drawer.removeItem(G.config.id)});j.forEach((G)=>{J.drawer.addItem(G)}),Q()},R2=(J,$)=>{let Q=Object.keys(J.items||{}).map((q)=>({id:q,label:J.items[q]?.label||q,icon:J.items[q]?.icon||"",active:q===J.activeSection})),Z=w7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(Z.element),Z},A2=(J,$)=>{let Q=w7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},w2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},x2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},y2=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},T2=(J,$,Q,Z,q)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||MJ(),j!==J.isMobile){if(J.isMobile)Q();else Z();if(q.onViewChange)q.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},I2=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},S2=(J,$,Q,Z)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,Z);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,Z)};var b2=(J,$,Q,Z,q,j)=>{let K=J.rail;if(!K)return;K.on("change",(G)=>{let W=G?.id;if(!W||J.processingChange)return;let z=G?.source==="userAction";if(J.processingChange=!0,J.activeSection=W,Q(W),j.onSectionChange&&z)j.onSectionChange(W,{source:z?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),K.on("mouseover",(G)=>{let W=G?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,W)if(J.items[W]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(W)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)q()},$.hoverDelay)}),K.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),K.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)q()},$.closeDelay)})},v2=(J,$,Q,Z)=>{let q=J.drawer;if(!q)return;if(typeof q.on==="function")q.on("change",(j)=>{let K=j.id;if(J.activeSubsection=K,$.hideDrawerOnClick)Q();if(Z.onItemSelect)Z.onItemSelect(j)}),q.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),q.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},C2=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},E2=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};q7();var WK=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(Z)=>{if(Z.target===J.overlayElement)Q()}),J.overlayElement},YK=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
58
58
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
59
59
  <line x1="18" y1="6" x2="6" y2="18"></line>
60
60
  <line x1="6" y1="6" x2="18" y2="18"></line>
61
61
  </svg>
62
- `,J.closeButtonElement.addEventListener("click",()=>{Q()}),u6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${E$.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${E$.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},W9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},h2=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;if(WK(J,$,Q),YK(J,$,Q),UK(J,$,Q,Z),$.enableSwipeGestures&&u6())XK(J,Q,Z);Q()},UK=(J,$,Q,Z)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let q=u6()?"touchend":"click",j=(G)=>{if(!J.isMobile||!Z())return;let z=p6(G).target;if(J.drawer.element.contains(z)||J.rail.element.contains(z))return;Q()};J.outsideClickHandler=j,document.addEventListener(q,j,u6()?{passive:!0}:!1)},XK=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;let G=0,K=0;j.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),j.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||Q()||!Z)return;let W=z.touches[0],Y=W.clientX-G,U=W.clientY-K;if(Math.abs(Y)>Math.abs(U)&&Y>W9.SWIPE_THRESHOLD)Z()},{passive:!0}),q.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),q.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||!Q())return;let Y=z.touches[0].clientX-G;if(Y<0){if(q.element.style.transform=`translateX(${Y/2}px)`,Y<-W9.SWIPE_THRESHOLD)$()}},{passive:!0}),q.element.addEventListener("touchend",()=>{if(q.element.style.transform)q.element.style.transition="transform 0.2s ease",q.element.style.transform="",setTimeout(()=>{q.element.style.transition=""},200)},{passive:!0})},u2=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var BK=(J={})=>{let $=O2(J),Q=ZJ(J),Z=qJ(J),q={initialize:()=>q,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>q,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>w2($,Z),G=()=>x2($,Z),K=()=>y2($),z=(B)=>{P2($,B,j,G)},W=()=>{h2($,Z,G,K)},Y=()=>{T2($,Z,W,()=>u2($,Z),q)},U=(B,M,k)=>{S2($,B,M,k)},X=()=>{if($.rail=R2($,Q),$.drawer=A2($,Q),b2($,Q,z,j,G,q),v2($,Q,G,q),C2($,Y),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(z(J.activeSection),J.expanded===!0)j();else G()}return Y(),q},_=()=>{E2($,Y),I2($)},H=(B)=>{return Object.assign(J,B),Object.assign(Q,ZJ({...J,...B})),Object.assign(Z,qJ({...J,...B})),q};return q.initialize=X,q.cleanup=_,q.navigateTo=U,q.showDrawer=j,q.hideDrawer=G,q.isDrawerVisible=K,q.configure=H,q.setProcessingChange=(B)=>{$.processingChange=B},q.isProcessingChange=()=>$.processingChange,q.isMobile=()=>$.isMobile,q.checkMobileState=Y,q},FK=BK;z8();m6();J6();c();o();var f2=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((G)=>G.id===J.value);if(j)Q=j.text}let Z='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',q=A$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:Z,readonly:!0});return q.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:q.element,textfield:q}},jJ=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=jJ($.submenu);return Q})},g2=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((G)=>G.id===J.value);let Z=jJ(Q.options),q=H$({opener:$.textfield,items:Z,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});q.on("select",(G)=>{if(!G.item||G.item.hasSubmenu)return;let K=G.item.data;if(!K||!("id"in K)||!("text"in K)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id),$.emit)$.emit("change",{select:$,value:K.id,text:K.text,option:K,originalEvent:G.originalEvent,preventDefault:()=>{G.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(G)=>{if($.textfield.input.disabled)return;if((G.key==="Enter"||G.key===" "||G.key==="ArrowDown")&&!q.isOpen()){if(G.preventDefault(),q.open(G,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:G,preventDefault:()=>{},defaultPrevented:!1})}else if(G.key==="Escape"&&q.isOpen())G.preventDefault(),q.close(G)}),q.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let G=J.prefix||"mtrl";if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}),q.on("close",(G)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let K=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.remove(`${K}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:G.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;q.setSelected(Q.selectedOption.id)};return q.on("open",()=>{setTimeout(j,50)}),{...$,menu:q,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(G)=>{let K=Q.options.find((z)=>("id"in z)&&z.id===G);if(K&&"text"in K)Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(G)=>{Q.options=G;let K=jJ(G);if(q.setItems(K),Q.selectedOption&&!G.find((z)=>("id"in z)&&z.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(G,K="mouse")=>{return q.open(G,K),$},close:(G)=>{return q.close(G),$},isOpen:()=>q.isOpen()}}};var d2=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);else if($.on)$.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);else if($.off)$.off(Q,Z);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});t();var HK={options:[],variant:E9.VARIANT,placement:E9.PLACEMENT},l2=(J={options:[]})=>u(HK,J,"select"),r2=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var kK=(J)=>{try{let $=l2(J),Q=b(S,d(),f2($),g2($),C(),(Z)=>d2(r2(Z))(Z))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},p2=kK;_7();_7();Q$();H8();Q8();T8();var s2={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},m2={DAY:"day",MONTH:"month",YEAR:"year"},a2={SINGLE:"single",RANGE:"range"},c2=["S","M","T","W","T","F","S"],i2=["January","February","March","April","May","June","July","August","September","October","November","December"],o2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t2="MM/DD/YYYY";var n2={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},e2={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},$3={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var J3={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},Q3="Yes",Z3="No";var q3={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},j3={SMALL:"small",DEFAULT:"default",LARGE:"large"},K3={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};m6();var Tx=V7,Ix=V7,Sx=V7;export{K6 as withVariant,l7 as withTrack,yJ as withThrottle,X9 as withTextLabel,d7 as withTextInput,Y9 as withText,S3 as withTapGesture,E1 as withTabsManagement,Oq as withSwipeable,v3 as withSwipeGesture,y1 as withSupportingText,PJ as withStyle,f7 as withSize,h1 as withScrollable,S6 as withRipple,g7 as withPosition,E3 as withPanGesture,C3 as withLongPressGesture,Lq as withLoading,C as withLifecycle,u9 as withInput,f1 as withIndicator,U9 as withIcon,fJ as withGestures,Dq as withExpandable,d as withEvents,AJ as withEnhancedEvents,v8 as withElevation,h as withElement,u1 as withDivider,G6 as withDisabled,IJ as withDebounce,f9 as withCheckable,I8 as withAPI,o3 as when,b1 as updateTabPanels,V4 as updateCanvasDimensions,Hq as transforms,W3 as transform,YJ as toggleClass,G7 as throttle,pj as setupResponsiveBehavior,v1 as setupKeyboardNavigation,aJ as setGlobalDefaults,mJ as setComponentDefaults,GJ as setAttributes,j6 as removeClass,U3 as removeAttributes,B8 as processSchema,l9 as processClassNames,b as pipe,u$ as once,t7 as observeCanvasResize,p6 as normalizeEvent,e6 as normalizeClasses,Qq as loggingMiddleware,Ix as jsxs,Sx as jsxDEV,Tx as jsx,t3 as joinClasses,a6 as isObject,f0 as isJsxSchema,x6 as isComponent,N4 as initializeCanvasWithRetry,u6 as hasTouchSupport,M6 as hasLifecycle,_6 as hasEmit,R6 as hasClass,V7 as h,B3 as getModifierClass,p9 as getLayoutType,w9 as getInheritedBackground,F3 as getElementClass,s7 as getComponentDefaults,X3 as getComponentClass,W8 as flattenLayout,B4 as fillRoundedRectLR,QX as fillRoundedRect,w8 as easeOutCubic,Zq as deriveFiltered,z7 as debounce,JK as createTopAppBar,M2 as createTooltip,j2 as createTimePicker,A$ as createTextfield,dj as createTabsState,sj as createTabs,C1 as createTabIndicator,S7 as createTab,PZ as createSwitch,_4 as createStyledCanvas,Jq as createStore,h$ as createStateEventManager,MZ as createSnackbar,qZ as createSlider,cQ as createSheet,p2 as createSelect,F1 as createSegmentedButton,B1 as createSegment,bQ as createSearch,M3 as createSVGElement,N8 as createRouteAdapter,U4 as createRoundedRectPath,LQ as createRadios,G8 as createProgress,FK as createNavigationSystem,w7 as createNavigation,H$ as createMenu,R8 as createListManager,D2 as createList,qq as createLifecycle,J9 as createLayoutResult,s9 as createLayout,Gq as createJsxLayout,r7 as createGestureManager,s8 as createFab,m8 as createExtendedFab,a3 as createEventManager,f6 as createEmitter,v as createElement,c9 as createDivider,jq as createDisabled,m5 as createDialog,x5 as createDatePicker,r9 as createComponentInstance,Y3 as createComponent,k8 as createCollection,hq as createChips,Y$ as createChip,e4 as createCheckbox,m4 as createCarousel,D7 as createCardMedia,z$ as createCardHeader,G$ as createCardContent,L7 as createCardActions,d4 as createCard,x8 as createCanvasThemeObserver,M4 as createCanvasContext,Q9 as createButton,m3 as createBottomAppBar,M8 as createBaseAdapter,S as createBase,j7 as createBadge,z3 as compose,X4 as clipRoundedRect,cJ as clearGlobalDefaults,F4 as clearCanvas,u0 as cleanupLayoutClasses,H3 as classNames,X0 as byString,U8 as applyLayoutItemClasses,Y8 as applyLayoutClasses,rj as addScrollIndicators,g as addClass,n1 as TOP_APP_BAR_TYPES,K2 as TOP_APP_BAR_STATES,D9 as TOP_APP_BAR_DEFAULTS,G2 as TOP_APP_BAR_CLASSES,$J as TOOLTIP_VARIANTS,e1 as TOOLTIP_POSITIONS,X2 as TOOLTIP_EVENTS,r6 as TOOLTIP_DEFAULTS,B2 as TOOLTIP_CLASSES,v7 as TIME_PICKER_TYPE,w$ as TIME_PICKER_ORIENTATION,Q7 as TIME_PERIOD,J7 as TIME_FORMAT,C7 as TIMEPICKER_Z_INDEX,iZ as TIMEPICKER_VALUES,i1 as TIMEPICKER_TYPES,Q6 as TIMEPICKER_SELECTORS,cZ as TIMEPICKER_PERIODS,o1 as TIMEPICKER_ORIENTATIONS,l6 as TIMEPICKER_ICONS,t1 as TIMEPICKER_FORMATS,L6 as TIMEPICKER_EVENTS,j9 as TIMEPICKER_DIAL,t6 as TIMEPICKER_DEFAULTS,oZ as TIMEPICKER_CLASSES,R$ as TEXTFIELD_VARIANTS,c1 as TEXTFIELD_TYPES,dZ as TEXTFIELD_STATES,lZ as TEXTFIELD_EVENTS,rZ as TEXTFIELD_DENSITY,b7 as TEXTFIELD_DEFAULTS,pZ as TEXTFIELD_CLASSES,P$ as TAB_VARIANTS,I7 as TAB_STATES,I1 as TAB_INDICATOR_WIDTH_STRATEGIES,yZ as TAB_EVENTS,IZ as TAB_CLASSES,S1 as TABS_EVENTS,v9 as TABS_DEFAULTS,TZ as TABS_CLASSES,N$ as SelectionMode,RZ as SWITCH_STATES,T1 as SWITCH_LABEL_POSITIONS,AZ as SWITCH_EVENTS,wZ as SWITCH_DEFAULTS,xZ as SWITCH_CLASSES,WJ as STATES,x1 as SNACKBAR_VARIANTS,GZ as SNACKBAR_STATES,q9 as SNACKBAR_POSITIONS,zZ as SNACKBAR_EVENTS,e9 as SNACKBAR_DEFAULTS,WZ as SNACKBAR_CLASSES,D6 as SLIDER_SIZES,L$ as SLIDER_POSITIONS,H6 as SLIDER_EVENTS,V6 as SLIDER_DEFAULTS,Z9 as SLIDER_COLORS,iQ as SLIDER_CLASSES,b9 as SHEET_VARIANTS,n9 as SHEET_POSITIONS,rQ as SHEET_GESTURE,dQ as SHEET_EVENTS,_1 as SHEET_ELEVATION,L9 as SHEET_DEFAULTS,pQ as SHEET_CLASSES,lQ as SHEET_ANIMATION,E7 as SELECT_VARIANTS,h7 as SELECT_PLACEMENT,S$ as SELECT_INTERACTION,v$ as SELECT_ICONS,b$ as SELECT_EVENTS,E9 as SELECT_DEFAULTS,C$ as SELECT_CLASSES,Y1 as SEGMENTED_BUTTON_MODES,EQ as SEGMENTED_BUTTON_ICONS,vQ as SEGMENTED_BUTTON_EVENTS,U1 as SEGMENTED_BUTTON_DENSITY,o9 as SEGMENTED_BUTTON_DEFAULTS,hQ as SEGMENTED_BUTTON_CLASSES,x7 as SEARCH_VARIANTS,wQ as SEARCH_STATES,y7 as SEARCH_ICONS,xQ as SEARCH_EVENTS,o6 as SEARCH_DEFAULTS,yQ as SEARCH_CLASSES,q1 as RADIO_VARIANTS,DQ as RADIO_STATES,K1 as RADIO_SIZES,j1 as RADIO_LABEL_POSITIONS,OQ as RADIO_EVENTS,Z1 as RADIO_DIRECTIONS,PQ as RADIO_DEFAULTS,RQ as RADIO_CLASSES,B9 as PROGRESS_VARIANTS,d6 as PROGRESS_THICKNESS,v6 as PROGRESS_SHAPES,s6 as PROGRESS_MEASUREMENTS,Y7 as PROGRESS_EVENTS,g6 as PROGRESS_DEFAULTS,W6 as PROGRESS_CLASSES,f as PREFIX,y6 as OPERATORS,e8 as NAV_VARIANTS,$1 as NAV_POSITIONS,YQ as NAV_ITEM_STATES,k$ as NAV_EVENTS,_9 as NAV_DEFAULTS,n as NAV_CLASSES,J1 as NAV_BEHAVIORS,o2 as MONTH_NAMES_SHORT,i2 as MONTH_NAMES,n8 as MENU_POSITION,qQ as MENU_ITEM_TYPES,ZQ as MENU_INTERACTION_TYPES,jQ as MENU_EVENTS,c6 as MENU_DEFAULTS,F$ as MENU_CLASSES,y$ as LIST_TYPES,T$ as LIST_SELECTION_MODES,I$ as LIST_SCROLL_POSITIONS,P9 as LIST_EVENTS,G9 as LIST_DEFAULTS,$6 as LIST_CLASSES,g0 as Fragment,q3 as FAB_VARIANTS,j3 as FAB_SIZES,K3 as FAB_POSITIONS,qX as EASING_FUNCTIONS,_$ as Density,n2 as DIALOG_SIZES,$3 as DIALOG_FOOTER_ALIGNMENTS,J3 as DIALOG_BUTTON_VARIANTS,e2 as DIALOG_ANIMATIONS,m9 as DEFAULT_RIPPLE_CONFIG,t2 as DEFAULT_DATE_FORMAT,Q3 as DEFAULT_CONFIRM_BUTTON_TEXT,Z3 as DEFAULT_CANCEL_BUTTON_TEXT,c2 as DAY_NAMES,m2 as DATEPICKER_VIEWS,s2 as DATEPICKER_VARIANTS,a2 as DATEPICKER_SELECTION_MODES,Mq as CleanupManager,zJ as COMPONENTS,zq as COLLECTION_OPERATORS,Y6 as COLLECTION_EVENTS,K5 as CHIP_VARIANTS,G5 as CHIP_EVENTS,M9 as CHIPS_EVENTS,h8 as CHECKBOX_VARIANTS,$5 as CHECKBOX_STATES,u8 as CHECKBOX_LABEL_POSITION,J5 as CHECKBOX_CLASSES,W$ as CAROUSEL_TRANSITIONS,l4 as CAROUSEL_SCROLL_BEHAVIORS,k9 as CAROUSEL_LAYOUTS,Rq as CAROUSEL_ITEM_SIZES,a9 as CAROUSEL_EVENTS,F6 as CAROUSEL_DEFAULTS,S8 as CARD_WIDTHS,I9 as CARD_VARIANTS,b4 as CARD_MEDIA_POSITION,O7 as CARD_ELEVATIONS,I4 as CARD_CORNER_RADIUS,v4 as CARD_CLASSES,b8 as CARD_ASPECT_RATIOS,S4 as CARD_ACTION_ALIGNMENT,Z$ as BUTTON_VARIANTS,K$ as BUTTON_TYPES,q$ as BUTTON_SIZES,j$ as BUTTON_SHAPES,P4 as BUTTON_CLASSES,m7 as BADGE_VARIANTS,c7 as BADGE_POSITIONS,g9 as BADGE_MAX_CHARACTERS,a7 as BADGE_COLORS,kq as AnimationFrameManager,H4 as ANIMATION_DURATIONS};
62
+ `,J.closeButtonElement.addEventListener("click",()=>{Q()}),u6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${E$.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${E$.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},W9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},h2=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;if(WK(J,$,Q),YK(J,$,Q),UK(J,$,Q,Z),$.enableSwipeGestures&&u6())XK(J,Q,Z);Q()},UK=(J,$,Q,Z)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let q=u6()?"touchend":"click",j=(K)=>{if(!J.isMobile||!Z())return;let W=p6(K).target;if(J.drawer.element.contains(W)||J.rail.element.contains(W))return;Q()};J.outsideClickHandler=j,document.addEventListener(q,j,u6()?{passive:!0}:!1)},XK=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;let K=0,G=0;j.element.addEventListener("touchstart",(W)=>{let z=W.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),j.element.addEventListener("touchmove",(W)=>{if(!J.isMobile||Q()||!Z)return;let z=W.touches[0],Y=z.clientX-K,U=z.clientY-G;if(Math.abs(Y)>Math.abs(U)&&Y>W9.SWIPE_THRESHOLD)Z()},{passive:!0}),q.element.addEventListener("touchstart",(W)=>{let z=W.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),q.element.addEventListener("touchmove",(W)=>{if(!J.isMobile||!Q())return;let Y=W.touches[0].clientX-K;if(Y<0){if(q.element.style.transform=`translateX(${Y/2}px)`,Y<-W9.SWIPE_THRESHOLD)$()}},{passive:!0}),q.element.addEventListener("touchend",()=>{if(q.element.style.transform)q.element.style.transition="transform 0.2s ease",q.element.style.transform="",setTimeout(()=>{q.element.style.transition=""},200)},{passive:!0})},u2=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var BK=(J={})=>{let $=O2(J),Q=ZJ(J),Z=qJ(J),q={initialize:()=>q,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>q,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>w2($,Z),K=()=>x2($,Z),G=()=>y2($),W=(B)=>{P2($,B,j,K)},z=()=>{h2($,Z,K,G)},Y=()=>{T2($,Z,z,()=>u2($,Z),q)},U=(B,k,M)=>{S2($,B,k,M)},X=()=>{if($.rail=R2($,Q),$.drawer=A2($,Q),b2($,Q,W,j,K,q),v2($,Q,K,q),C2($,Y),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(W(J.activeSection),J.expanded===!0)j();else K()}return Y(),q},_=()=>{E2($,Y),I2($)},H=(B)=>{return Object.assign(J,B),Object.assign(Q,ZJ({...J,...B})),Object.assign(Z,qJ({...J,...B})),q};return q.initialize=X,q.cleanup=_,q.navigateTo=U,q.showDrawer=j,q.hideDrawer=K,q.isDrawerVisible=G,q.configure=H,q.setProcessingChange=(B)=>{$.processingChange=B},q.isProcessingChange=()=>$.processingChange,q.isMobile=()=>$.isMobile,q.checkMobileState=Y,q},FK=BK;z8();m6();J6();c();o();var f2=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((K)=>K.id===J.value);if(j)Q=j.text}let Z='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',q=A$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:Z,readonly:!0});return q.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:q.element,textfield:q}},jJ=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=jJ($.submenu);return Q})},g2=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((K)=>K.id===J.value);let Z=jJ(Q.options),q=H$({opener:$.textfield,items:Z,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});q.on("select",(K)=>{if(!K.item||K.item.hasSubmenu)return;let G=K.item.data;if(!G||!("id"in G)||!("text"in G)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=G,$.textfield.setValue(G.text),q.setSelected(G.id),$.emit)$.emit("change",{select:$,value:G.id,text:G.text,option:G,originalEvent:K.originalEvent,preventDefault:()=>{K.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(K)=>{if($.textfield.input.disabled)return;if((K.key==="Enter"||K.key===" "||K.key==="ArrowDown")&&!q.isOpen()){if(K.preventDefault(),q.open(K,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:K,preventDefault:()=>{},defaultPrevented:!1})}else if(K.key==="Escape"&&q.isOpen())K.preventDefault(),q.close(K)}),q.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let K=J.prefix||"mtrl";if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}),q.on("close",(K)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let G=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.remove(`${G}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:K.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;q.setSelected(Q.selectedOption.id)};return q.on("open",()=>{setTimeout(j,50)}),{...$,menu:q,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(K)=>{let G=Q.options.find((W)=>("id"in W)&&W.id===K);if(G&&"text"in G)Q.selectedOption=G,$.textfield.setValue(G.text),q.setSelected(G.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(K)=>{Q.options=K;let G=jJ(K);if(q.setItems(G),Q.selectedOption&&!K.find((W)=>("id"in W)&&W.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(K,G="mouse")=>{return q.open(K,G),$},close:(K)=>{return q.close(K),$},isOpen:()=>q.isOpen()}}};var d2=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);else if($.on)$.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);else if($.off)$.off(Q,Z);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});t();var HK={options:[],variant:E9.VARIANT,placement:E9.PLACEMENT},l2=(J={options:[]})=>u(HK,J,"select"),r2=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var MK=(J)=>{try{let $=l2(J),Q=b(S,d(),f2($),g2($),C(),(Z)=>d2(r2(Z))(Z))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},p2=MK;_7();_7();Q$();H8();Q8();T8();var s2={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},m2={DAY:"day",MONTH:"month",YEAR:"year"},a2={SINGLE:"single",RANGE:"range"},c2=["S","M","T","W","T","F","S"],i2=["January","February","March","April","May","June","July","August","September","October","November","December"],o2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t2="MM/DD/YYYY";var n2={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},e2={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},$3={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var J3={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},Q3="Yes",Z3="No";var q3={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},j3={SMALL:"small",DEFAULT:"default",LARGE:"large"},K3={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};m6();var Tx=N7,Ix=N7,Sx=N7;export{K6 as withVariant,l7 as withTrack,yJ as withThrottle,X9 as withTextLabel,d7 as withTextInput,Y9 as withText,S3 as withTapGesture,E1 as withTabsManagement,Oq as withSwipeable,v3 as withSwipeGesture,y1 as withSupportingText,PJ as withStyle,f7 as withSize,h1 as withScrollable,S6 as withRipple,g7 as withPosition,E3 as withPanGesture,C3 as withLongPressGesture,Lq as withLoading,C as withLifecycle,u9 as withInput,f1 as withIndicator,U9 as withIcon,fJ as withGestures,Dq as withExpandable,d as withEvents,AJ as withEnhancedEvents,v8 as withElevation,h as withElement,u1 as withDivider,G6 as withDisabled,IJ as withDebounce,f9 as withCheckable,I8 as withAPI,o3 as when,b1 as updateTabPanels,N4 as updateCanvasDimensions,Hq as transforms,W3 as transform,YJ as toggleClass,G7 as throttle,pj as setupResponsiveBehavior,v1 as setupKeyboardNavigation,aJ as setGlobalDefaults,mJ as setComponentDefaults,GJ as setAttributes,j6 as removeClass,U3 as removeAttributes,B8 as processSchema,l9 as processClassNames,b as pipe,u$ as once,t7 as observeCanvasResize,p6 as normalizeEvent,e6 as normalizeClasses,Qq as loggingMiddleware,Ix as jsxs,Sx as jsxDEV,Tx as jsx,t3 as joinClasses,a6 as isObject,f0 as isJsxSchema,x6 as isComponent,V4 as initializeCanvasWithRetry,u6 as hasTouchSupport,k6 as hasLifecycle,N6 as hasEmit,R6 as hasClass,N7 as h,B3 as getModifierClass,p9 as getLayoutType,w9 as getInheritedBackground,F3 as getElementClass,s7 as getComponentDefaults,X3 as getComponentClass,W8 as flattenLayout,B4 as fillRoundedRectLR,QX as fillRoundedRect,w8 as easeOutCubic,Zq as deriveFiltered,z7 as debounce,JK as createTopAppBar,k2 as createTooltip,j2 as createTimePicker,A$ as createTextfield,dj as createTabsState,sj as createTabs,C1 as createTabIndicator,S7 as createTab,PZ as createSwitch,_4 as createStyledCanvas,Jq as createStore,h$ as createStateEventManager,kZ as createSnackbar,qZ as createSlider,cQ as createSheet,p2 as createSelect,F1 as createSegmentedButton,B1 as createSegment,bQ as createSearch,k3 as createSVGElement,V8 as createRouteAdapter,U4 as createRoundedRectPath,LQ as createRadios,G8 as createProgress,FK as createNavigationSystem,w7 as createNavigation,H$ as createMenu,R8 as createListManager,D2 as createList,qq as createLifecycle,J9 as createLayoutResult,s9 as createLayout,Gq as createJsxLayout,r7 as createGestureManager,s8 as createFab,m8 as createExtendedFab,a3 as createEventManager,f6 as createEmitter,v as createElement,c9 as createDivider,jq as createDisabled,m5 as createDialog,x5 as createDatePicker,r9 as createComponentInstance,Y3 as createComponent,M8 as createCollection,hq as createChips,Y$ as createChip,e4 as createCheckbox,m4 as createCarousel,D7 as createCardMedia,z$ as createCardHeader,G$ as createCardContent,L7 as createCardActions,d4 as createCard,x8 as createCanvasThemeObserver,k4 as createCanvasContext,Q9 as createButton,m3 as createBottomAppBar,k8 as createBaseAdapter,S as createBase,j7 as createBadge,z3 as compose,X4 as clipRoundedRect,cJ as clearGlobalDefaults,F4 as clearCanvas,u0 as cleanupLayoutClasses,H3 as classNames,X0 as byString,U8 as applyLayoutItemClasses,Y8 as applyLayoutClasses,rj as addScrollIndicators,g as addClass,n1 as TOP_APP_BAR_TYPES,K2 as TOP_APP_BAR_STATES,D9 as TOP_APP_BAR_DEFAULTS,G2 as TOP_APP_BAR_CLASSES,$J as TOOLTIP_VARIANTS,e1 as TOOLTIP_POSITIONS,X2 as TOOLTIP_EVENTS,r6 as TOOLTIP_DEFAULTS,B2 as TOOLTIP_CLASSES,v7 as TIME_PICKER_TYPE,w$ as TIME_PICKER_ORIENTATION,Q7 as TIME_PERIOD,J7 as TIME_FORMAT,C7 as TIMEPICKER_Z_INDEX,iZ as TIMEPICKER_VALUES,i1 as TIMEPICKER_TYPES,Q6 as TIMEPICKER_SELECTORS,cZ as TIMEPICKER_PERIODS,o1 as TIMEPICKER_ORIENTATIONS,l6 as TIMEPICKER_ICONS,t1 as TIMEPICKER_FORMATS,L6 as TIMEPICKER_EVENTS,j9 as TIMEPICKER_DIAL,t6 as TIMEPICKER_DEFAULTS,oZ as TIMEPICKER_CLASSES,R$ as TEXTFIELD_VARIANTS,c1 as TEXTFIELD_TYPES,dZ as TEXTFIELD_STATES,lZ as TEXTFIELD_EVENTS,rZ as TEXTFIELD_DENSITY,b7 as TEXTFIELD_DEFAULTS,pZ as TEXTFIELD_CLASSES,P$ as TAB_VARIANTS,I7 as TAB_STATES,I1 as TAB_INDICATOR_WIDTH_STRATEGIES,yZ as TAB_EVENTS,IZ as TAB_CLASSES,S1 as TABS_EVENTS,v9 as TABS_DEFAULTS,TZ as TABS_CLASSES,V$ as SelectionMode,RZ as SWITCH_STATES,T1 as SWITCH_LABEL_POSITIONS,AZ as SWITCH_EVENTS,wZ as SWITCH_DEFAULTS,xZ as SWITCH_CLASSES,WJ as STATES,x1 as SNACKBAR_VARIANTS,GZ as SNACKBAR_STATES,q9 as SNACKBAR_POSITIONS,zZ as SNACKBAR_EVENTS,e9 as SNACKBAR_DEFAULTS,WZ as SNACKBAR_CLASSES,D6 as SLIDER_SIZES,L$ as SLIDER_POSITIONS,H6 as SLIDER_EVENTS,V6 as SLIDER_DEFAULTS,Z9 as SLIDER_COLORS,iQ as SLIDER_CLASSES,b9 as SHEET_VARIANTS,n9 as SHEET_POSITIONS,rQ as SHEET_GESTURE,dQ as SHEET_EVENTS,_1 as SHEET_ELEVATION,L9 as SHEET_DEFAULTS,pQ as SHEET_CLASSES,lQ as SHEET_ANIMATION,E7 as SELECT_VARIANTS,h7 as SELECT_PLACEMENT,S$ as SELECT_INTERACTION,v$ as SELECT_ICONS,b$ as SELECT_EVENTS,E9 as SELECT_DEFAULTS,C$ as SELECT_CLASSES,Y1 as SEGMENTED_BUTTON_MODES,EQ as SEGMENTED_BUTTON_ICONS,vQ as SEGMENTED_BUTTON_EVENTS,U1 as SEGMENTED_BUTTON_DENSITY,o9 as SEGMENTED_BUTTON_DEFAULTS,hQ as SEGMENTED_BUTTON_CLASSES,x7 as SEARCH_VARIANTS,wQ as SEARCH_STATES,y7 as SEARCH_ICONS,xQ as SEARCH_EVENTS,o6 as SEARCH_DEFAULTS,yQ as SEARCH_CLASSES,q1 as RADIO_VARIANTS,DQ as RADIO_STATES,K1 as RADIO_SIZES,j1 as RADIO_LABEL_POSITIONS,OQ as RADIO_EVENTS,Z1 as RADIO_DIRECTIONS,PQ as RADIO_DEFAULTS,RQ as RADIO_CLASSES,B9 as PROGRESS_VARIANTS,d6 as PROGRESS_THICKNESS,v6 as PROGRESS_SHAPES,s6 as PROGRESS_MEASUREMENTS,Y7 as PROGRESS_EVENTS,g6 as PROGRESS_DEFAULTS,W6 as PROGRESS_CLASSES,f as PREFIX,y6 as OPERATORS,e8 as NAV_VARIANTS,$1 as NAV_POSITIONS,YQ as NAV_ITEM_STATES,M$ as NAV_EVENTS,_9 as NAV_DEFAULTS,n as NAV_CLASSES,J1 as NAV_BEHAVIORS,o2 as MONTH_NAMES_SHORT,i2 as MONTH_NAMES,n8 as MENU_POSITION,qQ as MENU_ITEM_TYPES,ZQ as MENU_INTERACTION_TYPES,jQ as MENU_EVENTS,c6 as MENU_DEFAULTS,F$ as MENU_CLASSES,y$ as LIST_TYPES,T$ as LIST_SELECTION_MODES,I$ as LIST_SCROLL_POSITIONS,P9 as LIST_EVENTS,G9 as LIST_DEFAULTS,$6 as LIST_CLASSES,g0 as Fragment,q3 as FAB_VARIANTS,j3 as FAB_SIZES,K3 as FAB_POSITIONS,qX as EASING_FUNCTIONS,_$ as Density,n2 as DIALOG_SIZES,$3 as DIALOG_FOOTER_ALIGNMENTS,J3 as DIALOG_BUTTON_VARIANTS,e2 as DIALOG_ANIMATIONS,m9 as DEFAULT_RIPPLE_CONFIG,t2 as DEFAULT_DATE_FORMAT,Q3 as DEFAULT_CONFIRM_BUTTON_TEXT,Z3 as DEFAULT_CANCEL_BUTTON_TEXT,c2 as DAY_NAMES,m2 as DATEPICKER_VIEWS,s2 as DATEPICKER_VARIANTS,a2 as DATEPICKER_SELECTION_MODES,kq as CleanupManager,zJ as COMPONENTS,zq as COLLECTION_OPERATORS,Y6 as COLLECTION_EVENTS,K5 as CHIP_VARIANTS,G5 as CHIP_EVENTS,k9 as CHIPS_EVENTS,h8 as CHECKBOX_VARIANTS,$5 as CHECKBOX_STATES,u8 as CHECKBOX_LABEL_POSITION,J5 as CHECKBOX_CLASSES,W$ as CAROUSEL_TRANSITIONS,l4 as CAROUSEL_SCROLL_BEHAVIORS,M9 as CAROUSEL_LAYOUTS,Rq as CAROUSEL_ITEM_SIZES,a9 as CAROUSEL_EVENTS,F6 as CAROUSEL_DEFAULTS,S8 as CARD_WIDTHS,I9 as CARD_VARIANTS,b4 as CARD_MEDIA_POSITION,O7 as CARD_ELEVATIONS,I4 as CARD_CORNER_RADIUS,v4 as CARD_CLASSES,b8 as CARD_ASPECT_RATIOS,S4 as CARD_ACTION_ALIGNMENT,Z$ as BUTTON_VARIANTS,K$ as BUTTON_TYPES,q$ as BUTTON_SIZES,j$ as BUTTON_SHAPES,P4 as BUTTON_CLASSES,m7 as BADGE_VARIANTS,c7 as BADGE_POSITIONS,g9 as BADGE_MAX_CHARACTERS,a7 as BADGE_COLORS,Mq as AnimationFrameManager,H4 as ANIMATION_DURATIONS};
63
63
 
64
- //# debugId=4630CE7A1441793D64756E2164756E21
64
+ //# debugId=D93EB4EEA970E48564756E2164756E21