@rettangoli/ui 1.7.6 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rettangoli-iife-layout.min.js +164 -60
- package/dist/rettangoli-iife-ui.min.js +186 -82
- package/package.json +2 -2
- package/src/common/popover.js +5 -0
- package/src/components/dropdownMenu/dropdownMenu.schema.yaml +28 -0
- package/src/components/dropdownMenu/dropdownMenu.store.js +33 -0
- package/src/components/dropdownMenu/dropdownMenu.view.yaml +1 -1
- package/src/components/globalUi/globalUi.handlers.js +3 -0
- package/src/components/globalUi/globalUi.store.js +55 -0
- package/src/components/globalUi/globalUi.view.yaml +4 -1
- package/src/deps/createGlobalUI.js +3 -0
- package/src/primitives/dialog.js +249 -4
- package/src/primitives/popover.js +155 -15
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var _e=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
16
|
-
${u
|
|
15
|
+
`,Ke=({linkElement:e,href:t,newTab:i,rel:s})=>{e.href=t,i?e.target="_blank":e.removeAttribute("target"),s!=null?e.rel=s:i?e.rel="noopener noreferrer":e.removeAttribute("rel")},xe=({shadowRoot:e,slotElement:t,linkElement:i,href:s,newTab:r,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!s)return i&&i.parentNode===e&&e.removeChild(i),null;let o=i||document.createElement("a");return Ke({linkElement:o,href:s,newTab:r,rel:n}),o.parentNode!==e&&e.appendChild(o),o},Pt=({shadowRoot:e,childElement:t,linkElement:i,href:s,newTab:r,rel:n})=>{if(!s)return i?(t.parentNode===i&&e.appendChild(t),i.parentNode===e&&e.removeChild(i),null):(t.parentNode!==e&&e.appendChild(t),null);let o=i||document.createElement("a");return Ke({linkElement:o,href:s,newTab:r,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==e&&e.appendChild(o),o};var te=["default","sm","md","lg","xl"],F=()=>te.reduce((e,t)=>(e[t]={},e),{}),is=["sm","md","lg","xl"],Hn=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,qn=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let i=is.indexOf(e);if(i===-1)return t?["default"]:[];let s=is.slice(i);return t&&s.push("default"),s},Se=({element:e,size:t,attr:i,includeDefault:s=!0})=>{let r=qn({size:t,includeDefault:s});for(let n of r){let o=Hn({size:n,attr:i}),l=e.getAttribute(o);if(l!==null)return l}return null};var Yn=/^([1-9]|1[0-2])fg$/,Gn=/^([1-9]\d*)\/([1-9]\d*)fb$/,Bt=e=>typeof e=="string"&&Yn.test(e),ct=e=>{if(typeof e!="string")return null;let t=e.match(Gn);if(!t)return null;let i=Number(t[1]),s=Number(t[2]);return!Number.isInteger(i)||!Number.isInteger(s)||s<=0||i>s?null:{numerator:i,denominator:s}};function ss({numerator:e,denominator:t,gapVar:i}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${i})) / ${t})`:`calc(((100% - ((${t} - 1) * ${i})) * ${e}) / ${t})`}var K=({styleBucket:e,axis:t,dimension:i,fillValue:s,allowFlexGrow:r=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let l=()=>{!r||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},p=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(i===void 0)return;if(i==="f"){l(),e[t]=s,p();return}if(r&&Bt(i)){e["flex-grow"]=i.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let a=r?ct(i):null;if(a){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=ss({...a,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}l(),e[t]=i,o&&(e[`min-${t}`]=i,e[`max-${t}`]=i)},Ue=({style:e,width:t,fillValue:i="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:r="0"})=>{if(t==="f"){e.width=i,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(s&&Bt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=r;return}let n=s?ct(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=ss({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=r;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};var Jn=e=>`${e}`.trim().replace(/\s*\/\s*/g,"/"),He=e=>{if(e==null)return;let t=Jn(e);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function I(e,...t){let i="";return e.forEach((s,r)=>{i+=s+(t[r]||"")}),i}var Zn=["sm","md","lg","xl"],rs={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},pe=Object.keys(rs),W=e=>e.concat(Zn.flatMap(t=>e.map(i=>`${t}-${i}`))),Ae={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},Y=(e,t={},i=null)=>{let s="";for(let[r,n]of Object.entries(Ae)){r!=="default"&&(s+=`${n} {`);for(let[o,l]of Object.entries(e))for(let[p,a]of Object.entries(l)){let c=rs[o],d=a.startsWith("--")?`var(${a})`:a,u=r==="default"?o:`${r}-${o}`,f=r==="default"?`h-${o}`:`${r}-h-${o}`,h=(y,m=!1)=>{let b=m?`:host([${y}="${p}"]:hover)`:`:host([${y}="${p}"])`;if(i)return i.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let g=t[o];return g?`${b} ${g}`:b};if(c){let m=c.split(" ").map(b=>`${b}: ${d};`).join(" ");s+=`
|
|
16
|
+
${h(u)}{
|
|
17
17
|
${m}
|
|
18
18
|
}
|
|
19
|
-
${
|
|
19
|
+
${h(f,!0)}{
|
|
20
20
|
${m}
|
|
21
21
|
}
|
|
22
|
-
`}else
|
|
23
|
-
${u
|
|
22
|
+
`}else s+=`
|
|
23
|
+
${h(u)}{
|
|
24
24
|
${a}
|
|
25
25
|
}
|
|
26
|
-
${
|
|
26
|
+
${h(f,!0)}{
|
|
27
27
|
${a}
|
|
28
28
|
}
|
|
29
|
-
`}
|
|
30
|
-
`);let o="";for(let[l,p]of Object.entries(e[
|
|
31
|
-
`);
|
|
29
|
+
`}r!=="default"&&(s+="}")}return s};function Xn(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Qn=e=>/%$/.test(e),eo=e=>/^([1-9]|1[0-2])fg$/.test(e),T=e=>{if(e!=null)return eo(e)||Qn(e)?e:Xn(e)?`${e}px`:Object.keys(L).includes(e)?`var(${L[e]})`:e},L={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function G(e,t=":host"){let i="",s=["default","xl","lg","md","sm"];for(let r of s){let n=Ae[r];if(!e[r]||Object.keys(e[r]).length===0)continue;r!=="default"&&(i+=`${n} {
|
|
30
|
+
`);let o="";for(let[l,p]of Object.entries(e[r]))p!=null&&(o+=`${l}: ${p} !important;
|
|
31
|
+
`);i+=`${t} {
|
|
32
32
|
${o.trim()}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
35
|
-
`)}return
|
|
34
|
+
`,r!=="default"&&(i+=`}
|
|
35
|
+
`)}return i}var to={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},ns=Y(to,{},".surface");var io=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],zt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -252,8 +252,8 @@ var rettangoli=(()=>{var _e=`
|
|
|
252
252
|
color: inherit;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
${
|
|
256
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,s
|
|
255
|
+
${ns}
|
|
256
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,i,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:i,maxWidth:s}of io){let r=`${i}-s`;if(t<=s&&this.hasAttribute(r))return this.getAttribute(r)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),i=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel"),n=i&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(Ke({linkElement:this._surfaceElement,href:i,newTab:s,rel:r}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},i=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[i]||18:s=t[i]||18;let r=this.getAttribute("pre");r&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",r),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=T(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},os=({render:e,html:t})=>zt;var so=({numerator:e,denominator:t,gapVar:i})=>e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${i})) / ${t})`:`calc(((100% - ((${t} - 1) * ${i})) * ${e}) / ${t})`,ut=({index:e,maxIndex:t})=>!Number.isFinite(e)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(e),0),t),Wt=({value:e,defaultValue:t=!1})=>{if(e==null)return t;let i=`${e}`.trim().toLowerCase();return i.length===0?!0:!(i==="false"||i==="0"||i==="no"||i==="off"||i==="none")},Mt=e=>{if(e==null)return"x mandatory";let t=`${e}`.trim().toLowerCase();return t===""||t==="true"||t==="1"||t==="yes"?"x mandatory":t==="false"||t==="0"||t==="no"||t==="off"||t==="none"?"none":"x mandatory"},as=({slideLeft:e,slideWidth:t,viewportWidth:i,scrollPaddingInlineStart:s=0,scrollPaddingInlineEnd:r=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(i))return 0;let l=s,p=i-r,a=Math.max(p-l,0),c;n==="start"?c=e-l:n==="end"?c=e+t-p:c=e+t/2-(l+a/2);let d=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(c,0),d)},ls=({slideWidthCss:e,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${e&&`${e}`.trim().length>0?`${e}`.trim():"100%"})) / 2), 0px)`,ps=({slideWidth:e,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(e==null||`${e}`.trim()===""||e==="f")return"100%";let i=ct(`${e}`.trim());return i?so({...i,gapVar:t}):T(`${e}`.trim())??"100%"};var ro=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),Ft=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},no=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,ds=e=>{let t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");let s=document.createElementNS(t,"path");return s.setAttribute("d",e==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("stroke-width","2"),s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),i.appendChild(s),i},Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
257
257
|
:host {
|
|
258
258
|
display: block;
|
|
259
259
|
width: 100%;
|
|
@@ -448,7 +448,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
448
448
|
border-color: var(--foreground);
|
|
449
449
|
transform: scale(1.2);
|
|
450
450
|
}
|
|
451
|
-
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),e.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(or("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(or("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let s=Number(t);this.setAttribute("index",Number.isFinite(s)?`${s}`:"0")}get snap(){return zt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,s,r){if(s!==r){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(r),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Bt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Bt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,s={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let r=pt({index:Number(t),maxIndex:this._slides.length-1}),i=this._slides[r],n=s.behavior??"smooth";i&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(i),{behavior:n}),this._setCurrentIndex(r))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(s)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-s)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let s=this._dragState.dragging,r=s?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),s&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(r,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(s=>s instanceof Element&&s.matches(Gn))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,s=this._currentIndex,r=Number.POSITIVE_INFINITY;return this._slides.forEach((i,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(i)-t);o<r&&(s=n,r=o)}),s}_syncSlides(){let t=new Set(this._slides),s=this._slotElement.assignedElements({flatten:!0}).filter(r=>!r.hasAttribute("hidden"));t.forEach(r=>{s.includes(r)||(this._restoreSlideStyles(r),r.removeAttribute("data-rtgl-carousel-active"))}),this._slides=s,this._slides.forEach(r=>{this._slideStyleCache.has(r)||this._slideStyleCache.set(r,{flex:r.style.flex,width:r.style.width,minWidth:r.style.minWidth,maxWidth:r.style.maxWidth,boxSizing:r.style.boxSizing,scrollSnapAlign:r.style.scrollSnapAlign,scrollSnapStop:r.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(pt({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let s=this._slideStyleCache.get(t);s&&(t.style.flex=s.flex,t.style.width=s.width,t.style.minWidth=s.minWidth,t.style.maxWidth=s.maxWidth,t.style.boxSizing=s.boxSizing,t.style.scrollSnapAlign=s.scrollSnapAlign,t.style.scrollSnapStop=s.scrollSnapStop)}_updateLayoutStyles(){let t=nr({slideWidth:this.getAttribute("sw")}),s=Wt(this.getAttribute("sna"))??"center",r=zt(this.getAttribute("snap")),i=O(this.getAttribute("g"))??"var(--spacing-md)",n=O(this.getAttribute("spi"))??"0px",o=Wt(this.getAttribute("sbh"))??"smooth",l=ir({slideWidthCss:t,snapAlign:s});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",i),this.style.setProperty("--rtgl-carousel-scroll-snap-type",r),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",s),this._slides.forEach(p=>{p.style.flex=`0 0 ${t}`,p.style.width=t,p.style.minWidth="0",p.style.maxWidth="unset",p.style.boxSizing="border-box",p.style.scrollSnapAlign=s,p.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,s={}){let r=s.behavior??"smooth",i=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(r!=="smooth"||Math.abs(i-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=i;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=i-n,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),p=performance.now();this._setAnimatingScrollState(!0);let a=c=>{let d=c-p,h=Math.min(d/l,1),f=Jn(h);if(this._viewportElement.scrollLeft=n+o*f,h<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=i,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(a)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,s)=>{let r=document.createElement("button");r.type="button",r.setAttribute("part","pager-button"),r.setAttribute("aria-label",`Go to slide ${s+1}`),r.setAttribute("title",`Go to slide ${s+1}`),r.addEventListener("click",()=>{this.goTo(s)}),this._pagerElement.appendChild(r),this._pagerButtons.push(r)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,s=this._slides.length>1,r=this._currentIndex<=0,i=this._currentIndex>=this._slides.length-1,n=s&&this._showsNavControls(),o=s&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||r,this._nextButton.disabled=!t||i,this._pagerButtons.forEach((l,p)=>{let a=p===this._currentIndex;l.classList.toggle("is-active",a),l.disabled=a,l.setAttribute("part",a?"pager-button pager-button-active":"pager-button"),a?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,s={}){let r=pt({index:t,maxIndex:this._slides.length-1}),i=s.emit??!0,n=s.reflect??!0,o=this._currentIndex;this._currentIndex=r,this._slides.forEach((l,p)=>{p===r?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${r}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${r}`)),i&&o!==r&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:r},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Wt(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let s=this._viewportElement.getBoundingClientRect(),r=t.getBoundingClientRect();if(s.width<=0||r.width<=0)return this._viewportElement.scrollLeft;let i=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=r.left-s.left+n;return rr({slideLeft:o,slideWidth:r.width,viewportWidth:s.width,scrollPaddingInlineStart:this._parsePx(i.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(i.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let s=Number.parseFloat(t);return Number.isFinite(s)?s:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},ar=()=>Mt;var Zn={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=Y(Zn);var dt=T`
|
|
451
|
+
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),e.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(ds("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(ds("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let i=Number(t);this.setAttribute("index",Number.isFinite(i)?`${i}`:"0")}get snap(){return Mt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,i,s){if(i!==s){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(s),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return Wt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return Wt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,i={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let s=ut({index:Number(t),maxIndex:this._slides.length-1}),r=this._slides[s],n=i.behavior??"smooth";r&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(r),{behavior:n}),this._setCurrentIndex(s))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let i=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(i)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-i)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let i=this._dragState.dragging,s=i?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),i&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(s,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(i=>i instanceof Element&&i.matches(ro))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,i=this._currentIndex,s=Number.POSITIVE_INFINITY;return this._slides.forEach((r,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(r)-t);o<s&&(i=n,s=o)}),i}_syncSlides(){let t=new Set(this._slides),i=this._slotElement.assignedElements({flatten:!0}).filter(s=>!s.hasAttribute("hidden"));t.forEach(s=>{i.includes(s)||(this._restoreSlideStyles(s),s.removeAttribute("data-rtgl-carousel-active"))}),this._slides=i,this._slides.forEach(s=>{this._slideStyleCache.has(s)||this._slideStyleCache.set(s,{flex:s.style.flex,width:s.style.width,minWidth:s.style.minWidth,maxWidth:s.style.maxWidth,boxSizing:s.style.boxSizing,scrollSnapAlign:s.style.scrollSnapAlign,scrollSnapStop:s.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(ut({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let i=this._slideStyleCache.get(t);i&&(t.style.flex=i.flex,t.style.width=i.width,t.style.minWidth=i.minWidth,t.style.maxWidth=i.maxWidth,t.style.boxSizing=i.boxSizing,t.style.scrollSnapAlign=i.scrollSnapAlign,t.style.scrollSnapStop=i.scrollSnapStop)}_updateLayoutStyles(){let t=ps({slideWidth:this.getAttribute("sw")}),i=Ft(this.getAttribute("sna"))??"center",s=Mt(this.getAttribute("snap")),r=T(this.getAttribute("g"))??"var(--spacing-md)",n=T(this.getAttribute("spi"))??"0px",o=Ft(this.getAttribute("sbh"))??"smooth",l=ls({slideWidthCss:t,snapAlign:i});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",r),this.style.setProperty("--rtgl-carousel-scroll-snap-type",s),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",i),this._slides.forEach(p=>{p.style.flex=`0 0 ${t}`,p.style.width=t,p.style.minWidth="0",p.style.maxWidth="unset",p.style.boxSizing="border-box",p.style.scrollSnapAlign=i,p.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,i={}){let s=i.behavior??"smooth",r=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(s!=="smooth"||Math.abs(r-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=r;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=r-n,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),p=performance.now();this._setAnimatingScrollState(!0);let a=c=>{let d=c-p,u=Math.min(d/l,1),f=no(u);if(this._viewportElement.scrollLeft=n+o*f,u<1){this._scrollAnimationFrame=requestAnimationFrame(a);return}this._viewportElement.scrollLeft=r,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(a)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,i)=>{let s=document.createElement("button");s.type="button",s.setAttribute("part","pager-button"),s.setAttribute("aria-label",`Go to slide ${i+1}`),s.setAttribute("title",`Go to slide ${i+1}`),s.addEventListener("click",()=>{this.goTo(i)}),this._pagerElement.appendChild(s),this._pagerButtons.push(s)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,i=this._slides.length>1,s=this._currentIndex<=0,r=this._currentIndex>=this._slides.length-1,n=i&&this._showsNavControls(),o=i&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||s,this._nextButton.disabled=!t||r,this._pagerButtons.forEach((l,p)=>{let a=p===this._currentIndex;l.classList.toggle("is-active",a),l.disabled=a,l.setAttribute("part",a?"pager-button pager-button-active":"pager-button"),a?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,i={}){let s=ut({index:t,maxIndex:this._slides.length-1}),r=i.emit??!0,n=i.reflect??!0,o=this._currentIndex;this._currentIndex=s,this._slides.forEach((l,p)=>{p===s?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${s}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${s}`)),r&&o!==s&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:s},bubbles:!0}))}_resolveScrollInlinePosition(){let t=Ft(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let i=this._viewportElement.getBoundingClientRect(),s=t.getBoundingClientRect();if(i.width<=0||s.width<=0)return this._viewportElement.scrollLeft;let r=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=s.left-i.left+n;return as({slideLeft:o,slideWidth:s.width,viewportWidth:i.width,scrollPaddingInlineStart:this._parsePx(r.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(r.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let i=Number.parseFloat(t);return Number.isFinite(i)?i:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},cs=()=>Kt;var oo={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},D=Y(oo);var ht=I`
|
|
452
452
|
:host([sh]:not([sv])) {
|
|
453
453
|
overflow-x: auto;
|
|
454
454
|
flex-wrap: nowrap;
|
|
@@ -528,7 +528,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
`;var
|
|
531
|
+
`;var qe={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ao={bgc:{pr:`
|
|
532
532
|
background-color: var(--primary);
|
|
533
533
|
`,se:`
|
|
534
534
|
background-color: var(--secondary);
|
|
@@ -570,7 +570,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
570
570
|
left: 0;
|
|
571
571
|
top: 0;
|
|
572
572
|
height: 100%;
|
|
573
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:
|
|
573
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:L,pr:L,pb:L,pl:L,p:L,ph:L,pv:L,g:L,gv:L,gh:L,bw:qe,bwt:qe,bwr:qe,bwb:qe,bwl:qe,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ft=Y(ao);var lo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},M=Y(lo);var Ve=I`
|
|
574
574
|
a, a:link, a:visited, a:hover, a:active {
|
|
575
575
|
color: inherit;
|
|
576
576
|
text-decoration: none;
|
|
@@ -580,7 +580,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
580
580
|
margin: 0;
|
|
581
581
|
font: inherit;
|
|
582
582
|
}
|
|
583
|
-
`;var
|
|
583
|
+
`;var po=e=>{if(e==null)return null;let t=e.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Ut=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
584
584
|
slot {
|
|
585
585
|
display: contents;
|
|
586
586
|
}
|
|
@@ -594,13 +594,13 @@ var rettangoli=(()=>{var _e=`
|
|
|
594
594
|
border-color: var(--border);
|
|
595
595
|
}
|
|
596
596
|
|
|
597
|
-
${
|
|
598
|
-
${
|
|
599
|
-
${
|
|
600
|
-
${
|
|
601
|
-
${
|
|
597
|
+
${ht}
|
|
598
|
+
${M}
|
|
599
|
+
${D}
|
|
600
|
+
${ft}
|
|
601
|
+
${Ve}
|
|
602
602
|
${_e}
|
|
603
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...
|
|
603
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...W([...pe,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:i,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(i=>{let s=f=>`${i==="default"?"":`${i}-`}${f}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=po(this.getAttribute(s("cols"))),p=this.getAttribute(s("op")),a=this.getAttribute(s("z"));l!==null&&(this._styles[i]["grid-template-columns"]=l),a!==null&&(this._styles[i]["z-index"]=a),p!==null&&(this._styles[i].opacity=p),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none"),this.hasAttribute(s("show"))&&(this._styles[i].display="grid");let c=this.hasAttribute(s("sh")),d=this.hasAttribute(s("sv")),u=this.getAttribute(s("overflow"));c&&d?(this._styles[i].overflow="auto",this._styles[i]["scrollbar-gutter"]="stable"):c?(this._styles[i]["overflow-x"]="auto",this._styles[i]["scrollbar-gutter"]="stable"):d&&(this._styles[i]["overflow-y"]="auto",this._styles[i]["scrollbar-gutter"]="stable"),u==="hidden"&&(this._styles[i].overflow="hidden")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,i,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}i!==s&&this.updateStyles()}},us=({render:e,html:t})=>Ut;var hs=I`
|
|
604
604
|
|
|
605
605
|
:host([d="h"]) {
|
|
606
606
|
flex-direction: row;
|
|
@@ -671,7 +671,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
671
671
|
justify-content: center;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
`;var
|
|
674
|
+
`;var yt=e=>{if(e==null)return null;let t=`${e}`.trim();return t.length>0?t:null},Ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
675
675
|
slot {
|
|
676
676
|
display: contents;
|
|
677
677
|
}
|
|
@@ -687,14 +687,14 @@ var rettangoli=(()=>{var _e=`
|
|
|
687
687
|
}
|
|
688
688
|
|
|
689
689
|
|
|
690
|
-
${
|
|
691
|
-
${
|
|
692
|
-
${
|
|
693
|
-
${
|
|
694
|
-
${
|
|
695
|
-
${
|
|
690
|
+
${ht}
|
|
691
|
+
${hs}
|
|
692
|
+
${M}
|
|
693
|
+
${D}
|
|
694
|
+
${ft}
|
|
695
|
+
${Ve}
|
|
696
696
|
${_e}
|
|
697
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...
|
|
697
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...W([...pe,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:i,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(i=>{let s=z=>`${i==="default"?"":`${i}-`}${z}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),p=this.getAttribute(s("z")),a=He(this.getAttribute(s("ar"))),c=yt(this.getAttribute(s("bgi"))),d=yt(this.getAttribute(s("bgs"))),u=yt(this.getAttribute(s("bgp"))),f=yt(this.getAttribute(s("bgr")));p!==null&&(this._styles[i]["z-index"]=p),l!==null&&(this._styles[i].opacity=l),a!==void 0&&(this._styles[i]["aspect-ratio"]=a),c!==null&&(this._styles[i]["background-image"]=c),d!==null&&(this._styles[i]["background-size"]=d),u!==null&&(this._styles[i]["background-position"]=u),f!==null&&(this._styles[i]["background-repeat"]=f),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none"),this.hasAttribute(s("show"))&&(this._styles[i].display="flex");let h=this.getAttribute(s("d")),y=this.getAttribute(s("ah")),m=this.getAttribute(s("av")),b=Se({element:this,size:i,attr:"d"});h==="h"?this._styles[i]["flex-direction"]="row":h==="v"?this._styles[i]["flex-direction"]="column":i==="default"&&!h&&["sm","md","lg","xl"].some(B=>this.hasAttribute(`${B}-d`))&&(this._styles[i]["flex-direction"]="column");let g=b==="h",_=b==="v"||!b;g&&(y==="c"?this._styles[i]["justify-content"]="center":y==="e"?this._styles[i]["justify-content"]="flex-end":y==="s"&&(this._styles[i]["justify-content"]="flex-start"),m==="c"?(this._styles[i]["align-items"]="center",this._styles[i]["align-content"]="center"):m==="e"?(this._styles[i]["align-items"]="flex-end",this._styles[i]["align-content"]="flex-end"):m==="s"&&(this._styles[i]["align-items"]="flex-start")),_&&(y!==null||m!==null)&&(y==="c"?this._styles[i]["align-items"]="center":y==="e"?this._styles[i]["align-items"]="flex-end":y==="s"&&(this._styles[i]["align-items"]="flex-start"),m==="c"?this._styles[i]["justify-content"]="center":m==="e"?this._styles[i]["justify-content"]="flex-end":m==="s"&&(this._styles[i]["justify-content"]="flex-start"));let S=this.hasAttribute(s("wrap")),A=this.hasAttribute(s("no-wrap"));S&&(this._styles[i]["flex-wrap"]="wrap"),A&&(this._styles[i]["flex-wrap"]="nowrap"),this.hasAttribute(s("stretch"))&&(this._styles[i]["align-self"]="stretch");let k=this.hasAttribute(s("sh")),C=this.hasAttribute(s("sv")),O=this.hasAttribute(s("hsb")),V=this.getAttribute(s("overflow"));k&&C?(this._styles[i].overflow="auto",this._styles[i]["scrollbar-gutter"]="stable",this._styles[i]["flex-wrap"]="nowrap"):k?(this._styles[i]["overflow-x"]="auto",this._styles[i]["scrollbar-gutter"]="stable",this._styles[i]["flex-wrap"]="nowrap"):C&&(this._styles[i]["overflow-y"]="auto",this._styles[i]["scrollbar-gutter"]="stable",this._styles[i]["flex-wrap"]="nowrap"),V==="hidden"&&(this._styles[i].overflow="hidden",this._styles[i]["flex-wrap"]="nowrap"),O&&(this._styles[i]["-ms-overflow-style"]="none",this._styles[i]["scrollbar-gutter"]="auto",this._styles[i]["scrollbar-width"]="none")});let t=G(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,i,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}i!==s&&this.updateStyles()}},fs=({render:e,html:t})=>Ht;var co={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
698
698
|
font-size: var(--h1-font-size);
|
|
699
699
|
font-weight: var(--h1-font-weight);
|
|
700
700
|
line-height: var(--h1-line-height);
|
|
@@ -734,7 +734,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
734
734
|
font-weight: var(--xs-font-weight);
|
|
735
735
|
line-height: var(--xs-line-height);
|
|
736
736
|
letter-spacing: var(--xs-letter-spacing);
|
|
737
|
-
`}},
|
|
737
|
+
`}},ys=Y(co);var uo={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},mt=Y(uo);var qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
738
738
|
:host {
|
|
739
739
|
display: block;
|
|
740
740
|
font-size: var(--md-font-size);
|
|
@@ -754,11 +754,11 @@ var rettangoli=(()=>{var _e=`
|
|
|
754
754
|
color: var(--anchor-color-hover);
|
|
755
755
|
}
|
|
756
756
|
${_e}
|
|
757
|
-
${
|
|
758
|
-
${
|
|
759
|
-
${
|
|
760
|
-
${
|
|
761
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,s
|
|
757
|
+
${ys}
|
|
758
|
+
${mt}
|
|
759
|
+
${M}
|
|
760
|
+
${D}
|
|
761
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,i,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=T(this.getAttribute("w")),i=this.hasAttribute("ellipsis"),s=this.hasAttribute("break-long-tokens");i?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap",this.style.overflowWrap="",this.style.wordBreak=""):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace="",this.style.overflowWrap=s?"anywhere":"",this.style.wordBreak=s?"break-word":""),Ue({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=xe({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:i,rel:s})}},ms=({render:e,html:t})=>qt;var Ye={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ho={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",su:"background-color: var(--surface);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:Ye,bwt:Ye,bwr:Ye,bwb:Ye,bwl:Ye,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},gs=e=>Y(ho,{},e);var fo={mt:L,mr:L,mb:L,ml:L,m:L,mh:L,mv:L},bs=e=>Y(fo,{},e);var Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
762
762
|
:host {
|
|
763
763
|
display: contents;
|
|
764
764
|
}
|
|
@@ -785,7 +785,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
785
785
|
height: auto;
|
|
786
786
|
}
|
|
787
787
|
|
|
788
|
-
${
|
|
788
|
+
${Ve}
|
|
789
789
|
|
|
790
790
|
a {
|
|
791
791
|
display: block;
|
|
@@ -793,10 +793,10 @@ var rettangoli=(()=>{var _e=`
|
|
|
793
793
|
width: 100%;
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
${
|
|
797
|
-
${
|
|
798
|
-
${
|
|
799
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return
|
|
796
|
+
${gs("img, a")}
|
|
797
|
+
${bs("img, a")}
|
|
798
|
+
${D}
|
|
799
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return W([...pe,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=F();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Pt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:i,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,i,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}i!==s&&this.updateStyles()}updateStyles(){this._styles=F(),te.forEach(i=>{let s=c=>`${i==="default"?"":`${i}-`}${c}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),p=this.getAttribute(s("z")),a=He(this.getAttribute(s("ar")));p!==null&&(this._styles[i]["z-index"]=p),l!==null&&(this._styles[i].opacity=l),a!==void 0&&(this._styles[i]["aspect-ratio"]=a),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[i].display="block !important")});let t=G(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),i=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),i!==null?this._imgElement.setAttribute("alt",i):this._imgElement.removeAttribute("alt")}},vs=({render:e,html:t})=>Yt;var yo={s:{sm:`
|
|
800
800
|
height: 20px;
|
|
801
801
|
padding-left: 8px;
|
|
802
802
|
padding-right: 8px;
|
|
@@ -849,7 +849,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
849
849
|
background-color: var(--destructive);
|
|
850
850
|
color: var(--destructive-foreground);
|
|
851
851
|
border-color: transparent;
|
|
852
|
-
`}},
|
|
852
|
+
`}},ws=Y(yo,{},".surface");var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
853
853
|
:host {
|
|
854
854
|
display: inline-flex;
|
|
855
855
|
min-width: 0;
|
|
@@ -945,13 +945,13 @@ var rettangoli=(()=>{var _e=`
|
|
|
945
945
|
opacity: 1;
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
-
${
|
|
948
|
+
${ws}
|
|
949
949
|
:host .surface {
|
|
950
950
|
border-radius: var(--tag-border-radius) !important;
|
|
951
951
|
}
|
|
952
|
-
${
|
|
953
|
-
${
|
|
954
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,s
|
|
952
|
+
${M}
|
|
953
|
+
${D}
|
|
954
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,i,s){if(t==="w"){this._updateWidth();return}i!==s&&this._updateStructure()}_updateWidth(){let t=T(this.getAttribute("w"));Ue({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,i){let s=document.createElement("rtgl-svg");return s.className=t,s.setAttribute("part",i),s.setAttribute("aria-hidden","true"),s}_syncIcon({iconName:t,element:i,className:s,part:r,insertBeforeElement:n}){if(!t)return i&&i.remove(),null;let o=i||this._createIconElement(s,r);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},_s=({render:e,html:t})=>Gt;var xs=I`
|
|
955
955
|
:host([pt="xs"]) svg {
|
|
956
956
|
padding-top: var(--spacing-xs);
|
|
957
957
|
}
|
|
@@ -1067,7 +1067,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
1067
1067
|
padding-top: var(--spacing-xl);
|
|
1068
1068
|
padding-bottom: var(--spacing-xl);
|
|
1069
1069
|
}
|
|
1070
|
-
`;var
|
|
1070
|
+
`;var Jt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1071
1071
|
:host {
|
|
1072
1072
|
display: contents;
|
|
1073
1073
|
color: var(--foreground);
|
|
@@ -1092,11 +1092,11 @@ var rettangoli=(()=>{var _e=`
|
|
|
1092
1092
|
box-sizing: border-box;
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
-
${
|
|
1096
|
-
${
|
|
1097
|
-
${
|
|
1098
|
-
${
|
|
1099
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,
|
|
1095
|
+
${mt}
|
|
1096
|
+
${xs}
|
|
1097
|
+
${M}
|
|
1098
|
+
${D}
|
|
1099
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,i){e._icons[t]=i}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,i,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),i=T(t===null?this.getAttribute("w"):t),s=T(t===null?this.getAttribute("h"):t);i!=null?this.style.width=i:this.style.width="",s!=null?this.style.height=s:this.style.height=""}getBoundingClientRect(){let t=this.shadow.querySelector("svg");return t?t.getBoundingClientRect():super.getBoundingClientRect()}_render(){try{let t=this.getAttribute("svg"),i=e._icons[t]||(window.rtglIcons||{})[t];if(i){this.shadow.innerHTML=i;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Ss=({render:e,html:t})=>Jt;var mo=["mt","mr","mb","ml","m","mh","mv","cur"],Zt=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1100
1100
|
:host {
|
|
1101
1101
|
display: contents;
|
|
1102
1102
|
}
|
|
@@ -1158,9 +1158,9 @@ var rettangoli=(()=>{var _e=`
|
|
|
1158
1158
|
input[type="datetime-local"]::-webkit-date-and-time-value {
|
|
1159
1159
|
text-align: left;
|
|
1160
1160
|
}
|
|
1161
|
-
${
|
|
1162
|
-
${
|
|
1163
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
1161
|
+
${M}
|
|
1162
|
+
${D}
|
|
1163
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...W([...mo,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,i,s){if(i!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(i=>{let s=a=>`${i==="default"?"":`${i}-`}${a}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[i]["z-index"]=p),l!==null&&(this._styles[i].opacity=l),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none"),this.hasAttribute(s("show"))&&(this._styles[i].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,i){if(i==null||i==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,i)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",r=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ve=({render:e,html:t})=>Zt;var go=ve({}),Ge="date",Xt=class extends go{connectedCallback(){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,i,s){if(t==="type"&&s!==Ge){this.getAttribute("type")!==Ge&&super.setAttribute("type",Ge);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,i,s)}},As=({render:e,html:t})=>Xt;var bo=ve({}),Je="time",Qt=class extends bo{connectedCallback(){this.getAttribute("type")!==Je&&super.setAttribute("type",Je),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,i,s){if(t==="type"&&s!==Je){this.getAttribute("type")!==Je&&super.setAttribute("type",Je);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,i,s)}},ks=({render:e,html:t})=>Qt;var vo=ve({}),Ze="datetime-local",ei=class extends vo{connectedCallback(){this.getAttribute("type")!==Ze&&super.setAttribute("type",Ze),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,i,s){if(t==="type"&&s!==Ze){this.getAttribute("type")!==Ze&&super.setAttribute("type",Ze);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,i,s)}},Es=({render:e,html:t})=>ei;var wo=["mt","mr","mb","ml","m","mh","mv","cur"],ti=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1164
1164
|
:host {
|
|
1165
1165
|
display: contents;
|
|
1166
1166
|
}
|
|
@@ -1193,9 +1193,9 @@ var rettangoli=(()=>{var _e=`
|
|
|
1193
1193
|
input:disabled {
|
|
1194
1194
|
cursor: not-allowed;
|
|
1195
1195
|
}
|
|
1196
|
-
${
|
|
1197
|
-
${
|
|
1198
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
1196
|
+
${M}
|
|
1197
|
+
${D}
|
|
1198
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...W([...wo,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let i=this._inputElement.value;if(i.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(i);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,i,s){if(i!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(i=>{let s=a=>`${i==="default"?"":`${i}-`}${a}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[i]["z-index"]=p),l!==null&&(this._styles[i].opacity=l),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none"),this.hasAttribute(s("show"))&&(this._styles[i].display="block")});let t=G(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,i){if(i==null||i==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,i)}_clampValueToBounds(t){let i=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(i=Math.max(i,n))}let r=this.getAttribute("max");if(r!==null){let n=parseFloat(r);isNaN(n)||(i=Math.min(i,n))}return i}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let i=parseFloat(t);if(isNaN(i)){this._inputElement.value="";return}let s=this._clampValueToBounds(i);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),i=this.getAttribute("min"),s=this.getAttribute("max"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",i),this._setOrRemoveInputAttribute("max",s),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},$s=({render:e,html:t})=>ti;var ii=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1199
1199
|
:host {
|
|
1200
1200
|
display: contents;
|
|
1201
1201
|
}
|
|
@@ -1221,9 +1221,9 @@ var rettangoli=(()=>{var _e=`
|
|
|
1221
1221
|
textarea:disabled {
|
|
1222
1222
|
cursor: not-allowed;
|
|
1223
1223
|
}
|
|
1224
|
-
${
|
|
1225
|
-
${
|
|
1226
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...
|
|
1224
|
+
${M}
|
|
1225
|
+
${D}
|
|
1226
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...W([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,i,s){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=u=>`${n==="default"?"":`${n}-`}${u}`,l=this.getAttribute(o("wh")),p=T(l===null?this.getAttribute(o("w")):l),a=T(l===null?this.getAttribute(o("h")):l),c=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),i=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),i!==null?this._textareaElement.setAttribute("rows",i):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Cs=({render:e,html:t})=>ii;var _o=["mt","mr","mb","ml","m","mh","mv","cur"],xo=/^#[0-9a-fA-F]{6}$/,si=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1227
1227
|
:host {
|
|
1228
1228
|
display: contents;
|
|
1229
1229
|
}
|
|
@@ -1244,9 +1244,9 @@ var rettangoli=(()=>{var _e=`
|
|
|
1244
1244
|
cursor: not-allowed;
|
|
1245
1245
|
opacity: 0.5;
|
|
1246
1246
|
}
|
|
1247
|
-
${
|
|
1248
|
-
${
|
|
1249
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
1247
|
+
${M}
|
|
1248
|
+
${D}
|
|
1249
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=F(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...W([..._o,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,i,s){if(i!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=F(),te.forEach(i=>{let s=a=>`${i==="default"?"":`${i}-`}${a}`,r=this.getAttribute(s("wh")),n=T(r===null?this.getAttribute(s("w")):r),o=T(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[i]["z-index"]=p),l!==null&&(this._styles[i].opacity=l),K({styleBucket:this._styles[i],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),K({styleBucket:this._styles[i],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[i].display="none"),this.hasAttribute(s("show"))&&(this._styles[i].display="block")});let t=G(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=xo.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Os=({render:e,html:t})=>si;var ri=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1250
1250
|
:host {
|
|
1251
1251
|
display: contents;
|
|
1252
1252
|
}
|
|
@@ -1298,9 +1298,9 @@ var rettangoli=(()=>{var _e=`
|
|
|
1298
1298
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
1299
1299
|
cursor: not-allowed;
|
|
1300
1300
|
}
|
|
1301
|
-
${
|
|
1302
|
-
${
|
|
1303
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...
|
|
1301
|
+
${M}
|
|
1302
|
+
${D}
|
|
1303
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...W([...pe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,i,s){if(t==="key"&&i!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=u=>`${n==="default"?"":`${n}-`}${u}`,l=this.getAttribute(o("wh")),p=T(l===null?this.getAttribute(o("w")):l),a=T(l===null?this.getAttribute(o("h")):l),c=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,'input[type="range"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("value"),i=this.getAttribute("min"),s=this.getAttribute("max"),r=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=i??0,i!==null?this._inputElement.min=i:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",r!==null?this._inputElement.step=r:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Is=({render:e,html:t})=>ri;var ni=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1304
1304
|
:host {
|
|
1305
1305
|
display: inline-flex;
|
|
1306
1306
|
}
|
|
@@ -1367,14 +1367,42 @@ var rettangoli=(()=>{var _e=`
|
|
|
1367
1367
|
cursor: not-allowed;
|
|
1368
1368
|
opacity: 0.5;
|
|
1369
1369
|
}
|
|
1370
|
-
${
|
|
1371
|
-
${
|
|
1372
|
-
`))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...
|
|
1370
|
+
${M}
|
|
1371
|
+
${D}
|
|
1372
|
+
`))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...W([...pe,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,i,s){if(t==="key"&&i!==s){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=s!==null;return}if(t==="disabled"){s!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=u=>`${n==="default"?"":`${n}-`}${u}`,l=this.getAttribute(o("wh")),p=T(l===null?this.getAttribute(o("w")):l),a=T(l===null?this.getAttribute(o("h")):l),c=this.getAttribute(o("op")),d=this.getAttribute(o("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),a==="f"?this._styles[n].height="100%":a!==void 0&&(this._styles[n].height=a,this._styles[n]["min-height"]=a,this._styles[n]["max-height"]=a),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=G(this._styles,'input[type="checkbox"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),i=t??"";this._labelSlotElement.textContent!==i&&(this._labelSlotElement.textContent=i);let r=this._labelSlotElement.assignedNodes({flatten:!0}).some(l=>l.nodeType===Node.TEXT_NODE?l.textContent.trim().length>0:l.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,o=r||n;o&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!o&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Ts=({render:e,html:t})=>ni;var oi=40,So=6,Ao=["sm","md","lg","xl"],ai=32,li=8,Xe="data-rtgl-active-layout",ko=`:host([${Xe}="fixed"])`,Eo=e=>e.replace(/^@media\s+/,""),$o=e=>I`
|
|
1373
|
+
${e} dialog {
|
|
1374
|
+
width: 100vw !important;
|
|
1375
|
+
max-width: 100vw !important;
|
|
1376
|
+
height: 100vh !important;
|
|
1377
|
+
height: 100dvh !important;
|
|
1378
|
+
max-height: 100vh !important;
|
|
1379
|
+
max-height: 100dvh !important;
|
|
1380
|
+
margin: 0 !important;
|
|
1381
|
+
overflow: hidden !important;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
${e} slot[name="content"] {
|
|
1385
|
+
box-sizing: border-box;
|
|
1386
|
+
width: 100vw !important;
|
|
1387
|
+
max-width: 100vw !important;
|
|
1388
|
+
height: 100vh !important;
|
|
1389
|
+
height: 100dvh !important;
|
|
1390
|
+
max-height: 100vh !important;
|
|
1391
|
+
max-height: 100dvh !important;
|
|
1392
|
+
margin: 0 !important;
|
|
1393
|
+
overflow-y: auto !important;
|
|
1394
|
+
overscroll-behavior: contain;
|
|
1395
|
+
border-radius: 0;
|
|
1396
|
+
padding-top: max(var(--spacing-lg), env(safe-area-inset-top));
|
|
1397
|
+
padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
|
|
1398
|
+
}
|
|
1399
|
+
`,pi=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1373
1400
|
:host {
|
|
1374
1401
|
display: contents;
|
|
1375
1402
|
}
|
|
1376
1403
|
|
|
1377
1404
|
dialog {
|
|
1405
|
+
position: relative;
|
|
1378
1406
|
padding: 0;
|
|
1379
1407
|
border: none;
|
|
1380
1408
|
background: transparent;
|
|
@@ -1407,6 +1435,64 @@ var rettangoli=(()=>{var _e=`
|
|
|
1407
1435
|
margin-bottom: 40px;
|
|
1408
1436
|
}
|
|
1409
1437
|
|
|
1438
|
+
.close-button {
|
|
1439
|
+
align-items: center;
|
|
1440
|
+
appearance: none;
|
|
1441
|
+
background: transparent;
|
|
1442
|
+
border: none;
|
|
1443
|
+
border-radius: var(--border-radius-sm);
|
|
1444
|
+
box-shadow: none;
|
|
1445
|
+
color: var(--muted-foreground);
|
|
1446
|
+
cursor: pointer;
|
|
1447
|
+
display: none;
|
|
1448
|
+
height: ${ai}px;
|
|
1449
|
+
justify-content: center;
|
|
1450
|
+
left: var(--rtgl-dialog-close-left, auto);
|
|
1451
|
+
padding: 0;
|
|
1452
|
+
position: absolute;
|
|
1453
|
+
top: var(--rtgl-dialog-close-top, ${li}px);
|
|
1454
|
+
width: ${ai}px;
|
|
1455
|
+
z-index: 1;
|
|
1456
|
+
-webkit-appearance: none;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
:host([close-button]) .close-button {
|
|
1460
|
+
display: flex;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.close-button[hidden] {
|
|
1464
|
+
display: none;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.close-button:hover {
|
|
1468
|
+
background: var(--accent);
|
|
1469
|
+
color: var(--foreground);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.close-button:focus-visible {
|
|
1473
|
+
background: var(--accent);
|
|
1474
|
+
color: var(--foreground);
|
|
1475
|
+
outline: none;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.close-button::before,
|
|
1479
|
+
.close-button::after {
|
|
1480
|
+
background: currentColor;
|
|
1481
|
+
border-radius: 999px;
|
|
1482
|
+
content: "";
|
|
1483
|
+
height: 16px;
|
|
1484
|
+
position: absolute;
|
|
1485
|
+
width: 2px;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
.close-button::before {
|
|
1489
|
+
transform: rotate(45deg);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.close-button::after {
|
|
1493
|
+
transform: rotate(-45deg);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1410
1496
|
/* Size attribute styles */
|
|
1411
1497
|
:host([s="sm"]) slot[name="content"] {
|
|
1412
1498
|
width: 33vw;
|
|
@@ -1426,7 +1512,7 @@ var rettangoli=(()=>{var _e=`
|
|
|
1426
1512
|
margin-right: 0;
|
|
1427
1513
|
}
|
|
1428
1514
|
|
|
1429
|
-
${
|
|
1515
|
+
${Ae.md} {
|
|
1430
1516
|
:host(:not([w])[s="sm"]) slot[name="content"],
|
|
1431
1517
|
:host(:not([w])[s="md"]) slot[name="content"],
|
|
1432
1518
|
:host(:not([w])[s="lg"]) slot[name="content"] {
|
|
@@ -1451,12 +1537,26 @@ var rettangoli=(()=>{var _e=`
|
|
|
1451
1537
|
animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1452
1538
|
}
|
|
1453
1539
|
|
|
1540
|
+
dialog[open] .close-button {
|
|
1541
|
+
animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1454
1544
|
@media (prefers-reduced-motion: reduce) {
|
|
1455
|
-
dialog[open] slot[name="content"]
|
|
1545
|
+
dialog[open] slot[name="content"],
|
|
1546
|
+
dialog[open] .close-button {
|
|
1456
1547
|
animation: none;
|
|
1457
1548
|
}
|
|
1458
1549
|
}
|
|
1459
|
-
|
|
1550
|
+
|
|
1551
|
+
${$o(ko)}
|
|
1552
|
+
|
|
1553
|
+
:host([no-padding]) slot[name="content"] {
|
|
1554
|
+
margin-left: 0;
|
|
1555
|
+
margin-right: 0;
|
|
1556
|
+
max-width: 100vw;
|
|
1557
|
+
padding: 0;
|
|
1558
|
+
}
|
|
1559
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this._dialogElement.tabIndex=-1,this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._closeButtonElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._managedLongTokenTextElements=new Set,this._contentMutationObserver=typeof MutationObserver<"u"?new MutationObserver(()=>{this._syncLongTokenWrapping()}):null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._syncLongTokenWrapping(),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onDialogScroll=()=>{this._updateCloseButtonPosition()},this._onCloseButtonClick=t=>{t.preventDefault(),t.stopPropagation(),this._attemptClose()},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s","close-button",...W(["layout"])]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,i,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="s"||t.endsWith("layout")?(this._updateActiveLayoutAttribute(),this._scheduleAdaptiveCentering({resetRetries:!0})):t==="w"?this._updateWidth():t==="close-button"&&(this._updateCloseButton(),this._updateCloseButtonPosition())}_updateDialog(){this._updateWidth(),this._updateCloseButton(),this._updateActiveLayoutAttribute()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_updateCloseButton(){this._closeButtonElement&&(this._closeButtonElement.setAttribute("aria-label","Close dialog"),this._closeButtonElement.hidden=!this.hasAttribute("close-button"))}_createCloseButtonElement(){let t=document.createElement("button");return t.type="button",t.className="close-button",t.addEventListener("click",this._onCloseButtonClick),t}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,i){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&i.push(t);for(let s of t.children)this._collectTextElements(s,i);if(t.shadowRoot)for(let s of t.shadowRoot.children)this._collectTextElements(s,i)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),i=[];for(let s of t)this._collectTextElements(s,i);for(let s of i)s.hasAttribute("ellipsis")||s.hasAttribute("break-long-tokens")||(s.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(s))}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._closeButtonElement||(this._closeButtonElement=this._createCloseButtonElement(),this._dialogElement.appendChild(this._closeButtonElement)),this._updateCloseButton(),this._updateActiveLayoutAttribute(),this._dialogElement.showModal(),this.shadow.activeElement===this._closeButtonElement&&this._dialogElement.focus({preventScroll:!0}),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._dialogElement.addEventListener("scroll",this._onDialogScroll,{passive:!0}),this._syncLongTokenWrapping(),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._closeButtonElement&&(this._closeButtonElement.removeEventListener("click",this._onCloseButtonClick),this._dialogElement.removeChild(this._closeButtonElement),this._closeButtonElement=null),this._dialogElement.style.height="",this._dialogElement.style.removeProperty("--rtgl-dialog-close-top"),this._dialogElement.style.removeProperty("--rtgl-dialog-close-left"))}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._dialogElement.removeEventListener("scroll",this._onDialogScroll),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect(),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver&&!this._contentMutationObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect()),this._observedContentElement=t,this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.observe(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.observe(this._observedContentElement,{childList:!0,subtree:!0}),this._syncLongTokenWrapping()))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Ao){let i=Ae[t];if(i&&window.matchMedia(Eo(i)).matches)return t}return"default"}_getActiveLayout(){return Se({element:this,size:this._getActiveResponsiveSize(),attr:"layout"})||"centered"}_isFixedLayoutActive(){return this._updateActiveLayoutAttribute()==="fixed"}_updateActiveLayoutAttribute(){let t=this._getActiveLayout();return t==="fixed"?this.getAttribute(Xe)!=="fixed"&&this.setAttribute(Xe,"fixed"):this.hasAttribute(Xe)&&this.removeAttribute(Xe),t}_updateCloseButtonPosition(){if(!this._slotElement||!this._closeButtonElement||!this._dialogElement.open)return;let t=Math.round(this._slotElement.getBoundingClientRect().width),i=Math.round(this._dialogElement.scrollTop),s=Math.round(this._dialogElement.scrollLeft),r=Math.max(0,Math.round(this._slotElement.offsetTop)+i+li),n=Math.max(0,Math.round(this._slotElement.offsetLeft)+s+t-ai-li);this._dialogElement.style.setProperty("--rtgl-dialog-close-top",`${r}px`),this._dialogElement.style.setProperty("--rtgl-dialog-close-left",`${n}px`)}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;if(this._isFixedLayoutActive()){this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.style.height="",this._updateCloseButtonPosition(),this._layoutRetryCount=0;return}this._observeAssignedContent();let t=this._getAssignedContentElement(),i=t?Math.round(t.getBoundingClientRect().height):0;if(i<=0){this._layoutRetryCount<So&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(i>=s-2*oi){this._slotElement.style.marginTop=`${oi}px`,this._slotElement.style.marginBottom=`${oi}px`,this._dialogElement.style.height="100vh",this._updateCloseButtonPosition();return}let r=s-i,n=Math.floor(r/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto",this._updateCloseButtonPosition()}get dialog(){return this._dialogElement}},Ls=({render:e,html:t})=>pi;var Vs=({x:e,y:t,width:i,height:s,place:r,viewportWidth:n,viewportHeight:o,offset:l=8,padding:p=8})=>{let a=e,c=t;switch(r){case"t":a=e-i/2,c=t-s-l;break;case"ts":a=e,c=t-s-l;break;case"te":a=e-i,c=t-s-l;break;case"r":a=e+l,c=t-s/2;break;case"rs":a=e+l,c=t;break;case"re":a=e+l,c=t-s;break;case"b":a=e-i/2,c=t+l;break;case"bs":a=e,c=t+l;break;case"be":a=e-i,c=t+l;break;case"l":a=e-i-l,c=t-s/2;break;case"ls":a=e-i-l,c=t;break;case"le":a=e-i-l,c=t-s;break;case"center":case"c":a=(n-i)/2,c=(o-s)/2;break;default:a=e,c=t+l;break}return{left:Math.max(p,Math.min(a,n-i-p)),top:Math.max(p,Math.min(c,o-s-p))}};var Rs="data-rtgl-popover-content",di="min-width: 200px; max-width: 400px; box-sizing: border-box;",Qe="data-rtgl-active-overlay",Ns="data-rtgl-active-place",Co=["sm","md","lg","xl"],Oo=e=>e.replace(/^@media\s+/,""),Ds=(e,t=!1)=>{if(e==null)return t;if(typeof e=="boolean")return e;let i=`${e}`.trim().toLowerCase();return!["false","0","no","off"].includes(i)},ci=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
|
|
1460
1560
|
:host {
|
|
1461
1561
|
display: contents;
|
|
1462
1562
|
}
|
|
@@ -1486,6 +1586,10 @@ var rettangoli=(()=>{var _e=`
|
|
|
1486
1586
|
pointer-events: auto;
|
|
1487
1587
|
}
|
|
1488
1588
|
|
|
1589
|
+
:host([${Qe}="true"]) dialog::backdrop {
|
|
1590
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1489
1593
|
.popover-container {
|
|
1490
1594
|
position: fixed;
|
|
1491
1595
|
z-index: inherit;
|
|
@@ -1505,19 +1609,19 @@ var rettangoli=(()=>{var _e=`
|
|
|
1505
1609
|
slot[name="content"] {
|
|
1506
1610
|
display: contents;
|
|
1507
1611
|
}
|
|
1508
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let s=t.composedPath();(s[0]===this._dialogElement||s[0].nodeName==="DIALOG"&&s[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._observedContentWrapper=null,this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,s,r){t==="open"?r!==null&&!this._isOpen?this.isConnected&&this._show():r===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._schedulePositionUpdate():t==="no-overlay"&&s!==r&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(s=>s.hasAttribute(Or));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Or,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",os)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),s=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[i,n]of s){let o=this.getAttribute(i);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let r=this.getAttribute("content-style");t.setAttribute("style",r?`${os} ${r}`:os)}_syncContentWrapper({reposition:t=!0}={}){let s=this._ensureContentWrapper(),r=Array.from(this.childNodes).filter(n=>n!==s&&!this._isIgnorableTextNode(n));for(let n of r)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),s.appendChild(n);this._syncContentWrapperAttributes(),Array.from(s.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?s.setAttribute("slot","content"):s.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal()),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let s=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(s)?s:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),s=this._readCoordinateAttr("y"),r=this.getAttribute("place")||"bs",i=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,s,i.width,i.height,r);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,s,r,i,n){return Ir({x:t,y:s,width:r,height:i,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},Tr=({render:e,html:t})=>as;var yo=(e,t)=>{let{store:s,render:r}=e;s.toggleOpen({}),r()},mo=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:yo},Symbol.toStringTag,{value:"Module"})),go=()=>Object.freeze({open:!1}),bo=["id","class","style","slot","label","content"],vo=(e={})=>Object.entries(e).filter(([t])=>!bo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),wo=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:vo(t)}),_o=({state:e})=>{e.open=!e.open},xo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:go,selectViewData:wo,toggleOpen:_o},Symbol.toStringTag,{value:"Module"})),So=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(r.items)?r.items[n]:void 0;if(o){if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),s(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))}},Ao=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:So},Symbol.toStringTag,{value:"Module"})),ko=()=>Object.freeze({}),Eo=["id","class","style","slot","items","sep","max","separator"],$o=(e={})=>Object.entries(e).filter(([t])=>!Eo.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Co=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Io=e=>`${e}`.replace(/"/g,"""),Oo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let s=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-s)]},To=e=>e.map((t,s)=>{let r=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,l=!n&&!o&&(r||i||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",p?`rel="${Io(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:s,href:r?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:l,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),Lo=({props:e})=>{let t=$o(e),s=Array.isArray(e.items)?e.items:[],r=Co(e.max),i=e.sep||"breadcrumb-arrow",n=To(s),o=Oo(n,r),l=[];return o.forEach((p,a)=>{l.push(p),a<o.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}},Vo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ko,selectViewData:Lo},Symbol.toStringTag,{value:"Module"})),No=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],Lr={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},Ro=(e={})=>Object.entries(e).filter(([t])=>!No.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),jo=()=>Object.freeze({}),Do=({props:e={}})=>{let t=Lr[e.size]?e.size:"md",s=Lr[t];return{containerAttrString:Ro(e),cardAttrString:s.cardAttrString,headerAttrString:s.headerAttrString,headingSize:s.headingSize,subheadingSize:s.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Po=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jo,selectViewData:Do},Symbol.toStringTag,{value:"Module"})),Bo=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",zo=(e,t)=>{let{render:s,refs:r}=e,{oldProps:i={},newProps:n={}}=t,o=i.items!==n.items&&!!n.open;s(),o&&r?.popover?.refreshContent?.()},Wo=(e,t)=>{let{dispatchEvent:s}=e;s(new CustomEvent("close"))},Mo=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=r.items[n],l=Bo(o);if(!o||l!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),s(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))},Fo=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:Mo,handleClosePopover:Wo,handleOnUpdate:zo},Symbol.toStringTag,{value:"Module"})),Ko=()=>Object.freeze({}),Uo=e=>`${e}`.replace(/"/g,"""),Ho=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",qo=e=>e.map((t,s)=>{let r=Ho(t),i=r==="separator",n=r==="section",o=r==="item",l=!!t.disabled,p=o&&!l,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",h=l?"mu-fg":"fg",f=l?"mu":"",u=l?"":"ac",y=h,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${Uo(g)}"`:""].filter(Boolean).join(" ");return{...t,index:s,type:r,isSeparator:i,isSection:n,isItem:o,isDisabled:l,isInteractive:p,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:h,bgc:f,hoverBgc:u,iconColor:y,suffixTextColor:m}}),Yo=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:qo(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},Go=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ko,selectViewData:Yo},Symbol.toStringTag,{value:"Module"})),w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},ms={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Vr=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Jo=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},Zo=(e,t,s=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new de(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new de(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},Xo=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${s})`)},Qo=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=N(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},N=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return K(e.var,s,r);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return K(e.path,s,r);if(e.type===w.INTERPOLATION)return ta(e.parts,t,s,r);switch(e.type){case w.FUNCTION:return yi(e,t,s,r);case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.CONDITIONAL:return ra(e,t,s,r);case w.LOOP:return la(e,t,s,r);case w.OBJECT:return da(e,t,s,r);case w.ARRAY:return ca(e,t,s,r);case w.PARTIAL:return ua(e,t,s,r);case w.PATH_REFERENCE:return ha(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Nr=new Map,ea=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},K=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Nr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=ea(p.trim());r.push(...a)}Nr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ta=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=N(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},yi=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Xo(e.name,i);let o=e.args.map(l=>N(l,t,s,r));return n(...o)},De=(e,t,s,r)=>{if(e.var&&!e.type)return K(e.var,s,r);switch(e.type){case w.VARIABLE:return K(e.path,s,r);case w.LITERAL:return e.value;case w.BINARY:return mi(e,t,s,r);case w.UNARY:return gi(e,t,s,r);case w.FUNCTION:return yi(e,t,s,r);default:return N(e,t,s,r)}},mi=(e,t,s,r)=>{if(e.op===D.AND||e.op===D.OR){let o=De(e.left,t,s,r),l=De(e.right,t,s,r);switch(e.op){case D.AND:return o&&l;case D.OR:return o||l}}let i=N(e.left,t,s,r),n=N(e.right,t,s,r);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},gi=(e,t,s,r)=>{let i=e.op===ms.NOT?De(e.operand,t,s,r):N(e.operand,t,s,r);switch(e.op){case ms.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},sa=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(K(i.path,s,r)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=K(a.path,s,r);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=K(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=N(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=N(a,t,s,r)}return o}}}return null},ra=(e,t,s,r)=>{let i=sa(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||De(o,t,s,r))return N(e.bodies[n],t,s,r)}return bi},ia=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},na=(e,t)=>{let s=e.body,r=e.itemVar,i=ia(e,t);if(i!==null)return i;if(s.type===w.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===w.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},oa=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?N(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=K(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=K(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=K(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=N(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=N(m,t,s,b)}}n.push(d)}return n}return null},aa=(e,t,s)=>{let r=e.body;if(r.type===w.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===w.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},la=(e,t,s,r)=>{let i=N(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw Zo(d,i,c)}if(!e.indexVar){let a=aa(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=na(e,i);if(a!==null)return a}let n=oa(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},pa=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?N(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===w.LITERAL)p[d]=h.value;else if(h.type===w.VARIABLE)p[d]=K(h.path,s,r);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=K(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=K(m.path,s,r);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=K(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},da=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!De(e.whenCondition,i,s,r))return;let n=pa(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=K(d.path,s,r);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=K(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=N(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=N(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=N(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return N(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=N(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?N(p.parsedKey,t,s,r):p.key,d=N(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},bi={},ca=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let o=N(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=N(n,t,s,r);o!==bi&&o!==void 0&&i.push(o)}return i},ua=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!De(o,p,s,r))return;if(!l[i])throw new de(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new de(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=N(n,t,s,r);d={...d,...f}}return N(c,t,d,h)},ha=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new de(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new de(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new de(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},fa=/\$\{([^}]*)\}/g,ya=/#\{([^}]*)\}/g,vi=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=ma(i,t);return{isFunction:!0,type:w.FUNCTION,name:r,args:n}},ma=(e,t={})=>e.trim()?ga(e).map(s=>ba(s.trim(),t)):[],ga=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},ba=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let s=vi(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Le(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return X(r,t)}catch{return{type:w.VARIABLE,path:r}}return{type:w.VARIABLE,path:r}},wi=/^\w+\(.*\)$/,va=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,wa=e=>{if(!(!e||e.trim()===""||wi.test(e))&&va.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Rr=e=>{let t=e.trim();if(wi.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},mt=(e,t={})=>{let s=e.trim();wa(s);let r=vi(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:s}},_i=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(fa)],n=[...s.matchAll(ya)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?mt(a[1],t):Rr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=mt(h.trim(),t):u=Rr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:w.INTERPOLATION,parts:l}},ke=(e,t)=>typeof e=="string"?_i(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?xa(e,t):Sa(e,t):{type:w.LITERAL,value:e},_a=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new $("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new $("Empty $each body not allowed");if(s.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},xa=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=_a(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof $?p:new $(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=ke(n,t);s.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(r=!0)}return{type:w.ARRAY,items:s,fast:!r}},Sa=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=ke(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");i=X(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new $("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=Aa(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new $(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new $("Missing condition expression after '$if'");{let c=ke(a,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(r=!0);let d=_i(p,t),h={key:p,value:c};(d.type!==w.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:w.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},Aa=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Vr(a);let c=X(a,s);for(r.push(c),i.push(ke(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{Vr(u);let y=X(u,s);r.push(y)}if(i.push(ke(h,s)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let s=Le(e,"||");if(s!==-1)return{type:w.BINARY,op:D.OR,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=Le(e,"&&");if(r!==-1)return{type:w.BINARY,op:D.AND,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:a,type:c}of i){let d=Le(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Le(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Le(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:ms.NOT,operand:X(e.substring(1).trim(),t)}:xi(e,t)},Le=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},ka=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},xi=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return mt(s,t);let r=ka(s);if(r.type===w.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:w.VARIABLE,path:s};try{return mt(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ea=(e,t=!1)=>{try{Jo(e)}catch(s){if(s instanceof $&&t){let r=s.message.replace(/\$for/g,"$each");throw new $(r.replace("Parse Error: ",""))}throw s}},jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ea(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new $(`Reserved variable name: ${h}`);let u=xi(c,s),y=ke(t,s);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Dr=(e,t={})=>{let{functions:s={}}=t;return ke(e,s)},$a=()=>Date.now(),Ca=Object.freeze(Object.defineProperty({__proto__:null,now:$a},Symbol.toStringTag,{value:"Module"})),Ia=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Ca,...r},o=Dr(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Dr(a,{functions:n});return Qo(o,t,{functions:n,partials:l})},js=e=>e!==null&&typeof e=="object",gt=e=>js(e)&&!Array.isArray(e),Oa=e=>typeof e=="string"&&e.includes("."),Si=e=>typeof e=="string"&&/[\[\]]/.test(e);function Ai(e,t){let s={};for(let r of t){if(typeof r!="string"||r.length===0)continue;let i=ne(e,r);i!==void 0&&he(s,r,i)}return s}function Ta(e){if(!gt(e)||!Array.isArray(e.fields))return e;let t=(s=[])=>s.map(r=>{if(!gt(r))return r;if(typeof r.$when=="string"&&r.$when.trim().length>0){let{$when:i,...n}=r,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:o}}return Array.isArray(r.fields)?{...r,fields:t(r.fields)}:r});return{...e,fields:t(e.fields)}}var ne=(e,t,s=void 0)=>{if(!t||!js(e)||Si(t))return s;let r=t.split(".").filter(n=>n!==""),i=e;for(let n of r){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:s;i=i[n]}return i},he=(e,t,s)=>{if(!js(e)||typeof t!="string"||t.length===0||Si(t))return e;let r=t.split(".").filter(n=>n!=="");if(r.length===0)return e;Oa(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<r.length-1;n++){let o=r[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}return i[r[r.length-1]]=s,e},La=["id","class","style","slot","form","defaultValues","disabled","context"],Va=(e={})=>Object.entries(e).filter(([t,s])=>!(La.includes(t)||s==null||typeof s=="object"||typeof s=="function")).map(([t,s])=>`${t}=${String(s)}`).join(" "),Na={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Ra="input-date",ja="input-time",Da="input-datetime",Pa=/^(\d{4})-(\d{2})-(\d{2})$/,Ba=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,za=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Wa=e=>{if(typeof e!="string")return null;let t=Pa.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let n=new Date(Date.UTC(s,r-1,i));return n.getUTCFullYear()===s&&n.getUTCMonth()===r-1&&n.getUTCDate()===i?{year:s,month:r,day:i}:null},Ma=e=>{if(typeof e!="string")return null;let t=Ba.exec(e);if(!t)return null;let s=Number(t[1]),r=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(s)||!Number.isInteger(r)||!Number.isInteger(i)||s<0||s>23||r<0||r>59||i<0||i>59?null:{hour:s,minute:r,second:i}},ki=e=>{let t=Ma(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Ei=e=>Wa(e)?e:null,Fa=e=>{if(typeof e!="string")return null;let t=za.exec(e);if(!t)return null;let s=Ei(t[1]),r=ki(t[2]);return!s||!r?null:`${s}T${r}`},Ka=e=>e===Ra?{normalize:Ei,invalidMessage:ue.invalidDate}:e===ja?{normalize:ki,invalidMessage:ue.invalidTime}:e===Da?{normalize:Fa,invalidMessage:ue.invalidDateTime}:null,Ua=(e,t)=>{let s=Ka(e.type);if(!s||t==null||t==="")return null;let r=s.normalize(String(t));if(!r)return s.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=s.normalize(String(e.min));if(i&&r<i)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=s.normalize(String(e.max));if(i&&r>i)return ue.maxTemporal(String(e.max))}return null},Et=(e,t)=>{if(e.required){let r=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:r)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let s=Ua(e,t);if(s)return s;if(Array.isArray(e.rules))for(let r of e.rules){let i=Ha(r,t);if(i)return i}return null},Ha=(e,t)=>{if(t==null||t==="")return null;let s=String(t);switch(e.rule){case"minLength":return s.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return s.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let r=Na[e.value];if(!r)try{r=new RegExp(e.value)}catch{return e.message||ue.pattern}return r.test(s)?null:e.message||ue.pattern}default:return null}},$t=(e,t)=>{let s={},r=ie(e);for(let i of r){let n=ne(t,i.name),o=Et(i,n);o&&(s[i.name]=o)}return{valid:Object.keys(s).length===0,errors:s}},qa=["section","read-only-text","slot"],Ds=e=>!qa.includes(e.type),ie=e=>{let t=[];for(let s of e)s.type==="section"&&Array.isArray(s.fields)?t.push(...ie(s.fields)):Ds(s)&&t.push(s);return t},Ps=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Bs=(e,t=0)=>{let s=[],r=t;for(let i of e)if(i.type==="section"){if(s.push({...i,_isSection:!0,_idx:r}),r++,Array.isArray(i.fields)){let n=Bs(i.fields,r);s.push(...n),r+=n.length}}else s.push({...i,_isSection:!1,_idx:r}),r++;return s},Ya=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:s={}}=t||{},r=Ta(s),i=gt(t?.context)?t.context:{},n=gt(e?.formValues)?e.formValues:{},o={...i,...n,formValues:n};return Object.keys(o).length>0?Ia(r,o):r},Ga=({state:e,props:t})=>{let s=Va(t),r=ee({state:e,props:t}),i=r.fields||[],n=!!t?.disabled,o=Bs(i);o.forEach(d=>{if(d._isSection)return;let h=Ds(d);if(d._disabled=n||!!d.disabled,h&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let l=r.actions||{buttons:[]},p=l.layout||"split",a=(l.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return p==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:p,buttons:a,_allButtons:a},{containerAttrString:s,title:r?.title||"",description:r?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Ie=({state:e,props:t})=>{let s=ee({state:e,props:t}),r=ie(s.fields||[]);return Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Ja=({state:e,props:t},s={})=>{let{name:r,value:i}=s;r&&(he(e.formValues,r,i),rt({state:e,props:t}))},rt=({state:e,props:t})=>{if(!t)return;let s=ee({state:e,props:t}),r=ie(s.fields||[]);e.formValues=Ai(e.formValues,r.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},Za=({state:e},t={})=>{let{values:s}=t;!s||typeof s!="object"||Object.keys(s).forEach(r=>{he(e.formValues,r,s[r])})},Xa=({state:e},t={})=>{let{defaultValues:s={}}=t;e.formValues=s?structuredClone(s):{},e.errors={},e.reactiveMode=!1},Qa=({state:e},t={})=>{e.errors=t.errors||{}},el=({state:e},t={})=>{let{name:s}=t;s&&e.errors[s]&&delete e.errors[s]},tl=({state:e})=>{e.reactiveMode=!0},sl=({state:e},t={})=>{let{x:s,y:r,content:i}=t;e.tooltipState={open:!0,x:s,y:r,content:i}},rl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},il=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:el,collectAllDataFields:ie,createInitialState:Ya,flattenFields:Bs,get:ne,getDefaultValue:Ps,hideTooltip:rl,isDataField:Ds,pruneHiddenValues:rt,resetFormValues:Xa,selectForm:ee,selectFormValues:Ie,selectViewData:Ga,set:he,setErrors:Qa,setFormFieldValue:Ja,setFormValues:Za,setReactiveMode:tl,showTooltip:sl,validateField:Et,validateForm:$t},Symbol.toStringTag,{value:"Module"})),$i=({field:e,target:t,value:s})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(s==null?t.removeAttribute("value"):t.setAttribute("value",String(s)))},Ci=({form:e,formValues:t={},refs:s,formDisabled:r=!1})=>{let i=e.fields||[],n=0,o=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&o(p.fields);continue}let a=s[`field${n}`];if(n++,!a)continue;let c=r||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let d=ne(t,p.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),p.type==="slider-with-input"&&a.store?.setValue){let h=Number(d??0);a.store.setValue({value:Number.isFinite(h)?h:0}),typeof a.render=="function"&&a.render()}p.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(p.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,p.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}p.type==="checkbox"&&(ne(t,p.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&a.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",p.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(i)},Ii=(e,t)=>{let s=t?.defaultValues||{},r={};Object.keys(s).forEach(l=>{he(r,l,s[l])});let i=ee({state:{formValues:r},props:t}),n=ie(i.fields||[]),o={};for(let l of n){let p=ne(s,l.name);p!==void 0?he(o,l.name,p):he(o,l.name,Ps(l))}e.resetFormValues({defaultValues:o})},nl=e=>{let{store:t,props:s}=e;Ii(t,s)},ol=e=>{let{props:t,refs:s,render:r}=e,i=e.store.getState(),n=ee({state:i,props:t});Ci({form:n,formValues:i.formValues,refs:s,formDisabled:!!t?.disabled}),r()},al=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!!r?.disabled;s?.key!==r?.key&&Ii(i,r);let p=i.getState();rt({state:p,props:r});let a=ee({state:p,props:r});Ci({form:a,formValues:p.formValues,refs:o,formDisabled:l}),n()},ll=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},pl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;s.setFormFieldValue({name:l,value:p});let a=s.getState();rt({state:a,props:n});let c=ee({state:a,props:n}),d=ie(c.fields||[]).find(h=>h.name===l);if($i({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let h=Et(d,p);h?s.setErrors({errors:{...a.errors,[l]:h}}):s.clearFieldError({name:l})}i(),r(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:Ie({state:s.getState(),props:n})}}))},dl=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let l=s.getState(),p=ee({state:l,props:n}),a=((p.actions||{}).buttons||[]).find(d=>d.id===o),c=Ie({state:l,props:n});if(a&&a.validate){let d=ie(p.fields||[]),{valid:h,errors:f}=$t(d,l.formValues);s.setErrors({errors:f}),h||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:h,errors:f}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},cl=(e,t)=>{let s=t._event;s.type==="contextmenu"&&s.preventDefault();let{store:r,dispatchEvent:i,props:n}=e,o=s.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:s.type,values:Ie({state:r.getState(),props:n})}}))},ul=(e,t)=>{let{store:s,dispatchEvent:r,render:i,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let l=o.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let p=s.getState(),a=ee({state:p,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=Ie({state:p,props:n});if(d.validate){let f=ie(a.fields||[]),{valid:u,errors:y}=$t(f,p.formValues);s.setErrors({errors:y}),u||s.setReactiveMode(),i(),r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else r(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},hl=(e,t)=>{let{store:s,render:r,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName,l=ee({state:s.getState(),props:i}),p=ie(l.fields||[]).find(a=>a.name===o);if(p&&p.tooltip){let a=n.currentTarget.getBoundingClientRect();s.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof p.tooltip=="string"?p.tooltip:p.tooltip.content||""}),r()}},fl=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},yl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:dl,handleAfterMount:ol,handleBeforeMount:nl,handleImageClick:cl,handleKeyDown:ul,handleOnUpdate:al,handleTooltipMouseEnter:hl,handleTooltipMouseLeave:fl,handleValueChange:pl,handleValueInput:ll},Symbol.toStringTag,{value:"Module"})),ml=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],gl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],bl=({ref:e,fieldType:t,value:s,forceRefresh:r=!1})=>{if(ml.includes(t)){if(r&&e.removeAttribute("value"),s==null){if(gl.includes(t)&&r){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(s))}},Oi=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},vl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(s=>{let r=s.getAttribute("data-field-name");r&&t.set(r,s)}),t},Pr=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,wl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(s=>{let r=s.dataset?.fieldName;if(!r)return;let i=ne(t,r);Oi({ref:s,value:i})})},_l=function(){let e=this.store.getState();return Ie({state:e,props:this.props})},xl=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let s=this.store.getState(),r=ee({state:s,props:this.props}),i=ie(r.fields||[]),n=vl(Pr(this));for(let l of i){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let a=Object.prototype.hasOwnProperty.call(t,l.name),c=ne(t,l.name);if(!a&&c===void 0)continue;let d=ne(s.formValues,l.name);bl({ref:p,fieldType:l.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(l.type)&&Oi({ref:p,value:d}),l.type==="checkbox"&&(d?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let o=()=>{let l=this.store.getState();wl({root:Pr(this),values:l.formValues})};o(),setTimeout(()=>{o()},0)},Sl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),s=ie(t.fields||[]),{valid:r,errors:i}=$t(s,e.formValues);return this.store.setErrors({errors:i}),r||this.store.setReactiveMode(),this.render(),{valid:r,errors:i}},Al=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let s=ee({state:{formValues:t},props:this.props}),r=ie(s.fields||[]),i={};for(let n of r){let o=ne(e,n.name);o!==void 0?he(i,n.name,o):he(i,n.name,Ps(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)},kl=Object.freeze(Object.defineProperty({__proto__:null,getValues:_l,reset:Al,setValues:xl,validate:Sl},Symbol.toStringTag,{value:"Module"})),Br=3e3,El=180,bt=new WeakMap,Ti=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},$l=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:s,refs:r,emitResult:i=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:$l(e);Ti(r),e.closeAll(),t(),i&&s.emit("event",o)},Li=({store:e,render:t,globalUI:s,refs:r,error:i})=>{Ti(r),e.selectIsOpen()&&(e.closeAll(),t()),s.emit("error",i)},it=({store:e,render:t,globalUI:s,refs:r})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:s,refs:r,emitResult:!0})},nt=(e,{rejectOnError:t=!1}={})=>new Promise((s,r)=>{let i=null,n=e.once("event",o=>{i?.(),s(o)});t&&(i=e.once("error",o=>{n?.(),r(o)}))}),Cl=e=>{let t=bt.get(e);return t||(t=new Map,bt.set(e,t)),t},Il=(e,t)=>{let s=bt.get(e),r=s?.get(t);r&&(clearTimeout(r.exitTimerId),clearTimeout(r.removeTimerId),s.delete(t))},Ol=e=>{let t=bt.get(e);if(t){for(let s of t.values())clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId);t.clear()}},Tl=({store:e,render:t,globalUI:s},r)=>{Il(s,r);let i=Cl(s),n=setTimeout(()=>{e.setToastPhase?.({id:r,phase:"exiting"}),t()},Math.max(0,Br-El)),o=setTimeout(()=>{i.delete(r),e.removeToast({id:r}),t()},Br);i.set(r,{exitTimerId:n,removeTimerId:o})},Ll=(e,t)=>{setTimeout(()=>{let{store:s,refs:r}=e;if(!s.selectIsOpen()||s.selectUiType()!=="formDialog")return;let i=s.selectFormDialogConfig?.();if(!i||i.key!==t||typeof i.mount!="function")return;let n=r.formDialog;n&&i.mount(n)},0)},Vl=(e,t)=>{setTimeout(()=>{let{store:s,refs:r,render:i,globalUI:n}=e;if(!s.selectIsOpen()||s.selectUiType()!=="componentDialog")return;let o=s.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let l=r.componentDialogBodyHost;if(l)try{let p=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{p[a]=c}),l.replaceChildren(p),r.componentDialogBody=p}catch(p){Li({store:s,render:i,globalUI:n,refs:r,error:p})}},0)},ls=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Nl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0})},Rl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:n})},jl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:!1})},Dl=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0,result:null})},Pl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,{index:l,item:p}=o.detail;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{index:l,item:p}})},Bl=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setAlertConfig(o),r(),nt(i)},zl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setConfirmConfig(o),r(),nt(i)},Wl=(e,t)=>{let{store:s,render:r,globalUI:i}=e;s.addToast(t),r();let n=s.selectToasts?.()??[],o=n[n.length-1]?.id;o&&Tl({store:s,render:r,globalUI:i},o)},Ml=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;return it({store:s,render:r,globalUI:i,refs:n}),s.setDropdownConfig(o),r(),nt(i)},Fl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setFormDialogConfig(o),r();let l=s.selectFormDialogConfig?.().key;return Ll(e,l),nt(i)},Kl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t;it({store:s,render:r,globalUI:i,refs:n}),s.setComponentDialogConfig(o),r();let l=s.selectComponentDialogConfig?.().key;return Vl(e,l),nt(i,{rejectOnError:!0})},Ul=(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:o})},Hl=(e,t)=>{let{store:s,refs:r}=e,i=t._event?.detail??{},n=s.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:i,formEl:r.formDialog??null})},ql=e=>{let{store:t,render:s,globalUI:r,refs:i}=e;Ol(r);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:s,globalUI:r,refs:i,emitResult:!0});return}n&&s()},Yl=async(e,t)=>{let{store:s,render:r,globalUI:i,refs:n}=e,o=t._event,l=Number(o?.currentTarget?.dataset?.actionIndex),p=s.selectComponentDialogConfig?.(),a=p?.key,c=Number.isInteger(l)?p?.actions?.buttons?.[l]:null;if(c){if(c.role==="cancel"){fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${p?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!ls(s,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let h=await d.getValues();if(!ls(s,a))return;fe({store:s,render:r,globalUI:i,refs:n,emitResult:!0,result:{actionId:c.id,values:h}})}catch(d){if(!ls(s,a))return;Li({store:s,render:r,globalUI:i,refs:n,error:d})}}},Gl=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:jl,handleCloseAll:ql,handleComponentDialogAction:Yl,handleConfirm:Rl,handleDialogClose:Nl,handleDropdownClose:Dl,handleDropdownItemClick:Pl,handleFormAction:Ul,handleFormFieldEvent:Hl,handleShowAlert:Bl,handleShowComponentDialog:Kl,handleShowConfirm:zl,handleShowDropdownMenu:Ml,handleShowFormDialog:Fl,handleShowToast:Wl},Symbol.toStringTag,{value:"Module"})),Jl=new Set(["sm","md","lg","f"]),Zl=new Set(["sm","md","lg"]),Xl=new Set(["active","exiting"]),Ql=new Set(["top","bottom"]),ep=new Set(["confirm","cancel"]),tp=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),gs=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,je=(e,t="md")=>Jl.has(e)?e:t,Vi=(e,t="sm")=>Zl.has(e)?e:t,Ni=(e,t="active")=>Xl.has(e)?e:t,Ri=(e,t="top")=>Ql.has(e)?e:t,zs=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:tp).map((s,r)=>{if(!s||typeof s!="object"||Array.isArray(s))throw new Error("component dialog buttons must be objects");if(typeof s.id!="string"||s.id.length===0)throw new Error("component dialog button id is required");if(typeof s.label!="string"||s.label.length===0)throw new Error("component dialog button label is required");if(!ep.has(s.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...s,_globalIdx:r,variant:s.variant??(s.role==="confirm"?"pr":"se"),align:s.align??(s.role==="cancel"?"left":"right"),validate:s.role==="confirm"?!!s.validate:!1,_disabled:!!s.disabled,pre:s.pre??"",suf:s.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(s=>s.align==="left"),_rightButtons:t.filter(s=>s.align!=="left")}},ji=()=>({title:"",description:"",size:"md",component:"",props:{},actions:zs(),key:0}),sp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:ji()}),rp=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},ip=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"Yes",cancelText:t.cancelText??"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},np=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs"},e.uiType="dropdown",e.isOpen=!0},op=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let s=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:gs(t.defaultValues),context:gs(t.context),disabled:!!t.disabled,size:je(t.size,"md"),key:s+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},ap=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let s=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:je(t.size,"md"),component:t.component,props:gs(t.props),actions:zs(t.actions),key:s+1},e.uiType="componentDialog",e.isOpen=!0},lp=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let s=(e.nextToastId??0)+1,r={id:`toast-${s}`,message:t.message,size:Vi(t.size??t.s,"sm"),position:Ri(t.position,"top"),phase:"active"};e.nextToastId=s,e.toasts=[...e.toasts??[],r]},pp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(s=>s.id!==t.id))},dp=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(s=>s.id!==t.id?s:{...s,phase:Ni(t.phase,"active")}))},cp=({state:e})=>{e.toasts=[]},up=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},hp=({state:e})=>e.config,fp=({state:e})=>e.dropdownConfig,yp=({state:e})=>e.formDialogConfig,mp=({state:e})=>e.componentDialogConfig,gp=({state:e})=>e.uiType,bp=({state:e})=>e.isOpen,vp=({state:e})=>e.toasts??[],wp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",s=e.isOpen&&e.uiType==="formDialog",r=e.isOpen&&e.uiType==="componentDialog",i=e.componentDialogConfig??ji(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Vi(o.size,"sm"),position:Ri(o.position,"top"),phase:Ni(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs"},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:je(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:i.title??"",description:i.description??"",size:je(i.size,"md"),component:i.component??"",props:i.props??{},actions:i.actions??zs(),key:i.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:s,isComponentDialogOpen:r,isDialogContainerOpen:t||s||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?je(i.size,"md"):s?je(e.formDialogConfig?.size,"md"):"sm"}},_p=Object.freeze(Object.defineProperty({__proto__:null,addToast:lp,clearToasts:cp,closeAll:up,createInitialState:sp,removeToast:pp,selectComponentDialogConfig:mp,selectConfig:hp,selectDropdownConfig:fp,selectFormDialogConfig:yp,selectIsOpen:bp,selectToasts:vp,selectUiType:gp,selectViewData:wp,setAlertConfig:rp,setComponentDialogConfig:ap,setConfirmConfig:ip,setDropdownConfig:np,setFormDialogConfig:op,setToastPhase:dp},Symbol.toStringTag,{value:"Module"})),xp=(e,t)=>{let{dispatchEvent:s,store:r}=e;t._event,console.log("handle click start",r.selectPath()),s(new CustomEvent("start-click",{detail:{path:r.selectPath()}}))},Sp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:xp},Symbol.toStringTag,{value:"Module"})),Ap=()=>Object.freeze({}),kp=["id","class","style","slot","start"],Ep=(e={})=>Object.entries(e).filter(([t])=>!kp.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),$p=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Cp=({props:e})=>{let t=$p(e.start)||e.start;return{containerAttrString:Ep(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Ip=({props:e})=>e.start?.path,Op=({state:e})=>{},Tp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ap,selectPath:Ip,selectViewData:Cp,setState:Op},Symbol.toStringTag,{value:"Module"})),zr=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Lp=e=>e.map(t=>{let s=1,r=t.tagName.toLowerCase();return r==="h1"?s=1:r==="h2"?s=2:r==="h3"?s=3:r==="h4"?s=4:r==="rtgl-text"&&(s=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:s}}),Wr=(e,t,s)=>{let{store:r,render:i}=s,n,o=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>o&&(o=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let a=p.getBoundingClientRect();a.top>t&&a.top<l&&(l=a.top,n=p.id)})}n&&n!==r.selectCurrentId()&&(r.setCurrentId({id:n}),i())},Vp=(e,t,s,r)=>{let{store:i,render:n}=r,o=null,l=()=>{o=null;let d=zr(e);i.setItems({items:Lp(d)}),Wr(d,s,r),n()},p=()=>{o===null&&(o=requestAnimationFrame(l))},a=()=>{Wr(zr(e),s,r)};p(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{p()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},Np=e=>{let{props:t}=e,s=()=>{};return requestAnimationFrame(()=>{let r=document.getElementById(t.targetId);if(!r)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);s=Vp(r,i,n,e)}),()=>{s()}},Rp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Np},Symbol.toStringTag,{value:"Module"})),jp=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Dp=({state:e})=>{let t=((s,r)=>{let i=new Set,n=s.findIndex(l=>l.id===r);if(n===-1)return i;let o=s[n].level;for(let l=n-1;l>=0;l--)if(s[l].level<o){let p=s[l].level;i.add(s[l].id);for(let a=l-1;a>=0;a--)s[a].level<p&&(i.add(s[a].id),p=s[a].level);break}return i})(e.items,e.currentId);return{items:e.items.map(s=>{let r={1:"0",2:"12px",3:"24px",4:"32px"},i=s.id===e.currentId,n=t.has(s.id),o=i||n;return{...s,c:o?"fg":"mu-fg",ml:r[s.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},Pp=({state:e})=>e,Bp=({state:e})=>e.currentId,zp=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Wp=({state:e},t={})=>{e.currentId=t.id},Mp=({state:e},t={})=>{e.contentContainer=t.container},Fp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:jp,selectCurrentId:Bp,selectState:Pp,selectViewData:Dp,setContentContainer:Mp,setCurrentId:Wp,setItems:zp},Symbol.toStringTag,{value:"Module"})),ot=e=>e==null||e===!0?"":String(e),Di=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=ot(t);s.setValue({value:n}),s.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),r()},Kp=e=>{let{store:t,props:s}=e;if(s.value!==void 0){let r=ot(s.value);t.setValue({value:r}),t.setTempValue({value:r})}},Up=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e;if(s?.value!==r?.value){let o=ot(r?.value);i.setValue({value:o}),i.getState().isOpen||i.setTempValue({value:o})}n()},Hp=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;let o=t._event,l=ot(n.value);s.setValue({value:l}),s.setTempValue({value:l}),s.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),r(),setTimeout(()=>{let{input:p}=i;if(!p)return;p.value=l,p.focus();let a=p.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},qp=(e,t)=>{let{store:s,render:r}=e;s.closePopover({}),r()},Yp=(e,t)=>{let{store:s}=e,r=t._event,i=ot(r.detail.value);s.setTempValue({value:i})},Gp=e=>{let{store:t,refs:s}=e,{input:r}=s,i=r?r.value:t.getState().tempValue;Di(e,i)},Jp=(e,t)=>{let{store:s,refs:r}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=r,o=n?n.value:s.getState().tempValue;Di(e,o)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.closePopover({}),e.render())},Zp=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Kp,handleInputChange:Yp,handleInputKeydown:Jp,handleOnUpdate:Up,handlePopoverClose:qp,handleSubmitClick:Gp,handleTextClick:Hp},Symbol.toStringTag,{value:"Module"})),Xp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Qp=({props:e,state:t})=>{let s=typeof t.value=="string"&&t.value.length>0,r=s?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:r,valueColor:s?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:o}},ed=({state:e},t={})=>{e.tempValue=t.value},td=({state:e},t={})=>{let{position:s}=t;e.position=s,e.isOpen=!0,e.hasUnsavedChanges=!1},sd=({state:e})=>{e.isOpen=!1,e.tempValue=""},rd=({state:e},t={})=>{e.value=t.value},id=({state:e})=>e.value,nd=Object.freeze(Object.defineProperty({__proto__:null,closePopover:sd,createInitialState:Xp,openPopover:td,selectValue:id,selectViewData:Qp,setTempValue:ed,setValue:rd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(let i of s)if(!r.includes(i)||!le(e[i],t[i]))return!1;return!0},Mr=({dispatchEvent:e,value:t,label:s,index:r,item:i})=>{e(new CustomEvent("value-change",{detail:{value:t,label:s,index:r,item:i},bubbles:!0}))},od=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i.value}),r())}},ad=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=!1;s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),o=!0),o&&n()},Pi=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[p],c=Object.prototype.hasOwnProperty.call(i||{},"selectedValue"),d=n.selectSelectedValue(),h=c?!0:n.selectHasSelectedValue(),f=a?h&&le(a.value,d):!1;if(a){if(f&&!i.noClear){n.clearSelectedValue({}),i.onChange&&typeof i.onChange=="function"&&i.onChange(void 0),Mr({dispatchEvent:r,value:void 0,label:void 0,index:null,item:void 0}),s();return}n.updateSelectedValue({value:a.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),Mr({dispatchEvent:r,value:a.value,label:a.label,index:p,item:a}),s()}},ld=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Pi(e,t))},pd=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},dd=e=>{let{store:t,render:s}=e;t.clearHoveredOption({}),s()},Bi=(e,t)=>{if(e.props.disabled)return;let{render:s,dispatchEvent:r}=e,{_event:i}=t;i.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},cd=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Bi(e,t))},ud=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!0}),s()},hd=e=>{let{store:t,render:s}=e;t.setHoveredAddOption({isHovered:!1}),s()},fd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Bi,handleAddOptionKeyDown:cd,handleAddOptionMouseEnter:ud,handleAddOptionMouseLeave:hd,handleBeforeMount:od,handleOnUpdate:ad,handleOptionClick:Pi,handleOptionKeyDown:ld,handleOptionMouseEnter:pd,handleOptionMouseLeave:dd},Symbol.toStringTag,{value:"Module"})),yd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],md=(e={})=>Object.entries(e).filter(([t])=>!yd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),gd=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),bd=({state:e,props:t})=>{let s=md(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=i?t.selectedValue:e.selectedValue,o=i?!0:!!e.hasSelectedValue,l=t.options||[],p=l.map((a,c)=>{let d=o&&le(a.value,n),h=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":h&&!r?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:r?"not-allowed":"pointer",tabIndex:r?-1:0}});return{containerAttrString:s,isDisabled:r,options:p,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:l.length===0?"none":"xs"}},vd=({state:e})=>e,wd=({state:e})=>e.selectedValue,_d=({state:e})=>!!e.hasSelectedValue,xd=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Sd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Ad=({state:e},t={})=>{e.hoveredOptionId=t.optionId},kd=({state:e})=>{e.hoveredOptionId=null},Ed=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},$d=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:kd,clearSelectedValue:Sd,createInitialState:gd,selectHasSelectedValue:_d,selectSelectedValue:wd,selectState:vd,selectViewData:bd,setHoveredAddOption:Ed,setHoveredOption:Ad,updateSelectedValue:xd},Symbol.toStringTag,{value:"Module"})),Ws=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Cd=e=>{let{store:t,props:s,render:r}=e;if(s.selectedValue!==null&&s.selectedValue!==void 0&&s.options){let i=s.options.find(n=>Ws(n)==="item"&&le(n.value,s.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),r())}},Id=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1,p=!1;r?.disabled&&!s?.disabled&&(i.closeOptionsPopover({}),l=!0),s.selectedValue!==r.selectedValue&&(i.updateSelectedValue({value:r.selectedValue}),l=!0),s.options!==r.options&&(l=!0,p=!0),l&&(n(),p&&i.selectState?.().isOpen&&o?.popover?.refreshContent?.())},zi=(e,t)=>{let{store:s,render:r,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=i.selectButton.getBoundingClientRect(),l=s.selectSelectedValue(),p=l!==null?l:n.selectedValue,a=null;p!=null&&n.options&&(a=n.options.findIndex(c=>Ws(c)==="item"&&le(c.value,p)),a===-1&&(a=null)),s.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),r()},Od=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),zi(e,t))},Td=e=>{let{store:t,render:s}=e;t.closeOptionsPopover({}),s()},Ld=(e,t)=>{let{render:s,dispatchEvent:r,props:i,store:n}=e;if(i.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=i.options[l];Ws(a)==="item"&&(n.updateSelectedValue({value:a?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(a.value),r(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:p,item:a},bubbles:!0})),s())},Vd=(e,t)=>{let{store:s,render:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);s.setHoveredOption({optionId:n}),r()},Nd=(e,t)=>{let{store:s,render:r}=e;s.clearHoveredOption({}),r()},Rd=(e,t)=>{let{store:s,render:r,dispatchEvent:i,props:n}=e;n.disabled||(t._event.stopPropagation(),s.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),r())},jd=(e,t)=>{if(e.props.disabled)return;let{store:s,render:r,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),s.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),r()},Dd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!0}),r()},Pd=(e,t)=>{let{store:s,render:r}=e;s.setHoveredAddOption({isHovered:!1}),r()},Bd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:jd,handleAddOptionMouseEnter:Dd,handleAddOptionMouseLeave:Pd,handleBeforeMount:Cd,handleButtonClick:zi,handleButtonKeyDown:Od,handleClearClick:Rd,handleClickOptionsPopoverOverlay:Td,handleOnUpdate:Id,handleOptionClick:Ld,handleOptionMouseEnter:Vd,handleOptionMouseLeave:Nd},Symbol.toStringTag,{value:"Module"})),zd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Wd=(e={})=>Object.entries(e).filter(([t])=>!zd.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Md=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Wi=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Fr=(e={})=>Wi(e)==="item",Fd=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Kd=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",Ud=(e={},t,s,r,i)=>{let n=Wi(e),o=n==="section",l=n==="separator",p=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};if(l)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};let a=le(e.value,s),c=r===t,d=Fd(e),h=Kd(e);return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:i,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:h,hasSuffixText:h.length>0,suffixTextColor:"mu-fg"}},Hd=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),qd=({state:e,props:t})=>{let s=Wd(t),r=!!t.disabled,i=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,l=t.options||[],p=l.find(h=>Fr(h)&&le(h.value,i));p&&(n=p.label,o=!1);let a=l.some(h=>Fr(h)&&Md(h,"icon")),c=l.map((h,f)=>Ud(h,f,i,e.hoveredOptionId,a)),d=c.find(h=>h.isItem&&h.isSelected);return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:c,selectedValue:i,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-fg",selectButtonCursor:r?"not-allowed":"pointer",selectButtonHoverBorderColor:r?"bo":"ac",selectButtonTabIndex:r?-1:0,hasValue:i!=null,showClear:!r&&!t.noClear&&i!=null,showAddOption:!r&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Yd=({state:e})=>e,Gd=({state:e})=>e.selectedValue,Jd=({state:e},t={})=>{let{position:s,selectedIndex:r}=t;e.position=s,e.isOpen=!0,r!=null&&(e.hoveredOptionId=r)},Zd=({state:e})=>{e.isOpen=!1},Xd=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Qd=({state:e})=>{e.selectedValue=void 0},ec=({state:e},t={})=>{e.hoveredOptionId=t.optionId},tc=({state:e})=>{e.hoveredOptionId=null},sc=({state:e})=>{e.selectedValue=void 0},rc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},ic=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:tc,clearSelectedValue:sc,closeOptionsPopover:Zd,createInitialState:Hd,openOptionsPopover:Jd,resetSelection:Qd,selectSelectedValue:Gd,selectState:Yd,selectViewData:qd,setHoveredAddOption:rc,setHoveredOption:ec,updateSelectedValue:Xd},Symbol.toStringTag,{value:"Module"})),Kr=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},nc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Kr(e.tooltip):Kr(e.showCompactTooltip),oc=(e,t)=>{let{store:s,dispatchEvent:r}=e,i=t._event,n,o=s.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),r(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},ac=(e,t)=>{let{store:s,dispatchEvent:r,render:i}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=s.selectItem(o);s.hideTooltip({}),i(),r(new CustomEvent("item-click",{detail:{item:l},bubbles:!0,composed:!0}))},lc=(e,t)=>{let{props:s,store:r,render:i}=e;if(!nc(s)||(s.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=r.selectItem(o);if(!l||l.type==="groupLabel")return;let p=n.currentTarget.getBoundingClientRect(),a=l.tooltip||l.label||l.title;a&&(r.showTooltip({x:p.right,y:p.top+p.height/2,place:"r",content:a}),i())},pc=e=>{let{store:t,render:s}=e;t.hideTooltip({}),s()},dc=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:oc,handleItemClick:ac,handleItemMouseEnter:lc,handleItemMouseLeave:pc},Symbol.toStringTag,{value:"Module"})),cc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),uc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],hc=(e={})=>Object.entries(e).filter(([t])=>!uc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xe=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},bs=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},fc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?bs(e.tooltip):bs(e.showCompactTooltip),yc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Ur=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Ms(e,t=null){let s=[];for(let r of e){let i=r.id||r.href||r.path,n=i!=null&&t===i,o=Ur(r);if(s.push({id:i,label:o,title:r.title??o,href:r.href,type:r.type||"item",icon:r.icon,testId:r.testId,tooltip:r.tooltip,path:r.path,hrefAttr:r.href?`href=${r.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),r.items&&Array.isArray(r.items))for(let l of r.items){let p=l.id||l.href||l.path,a=p!=null&&t===p,c=Ur(l);s.push({id:p,label:c,title:l.title??c,href:l.href,type:l.type||"item",icon:l.icon,testId:l.testId,tooltip:l.tooltip,path:l.path,hrefAttr:l.href?`href=${l.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return s}var mc=({state:e,props:t})=>{let s=Xe(t.header)||t.header,r=Xe(t.items)||t.items,i=t.selectedItemId,n=hc(t),o=t.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?Ms(r,i):[],a=!bs(t.hideHeader),c=fc(t),d=t.bwr||"xs",h=yc(t.w,o),f=o==="full"?"fs":"c",u=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",I=o==="full"?"":`ah=${u}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:l,items:p,sidebarWidth:h,headerAlign:f,itemAlign:u,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:I,itemWidth:V,headerWidth:V,selectedItemId:i,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},gc=({props:e})=>Xe(e.header)||e.header,bc=({state:e,props:t})=>{let s=Xe(t.items)||t.items;return(s?Ms(s):[]).find(r=>r.active)},vc=({props:e},t)=>{let s=Xe(e.items)||e.items;return(s?Ms(s):[]).find(r=>r.id===t)},wc=({state:e})=>{},_c=({state:e},t={})=>{let{x:s,y:r,place:i="r",content:n=""}=t;e.tooltipState={open:!0,x:s,y:r,place:i,content:n}},xc=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Sc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:cc,hideTooltip:xc,selectActiveItem:bc,selectHeader:gc,selectItem:vc,selectViewData:mc,setState:wc,showTooltip:_c},Symbol.toStringTag,{value:"Module"})),Ac=e=>{let{store:t,props:s}=e;t.setValue({value:s.value??0})},kc=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n}=e,o=s?.key!==r?.key,l=s?.value!==r?.value;if(o||l){let p=r?.value??0;i.setValue({value:p}),n()}},Ec=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},$c=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;s.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),r(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},Cc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Ac,handleOnUpdate:kc,handleValueChange:Ec,handleValueInput:$c},Symbol.toStringTag,{value:"Module"})),Ic=()=>Object.freeze({value:0}),Oc=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),Tc=({state:e},t={})=>{e.value=t.value},Lc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ic,selectViewData:Oc,setValue:Tc},Symbol.toStringTag,{value:"Module"})),Vc=e=>{},Nc=(e,t)=>{let{dispatchEvent:s,props:r}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=r.data?.rows?.[n];o&&s(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},Rc=(e,t)=>{let{store:s,render:r,dispatchEvent:i}=e,n=t._event.currentTarget.dataset.columnKey,o=s.selectSortInfo(),l="asc";o.column===n&&(o.direction==="asc"?l="desc":o.direction==="desc"&&(l=null)),l?s.setSortColumn({column:n,direction:l}):s.clearSort(),r(),i(new CustomEvent("header-click",{detail:{column:n,direction:l,sortInfo:l?{column:n,direction:l}:null}}))},jc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Vc,handleHeaderClick:Rc,handleRowClick:Nc},Symbol.toStringTag,{value:"Module"})),Dc=()=>Object.freeze({sortColumn:null,sortDirection:null}),Pc=["id","class","style","slot","data"],Bc=(e={})=>Object.entries(e).filter(([t])=>!Pc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),zc=(e,t)=>{let s=t.split("."),r=e;for(let i of s){if(r==null)return null;r=r[i]}return r},Wc=({state:e,props:t})=>{let s=Bc(t),r=t.data||{columns:[],rows:[]},i=r.rows.map((n,o)=>{let l=r.columns.map(p=>{let a=zc(n,p.key);return{key:p.key,value:a!=null?String(a):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:r.columns||[],rows:i||[]}},Mc=({state:e})=>e,Fc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Kc=({state:e},{column:t,direction:s}={})=>{e.sortColumn=t,e.sortDirection=s},Uc=({state:e})=>{e.sortColumn=null,e.sortDirection=null},Hc=Object.freeze(Object.defineProperty({__proto__:null,clearSort:Uc,createInitialState:Dc,selectSortInfo:Fc,selectState:Mc,selectViewData:Wc,setSortColumn:Kc},Symbol.toStringTag,{value:"Module"})),qc=(e,t)=>{let{dispatchEvent:s}=e,r=t._event.currentTarget.dataset.id;s(new CustomEvent("item-click",{detail:{id:r}}))},Yc=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:qc},Symbol.toStringTag,{value:"Module"})),Gc=()=>Object.freeze({}),Jc=["id","class","style","slot","items","selectedTab"],Zc=(e={})=>Object.entries(e).filter(([t])=>!Jc.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),Xc=({props:e})=>{let t=Zc(e),s=e.items||[],r=e.selectedTab,i=s.map(n=>({...n,isSelected:n.id===r,bgColor:n.id===r?"ac":"",borderColor:n.id===r?"":"tr",textColor:n.id===r?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:r}},Qc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Gc,selectViewData:Xc},Symbol.toStringTag,{value:"Module"})),eu=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Mi=e=>Array.isArray(e)?[...e]:[],Fi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},vs=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Mi(t.selectedValues),Ki=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Mi(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():vs({store:e,props:t}),tu=({dispatchEvent:e,value:t,operation:s,changedValue:r,label:i,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:s,changedValue:r,label:i,index:n,item:o},bubbles:!0}))},su=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},Pe=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},Fs=({store:e,props:t,refs:s}={})=>{let r=Fi(s?.trigger);return r?(e.openOptionsPopover({position:r,values:Ki({store:e,props:t})}),!0):!1},ru=e=>{let{store:t,props:s,render:r,refs:i}=e,n=!1;s.selectedValues!==void 0&&(t.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),n=!0),Array.isArray(s.draftSelectedValues)&&(t.updateDraftSelectedValues({values:s.draftSelectedValues}),n=!0),s.open===!0&&!s.disabled&&Fs(e)&&(n=!0),n&&r()},iu=e=>{let{props:t,render:s,store:r,dispatchEvent:i}=e;if(t.disabled){t.open===!0&&Pe({dispatchEvent:i,open:!1});return}t.open===!0&&!r.getState().isOpen&&Fs(e)&&s()},nu=(e,t)=>{let{oldProps:s,newProps:r}=t,{store:i,render:n,refs:o}=e,l=!1;if(r?.disabled&&!s?.disabled){let p=i.getState().isOpen;i.closeOptionsPopover({}),p&&Pe({dispatchEvent:e.dispatchEvent,open:!1}),l=!0}if(s.selectedValues!==r.selectedValues&&(i.updateSelectedValues({values:r.selectedValues,syncDraft:r.draftSelectedValues===void 0,preserveDraft:Array.isArray(r.draftSelectedValues)}),l=!0),s.draftSelectedValues!==r.draftSelectedValues&&(i.updateDraftSelectedValues({values:Array.isArray(r?.draftSelectedValues)?r.draftSelectedValues:vs({store:i,props:r})}),l=!0),s.open!==r.open&&r.open!==void 0&&(r.open?r.disabled?Pe({dispatchEvent:e.dispatchEvent,open:!1}):Fs({store:i,props:r,refs:o})&&(l=!0):(i.closeOptionsPopover({}),l=!0)),s.options!==r.options){let p=vs({store:i,props:r}).length>0;(i.getState().isOpen||p)&&(l=!0)}l&&n()},Ui=(e,t)=>{let{store:s,render:r,refs:i,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let l=Fi(i.trigger);l&&(s.openOptionsPopover({position:l,values:Ki({store:s,props:n})}),Pe({dispatchEvent:o,open:!0}),r())},ou=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Ui(e,t))},au=e=>{let{store:t,render:s,dispatchEvent:r}=e;t.closeOptionsPopover({}),Pe({dispatchEvent:r,open:!1}),s()},Hi=(e,t)=>{let{render:s,props:r,store:i,dispatchEvent:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[p];!a||eu(a)!=="item"||(i.toggleDraftSelectedValue({value:a.value}),su({dispatchEvent:n,value:i.selectDraftSelectedValues()}),s())},lu=(e,t)=>{let s=t._event;s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),Hi(e,t))},pu=(e,t)=>{let{store:s,props:r,render:i,dispatchEvent:n}=e;if(r.disabled)return;t._event.stopPropagation();let o=s.selectDraftSelectedValues();s.commitDraftSelectedValues({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(o),tu({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),Pe({dispatchEvent:n,open:!1}),i()},du=(e,t)=>{let{props:s,dispatchEvent:r}=e;s.disabled||s.noAdd||(t._event.stopPropagation(),r(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},cu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:du,handleAfterMount:iu,handleBeforeMount:ru,handleOnUpdate:nu,handleOptionClick:Hi,handleOptionKeyDown:lu,handlePopoverClose:au,handleSubmitClick:pu,handleTriggerClick:Ui,handleTriggerKeyDown:ou},Symbol.toStringTag,{value:"Module"})),qi=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Ct=e=>Array.isArray(e)?[...e]:[],vt=e=>{typeof e.render=="function"&&e.render()},Yi=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Ct(e.props?.selectedValues),Ks=(e,t=[])=>{let s=qi(e.refs?.trigger);return!s||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:s,values:t}),!0)},Gi=(e,t=[],s=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):s?Ks(e,t):!1,uu=function(e={}){let t=this.store?.getState?.(),s=Array.isArray(e.values)?Ct(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let r=qi(this.refs?.trigger);r&&this.store.openOptionsPopover({position:r,values:s})}else e.keepOpen&&Ks(this,s.length>0?s:Yi(this));vt(this)},hu=function(e={}){let t=Ct(e.values);Gi(this,t,!!e.keepOpen)&&vt(this)},fu=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),s=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:Yi(this);if(s.some(i=>le(i,e.value))){e.keepOpen&&!t?.isOpen&&Ks(this,s)&&vt(this);return}let r=[...Ct(s),e.value];Gi(this,r,!!e.keepOpen)&&vt(this)},yu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:fu,refreshPopover:uu,setDraftSelectedValues:hu},Symbol.toStringTag,{value:"Module"})),mu=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],gu=(e={})=>Object.entries(e).filter(([t])=>!mu.includes(t)).map(([t,s])=>`${t}=${s}`).join(" "),bu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Ji=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Zi=(e={})=>Ji(e)==="item",Xi=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",vu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],wu=(e=[],t=[])=>e.length!==t.length?!1:e.every((s,r)=>le(s,t[r])),_u=(e=[],t)=>e.some(s=>le(s,t)),Qi=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),xu=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):Qi({state:e,props:t}),Su=e=>e==null?"":String(e),Au=(e=[],t)=>e.find(s=>Zi(s)&&le(s.value,t)),ws=({isSelected:e=!0,isAddChip:t=!1}={})=>{let s=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&s.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${s.join("; ")};`},ku=({option:e={},index:t,selectedValues:s=[],hasIconColumn:r=!1})=>{let i=Ji(e),n=i==="section",o=i==="separator",l=i==="item";if(n||o)return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l};let p=_u(s,e.value),a=Xi(e),c=vu(e),d=p?c||"Added":c;return{...e,index:t,type:i,isSection:n,isSeparator:o,isItem:l,isSelected:p,hasIconSlot:r,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:ws({isSelected:p}),suffixText:d,hasSuffixText:d.length>0}},Eu=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),$u=({state:e,props:t})=>{let s=gu(t),r=!!t.disabled,i=Qi({state:e,props:t}),n=xu({state:e,props:t}),o=(e.isOpen||i.length>0)&&Array.isArray(t.options)?t.options:[],l=o.some(f=>Zi(f)&&bu(f,"icon")),p=o.map((f,u)=>ku({option:f,index:u,selectedValues:n,hasIconColumn:l})),a=i.map((f,u)=>{let y=Au(o,f),m=y?Xi(y):"";return{value:f,selectionIndex:u,label:y?.label||Su(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${u}`}}),c=p.some(f=>f.isItem),d=!wu(i,n),h=a.length>0?a.map(f=>({...f,tagStyle:ws({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:ws({isAddChip:!0})}];return{containerAttrString:s,isDisabled:r,isOpen:e.isOpen,position:e.position,options:p,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:h,triggerCursor:r?"not-allowed":"pointer",triggerTabIndex:r?-1:0,showAddOption:!r&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:r,submitLabel:"Save"}},Cu=({state:e})=>ye(e.selectedValues),Iu=({state:e})=>!!e.hasSelectedValues,Ou=({state:e})=>ye(e.draftSelectedValues),Tu=({state:e},t={})=>{let{position:s,values:r}=t;e.position={...e.position,...s||{}},e.draftSelectedValues=ye(r),e.isOpen=!0},Lu=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Vu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},Nu=({state:e},t={})=>{let s=ye(t.values);e.selectedValues=s,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...s])},Ru=({state:e},t={})=>{let s=ye(e.draftSelectedValues),r=t.value,i=s.findIndex(n=>le(n,r));if(i>=0){e.draftSelectedValues=s.filter((n,o)=>o!==i);return}e.draftSelectedValues=[...s,r]},ju=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},Du=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Lu,commitDraftSelectedValues:ju,createInitialState:Eu,openOptionsPopover:Tu,selectDraftSelectedValues:Ou,selectHasSelectedValues:Iu,selectSelectedValues:Cu,selectViewData:$u,toggleDraftSelectedValue:Ru,updateDraftSelectedValues:Vu,updateSelectedValues:Nu},Symbol.toStringTag,{value:"Module"})),Pu=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bu=()=>Object.freeze({}),Hr={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},zu=({props:e})=>{let t=Hr[e.s]?e.s:"sm",s=Hr[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:s.textSize,padding:s.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${s.maxWidth};`}},Wu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Bu,selectViewData:zu},Symbol.toStringTag,{value:"Module"})),Mu=async e=>{let{props:t,store:s,render:r,refs:i}=e,{waveformData:n}=t;s.setWaveformData({data:n}),r();let o=i.canvas;o&&en(n,o)},Fu=async(e,t)=>{let{store:s,render:r,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}s.setWaveformData({data:o}),r();let l=i.canvas;l&&en(o,l)};async function en(e,t){let s=t.getContext("2d"),r=t.getBoundingClientRect(),i=r.width,n=r.height;t.width=i,t.height=n;let o=t.width,l=t.height;if(s.clearRect(0,0,o,l),s.fillStyle="#1a1a1a",s.fillRect(0,0,o,l),!e||!e.amplitudes)return;let p=e.amplitudes,a=l/2,c=s.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/p.length),h=.2;for(let f=0;f<p.length;f++){let u=p[f]/255*(l*.85),y=f*d,m=a-u/2;s.fillStyle=c,s.fillRect(y,m,Math.max(1,d*(1-h)),u)}s.strokeStyle="rgba(255, 255, 255, 0.1)",s.lineWidth=1,s.beginPath(),s.moveTo(0,a),s.lineTo(o,a),s.stroke(),s.shadowBlur=10,s.shadowColor="#2196F3"}var Ku=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:Mu,handleOnUpdate:Fu},Symbol.toStringTag,{value:"Module"})),Uu=()=>Object.freeze({waveformData:null}),Hu=({state:e},t={})=>{e.waveformData=t.data},qu=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),Yu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Uu,selectViewData:qu,setWaveformData:Hu},Symbol.toStringTag,{value:"Module"})),tn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sn=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),_s=e=>{if(e!=null)return e===""?!0:e},wt=(e,t)=>{let s=e.getAttribute(t);if(s!==null)return _s(s);let r=tn(t);if(r!==t){let i=e.getAttribute(r);if(i!==null)return _s(i)}},ps=Symbol("rtglReactivePropValues"),ds=Symbol("rtglNativeHostStyle"),Gu=(e,t)=>{let s=Object.getPrototypeOf(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=Object.getPrototypeOf(s)}},rn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,ds))return e[ds];let t=Gu(e,"style"),s;return typeof t?.get=="function"?s=t.get.call(e):e.style&&typeof e.style=="object"&&(s=e.style),s&&typeof s=="object"&&Object.defineProperty(e,ds,{value:s,enumerable:!1,configurable:!1,writable:!1}),s},Ju=e=>(Object.prototype.hasOwnProperty.call(e,ps)||Object.defineProperty(e,ps,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[ps]),Zu=({source:e,allowedKeys:t=[],onPropChange:s})=>{let r=Ju(e);t.includes("style")&&rn(e),t.forEach(i=>{if(typeof i!="string"||i.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0,o=Object.prototype.hasOwnProperty.call(e,i);o&&delete e[i],Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i)},set(l){let p=Object.prototype.hasOwnProperty.call(r,i)?r[i]:wt(e,i);l===void 0?delete r[i]:r[i]=l,p!==l&&s?.({propName:i,oldValue:p,newValue:l})}}),o&&(r[i]=n)})},Xu=(e,t)=>{let s=new Set(t);return new Proxy({},{get(r,i){if(typeof i=="string"&&s.has(i)){let n=e[i];return n!==void 0?n:wt(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(r,i){return typeof i=="string"&&s.has(i)},ownKeys(){return[...s]},getOwnPropertyDescriptor(r,i){if(typeof i=="string"&&s.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:wt(e,i)}}}})},Qu=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let s=e.methods;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(s,"type")&&s.type!=="object")throw new Error("methods.type must be 'object'.");if(!s.properties||typeof s.properties!="object"||Array.isArray(s.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let r of Object.keys(s.properties))if(!t.includes(r))throw new Error(`method '${r}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},xs={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},qr=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let s=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${s}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let s of t)if(e.trim().endsWith(s))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},eh=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,s]=e.split(" in ");if(!s||s.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let r=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of r){if(!i)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},th=(e,t,s=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return s?new re(`Cannot iterate over non-array value in loop '${e}' - got ${r} instead`):new re(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},sh=(e,t)=>{let s=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${s})`)},nn=(e,t,s={})=>{let r={},i={};s&&typeof s=="object"&&(s.functions!==void 0||s.partials!==void 0?(r=s.functions||{},i=s.partials||{}):typeof s=="object"&&(r=s));let n=R(e,{functions:r,partials:i},t,{});return n===void 0?{}:n},R=(e,t,s,r)=>{if(t.functions,e.var&&!e.type)return U(e.var,s,r);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return U(e.path,s,r);if(e.type===v.INTERPOLATION)return ih(e.parts,t,s,r);switch(e.type){case v.FUNCTION:return on(e,t,s,r);case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.CONDITIONAL:return oh(e,t,s,r);case v.LOOP:return ch(e,t,s,r);case v.OBJECT:return hh(e,t,s,r);case v.ARRAY:return fh(e,t,s,r);case v.PARTIAL:return yh(e,t,s,r);case v.PATH_REFERENCE:return mh(e,t,s,r);default:throw new Error(`Unknown node type: ${e.type}`)}},Yr=new Map,rh=e=>{let t=[],s="",r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")s&&(t.push({type:"property",value:s}),s=""),r=!0;else if(n==="]"){if(r&&s){let o=s.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});s=""}r=!1}else s+=n}return s&&t.push({type:"property",value:s}),t},U=(e,t,s)=>{if(!e)return;if(e in s)return s[e];let r=Yr.get(e);if(!r){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),r=[];for(let p of n){let a=rh(p.trim());r.push(...a)}Yr.set(e,r)}let i=t;for(let n=0;n<r.length;n++){let o=r[n];if(o.type==="property"&&o.value in s){i=s[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},ih=(e,t,s,r)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=R(n,t,s,r);i.push(o!=null?String(o):"")}return i.join("")},on=(e,t,s,r)=>{let i=t.functions||t,n=i[e.name];if(!n)throw sh(e.name,i);let o=e.args.map(l=>R(l,t,s,r));return n(...o)},Be=(e,t,s,r)=>{if(e.var&&!e.type)return U(e.var,s,r);switch(e.type){case v.VARIABLE:return U(e.path,s,r);case v.LITERAL:return e.value;case v.BINARY:return an(e,t,s,r);case v.UNARY:return ln(e,t,s,r);case v.FUNCTION:return on(e,t,s,r);default:return R(e,t,s,r)}},an=(e,t,s,r)=>{if(e.op===P.AND||e.op===P.OR){let o=Be(e.left,t,s,r),l=Be(e.right,t,s,r);switch(e.op){case P.AND:return o&&l;case P.OR:return o||l}}let i=R(e.left,t,s,r),n=R(e.right,t,s,r);switch(e.op){case P.EQ:return i==n;case P.NEQ:return i!=n;case P.GT:return i>n;case P.LT:return i<n;case P.GTE:return i>=n;case P.LTE:return i<=n;case P.IN:return Array.isArray(n)?n.includes(i):!1;case P.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case P.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ln=(e,t,s,r)=>{let i=e.op===xs.NOT?Be(e.operand,t,s,r):R(e.operand,t,s,r);switch(e.op){case xs.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},nh=(e,t,s,r)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(U(i.path,s,r)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,s,r):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=U(a.path,s,r);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=U(d.path,s,r);c.push(h!=null?String(h):"")}else{let h=R(d,t,s,r);c.push(h!=null?String(h):"")}o[p]=c.join("")}else o[p]=R(a,t,s,r)}return o}}}return null},oh=(e,t,s,r)=>{let i=nh(e,t,s,r);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,s,r))return R(e.bodies[n],t,s,r)}return pn},ah=(e,t)=>{let s=e.body,r=e.itemVar;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE){let i=s.conditions[0].path,n=s.bodies[0];if(i.startsWith(r+".")){let o=i.substring(r.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===r)c[h]=a;else if(u.startsWith(r+".")){let y=u.substring(r.length+1);c[h]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let m of f.parts)if(typeof m=="string")u.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===r)u.push(a!=null?String(a):"");else if(b.startsWith(r+".")){let g=b.substring(r.length+1),_=a[g];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}l.push(c)}}return l}}}return null},lh=(e,t)=>{let s=e.body,r=e.itemVar,i=ah(e,t);if(i!==null)return i;if(s.type===v.OBJECT&&s.properties.length<=5&&!s.whenCondition){for(let l of s.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of s.properties){let p=l.key,a=l.value;if(a.type===v.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===r)n.push({key:p,type:"item"});else if(c.startsWith(r+".")){let d=c.substring(r.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===r)n.push({key:p,type:"item_string"});else if(d.startsWith(r+".")){let h=d.substring(r.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:p,type:"prop_string",prop:h});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let h=a[d.prop];c[d.key]=h!=null?String(h):""}l[p]=c}return l}}return null},ph=(e,t,s,r,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<i.length;a++){let c=i[a],d={},h={...r,[l]:c,...p&&{[p]:a}};h.__paths__||(h.__paths__=r.__paths__||{});let f=e.iterable.path||"";if(r&&r.__paths__&&f){let u=f.split("."),y=u[0];y in r.__paths__&&(f=r.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let u of o.properties){let y=u.parsedKey?R(u.parsedKey,t,s,h):u.key,m=u.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else d[y]=U(b,s,{...r,[l]:c,...p&&{[p]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,s,{...r,[l]:c,...p&&{[p]:a}})}else S=U(_,s,{...r,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...r,[l]:c,...p&&{[p]:a}},S=R(g,t,s,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...r,[l]:c,...p&&{[p]:a}};d[y]=R(m,t,s,b)}}n.push(d)}return n}return null},dh=(e,t,s)=>{let r=e.body;if(r.type===v.OBJECT&&r.properties.length===1&&r.properties[0].key==="$if item.visible"){let i=r.properties[0].value;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE&&i.conditions[0].path==="item.visible"){let n=i.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},ch=(e,t,s,r)=>{let i=R(e.iterable,t,s,r);if(!Array.isArray(i)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${h})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw th(d,i,c)}if(!e.indexVar){let a=dh(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=lh(e,i);if(a!==null)return a}let n=ph(e,t,s,r,i);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(r&&r.__paths__&&l){let a=l.split("."),c=a[0];c in r.__paths__&&(l=r.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<i.length;a++){let c=e.indexVar?{...r,[e.itemVar]:i[a],[e.indexVar]:a}:{...r,[e.itemVar]:i[a]};c.__paths__||(c.__paths__=r.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,s,c);if(Array.isArray(d)&&d.length===1&&!p){let h=d[0];o.push(h===void 0?{}:h)}else o.push(d===void 0?{}:d)}return o},uh=(e,t,s,r)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?R(i.parsedKey,t,s,r):i.key,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,s,r):c.key,h=c.value;if(h.type===v.LITERAL)p[d]=h.value;else if(h.type===v.VARIABLE)p[d]=U(h.path,s,r);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=U(u.path,s,r);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,m=u.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=U(m.path,s,r);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=U(g.path,s,r);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},hh=(e,t,s,r)=>{let i=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,i,s,r))return;let n=uh(e,t,s,r);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,s,r):a.key,d=a.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=U(d.path,s,r);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=U(f.path,s,r);h.push(u!=null?String(u):"")}else{let u=R(f,t,s,r);h.push(u!=null?String(u):"")}p[c]=h.join("")}else p[c]=R(d,t,s,r)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=R(p.value,t,s,r);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return R(p.value,t,s,r)}else{let a=p.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,s,r);d!==void 0&&(o[p.key]=d)}else{let d=R(p.value,t,s,r);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?R(p.parsedKey,t,s,r):p.key,d=R(p.value,t,s,r);d!==void 0&&(o[c]=d)}}return o},pn={},fh=(e,t,s,r)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=R(n,t,s,r);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=R(n,t,s,r);o!==pn&&o!==void 0&&i.push(o)}return i},yh=(e,t,s,r)=>{let{name:i,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!Be(o,p,s,r))return;if(!l[i])throw new re(`Partial '${i}' is not defined`);let a=r._partialStack||[];if(a.includes(i))throw new re(`Circular partial reference detected: ${i}`);let c=l[i],d=s,h={...r,_partialStack:[...a,i]};if(r){d={...s};for(let f of Object.keys(r))f.startsWith("_")||(d[f]=r[f])}if(n){let f=R(n,t,s,r);d={...d,...f}}return R(c,t,d,h)},mh=(e,t,s,r)=>{let{path:i}=e,n=i.split("."),o=n[0],l=n.slice(1);if(!r||!(o in r))throw new re(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(r.__paths__||(r.__paths__={}),!(o in r.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=r.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},gh=/\$\{([^}]*)\}/g,bh=/#\{([^}]*)\}/g,dn=(e,t={})=>{let s=e.match(/^(\w+)\((.*)\)$/);if(!s)return{isFunction:!1};let[,r,i]=s,n=vh(i,t);return{isFunction:!0,type:v.FUNCTION,name:r,args:n}},vh=(e,t={})=>e.trim()?wh(e).map(s=>_h(s.trim(),t)):[],wh=e=>{let t=[],s="",r=0,i=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,s+=l):i&&l===n&&p!=="\\"?(i=!1,n="",s+=l):!i&&l==="("?(r++,s+=l):!i&&l===")"?(r--,s+=l):!i&&l===","&&r===0?(t.push(s),s=""):s+=l}return s&&t.push(s),t},_h=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let s=dn(e,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};let r=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of i){let p=0;for(;p<r.length;){let a=Ve(r.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return Q(r,t)}catch{return{type:v.VARIABLE,path:r}}return{type:v.VARIABLE,path:r}},cn=/^\w+\(.*\)$/,xh=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Sh=e=>{if(!(!e||e.trim()===""||cn.test(e))&&xh.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gr=e=>{let t=e.trim();if(cn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},_t=(e,t={})=>{let s=e.trim();Sh(s);let r=dn(s,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};if(s.includes("[")&&!/[\s+\-*/%|&?:]/.test(s)){let i=0;for(let n of s)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:s}},un=(e,t={})=>{let s=e,r=[];(e.includes("\\${")||e.includes("\\#{"))&&(s=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),s=s.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),s=s.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${r.length}__`;return r.push(c),d}),s=s.replace(/\\DOUBLE_ESC_VAR/g,"\\"),s=s.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...s.matchAll(gh)],n=[...s.matchAll(bh)],o=[...i.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=s;for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===s&&r.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?_t(a[1],t):Gr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:s};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,h]=a,f=a.index;if(f>p){let u=s.substring(p,f);for(let y=0;y<r.length;y++)u=u.replace(`__ESCAPED_${y}__`,r[y]);u&&l.push(u)}try{let u;c==="variable"?u=_t(h.trim(),t):u=Gr(h.trim()),l.push(u)}catch(u){if(u.message==="Invalid array index syntax")l.push(d);else throw u}p=f+d.length}if(p<s.length){let a=s.substring(p);for(let c=0;c<r.length;c++)a=a.replace(`__ESCAPED_${c}__`,r[c]);a&&l.push(a)}return{type:v.INTERPOLATION,parts:l}},Ee=(e,t)=>typeof e=="string"?un(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?kh(e,t):Eh(e,t):{type:v.LITERAL,value:e},Ah=e=>{let{$each:t,...s}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let r=t.trim();if(r==="")throw new E("$each value must be a non-empty string");if(Object.keys(s).length===0)throw new E("Empty $each body not allowed");if(s.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${r}`]:s}},kh=(e,t)=>{let s=[],r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Ah(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Jr(a[0],p[a[0]],t,!0);s.push(c),r=!0;continue}}catch(p){throw p instanceof E?p:new E(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Jr(l[0],n[l[0]],t);s.push(p),r=!0;continue}}let o=Ee(n,t);s.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(r=!0)}return{type:v.ARRAY,items:s,fast:!r}},Eh=(e,t)=>{let s=[],r=!1,i=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,g]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,u=!0}let y=null;if(u&&(y=Ee(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(i!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");i=Q(c,t),r=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new E("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=$h(n,o,t);s.push({key:p,value:c.node}),r=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new E(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new E("Missing condition expression after '$if'");{let c=Ee(a,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(r=!0);let d=un(p,t),h={key:p,value:c};(d.type!==v.LITERAL||d.value!==p)&&(h.parsedKey=d),s.push(h),o++}}}let l={type:v.OBJECT,properties:s,fast:!r};return i&&(l.whenCondition=i),l},$h=(e,t,s={})=>{let r=[],i=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());qr(a);let c=Q(a,s);for(r.push(c),i.push(Ee(l,s)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(p?d.startsWith(`$elif#${p} `)?(u=d.substring(`$elif#${p} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)r.push(null);else{qr(u);let y=Q(u,s);r.push(y)}if(i.push(Ee(h,s)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:r,bodies:i,id:p},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let h=0;h<a.length;h++)if(a[h]==="("?c++:a[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(a,t)}let s=Ve(e,"||");if(s!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,s).trim(),t),right:Q(e.substring(s+2).trim(),t)};let r=Ve(e,"&&");if(r!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,r).trim(),t),right:Q(e.substring(r+2).trim(),t)};let i=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of i){let d=Ve(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let h=Ve(e.substring(d),a);if(h===-1)break;let f=d+h;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Ve(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:xs.NOT,operand:Q(e.substring(1).trim(),t)}:hn(e,t)},Ve=(e,t)=>{let s=0,r=0;for(;r<=e.length-t.length;){if(e[r]==="(")s++;else if(e[r]===")")s--;else if(s===0&&e.substring(r,r+t.length)===t)return r;r++}return-1},Ch=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},hn=(e,t)=>{let s=e.trim();if(s.match(/^(\w+)\((.*)\)$/))return _t(s,t);let r=Ch(s);if(r.type===v.LITERAL)return r;if(/^[a-zA-Z_$][\w.$]*$/.test(s))return{type:v.VARIABLE,path:s};try{return _t(s,t)}catch(i){if(i.message&&i.message.includes("not supported"))return r;throw i}},Ih=(e,t=!1)=>{try{eh(e)}catch(s){if(s instanceof E&&t){let r=s.message.replace(/\$for/g,"$each");throw new E(r.replace("Parse Error: ",""))}throw s}},Jr=(e,t,s,r=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let m=r?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ih(l,r);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=r?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,h=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],h=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=hn(c,s),y=Ee(t,s);return{type:v.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:o!=="nested"}},Ss=(e,t={})=>{let{functions:s={}}=t;return Ee(e,s)},Oh=()=>Date.now(),Th=Object.freeze(Object.defineProperty({__proto__:null,now:Oh},Symbol.toStringTag,{value:"Module"})),fn=(e,t,s={})=>{let{functions:r={},partials:i={}}=s,n={...Th,...r},o=Ss(e,{functions:n}),l={};for(let[p,a]of Object.entries(i))l[p]=Ss(a,{functions:n});return nn(o,t,{functions:n,partials:l})},Qe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Lh=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([s,r])=>{if(s==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof r=="function"){if(s in e)throw new Error(`[Methods] Cannot define method '${s}' because it already exists on the component instance.`);Object.defineProperty(e,s,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!Qe(n))throw new Error(`[Methods] Method '${s}' expects payload to be an object.`);return r.call(e,n)}})}})},yn=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ze=Object.getPrototypeOf;function We(e){return!!e&&!!e[oe]}function $e(e){return e?mn(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||Ot(e)||Tt(e):!1}var Vh=Object.prototype.constructor.toString();function mn(e){if(!e||typeof e!="object")return!1;let t=ze(e);if(t===null)return!0;let s=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Vh}function xt(e,t){It(e)===0?Reflect.ownKeys(e).forEach(s=>{t(s,e[s],e)}):e.forEach((s,r)=>t(r,s,e))}function It(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Ot(e)?2:Tt(e)?3:0}function As(e,t){return It(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gn(e,t,s){let r=It(e);r===2?e.set(t,s):r===3?e.add(s):e[t]=s}function Nh(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ot(e){return e instanceof Map}function Tt(e){return e instanceof Set}function Se(e){return e.copy_||e.base_}function ks(e,t){if(Ot(e))return new Map(e);if(Tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let s=mn(e);if(t===!0||t==="class_only"&&!s){let r=Object.getOwnPropertyDescriptors(e);delete r[oe];let i=Reflect.ownKeys(r);for(let n=0;n<i.length;n++){let o=i[n],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(ze(e),r)}else{let r=ze(e);if(r!==null&&s)return{...e};let i=Object.create(r);return Object.assign(i,e)}}function Us(e,t=!1){return Lt(e)||We(e)||!$e(e)||(It(e)>1&&(e.set=e.add=e.clear=e.delete=Rh),Object.freeze(e),t&&Object.entries(e).forEach(([s,r])=>Us(r,!0))),e}function Rh(){ce(2)}function Lt(e){return Object.isFrozen(e)}var jh={};function Ce(e){let t=jh[e];return t||ce(0,e),t}var et;function bn(){return et}function Dh(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xr(e,t){t&&(Ce("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Es(e){$s(e),e.drafts_.forEach(Ph),e.drafts_=null}function $s(e){e===et&&(et=e.parent_)}function Qr(e){return et=Dh(et,e)}function Ph(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ei(e,t){t.unfinalizedDrafts_=t.drafts_.length;let s=t.drafts_[0];return e!==void 0&&e!==s?(s[oe].modified_&&(Es(t),ce(4)),$e(e)&&(e=St(t,e),t.parent_||At(t,e)),t.patches_&&Ce("Patches").generateReplacementPatches_(s[oe].base_,e,t.patches_,t.inversePatches_)):e=St(t,s,[]),Es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yn?e:void 0}function St(e,t,s){if(Lt(t))return t;let r=t[oe];if(!r)return xt(t,(i,n)=>ti(e,r,t,i,n,s)),t;if(r.scope_!==e)return t;if(!r.modified_)return At(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let i=r.copy_,n=i,o=!1;r.type_===3&&(n=new Set(i),i.clear(),o=!0),xt(n,(l,p)=>ti(e,r,i,l,p,s,o)),At(e,i,!1),s&&e.patches_&&Ce("Patches").generatePatches_(r,s,e.patches_,e.inversePatches_)}return r.copy_}function ti(e,t,s,r,i,n,o){if(We(i)){let l=n&&t&&t.type_!==3&&!As(t.assigned_,r)?n.concat(r):void 0,p=St(e,i,l);if(gn(s,r,p),We(p))e.canAutoFreeze_=!1;else return}else o&&s.add(i);if($e(i)&&!Lt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;St(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,r)&&At(e,i)}}function At(e,t,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Us(t,s)}function Bh(e,t){let s=Array.isArray(e),r={type_:s?1:0,scope_:t?t.scope_:bn(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,n=Hs;s&&(i=[r],n=tt);let{revoke:o,proxy:l}=Proxy.revocable(i,n);return r.draft_=l,r.revoke_=o,l}var Hs={get(e,t){if(t===oe)return e;let s=Se(e);if(!As(s,t))return zh(e,s,t);let r=s[t];return e.finalized_||!$e(r)?r:r===cs(e.base_,t)?(us(e),e.copy_[t]=Is(r,e)):r},has(e,t){return t in Se(e)},ownKeys(e){return Reflect.ownKeys(Se(e))},set(e,t,s){let r=vn(Se(e),t);if(r?.set)return r.set.call(e.draft_,s),!0;if(!e.modified_){let i=cs(Se(e),t),n=i?.[oe];if(n&&n.base_===s)return e.copy_[t]=s,e.assigned_[t]=!1,!0;if(Nh(s,i)&&(s!==void 0||As(e.base_,t)))return!0;us(e),Cs(e)}return e.copy_[t]===s&&(s!==void 0||t in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=s,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cs(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,us(e),Cs(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let s=Se(e),r=Reflect.getOwnPropertyDescriptor(s,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:s[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return ze(e.base_)},setPrototypeOf(){ce(12)}},tt={};xt(Hs,(e,t)=>{tt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tt.deleteProperty=function(e,t){return tt.set.call(this,e,t,void 0)};tt.set=function(e,t,s){return Hs.set.call(this,e[0],t,s,e[0])};function cs(e,t){let s=e[oe];return(s?Se(s):e)[t]}function zh(e,t,s){let r=vn(t,s);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function vn(e,t){if(!(t in e))return;let s=ze(e);for(;s;){let r=Object.getOwnPropertyDescriptor(s,t);if(r)return r;s=ze(s)}}function Cs(e){e.modified_||(e.modified_=!0,e.parent_&&Cs(e.parent_))}function us(e){e.copy_||(e.copy_=ks(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Wh=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,s,r)=>{if(typeof t=="function"&&typeof s!="function"){let n=s;s=t;let o=this;return function(l=n,...p){return o.produce(l,a=>s.call(this,a,...p))}}typeof s!="function"&&ce(6),r!==void 0&&typeof r!="function"&&ce(7);let i;if($e(t)){let n=Qr(this),o=Is(t,void 0),l=!0;try{i=s(o),l=!1}finally{l?Es(n):$s(n)}return Xr(n,r),ei(i,n)}else if(!t||typeof t!="object"){if(i=s(t),i===void 0&&(i=t),i===yn&&(i=void 0),this.autoFreeze_&&Us(i,!0),r){let n=[],o=[];Ce("Patches").generateReplacementPatches_(t,i,n,o),r(n,o)}return i}else ce(1,t)},this.produceWithPatches=(t,s)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,l=>t(l,...o));let r,i;return[this.produce(t,s,(n,o)=>{r=n,i=o}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){$e(e)||ce(8),We(e)&&(e=Mh(e));let t=Qr(this),s=Is(e,void 0);return s[oe].isManual_=!0,$s(t),s}finishDraft(e,t){let s=e&&e[oe];(!s||!s.isManual_)&&ce(9);let{scope_:r}=s;return Xr(r,t),ei(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let s;for(s=t.length-1;s>=0;s--){let i=t[s];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}s>-1&&(t=t.slice(s+1));let r=Ce("Patches").applyPatches_;return We(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Is(e,t){let s=Ot(e)?Ce("MapSet").proxyMap_(e,t):Tt(e)?Ce("MapSet").proxySet_(e,t):Bh(e,t);return(t?t.scope_:bn()).drafts_.push(s),s}function Mh(e){return We(e)||ce(10,e),wn(e)}function wn(e){if(!$e(e)||Lt(e))return e;let t=e[oe],s;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,s=ks(e,t.scope_.immer_.useStrictShallowCopy_)}else s=ks(e,!0);return xt(s,(r,i)=>{gn(s,r,wn(i))}),t&&(t.finalized_=!1),s}var ae=new Wh,Fh=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var Kh=(e,t,s)=>{let{createInitialState:r,...i}=e,n={},o={},l={};return r&&(l=r({props:t,constants:s})),Object.entries(i).forEach(([p,a])=>{if(p.startsWith("select")){n[p]=(...c)=>a({state:l,props:t,constants:s},...c);return}o[p]=(c={})=>{let d=c===void 0?{}:c;if(!Qe(d))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=Fh(l,h=>a({state:h,props:t,constants:s},d)),l}}),{getState:()=>l,...o,...n}},_n=e=>!Qe(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{_n(t)}),Object.freeze(e)),Uh=({setupConstants:e,fileConstants:t})=>{let s=Qe(e)?e:{},r=Qe(t)?t:{};return _n({...s,...r})},Hh=(e,t)=>{if(!t||typeof t!="object")return"";let s="",r=n=>Object.entries(n).map(([o,l])=>` ${o}: ${l};`).join(`
|
|
1509
|
-
`),
|
|
1612
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let i=t.composedPath();(i[0]===this._dialogElement||i[0].nodeName==="DIALOG"&&i[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let i=t.composedPath();(i[0]===this._dialogElement||i[0].nodeName==="DIALOG"&&i[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._isModalOpen=!1,this._observedContentWrapper=null,this._onWindowResize=()=>{this._updateActiveStateAttributes(),this._syncDialogMode(),this._schedulePositionUpdate()},this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y",...W(["place","overlay","no-overlay"]),"content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._isOpen&&this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1}attributeChangedCallback(t,i,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():t==="x"||t==="y"||t.endsWith("place")?(this._updateActiveStateAttributes(),this._isOpen&&this._schedulePositionUpdate()):t.endsWith("overlay")?(this._updateActiveStateAttributes(),this._isOpen&&(this._syncDialogMode(),this._schedulePositionUpdate())):t.startsWith("content-")&&this._syncContentWrapper()}_getActiveResponsiveSize(){if(typeof window>"u"||typeof window.matchMedia!="function")return"default";for(let t of Co){let i=Ae[t];if(i&&window.matchMedia(Oo(i)).matches)return t}return"default"}_getActiveResponsiveAttribute(t){return Se({element:this,size:this._getActiveResponsiveSize(),attr:t})}_getActivePlace(){return this._getActiveResponsiveAttribute("place")||"bs"}_isOverlayActive(){return Ds(this._getActiveResponsiveAttribute("overlay"),!1)}_isNoOverlayActive(){return Ds(this._getActiveResponsiveAttribute("no-overlay"),!1)}_shouldUseModalDialog(){return this._isOverlayActive()||!this._isNoOverlayActive()}_updateActiveStateAttributes(){let t=this._getActivePlace(),i=this._isOverlayActive();this.getAttribute(Ns)!==t&&this.setAttribute(Ns,t),i?this.getAttribute(Qe)!=="true"&&this.setAttribute(Qe,"true"):this.hasAttribute(Qe)&&this.removeAttribute(Qe)}_openDialogElement(){this._dialogElement.open||(this._shouldUseModalDialog()?(this._dialogElement.showModal(),this._isModalOpen=!0):(this._dialogElement.show(),this._isModalOpen=!1))}_syncDialogMode(){!this._isOpen||!this._dialogElement.open||this._shouldUseModalDialog()===this._isModalOpen||(this._dialogElement.close(),this._isModalOpen=!1,this._openDialogElement())}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(i=>i.hasAttribute(Rs));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(Rs,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",di)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),i=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[r,n]of i){let o=this.getAttribute(r);o===null?t.removeAttribute(n):t.setAttribute(n,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let s=this.getAttribute("content-style");t.setAttribute("style",s?`${di} ${s}`:di)}_syncContentWrapper({reposition:t=!0}={}){let i=this._ensureContentWrapper(),s=Array.from(this.childNodes).filter(n=>n!==i&&!this._isIgnorableTextNode(n));for(let n of s)n.nodeType===Node.ELEMENT_NODE&&n.getAttribute("slot")==="content"&&n.removeAttribute("slot"),i.appendChild(n);this._syncContentWrapperAttributes(),Array.from(i.childNodes).some(n=>!this._isIgnorableTextNode(n))||this.hasAttribute("open")?i.setAttribute("slot","content"):i.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._updateActiveStateAttributes(),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),window.addEventListener("resize",this._onWindowResize),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._isOpen&&this._dialogElement&&!this._dialogElement.open&&this._openDialogElement(),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),window.removeEventListener("resize",this._onWindowResize),this._dialogElement.open&&this._dialogElement.close(),this._isModalOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let i=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(i)?i:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),i=this._readCoordinateAttr("y"),s=this._getActivePlace();this._updateActiveStateAttributes();let r=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,i,r.width,r.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,i,s,r,n){return Vs({x:t,y:i,width:s,height:r,place:n,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},js=({render:e,html:t})=>ci;var Io=(e,t)=>{let{store:i,render:s}=e;i.toggleOpen({}),s()},To=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:Io},Symbol.toStringTag,{value:"Module"})),Lo=()=>Object.freeze({open:!1}),Vo=["id","class","style","slot","label","content"],Ro=(e={})=>Object.entries(e).filter(([t])=>!Vo.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),No=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Ro(t)}),Do=({state:e})=>{e.open=!e.open},jo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Lo,selectViewData:No,toggleOpen:Do},Symbol.toStringTag,{value:"Module"})),Po=(e,t)=>{let{dispatchEvent:i,props:s}=e,r=t._event,n=Number(r.currentTarget.dataset.index),o=Array.isArray(s.items)?s.items[n]:void 0;if(o){if(o.disabled||o.current){r.preventDefault();return}typeof o.href=="string"&&o.href.length>0||r.preventDefault(),i(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:r.type}}))}},Bo=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Po},Symbol.toStringTag,{value:"Module"})),zo=()=>Object.freeze({}),Wo=["id","class","style","slot","items","sep","max","separator"],Mo=(e={})=>Object.entries(e).filter(([t])=>!Wo.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),Fo=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Ko=e=>`${e}`.replace(/"/g,"""),Uo=(e,t)=>{if(!t||t<3||e.length<=t)return e;let i=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-i)]},Ho=e=>e.map((t,i)=>{let s=typeof t.href=="string"&&t.href.length>0,r=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,o=!!t.disabled,l=!n&&!o&&(s||r||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),a=[t.newTab?'target="_blank"':"",p?`rel="${Ko(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:i,href:s?t.href:void 0,path:r?t.path:void 0,isCurrent:n,isDisabled:o,isInteractive:l,linkExtraAttrs:a,c:n?"fg":"mu-fg"}}),qo=({props:e})=>{let t=Mo(e),i=Array.isArray(e.items)?e.items:[],s=Fo(e.max),r=e.sep||"breadcrumb-arrow",n=Ho(i),o=Uo(n,s),l=[];return o.forEach((p,a)=>{l.push(p),a<o.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:r}},Yo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:zo,selectViewData:qo},Symbol.toStringTag,{value:"Module"})),Go=["id","class","style","slot","head","desc","size","d","ah","av","wrap","noWrap","g","gh","gv","p","pt","pr","pb","pl","pv","ph","bw","bwt","bwr","bwb","bwl","bc","br","shadow","bgc","href","newTab","rel","cur","sv","sh","overflow"],Ps={sm:{cardAttrString:"p=md sm-p=sm g=md sm-g=sm",headerAttrString:"g=xs",headingSize:"lg",subheadingSize:"sm"},md:{cardAttrString:"p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h4",subheadingSize:"sm"},lg:{cardAttrString:"p=xl lg-p=lg md-p=md sm-p=md g=lg md-g=md sm-g=md",headerAttrString:"g=sm",headingSize:"h3",subheadingSize:"md"}},Jo=(e={})=>Object.entries(e).filter(([t])=>!Go.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),Zo=()=>Object.freeze({}),Xo=({props:e={}})=>{let t=Ps[e.size]?e.size:"md",i=Ps[t];return{containerAttrString:Jo(e),cardAttrString:i.cardAttrString,headerAttrString:i.headerAttrString,headingSize:i.headingSize,subheadingSize:i.subheadingSize,head:e.head||"",desc:e.desc||"",hasHeader:!!(e.head||e.desc),size:t}},Qo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Zo,selectViewData:Xo},Symbol.toStringTag,{value:"Module"})),ea=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",ta=(e,t)=>{let{render:i,refs:s}=e,{oldProps:r={},newProps:n={}}=t,o=r.items!==n.items&&!!n.open;i(),o&&s?.popover?.refreshContent?.()},ia=(e,t)=>{let{dispatchEvent:i}=e;i(new CustomEvent("close"))},sa=(e,t)=>{let{dispatchEvent:i,props:s}=e,r=t._event,n=Number(r.currentTarget.dataset.index??r.currentTarget.id.slice(6)),o=s.items[n],l=ea(o);if(!o||l!=="item"||o.disabled){r.preventDefault();return}o.href||r.preventDefault(),i(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:r.type}}))},ra=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:sa,handleClosePopover:ia,handleOnUpdate:ta},Symbol.toStringTag,{value:"Module"})),na=()=>Object.freeze({}),xr=e=>`${e}`.replace(/"/g,"""),oa=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],aa=(e={})=>oa.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,i])=>{let s=e[t];return s===!0?i:`${i}="${xr(s)}"`}).join(" "),la=(e={})=>e.type==="section"||e.type==="label"?"section":e.type==="separator"?"separator":"item",pa=e=>e.map((t,i)=>{let s=la(t),r=s==="separator",n=s==="section",o=s==="item",l=!!t.disabled,p=o&&!l,a=Object.prototype.hasOwnProperty.call(t,"icon"),c=typeof t.icon=="string"&&t.icon.length>0?t.icon:"",d=typeof t.shortcut=="string"&&t.shortcut.length>0?t.shortcut:typeof t.suffixText=="string"&&t.suffixText.length>0?t.suffixText:"",u=l?"mu-fg":"fg",f=l?"mu":"",h=l?"":"ac",y=u,m="mu-fg",b=typeof t.href=="string"&&t.href.length>0,g=t.rel||(t.newTab?"noopener noreferrer":""),_=[t.newTab?'target="_blank"':"",g?`rel="${xr(g)}"`:""].filter(Boolean).join(" ");return{...t,index:i,type:s,isSeparator:r,isSection:n,isItem:o,isDisabled:l,isInteractive:p,hasIconSlot:a,icon:c,hasIcon:c.length>0,suffixText:d,hasSuffixText:d.length>0,hasHref:b,linkExtraAttrs:_,c:u,bgc:f,hoverBgc:h,iconColor:y,suffixTextColor:m}}),da=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:pa(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs",popoverAttrString:aa(e)}},ca=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:na,selectViewData:da},Symbol.toStringTag,{value:"Module"})),w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},j={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},wi={NOT:0},$=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},de=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Bs=e=>{if(!e||e.trim()==="")throw new $("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let i=e.includes("===")?"==":"!=";throw new $(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${i}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let i of t)if(e.trim().endsWith(i))throw new $(`Incomplete comparison expression - missing right operand (got: '${e}')`)},ua=e=>{if(e.trim().endsWith(" in"))throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new $(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,i]=e.split(" in ");if(!i||i.trim()==="")throw new $(`Missing iterable expression after 'in' (got: '$for ${e}')`);let s=t.includes(",")?t.split(",").map(r=>r.trim()):[t.trim()];for(let r of s){if(!r)throw new $(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r))throw new $(`Invalid loop syntax (got: '$for ${e}')`)}},ha=(e,t,i=!1)=>{if(t===null)return new de(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new de(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return i?new de(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new de(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},fa=(e,t)=>{let i=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new de(`Unknown function '${e}' (${i})`)},ya=(e,t,i={})=>{let s={},r={};i&&typeof i=="object"&&(i.functions!==void 0||i.partials!==void 0?(s=i.functions||{},r=i.partials||{}):typeof i=="object"&&(s=i));let n=R(e,{functions:s,partials:r},t,{});return n===void 0?{}:n},R=(e,t,i,s)=>{if(t.functions,e.var&&!e.type)return U(e.var,i,s);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return U(e.path,i,s);if(e.type===w.INTERPOLATION)return ga(e.parts,t,i,s);switch(e.type){case w.FUNCTION:return Sr(e,t,i,s);case w.BINARY:return Ar(e,t,i,s);case w.UNARY:return kr(e,t,i,s);case w.CONDITIONAL:return va(e,t,i,s);case w.LOOP:return Aa(e,t,i,s);case w.OBJECT:return Ea(e,t,i,s);case w.ARRAY:return $a(e,t,i,s);case w.PARTIAL:return Ca(e,t,i,s);case w.PATH_REFERENCE:return Oa(e,t,i,s);default:throw new Error(`Unknown node type: ${e.type}`)}},zs=new Map,ma=e=>{let t=[],i="",s=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==="[")i&&(t.push({type:"property",value:i}),i=""),s=!0;else if(n==="]"){if(s&&i){let o=i.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});i=""}s=!1}else i+=n}return i&&t.push({type:"property",value:i}),t},U=(e,t,i)=>{if(!e)return;if(e in i)return i[e];let s=zs.get(e);if(!s){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),s=[];for(let p of n){let a=ma(p.trim());s.push(...a)}zs.set(e,s)}let r=t;for(let n=0;n<s.length;n++){let o=s[n];if(o.type==="property"&&o.value in i){r=i[o.value];continue}if(r==null)return;(o.type==="property"||o.type==="index")&&(r=r[o.value])}return r},ga=(e,t,i,s)=>{let r=[];for(let n of e)if(typeof n=="string")r.push(n);else{let o=R(n,t,i,s);r.push(o!=null?String(o):"")}return r.join("")},Sr=(e,t,i,s)=>{let r=t.functions||t,n=r[e.name];if(!n)throw fa(e.name,r);let o=e.args.map(l=>R(l,t,i,s));return n(...o)},Be=(e,t,i,s)=>{if(e.var&&!e.type)return U(e.var,i,s);switch(e.type){case w.VARIABLE:return U(e.path,i,s);case w.LITERAL:return e.value;case w.BINARY:return Ar(e,t,i,s);case w.UNARY:return kr(e,t,i,s);case w.FUNCTION:return Sr(e,t,i,s);default:return R(e,t,i,s)}},Ar=(e,t,i,s)=>{if(e.op===j.AND||e.op===j.OR){let o=Be(e.left,t,i,s),l=Be(e.right,t,i,s);switch(e.op){case j.AND:return o&&l;case j.OR:return o||l}}let r=R(e.left,t,i,s),n=R(e.right,t,i,s);switch(e.op){case j.EQ:return r==n;case j.NEQ:return r!=n;case j.GT:return r>n;case j.LT:return r<n;case j.GTE:return r>=n;case j.LTE:return r<=n;case j.IN:return Array.isArray(n)?n.includes(r):!1;case j.ADD:if(typeof r!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof r} + ${typeof n}`);return r+n;case j.SUBTRACT:if(typeof r!="number"||typeof n!="number")throw new de(`Arithmetic operations require numbers. Got ${typeof r} - ${typeof n}`);return r-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},kr=(e,t,i,s)=>{let r=e.op===wi.NOT?Be(e.operand,t,i,s):R(e.operand,t,i,s);switch(e.op){case wi.NOT:return!r;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ba=(e,t,i,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let r=e.conditions[0];if(r.type===w.VARIABLE)if(U(r.path,i,s)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,i,s):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=U(a.path,i,s);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=U(d.path,i,s);c.push(u!=null?String(u):"")}else{let u=R(d,t,i,s);c.push(u!=null?String(u):"")}o[p]=c.join("")}else o[p]=R(a,t,i,s)}return o}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?R(l.parsedKey,t,i,s):l.key,a=l.value;if(a.type===w.LITERAL)o[p]=a.value;else if(a.type===w.VARIABLE)o[p]=U(a.path,i,s);else if(a.type===w.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let u=U(d.path,i,s);c.push(u!=null?String(u):"")}else{let u=R(d,t,i,s);c.push(u!=null?String(u):"")}o[p]=c.join("")}else o[p]=R(a,t,i,s)}return o}}}return null},va=(e,t,i,s)=>{let r=ba(e,t,i,s);if(r!==null)return r;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Be(o,t,i,s))return R(e.bodies[n],t,i,s)}return Er},wa=(e,t)=>{let i=e.body,s=e.itemVar;if(i.type===w.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===w.VARIABLE){let r=i.conditions[0].path,n=i.bodies[0];if(r.startsWith(s+".")){let o=r.substring(s.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===w.LITERAL)c[u]=f.value;else if(f.type===w.VARIABLE){let h=f.path;if(h===s)c[u]=a;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[u]=a[y]}else return null}else if(f.type===w.INTERPOLATION){let h=[],y=!0;for(let m of f.parts)if(typeof m=="string")h.push(m);else if(m.type===w.VARIABLE){let b=m.path;if(b===s)h.push(a!=null?String(a):"");else if(b.startsWith(s+".")){let g=b.substring(s.length+1),_=a[g];h.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[u]=h.join("")}else return null}l.push(c)}}return l}}}return null},_a=(e,t)=>{let i=e.body,s=e.itemVar,r=wa(e,t);if(r!==null)return r;if(i.type===w.OBJECT&&i.properties.length<=5&&!i.whenCondition){for(let l of i.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of i.properties){let p=l.key,a=l.value;if(a.type===w.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===w.VARIABLE){let c=a.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let d=c.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===w.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===s)n.push({key:p,type:"item_string"});else if(d.startsWith(s+".")){let u=d.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop_string",prop:u});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let u=a[d.prop];c[d.key]=u!=null?String(u):""}l[p]=c}return l}}return null},xa=(e,t,i,s,r)=>{let n=[],o=e.body;if(o.type===w.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<r.length;a++){let c=r[a],d={},u={...s,[l]:c,...p&&{[p]:a}};u.__paths__||(u.__paths__=s.__paths__||{});let f=e.iterable.path||"";if(s&&s.__paths__&&f){let h=f.split("."),y=h[0];y in s.__paths__&&(f=s.__paths__[y],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let h of o.properties){let y=h.parsedKey?R(h.parsedKey,t,i,u):h.key,m=h.value;if(m.type===w.LITERAL)d[y]=m.value;else if(m.type===w.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=U(b,i,{...s,[l]:c,...p&&{[p]:a}})}else d[y]=U(b,i,{...s,[l]:c,...p&&{[p]:a}})}else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=U(_,i,{...s,[l]:c,...p&&{[p]:a}})}else S=U(_,i,{...s,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...s,[l]:c,...p&&{[p]:a}},S=R(g,t,i,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...s,[l]:c,...p&&{[p]:a}};d[y]=R(m,t,i,b)}}n.push(d)}return n}return null},Sa=(e,t,i)=>{let s=e.body;if(s.type===w.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let r=s.properties[0].value;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE&&r.conditions[0].path==="item.visible"){let n=r.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===w.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===w.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},Aa=(e,t,i,s)=>{let r=R(e.iterable,t,i,s);if(!Array.isArray(r)){let a,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${u})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw ha(d,r,c)}if(!e.indexVar){let a=Sa(e,r,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=_a(e,r);if(a!==null)return a}let n=xa(e,t,i,s,r);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let a=l.split("."),c=a[0];c in s.__paths__&&(l=s.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===w.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<r.length;a++){let c=e.indexVar?{...s,[e.itemVar]:r[a],[e.indexVar]:a}:{...s,[e.itemVar]:r[a]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=R(e.body,t,i,c);if(Array.isArray(d)&&d.length===1&&!p){let u=d[0];o.push(u===void 0?{}:u)}else o.push(d===void 0?{}:d)}return o},ka=(e,t,i,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let r=e.properties[0],n=r.parsedKey?R(r.parsedKey,t,i,s):r.key,o=r.value;if(o.type===w.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?R(c.parsedKey,t,i,s):c.key,u=c.value;if(u.type===w.LITERAL)p[d]=u.value;else if(u.type===w.VARIABLE)p[d]=U(u.path,i,s);else if(u.type===w.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===w.VARIABLE){let y=U(h.path,i,s);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(u.type===w.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let y=h.key,m=h.value;if(m.type===w.LITERAL)f[y]=m.value;else if(m.type===w.VARIABLE)f[y]=U(m.path,i,s);else if(m.type===w.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===w.VARIABLE){let _=U(g.path,i,s);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},Ea=(e,t,i,s)=>{let r=t.functions||t;if(e.whenCondition&&!Be(e.whenCondition,r,i,s))return;let n=ka(e,t,i,s);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?R(a.parsedKey,t,i,s):a.key,d=a.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=U(d.path,i,s);else if(d.type===w.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===w.VARIABLE){let h=U(f.path,i,s);u.push(h!=null?String(h):"")}else{let h=R(f,t,i,s);u.push(h!=null?String(h):"")}p[c]=u.join("")}else p[c]=R(d,t,i,s)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=R(p.value,t,i,s);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return R(p.value,t,i,s)}else{let a=p.value;if(a&&a.type===w.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=R(c.value,t,i,s);d!==void 0&&(o[p.key]=d)}else{let d=R(p.value,t,i,s);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?R(p.parsedKey,t,i,s):p.key,d=R(p.value,t,i,s);d!==void 0&&(o[c]=d)}}return o},Er={},$a=(e,t,i,s)=>{let r=[];for(let n of e.items)if(n.type===w.LOOP){let o=R(n,t,i,s);Array.isArray(o)&&n.flatten!==!1?r.push(...o):r.push(o)}else{let o=R(n,t,i,s);o!==Er&&o!==void 0&&r.push(o)}return r},Ca=(e,t,i,s)=>{let{name:r,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!Be(o,p,i,s))return;if(!l[r])throw new de(`Partial '${r}' is not defined`);let a=s._partialStack||[];if(a.includes(r))throw new de(`Circular partial reference detected: ${r}`);let c=l[r],d=i,u={...s,_partialStack:[...a,r]};if(s){d={...i};for(let f of Object.keys(s))f.startsWith("_")||(d[f]=s[f])}if(n){let f=R(n,t,i,s);d={...d,...f}}return R(c,t,d,u)},Oa=(e,t,i,s)=>{let{path:r}=e,n=r.split("."),o=n[0],l=n.slice(1);if(!s||!(o in s))throw new de(`Path reference '#{${r}}' refers to '${o}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(o in s.__paths__))throw new de(`Path reference '#{${r}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new de(`Path reference '#{${r}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},Ia=/\$\{([^}]*)\}/g,Ta=/#\{([^}]*)\}/g,$r=(e,t={})=>{let i=e.match(/^(\w+)\((.*)\)$/);if(!i)return{isFunction:!1};let[,s,r]=i,n=La(r,t);return{isFunction:!0,type:w.FUNCTION,name:s,args:n}},La=(e,t={})=>e.trim()?Va(e).map(i=>Ra(i.trim(),t)):[],Va=e=>{let t=[],i="",s=0,r=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!r&&(l==='"'||l==="'")?(r=!0,n=l,i+=l):r&&l===n&&p!=="\\"?(r=!1,n="",i+=l):!r&&l==="("?(s++,i+=l):!r&&l===")"?(s--,i+=l):!r&&l===","&&s===0?(t.push(i),i=""):i+=l}return i&&t.push(i),t},Ra=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let i=$r(e,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};let s=e.trim(),r=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of r){let p=0;for(;p<s.length;){let a=Re(s.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return X(s,t)}catch{return{type:w.VARIABLE,path:s}}return{type:w.VARIABLE,path:s}},Cr=/^\w+\(.*\)$/,Na=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Da=e=>{if(!(!e||e.trim()===""||Cr.test(e))&&Na.test(e))throw e.includes("?")&&e.includes(":")?new $(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new $(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new $(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Ws=e=>{let t=e.trim();if(Cr.test(t))throw new $(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new $(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new $(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new $(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new $(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},vt=(e,t={})=>{let i=e.trim();Da(i);let s=$r(i,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(i.includes("[")&&!/[\s+\-*/%|&?:]/.test(i)){let r=0;for(let n of i)n==="["?r++:n==="]"&&r--;if(r!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:i}},Or=(e,t={})=>{let i=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(i=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),i=i.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),i=i.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${s.length}__`;return s.push(c),d}),i=i.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${s.length}__`;return s.push(c),d}),i=i.replace(/\\DOUBLE_ESC_VAR/g,"\\"),i=i.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let r=[...i.matchAll(Ia)],n=[...i.matchAll(Ta)],o=[...r.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=i;for(let c=0;c<s.length;c++)a=a.replace(`__ESCAPED_${c}__`,s[c]);return{type:w.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===i&&s.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?vt(a[1],t):Ws(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:i};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,u]=a,f=a.index;if(f>p){let h=i.substring(p,f);for(let y=0;y<s.length;y++)h=h.replace(`__ESCAPED_${y}__`,s[y]);h&&l.push(h)}try{let h;c==="variable"?h=vt(u.trim(),t):h=Ws(u.trim()),l.push(h)}catch(h){if(h.message==="Invalid array index syntax")l.push(d);else throw h}p=f+d.length}if(p<i.length){let a=i.substring(p);for(let c=0;c<s.length;c++)a=a.replace(`__ESCAPED_${c}__`,s[c]);a&&l.push(a)}return{type:w.INTERPOLATION,parts:l}},$e=(e,t)=>typeof e=="string"?Or(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Pa(e,t):Ba(e,t):{type:w.LITERAL,value:e},ja=e=>{let{$each:t,...i}=e;if(typeof t!="string")throw new $("$each value must be a non-empty string");let s=t.trim();if(s==="")throw new $("$each value must be a non-empty string");if(Object.keys(i).length===0)throw new $("Empty $each body not allowed");if(i.$partial!==void 0)throw new $("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${s}`]:i}},Pa=(e,t)=>{let i=[],s=!1;for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=ja(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=Ms(a[0],p[a[0]],t,!0);i.push(c),s=!0;continue}}catch(p){throw p instanceof $?p:new $(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Ms(l[0],n[l[0]],t);i.push(p),s=!0;continue}}let o=$e(n,t);i.push(o),(o.type===w.FUNCTION||o.type===w.CONDITIONAL||o.type===w.LOOP||o.type===w.PARTIAL||o.type===w.OBJECT&&!o.fast||o.type===w.ARRAY&&!o.fast)&&(s=!0)}return{type:w.ARRAY,items:i,fast:!s}},Ba=(e,t)=>{let i=[],s=!1,r=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new $("$partial value must be a string");if(e.$partial.trim()==="")throw new $("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new $(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,g]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,h=!0}let y=null;if(h&&(y=$e(f,t),y.type===w.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new $("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(r!==null)throw new $("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new $("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new $("Empty condition expression after '$when'");r=X(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new $("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new $("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=za(n,o,t);i.push({key:p,value:c.node}),s=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new $(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new $(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new $("Missing condition expression after '$if'");{let c=$e(a,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(s=!0);let d=Or(p,t),u={key:p,value:c};(d.type!==w.LITERAL||d.value!==p)&&(u.parsedKey=d),i.push(u),o++}}}let l={type:w.OBJECT,properties:i,fast:!s};return r&&(l.whenCondition=r),l},za=(e,t,i={})=>{let s=[],r=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new $(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Bs(a);let c=X(a,i);for(s.push(c),r.push($e(l,i)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(p?d.startsWith(`$elif#${p} `)?(h=d.substring(`$elif#${p} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{Bs(h);let y=X(h,i);s.push(y)}if(r.push($e(u,i)),n++,h===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:s,bodies:r,id:p},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let u=0;u<a.length;u++)if(a[u]==="("?c++:a[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(a,t)}let i=Re(e,"||");if(i!==-1)return{type:w.BINARY,op:j.OR,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let s=Re(e,"&&");if(s!==-1)return{type:w.BINARY,op:j.AND,left:X(e.substring(0,s).trim(),t),right:X(e.substring(s+2).trim(),t)};let r=[{op:">=",type:j.GTE},{op:"<=",type:j.LTE},{op:"==",type:j.EQ},{op:"!=",type:j.NEQ},{op:">",type:j.GT},{op:"<",type:j.LT},{op:" in ",type:j.IN}];for(let{op:a,type:c}of r){let d=Re(e,a);if(d!==-1)return{type:w.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:j.ADD},{op:" - ",type:j.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let u=Re(e.substring(d),a);if(u===-1)break;let f=d+u;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:w.BINARY,op:o.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Re(e,a)!==-1)throw new $(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:w.UNARY,op:wi.NOT,operand:X(e.substring(1).trim(),t)}:Ir(e,t)},Re=(e,t)=>{let i=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")i++;else if(e[s]===")")i--;else if(i===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Wa=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},Ir=(e,t)=>{let i=e.trim();if(i.match(/^(\w+)\((.*)\)$/))return vt(i,t);let s=Wa(i);if(s.type===w.LITERAL)return s;if(/^[a-zA-Z_$][\w.$]*$/.test(i))return{type:w.VARIABLE,path:i};try{return vt(i,t)}catch(r){if(r.message&&r.message.includes("not supported"))return s;throw r}},Ma=(e,t=!1)=>{try{ua(e)}catch(i){if(i instanceof $&&t){let s=i.message.replace(/\$for/g,"$each");throw new $(s.replace("Parse Error: ",""))}throw i}},Ms=(e,t,i,s=!1)=>{let r=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(r);if(!n){let m=s?"$each":"$for";throw new $(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Ma(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=s?"$each":"$for";throw new $(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,u=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new $(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],u=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new $(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new $(`Reserved variable name: ${u}`);let h=Ir(c,i),y=$e(t,i);return{type:w.LOOP,itemVar:d,indexVar:u,iterable:h,body:y,flatten:o!=="nested"}},Fs=(e,t={})=>{let{functions:i={}}=t;return $e(e,i)},Fa=()=>Date.now(),Ka=Object.freeze(Object.defineProperty({__proto__:null,now:Fa},Symbol.toStringTag,{value:"Module"})),Ua=(e,t,i={})=>{let{functions:s={},partials:r={}}=i,n={...Ka,...s},o=Fs(e,{functions:n}),l={};for(let[p,a]of Object.entries(r))l[p]=Fs(a,{functions:n});return ya(o,t,{functions:n,partials:l})},zi=e=>e!==null&&typeof e=="object",wt=e=>zi(e)&&!Array.isArray(e),Ha=e=>typeof e=="string"&&e.includes("."),Tr=e=>typeof e=="string"&&/[\[\]]/.test(e);function Lr(e,t){let i={};for(let s of t){if(typeof s!="string"||s.length===0)continue;let r=ne(e,s);r!==void 0&&he(i,s,r)}return i}function qa(e){if(!wt(e)||!Array.isArray(e.fields))return e;let t=(i=[])=>i.map(s=>{if(!wt(s))return s;if(typeof s.$when=="string"&&s.$when.trim().length>0){let{$when:r,...n}=s,o=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${r}`]:o}}return Array.isArray(s.fields)?{...s,fields:t(s.fields)}:s});return{...e,fields:t(e.fields)}}var ne=(e,t,i=void 0)=>{if(!t||!zi(e)||Tr(t))return i;let s=t.split(".").filter(n=>n!==""),r=e;for(let n of s){if(r==null||!(n in r))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:i;r=r[n]}return r},he=(e,t,i)=>{if(!zi(e)||typeof t!="string"||t.length===0||Tr(t))return e;let s=t.split(".").filter(n=>n!=="");if(s.length===0)return e;Ha(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let r=e;for(let n=0;n<s.length-1;n++){let o=s[n];(!(o in r)||typeof r[o]!="object"||r[o]===null)&&(r[o]={}),r=r[o]}return r[s[s.length-1]]=i,e},Ya=["id","class","style","slot","form","defaultValues","disabled","context"],Ga=(e={})=>Object.entries(e).filter(([t,i])=>!(Ya.includes(t)||i==null||typeof i=="object"||typeof i=="function")).map(([t,i])=>`${t}=${String(i)}`).join(" "),Ja={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ue={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Za="input-date",Xa="input-time",Qa="input-datetime",el=/^(\d{4})-(\d{2})-(\d{2})$/,tl=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,il=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,sl=e=>{if(typeof e!="string")return null;let t=el.exec(e);if(!t)return null;let i=Number(t[1]),s=Number(t[2]),r=Number(t[3]);if(!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||s<1||s>12||r<1||r>31)return null;let n=new Date(Date.UTC(i,s-1,r));return n.getUTCFullYear()===i&&n.getUTCMonth()===s-1&&n.getUTCDate()===r?{year:i,month:s,day:r}:null},rl=e=>{if(typeof e!="string")return null;let t=tl.exec(e);if(!t)return null;let i=Number(t[1]),s=Number(t[2]),r=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||i<0||i>23||s<0||s>59||r<0||r>59?null:{hour:i,minute:s,second:r}},Vr=e=>{let t=rl(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},Rr=e=>sl(e)?e:null,nl=e=>{if(typeof e!="string")return null;let t=il.exec(e);if(!t)return null;let i=Rr(t[1]),s=Vr(t[2]);return!i||!s?null:`${i}T${s}`},ol=e=>e===Za?{normalize:Rr,invalidMessage:ue.invalidDate}:e===Xa?{normalize:Vr,invalidMessage:ue.invalidTime}:e===Qa?{normalize:nl,invalidMessage:ue.invalidDateTime}:null,al=(e,t)=>{let i=ol(e.type);if(!i||t==null||t==="")return null;let s=i.normalize(String(t));if(!s)return i.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let r=i.normalize(String(e.min));if(r&&s<r)return ue.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let r=i.normalize(String(e.max));if(r&&s>r)return ue.maxTemporal(String(e.max))}return null},Ot=(e,t)=>{if(e.required){let s=t==null||t===""||Array.isArray(t)&&t.length===0||typeof t=="boolean"&&t===!1,r=e.type==="input-number"&&t===null;if(e.type==="input-number"?r:s)return typeof e.required=="object"&&e.required.message?e.required.message:ue.required}let i=al(e,t);if(i)return i;if(Array.isArray(e.rules))for(let s of e.rules){let r=ll(s,t);if(r)return r}return null},ll=(e,t)=>{if(t==null||t==="")return null;let i=String(t);switch(e.rule){case"minLength":return i.length<e.value?e.message||ue.minLength(e.value):null;case"maxLength":return i.length>e.value?e.message||ue.maxLength(e.value):null;case"pattern":{let s=Ja[e.value];if(!s)try{s=new RegExp(e.value)}catch{return e.message||ue.pattern}return s.test(i)?null:e.message||ue.pattern}default:return null}},It=(e,t)=>{let i={},s=re(e);for(let r of s){let n=ne(t,r.name),o=Ot(r,n);o&&(i[r.name]=o)}return{valid:Object.keys(i).length===0,errors:i}},pl=["section","read-only-text","slot"],Wi=e=>!pl.includes(e.type),re=e=>{let t=[];for(let i of e)i.type==="section"&&Array.isArray(i.fields)?t.push(...re(i.fields)):Wi(i)&&t.push(i);return t},Mi=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":case"segmented-control":return null;case"tag-select":return[];case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},Fi=(e,t=0)=>{let i=[],s=t;for(let r of e)if(r.type==="section"){if(i.push({...r,_isSection:!0,_idx:s}),s++,Array.isArray(r.fields)){let n=Fi(r.fields,s);i.push(...n),s+=n.length}}else i.push({...r,_isSection:!1,_idx:s}),s++;return i},dl=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:i={}}=t||{},s=qa(i),r=wt(t?.context)?t.context:{},n=wt(e?.formValues)?e.formValues:{},o={...r,...n,formValues:n};return Object.keys(o).length>0?Ua(s,o):s},cl=({state:e,props:t})=>{let i=Ga(t),s=ee({state:e,props:t}),r=s.fields||[],n=!!t?.disabled,o=Fi(r);o.forEach(d=>{if(d._isSection)return;let u=Wi(d);if(d._disabled=n||!!d.disabled,u&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"||d.type==="tag-select"||d.type==="segmented-control"){let f=ne(e.formValues,d.name);d._selectedValue=f!==void 0?f:null,d._selectedValues=Array.isArray(f)?f:[],d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let f=ne(e.formValues,d.name);d._imageSrc=f&&String(f).trim()?f:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let f=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=f}});let l=s.actions||{buttons:[]},p=l.layout||"split",a=(l.buttons||[]).map((d,u)=>({...d,_globalIdx:u,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return p==="split"?c={_layout:"split",buttons:a,_leftButtons:a.filter(d=>d.align==="left"),_rightButtons:a.filter(d=>d.align!=="left")}:c={_layout:p,buttons:a,_allButtons:a},{containerAttrString:i,title:s?.title||"",description:s?.description||"",flatFields:o,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},Te=({state:e,props:t})=>{let i=ee({state:e,props:t}),s=re(i.fields||[]);return Lr(e.formValues,s.map(r=>r.name).filter(r=>typeof r=="string"&&r.length>0))},ul=({state:e,props:t},i={})=>{let{name:s,value:r}=i;s&&(he(e.formValues,s,r),at({state:e,props:t}))},at=({state:e,props:t})=>{if(!t)return;let i=ee({state:e,props:t}),s=re(i.fields||[]);e.formValues=Lr(e.formValues,s.map(r=>r.name).filter(r=>typeof r=="string"&&r.length>0))},hl=({state:e},t={})=>{let{values:i}=t;!i||typeof i!="object"||Object.keys(i).forEach(s=>{he(e.formValues,s,i[s])})},fl=({state:e},t={})=>{let{defaultValues:i={}}=t;e.formValues=i?structuredClone(i):{},e.errors={},e.reactiveMode=!1},yl=({state:e},t={})=>{e.errors=t.errors||{}},ml=({state:e},t={})=>{let{name:i}=t;i&&e.errors[i]&&delete e.errors[i]},gl=({state:e})=>{e.reactiveMode=!0},bl=({state:e},t={})=>{let{x:i,y:s,content:r}=t;e.tooltipState={open:!0,x:i,y:s,content:r}},vl=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},wl=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:ml,collectAllDataFields:re,createInitialState:dl,flattenFields:Fi,get:ne,getDefaultValue:Mi,hideTooltip:vl,isDataField:Wi,pruneHiddenValues:at,resetFormValues:fl,selectForm:ee,selectFormValues:Te,selectViewData:cl,set:he,setErrors:yl,setFormFieldValue:ul,setFormValues:hl,setReactiveMode:gl,showTooltip:bl,validateField:Ot,validateForm:It},Symbol.toStringTag,{value:"Module"})),Nr=({field:e,target:t,value:i})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(i==null?t.removeAttribute("value"):t.setAttribute("value",String(i)))},Dr=({form:e,formValues:t={},refs:i,formDisabled:s=!1})=>{let r=e.fields||[],n=0,o=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&o(p.fields);continue}let a=i[`field${n}`];if(n++,!a)continue;let c=s||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let d=ne(t,p.name);if(d==null?a.removeAttribute("value"):a.setAttribute("value",String(d)),p.type==="slider-with-input"&&a.store?.setValue){let u=Number(d??0);a.store.setValue({value:Number.isFinite(u)?u:0}),typeof a.render=="function"&&a.render()}p.type==="popover-input"&&a.store?.setValue&&(a.store.setValue({value:d==null?"":String(d)}),typeof a.render=="function"&&a.render())}if(p.type==="tag-select"&&a.store?.updateSelectedValues){let d=ne(t,p.name);a.store.updateSelectedValues({values:Array.isArray(d)?d:[]}),typeof a.render=="function"&&a.render()}p.type==="checkbox"&&(ne(t,p.name)?a.setAttribute("checked",""):a.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&a.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",p.placeholder)),c?a.setAttribute("disabled",""):a.removeAttribute("disabled")}};o(r)},jr=(e,t)=>{let i=t?.defaultValues||{},s={};Object.keys(i).forEach(l=>{he(s,l,i[l])});let r=ee({state:{formValues:s},props:t}),n=re(r.fields||[]),o={};for(let l of n){let p=ne(i,l.name);p!==void 0?he(o,l.name,p):he(o,l.name,Mi(l))}e.resetFormValues({defaultValues:o})},_l=e=>{let{store:t,props:i}=e;jr(t,i)},xl=e=>{let{props:t,refs:i,render:s}=e,r=e.store.getState(),n=ee({state:r,props:t});Dr({form:n,formValues:r.formValues,refs:i,formDisabled:!!t?.disabled}),s()},Sl=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n,refs:o}=e,l=!!s?.disabled;i?.key!==s?.key&&jr(r,s);let p=r.getState();at({state:p,props:s});let a=ee({state:p,props:s});Dr({form:a,formValues:p.formValues,refs:o,formDisabled:l}),n()},Al=(e,t)=>{let{store:i,dispatchEvent:s,render:r,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;i.setFormFieldValue({name:l,value:p});let a=i.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=re(c.fields||[]).find(u=>u.name===l);if(Nr({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let u=Ot(d,p);u?i.setErrors({errors:{...a.errors,[l]:u}}):i.clearFieldError({name:l})}r(),s(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:Te({state:i.getState(),props:n})}}))},kl=(e,t)=>{let{store:i,dispatchEvent:s,render:r,props:n}=e,o=t._event,l=o.currentTarget.dataset.fieldName;if(!l||!o.detail||!Object.prototype.hasOwnProperty.call(o.detail,"value"))return;let p=o.detail.value;i.setFormFieldValue({name:l,value:p});let a=i.getState();at({state:a,props:n});let c=ee({state:a,props:n}),d=re(c.fields||[]).find(u=>u.name===l);if(Nr({field:d,target:o.currentTarget,value:p}),a.reactiveMode&&d){let u=Ot(d,p);u?i.setErrors({errors:{...a.errors,[l]:u}}):i.clearFieldError({name:l})}r(),s(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:Te({state:i.getState(),props:n})}}))},El=(e,t)=>{let{store:i,dispatchEvent:s,render:r,props:n}=e,o=t._event.currentTarget.dataset.actionId;if(!o)return;let l=i.getState(),p=ee({state:l,props:n}),a=((p.actions||{}).buttons||[]).find(d=>d.id===o),c=Te({state:l,props:n});if(a&&a.validate){let d=re(p.fields||[]),{valid:u,errors:f}=It(d,l.formValues);i.setErrors({errors:f}),u||i.setReactiveMode(),r(),s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c,valid:u,errors:f}}))}else s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:o,values:c}}))},$l=(e,t)=>{let i=t._event;i.type==="contextmenu"&&i.preventDefault();let{store:s,dispatchEvent:r,props:n}=e,o=i.currentTarget.dataset.fieldName;r(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:o,event:i.type,values:Te({state:s.getState(),props:n})}}))},Cl=(e,t)=>{let{store:i,dispatchEvent:s,render:r,props:n}=e,o=t._event;if(o.key==="Enter"&&!o.shiftKey){let l=o.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;o.preventDefault();let p=i.getState(),a=ee({state:p,props:n}),c=(a.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let u=Te({state:p,props:n});if(d.validate){let f=re(a.fields||[]),{valid:h,errors:y}=It(f,p.formValues);i.setErrors({errors:y}),h||i.setReactiveMode(),r(),s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u,valid:h,errors:y}}))}else s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:u}}))}},Ol=(e,t)=>{let{store:i,render:s,props:r}=e,n=t._event,o=n.currentTarget.dataset.fieldName,l=ee({state:i.getState(),props:r}),p=re(l.fields||[]).find(a=>a.name===o);if(p&&p.tooltip){let a=n.currentTarget.getBoundingClientRect();i.showTooltip({x:a.left+a.width/2,y:a.top-8,content:typeof p.tooltip=="string"?p.tooltip:p.tooltip.content||""}),s()}},Il=e=>{let{store:t,render:i}=e;t.hideTooltip({}),i()},Tl=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:El,handleAfterMount:xl,handleBeforeMount:_l,handleImageClick:$l,handleKeyDown:Cl,handleOnUpdate:Sl,handleTooltipMouseEnter:Ol,handleTooltipMouseLeave:Il,handleValueChange:kl,handleValueInput:Al},Symbol.toStringTag,{value:"Module"})),Ll=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Vl=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],Rl=({ref:e,fieldType:t,value:i,forceRefresh:s=!1})=>{if(Ll.includes(t)){if(s&&e.removeAttribute("value"),i==null){if(Vl.includes(t)&&s){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(i))}},Pr=({ref:e,value:t})=>{if(e){if(e?.store?.updateSelectedValues)e.store.updateSelectedValues({values:Array.isArray(t)?t:[]});else if(e?.store?.updateSelectedValue)e.store.updateSelectedValue({value:t});else return;typeof e.render=="function"&&e.render()}},Nl=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(i=>{let s=i.getAttribute("data-field-name");s&&t.set(s,i)}),t},Ks=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,Dl=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name], rtgl-tag-select[data-field-name], rtgl-segmented-control[data-field-name]").forEach(i=>{let s=i.dataset?.fieldName;if(!s)return;let r=ne(t,s);Pr({ref:i,value:r})})},jl=function(){let e=this.store.getState();return Te({state:e,props:this.props})},Pl=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let i=this.store.getState(),s=ee({state:i,props:this.props}),r=re(s.fields||[]),n=Nl(Ks(this));for(let l of r){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let a=Object.prototype.hasOwnProperty.call(t,l.name),c=ne(t,l.name);if(!a&&c===void 0)continue;let d=ne(i.formValues,l.name);Rl({ref:p,fieldType:l.type,value:d,forceRefresh:!0}),["select","tag-select","segmented-control"].includes(l.type)&&Pr({ref:p,value:d}),l.type==="checkbox"&&(d?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let o=()=>{let l=this.store.getState();Dl({root:Ks(this),values:l.formValues})};o(),setTimeout(()=>{o()},0)},Bl=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),i=re(t.fields||[]),{valid:s,errors:r}=It(i,e.formValues);return this.store.setErrors({errors:r}),s||this.store.setReactiveMode(),this.render(),{valid:s,errors:r}},zl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{he(t,n,e[n])});let i=ee({state:{formValues:t},props:this.props}),s=re(i.fields||[]),r={};for(let n of s){let o=ne(e,n.name);o!==void 0?he(r,n.name,o):he(r,n.name,Mi(n))}this.store.resetFormValues({defaultValues:r}),this.setValues(r)},Wl=Object.freeze(Object.defineProperty({__proto__:null,getValues:jl,reset:zl,setValues:Pl,validate:Bl},Symbol.toStringTag,{value:"Module"})),Us=3e3,Ml=180,_t=new WeakMap,Br=e=>{e&&(typeof e.componentDialogBodyHost?.replaceChildren=="function"&&e.componentDialogBodyHost.replaceChildren(),delete e.componentDialogBody)},Fl=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"||t==="componentDialog"?null:e.selectConfig().mode==="confirm"?!1:null},fe=({store:e,render:t,globalUI:i,refs:s,emitResult:r=!1,result:n})=>{if(!e.selectIsOpen())return;let o=n!==void 0?n:Fl(e);Br(s),e.closeAll(),t(),r&&i.emit("event",o)},zr=({store:e,render:t,globalUI:i,refs:s,error:r})=>{Br(s),e.selectIsOpen()&&(e.closeAll(),t()),i.emit("error",r)},lt=({store:e,render:t,globalUI:i,refs:s})=>{e.selectIsOpen()&&fe({store:e,render:t,globalUI:i,refs:s,emitResult:!0})},pt=(e,{rejectOnError:t=!1}={})=>new Promise((i,s)=>{let r=null,n=e.once("event",o=>{r?.(),i(o)});t&&(r=e.once("error",o=>{n?.(),s(o)}))}),Kl=e=>{let t=_t.get(e);return t||(t=new Map,_t.set(e,t)),t},Ul=(e,t)=>{let i=_t.get(e),s=i?.get(t);s&&(clearTimeout(s.exitTimerId),clearTimeout(s.removeTimerId),i.delete(t))},Hl=e=>{let t=_t.get(e);if(t){for(let i of t.values())clearTimeout(i.exitTimerId),clearTimeout(i.removeTimerId);t.clear()}},ql=({store:e,render:t,globalUI:i},s)=>{Ul(i,s);let r=Kl(i),n=setTimeout(()=>{e.setToastPhase?.({id:s,phase:"exiting"}),t()},Math.max(0,Us-Ml)),o=setTimeout(()=>{r.delete(s),e.removeToast({id:s}),t()},Us);r.set(s,{exitTimerId:n,removeTimerId:o})},Yl=(e,t)=>{setTimeout(()=>{let{store:i,refs:s}=e;if(!i.selectIsOpen()||i.selectUiType()!=="formDialog")return;let r=i.selectFormDialogConfig?.();if(!r||r.key!==t||typeof r.mount!="function")return;let n=s.formDialog;n&&r.mount(n)},0)},Gl=(e,t)=>{setTimeout(()=>{let{store:i,refs:s,render:r,globalUI:n}=e;if(!i.selectIsOpen()||i.selectUiType()!=="componentDialog")return;let o=i.selectComponentDialogConfig?.();if(!o||o.key!==t)return;let l=s.componentDialogBodyHost;if(l)try{let p=document.createElement(o.component);Object.entries(o.props??{}).forEach(([a,c])=>{p[a]=c}),l.replaceChildren(p),s.componentDialogBody=p}catch(p){zr({store:i,render:r,globalUI:n,refs:s,error:p})}},0)},ui=(e,t)=>!e.selectIsOpen()||e.selectUiType()!=="componentDialog"?!1:e.selectComponentDialogConfig?.()?.key===t,Jl=e=>{let{store:t,render:i,globalUI:s,refs:r}=e;fe({store:t,render:i,globalUI:s,refs:r,emitResult:!0})},Zl=e=>{let{store:t,render:i,globalUI:s,refs:r}=e,n=t.selectConfig().mode==="confirm"?!0:null;fe({store:t,render:i,globalUI:s,refs:r,emitResult:!0,result:n})},Xl=e=>{let{store:t,render:i,globalUI:s,refs:r}=e;fe({store:t,render:i,globalUI:s,refs:r,emitResult:!0,result:!1})},Ql=e=>{let{store:t,render:i,globalUI:s,refs:r}=e;fe({store:t,render:i,globalUI:s,refs:r,emitResult:!0,result:null})},ep=(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t._event,{index:l,item:p}=o.detail;fe({store:i,render:s,globalUI:r,refs:n,emitResult:!0,result:{index:l,item:p}})},tp=(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t;return lt({store:i,render:s,globalUI:r,refs:n}),i.setAlertConfig(o),s(),pt(r)},ip=async(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t;return lt({store:i,render:s,globalUI:r,refs:n}),i.setConfirmConfig(o),s(),pt(r)},sp=(e,t)=>{let{store:i,render:s,globalUI:r}=e;i.addToast(t),s();let n=i.selectToasts?.()??[],o=n[n.length-1]?.id;o&&ql({store:i,render:s,globalUI:r},o)},rp=async(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t;return lt({store:i,render:s,globalUI:r,refs:n}),i.setDropdownConfig(o),s(),pt(r)},np=async(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t;lt({store:i,render:s,globalUI:r,refs:n}),i.setFormDialogConfig(o),s();let l=i.selectFormDialogConfig?.().key;return Yl(e,l),pt(r)},op=async(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t;lt({store:i,render:s,globalUI:r,refs:n}),i.setComponentDialogConfig(o),s();let l=i.selectComponentDialogConfig?.().key;return Gl(e,l),pt(r,{rejectOnError:!0})},ap=(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t._event?.detail??{};o.valid!==!1&&fe({store:i,render:s,globalUI:r,refs:n,emitResult:!0,result:o})},lp=(e,t)=>{let{store:i,refs:s}=e,r=t._event?.detail??{},n=i.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:r,formEl:s.formDialog??null})},pp=e=>{let{store:t,render:i,globalUI:s,refs:r}=e;Hl(s);let n=(t.selectToasts?.().length??0)>0;if(n&&t.clearToasts(),t.selectIsOpen()){fe({store:t,render:i,globalUI:s,refs:r,emitResult:!0});return}n&&i()},dp=async(e,t)=>{let{store:i,render:s,globalUI:r,refs:n}=e,o=t._event,l=Number(o?.currentTarget?.dataset?.actionIndex),p=i.selectComponentDialogConfig?.(),a=p?.key,c=Number.isInteger(l)?p?.actions?.buttons?.[l]:null;if(c){if(c.role==="cancel"){fe({store:i,render:s,globalUI:r,refs:n,emitResult:!0,result:{actionId:c.id}});return}try{let d=n.componentDialogBody;if(!d||typeof d.validate!="function"||typeof d.getValues!="function")throw new Error(`component dialog body '${p?.component??"unknown"}' must implement validate() and getValues()`);if(c.validate){let f=await d.validate();if(!ui(i,a))return;if(!f||typeof f!="object"||typeof f.valid!="boolean")throw new Error("component dialog body validate() must return { valid, errors? }");if(f.valid===!1)return}let u=await d.getValues();if(!ui(i,a))return;fe({store:i,render:s,globalUI:r,refs:n,emitResult:!0,result:{actionId:c.id,values:u}})}catch(d){if(!ui(i,a))return;zr({store:i,render:s,globalUI:r,refs:n,error:d})}}},cp=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Xl,handleCloseAll:pp,handleComponentDialogAction:dp,handleConfirm:Zl,handleDialogClose:Jl,handleDropdownClose:Ql,handleDropdownItemClick:ep,handleFormAction:ap,handleFormFieldEvent:lp,handleShowAlert:tp,handleShowComponentDialog:op,handleShowConfirm:ip,handleShowDropdownMenu:rp,handleShowFormDialog:np,handleShowToast:sp},Symbol.toStringTag,{value:"Module"})),up=new Set(["sm","md","lg","f"]),hp=new Set(["sm","md","lg"]),fp=new Set(["active","exiting"]),yp=new Set(["top","bottom"]),mp=new Set(["confirm","cancel"]),Wr=[["overlay","overlay"],["noOverlay","no-overlay"],["smPlace","sm-place"],["mdPlace","md-place"],["lgPlace","lg-place"],["xlPlace","xl-place"],["smOverlay","sm-overlay"],["mdOverlay","md-overlay"],["lgOverlay","lg-overlay"],["xlOverlay","xl-overlay"],["smNoOverlay","sm-no-overlay"],["mdNoOverlay","md-no-overlay"],["lgNoOverlay","lg-no-overlay"],["xlNoOverlay","xl-no-overlay"]],gp=Object.freeze([{id:"cancel",label:"Cancel",variant:"se",align:"left",role:"cancel"},{id:"confirm",label:"OK",variant:"pr",role:"confirm",validate:!0}]),_i=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,bp=e=>`${e}`.replace(/"/g,"""),vp=(e={},t,i)=>e[t]!==void 0?e[t]:e[i],wp=(e={})=>Wr.reduce((t,[i,s])=>{let r=vp(e,i,s);return r!=null&&(t[i]=r),t},{}),_p=(e={})=>Wr.filter(([t])=>e[t]!==void 0&&e[t]!==null).map(([t,i])=>{let s=e[t];return s===!0?i:`${i}="${bp(s)}"`}).join(" "),Pe=(e,t="md")=>up.has(e)?e:t,Mr=(e,t="sm")=>hp.has(e)?e:t,Fr=(e,t="active")=>fp.has(e)?e:t,Kr=(e,t="top")=>yp.has(e)?e:t,Ki=e=>{let t=(Array.isArray(e?.buttons)&&e.buttons.length>0?e.buttons:gp).map((i,s)=>{if(!i||typeof i!="object"||Array.isArray(i))throw new Error("component dialog buttons must be objects");if(typeof i.id!="string"||i.id.length===0)throw new Error("component dialog button id is required");if(typeof i.label!="string"||i.label.length===0)throw new Error("component dialog button label is required");if(!mp.has(i.role))throw new Error("component dialog button role must be 'confirm' or 'cancel'");return{...i,_globalIdx:s,variant:i.variant??(i.role==="confirm"?"pr":"se"),align:i.align??(i.role==="cancel"?"left":"right"),validate:i.role==="confirm"?!!i.validate:!1,_disabled:!!i.disabled,pre:i.pre??"",suf:i.suf??""}});return{_layout:"split",buttons:t,_leftButtons:t.filter(i=>i.align==="left"),_rightButtons:t.filter(i=>i.align!=="left")}},Ur=()=>({title:"",description:"",size:"md",component:"",props:{},actions:Ki(),key:0}),xp=()=>Object.freeze({isOpen:!1,uiType:"dialog",nextToastId:0,toasts:[],config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null},componentDialogConfig:Ur()}),Sp=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},Ap=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status??void 0,title:t.title??"",message:t.message,confirmText:t.confirmText??"Yes",cancelText:t.cancelText??"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},kp=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x??0,y:t.y??0,place:t.place??"bs",...wp(t)},e.uiType="dropdown",e.isOpen=!0},Ep=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let i=e.formDialogConfig?.key??0;e.formDialogConfig={form:t.form,defaultValues:_i(t.defaultValues),context:_i(t.context),disabled:!!t.disabled,size:Pe(t.size,"md"),key:i+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},$p=({state:e},t={})=>{if(typeof t.component!="string"||!t.component.includes("-"))throw new Error("component tag name is required for showComponentDialog");let i=e.componentDialogConfig?.key??0;e.componentDialogConfig={title:typeof t.title=="string"?t.title:"",description:typeof t.description=="string"?t.description:"",size:Pe(t.size,"md"),component:t.component,props:_i(t.props),actions:Ki(t.actions),key:i+1},e.uiType="componentDialog",e.isOpen=!0},Cp=({state:e},t={})=>{if(typeof t.message!="string"||t.message.length===0)throw new Error("message is required for showToast");let i=(e.nextToastId??0)+1,s={id:`toast-${i}`,message:t.message,size:Mr(t.size??t.s,"sm"),position:Kr(t.position,"top"),phase:"active"};e.nextToastId=i,e.toasts=[...e.toasts??[],s]},Op=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).filter(i=>i.id!==t.id))},Ip=({state:e},t={})=>{typeof t.id!="string"||t.id.length===0||(e.toasts=(e.toasts??[]).map(i=>i.id!==t.id?i:{...i,phase:Fr(t.phase,"active")}))},Tp=({state:e})=>{e.toasts=[]},Lp=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Vp=({state:e})=>e.config,Rp=({state:e})=>e.dropdownConfig,Np=({state:e})=>e.formDialogConfig,Dp=({state:e})=>e.componentDialogConfig,jp=({state:e})=>e.uiType,Pp=({state:e})=>e.isOpen,Bp=({state:e})=>e.toasts??[],zp=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",i=e.isOpen&&e.uiType==="formDialog",s=e.isOpen&&e.uiType==="componentDialog",r=e.componentDialogConfig??Ur(),n=Array.isArray(e.toasts)?e.toasts.map(o=>({...o,size:Mr(o.size,"sm"),position:Kr(o.position,"top"),phase:Fr(o.phase,"active")})):[];return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items??[],x:e.dropdownConfig?.x??0,y:e.dropdownConfig?.y??0,place:e.dropdownConfig?.place??"bs",popoverAttrString:_p(e.dropdownConfig)},formDialogConfig:{form:e.formDialogConfig?.form??{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues??{},context:e.formDialogConfig?.context??{},disabled:!!e.formDialogConfig?.disabled,size:Pe(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key??0},componentDialogConfig:{title:r.title??"",description:r.description??"",size:Pe(r.size,"md"),component:r.component??"",props:r.props??{},actions:r.actions??Ki(),key:r.key??0},toasts:n,topToasts:n.filter(o=>o.position==="top"),bottomToasts:n.filter(o=>o.position==="bottom"),isDialogOpen:t,isFormDialogOpen:i,isComponentDialogOpen:s,isDialogContainerOpen:t||i||s,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:s?Pe(r.size,"md"):i?Pe(e.formDialogConfig?.size,"md"):"sm"}},Wp=Object.freeze(Object.defineProperty({__proto__:null,addToast:Cp,clearToasts:Tp,closeAll:Lp,createInitialState:xp,removeToast:Op,selectComponentDialogConfig:Dp,selectConfig:Vp,selectDropdownConfig:Rp,selectFormDialogConfig:Np,selectIsOpen:Pp,selectToasts:Bp,selectUiType:jp,selectViewData:zp,setAlertConfig:Sp,setComponentDialogConfig:$p,setConfirmConfig:Ap,setDropdownConfig:kp,setFormDialogConfig:Ep,setToastPhase:Ip},Symbol.toStringTag,{value:"Module"})),Mp=(e,t)=>{let{dispatchEvent:i,store:s}=e;t._event,console.log("handle click start",s.selectPath()),i(new CustomEvent("start-click",{detail:{path:s.selectPath()}}))},Fp=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:Mp},Symbol.toStringTag,{value:"Module"})),Kp=()=>Object.freeze({}),Up=["id","class","style","slot","start"],Hp=(e={})=>Object.entries(e).filter(([t])=>!Up.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),qp=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Yp=({props:e})=>{let t=qp(e.start)||e.start;return{containerAttrString:Hp(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Gp=({props:e})=>e.start?.path,Jp=({state:e})=>{},Zp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Kp,selectPath:Gp,selectViewData:Yp,setState:Jp},Symbol.toStringTag,{value:"Module"})),Hs=e=>{let t=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]");return Array.from(t)},Xp=e=>e.map(t=>{let i=1,s=t.tagName.toLowerCase();return s==="h1"?i=1:s==="h2"?i=2:s==="h3"?i=3:s==="h4"?i=4:s==="rtgl-text"&&(i=parseInt(t.getAttribute("data-level")||"1",10)),{id:t.id,href:`#${t.id}`,title:t.textContent,level:i}}),qs=(e,t,i)=>{let{store:s,render:r}=i,n,o=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>o&&(o=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let a=p.getBoundingClientRect();a.top>t&&a.top<l&&(l=a.top,n=p.id)})}n&&n!==s.selectCurrentId()&&(s.setCurrentId({id:n}),r())},Qp=(e,t,i,s)=>{let{store:r,render:n}=s,o=null,l=()=>{o=null;let d=Hs(e);r.setItems({items:Xp(d)}),qs(d,i,s),n()},p=()=>{o===null&&(o=requestAnimationFrame(l))},a=()=>{qs(Hs(e),i,s)};p(),t.addEventListener("scroll",a,{passive:!0});let c=new MutationObserver(()=>{p()});return c.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["id","data-level"]}),()=>{o!==null&&cancelAnimationFrame(o),c.disconnect(),t.removeEventListener("scroll",a)}},ed=e=>{let{props:t}=e,i=()=>{};return requestAnimationFrame(()=>{let s=document.getElementById(t.targetId);if(!s)return;let r=window;t.scrollContainerId&&(r=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);i=Qp(s,r,n,e)}),()=>{i()}},td=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:ed},Symbol.toStringTag,{value:"Module"})),id=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),sd=({state:e})=>{let t=((i,s)=>{let r=new Set,n=i.findIndex(l=>l.id===s);if(n===-1)return r;let o=i[n].level;for(let l=n-1;l>=0;l--)if(i[l].level<o){let p=i[l].level;r.add(i[l].id);for(let a=l-1;a>=0;a--)i[a].level<p&&(r.add(i[a].id),p=i[a].level);break}return r})(e.items,e.currentId);return{items:e.items.map(i=>{let s={1:"0",2:"12px",3:"24px",4:"32px"},r=i.id===e.currentId,n=t.has(i.id),o=r||n;return{...i,c:o?"fg":"mu-fg",ml:s[i.level]||"",bc:o?"fg":"mu-fg"}}),currentId:e.currentId}},rd=({state:e})=>e,nd=({state:e})=>e.currentId,od=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},ad=({state:e},t={})=>{e.currentId=t.id},ld=({state:e},t={})=>{e.contentContainer=t.container},pd=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:id,selectCurrentId:nd,selectState:rd,selectViewData:sd,setContentContainer:ld,setCurrentId:ad,setItems:od},Symbol.toStringTag,{value:"Module"})),dt=e=>e==null||e===!0?"":String(e),Hr=(e,t)=>{let{store:i,render:s,dispatchEvent:r}=e,n=dt(t);i.setValue({value:n}),i.closePopover({}),r(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),s()},dd=e=>{let{store:t,props:i}=e;if(i.value!==void 0){let s=dt(i.value);t.setValue({value:s}),t.setTempValue({value:s})}},cd=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n}=e;if(i?.value!==s?.value){let o=dt(s?.value);r.setValue({value:o}),r.getState().isOpen||r.setTempValue({value:o})}n()},ud=(e,t)=>{let{store:i,render:s,refs:r,props:n}=e;if(n.disabled)return;let o=t._event,l=dt(n.value);i.setValue({value:l}),i.setTempValue({value:l}),i.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}}),s(),setTimeout(()=>{let{input:p}=r;if(!p)return;p.value=l,p.focus();let a=p.shadowRoot?.querySelector("input, textarea");a&&typeof a.focus=="function"&&a.focus()},50)},hd=(e,t)=>{let{store:i,render:s}=e;i.closePopover({}),s()},fd=(e,t)=>{let{store:i}=e,s=t._event,r=dt(s.detail.value);i.setTempValue({value:r})},yd=e=>{let{store:t,refs:i}=e,{input:s}=i,r=s?s.value:t.getState().tempValue;Hr(e,r)},md=(e,t)=>{let{store:i,refs:s}=e,r=t._event;if(r.key==="Enter"){r.preventDefault(),r.stopPropagation();let{input:n}=s,o=n?n.value:i.getState().tempValue;Hr(e,o)}else r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),i.closePopover({}),e.render())},gd=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:dd,handleInputChange:fd,handleInputKeydown:md,handleOnUpdate:cd,handlePopoverClose:hd,handleSubmitClick:yd,handleTextClick:ud},Symbol.toStringTag,{value:"Module"})),bd=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),vd=({props:e,state:t})=>{let i=typeof t.value=="string"&&t.value.length>0,s=i?t.value:"-",r=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",o=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:s,valueColor:i?"fg":"mu-fg",tempValue:t.tempValue,placeholder:r,label:n,disabled:o}},wd=({state:e},t={})=>{e.tempValue=t.value},_d=({state:e},t={})=>{let{position:i}=t;e.position=i,e.isOpen=!0,e.hasUnsavedChanges=!1},xd=({state:e})=>{e.isOpen=!1,e.tempValue=""},Sd=({state:e},t={})=>{e.value=t.value},Ad=({state:e})=>e.value,kd=Object.freeze(Object.defineProperty({__proto__:null,closePopover:xd,createInitialState:bd,openPopover:_d,selectValue:Ad,selectViewData:vd,setTempValue:wd,setValue:Sd},Symbol.toStringTag,{value:"Module"})),le=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(let r of i)if(!s.includes(r)||!le(e[r],t[r]))return!1;return!0},Ys=({dispatchEvent:e,value:t,label:i,index:s,item:r})=>{e(new CustomEvent("value-change",{detail:{value:t,label:i,index:s,item:r},bubbles:!0}))},Ed=e=>{let{store:t,props:i,render:s}=e;if(i.selectedValue!==null&&i.selectedValue!==void 0&&i.options){let r=i.options.find(n=>le(n.value,i.selectedValue));r&&(t.updateSelectedValue({value:r.value}),s())}},$d=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n}=e,o=!1;i.selectedValue!==s.selectedValue&&(r.updateSelectedValue({value:s.selectedValue}),o=!0),o&&n()},qr=(e,t)=>{let{render:i,dispatchEvent:s,props:r,store:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[p],c=Object.prototype.hasOwnProperty.call(r||{},"selectedValue"),d=n.selectSelectedValue(),u=c?!0:n.selectHasSelectedValue(),f=a?u&&le(a.value,d):!1;if(a){if(f&&!r.noClear){n.clearSelectedValue({}),r.onChange&&typeof r.onChange=="function"&&r.onChange(void 0),Ys({dispatchEvent:s,value:void 0,label:void 0,index:null,item:void 0}),i();return}n.updateSelectedValue({value:a.value}),r.onChange&&typeof r.onChange=="function"&&r.onChange(a.value),Ys({dispatchEvent:s,value:a.value,label:a.label,index:p,item:a}),i()}},Cd=(e,t)=>{let i=t._event;i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),qr(e,t))},Od=(e,t)=>{let{store:i,render:s}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(6),10);i.setHoveredOption({optionId:n}),s()},Id=e=>{let{store:t,render:i}=e;t.clearHoveredOption({}),i()},Yr=(e,t)=>{if(e.props.disabled)return;let{render:i,dispatchEvent:s}=e,{_event:r}=t;r.stopPropagation(),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},Td=(e,t)=>{let i=t._event;i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),Yr(e,t))},Ld=e=>{let{store:t,render:i}=e;t.setHoveredAddOption({isHovered:!0}),i()},Vd=e=>{let{store:t,render:i}=e;t.setHoveredAddOption({isHovered:!1}),i()},Rd=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Yr,handleAddOptionKeyDown:Td,handleAddOptionMouseEnter:Ld,handleAddOptionMouseLeave:Vd,handleBeforeMount:Ed,handleOnUpdate:$d,handleOptionClick:qr,handleOptionKeyDown:Cd,handleOptionMouseEnter:Od,handleOptionMouseLeave:Id},Symbol.toStringTag,{value:"Module"})),Nd=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Dd=(e={})=>Object.entries(e).filter(([t])=>!Nd.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),jd=()=>Object.freeze({selectedValue:null,hasSelectedValue:!1,hoveredOptionId:null,hoveredAddOption:!1}),Pd=({state:e,props:t})=>{let i=Dd(t),s=!!t.disabled,r=Object.prototype.hasOwnProperty.call(t||{},"selectedValue"),n=r?t.selectedValue:e.selectedValue,o=r?!0:!!e.hasSelectedValue,l=t.options||[],p=l.map((a,c)=>{let d=o&&le(a.value,n),u=e.hoveredOptionId===c;return{...a,isSelected:d,bgc:d?"ac":u&&!s?"mu":"",textColor:d?"ac-fg":"fg",borderLeftWidth:c===0?"none":"xs",cursor:s?"not-allowed":"pointer",tabIndex:s?-1:0}});return{containerAttrString:i,isDisabled:s,options:p,selectedValue:n,hasSelectedValue:o,ariaLabel:t.placeholder||"Segmented control",showAddOption:!s&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"mu":"",addOptionBorderLeftWidth:l.length===0?"none":"xs"}},Bd=({state:e})=>e,zd=({state:e})=>e.selectedValue,Wd=({state:e})=>!!e.hasSelectedValue,Md=({state:e},t={})=>{e.selectedValue=t.value,e.hasSelectedValue=!0},Fd=({state:e})=>{e.selectedValue=void 0,e.hasSelectedValue=!1},Kd=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Ud=({state:e})=>{e.hoveredOptionId=null},Hd=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},qd=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:Ud,clearSelectedValue:Fd,createInitialState:jd,selectHasSelectedValue:Wd,selectSelectedValue:zd,selectState:Bd,selectViewData:Pd,setHoveredAddOption:Hd,setHoveredOption:Kd,updateSelectedValue:Md},Symbol.toStringTag,{value:"Module"})),Ui=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Yd=e=>{let{store:t,props:i,render:s}=e;if(i.selectedValue!==null&&i.selectedValue!==void 0&&i.options){let r=i.options.find(n=>Ui(n)==="item"&&le(n.value,i.selectedValue));r&&(t.updateSelectedValue({value:r?.value}),s())}},Gd=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n,refs:o}=e,l=!1,p=!1;s?.disabled&&!i?.disabled&&(r.closeOptionsPopover({}),l=!0),i.selectedValue!==s.selectedValue&&(r.updateSelectedValue({value:s.selectedValue}),l=!0),i.options!==s.options&&(l=!0,p=!0),l&&(n(),p&&r.selectState?.().isOpen&&o?.popover?.refreshContent?.())},Gr=(e,t)=>{let{store:i,render:s,refs:r,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let o=r.selectButton.getBoundingClientRect(),l=i.selectSelectedValue(),p=l!==null?l:n.selectedValue,a=null;p!=null&&n.options&&(a=n.options.findIndex(c=>Ui(c)==="item"&&le(c.value,p)),a===-1&&(a=null)),i.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:a}),s()},Jd=(e,t)=>{let i=t._event;i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),Gr(e,t))},Zd=e=>{let{store:t,render:i}=e;t.closeOptionsPopover({}),i()},Xd=(e,t)=>{let{render:i,dispatchEvent:s,props:r,store:n}=e;if(r.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=r.options[l];Ui(a)==="item"&&(n.updateSelectedValue({value:a?.value}),r.onChange&&typeof r.onChange=="function"&&r.onChange(a.value),s(new CustomEvent("value-change",{detail:{value:a.value,label:a.label,index:p,item:a},bubbles:!0})),i())},Qd=(e,t)=>{let{store:i,render:s}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(6),10);i.setHoveredOption({optionId:n}),s()},ec=(e,t)=>{let{store:i,render:s}=e;i.clearHoveredOption({}),s()},tc=(e,t)=>{let{store:i,render:s,dispatchEvent:r,props:n}=e;n.disabled||(t._event.stopPropagation(),i.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),r(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),s())},ic=(e,t)=>{if(e.props.disabled)return;let{store:i,render:s,dispatchEvent:r}=e,{_event:n}=t;n.stopPropagation(),i.closeOptionsPopover({}),r(new CustomEvent("add-option-click",{bubbles:!0})),s()},sc=(e,t)=>{let{store:i,render:s}=e;i.setHoveredAddOption({isHovered:!0}),s()},rc=(e,t)=>{let{store:i,render:s}=e;i.setHoveredAddOption({isHovered:!1}),s()},nc=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:ic,handleAddOptionMouseEnter:sc,handleAddOptionMouseLeave:rc,handleBeforeMount:Yd,handleButtonClick:Gr,handleButtonKeyDown:Jd,handleClearClick:tc,handleClickOptionsPopoverOverlay:Zd,handleOnUpdate:Gd,handleOptionClick:Xd,handleOptionMouseEnter:Qd,handleOptionMouseLeave:ec},Symbol.toStringTag,{value:"Module"})),oc=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],ac=(e={})=>Object.entries(e).filter(([t])=>!oc.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),lc=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),Jr=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Gs=(e={})=>Jr(e)==="item",pc=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",dc=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",cc=(e={},t,i,s,r)=>{let n=Jr(e),o=n==="section",l=n==="separator",p=n==="item";if(o)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};if(l)return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p};let a=le(e.value,i),c=s===t,d=pc(e),u=dc(e);return{...e,index:t,type:n,isSection:o,isSeparator:l,isItem:p,isSelected:a,bgc:c?"ac":a?"mu":"",hasIconSlot:r,icon:d,hasIcon:d.length>0,iconColor:"fg",c:"fg",suffixText:u,hasSuffixText:u.length>0,suffixTextColor:"mu-fg"}},uc=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),hc=({state:e,props:t})=>{let i=ac(t),s=!!t.disabled,r=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",o=!0,l=t.options||[],p=l.find(u=>Gs(u)&&le(u.value,r));p&&(n=p.label,o=!1);let a=l.some(u=>Gs(u)&&lc(u,"icon")),c=l.map((u,f)=>cc(u,f,r,e.hoveredOptionId,a)),d=c.find(u=>u.isItem&&u.isSelected);return{containerAttrString:i,isDisabled:s,isOpen:e.isOpen,position:e.position,options:c,selectedValue:r,selectedLabel:n,selectedLabelColor:o?"mu-fg":"fg",selectedIcon:d?.icon||"",hasSelectedIcon:!!d?.hasIcon,selectedIconColor:o?"mu-fg":"fg",selectedSuffixText:d?.suffixText||"",hasSelectedSuffixText:!!d?.hasSuffixText,selectedSuffixTextColor:"mu-fg",selectButtonCursor:s?"not-allowed":"pointer",selectButtonHoverBorderColor:s?"bo":"ac",selectButtonTabIndex:s?-1:0,hasValue:r!=null,showClear:!s&&!t.noClear&&r!=null,showAddOption:!s&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},fc=({state:e})=>e,yc=({state:e})=>e.selectedValue,mc=({state:e},t={})=>{let{position:i,selectedIndex:s}=t;e.position=i,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},gc=({state:e})=>{e.isOpen=!1},bc=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},vc=({state:e})=>{e.selectedValue=void 0},wc=({state:e},t={})=>{e.hoveredOptionId=t.optionId},_c=({state:e})=>{e.hoveredOptionId=null},xc=({state:e})=>{e.selectedValue=void 0},Sc=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},Ac=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:_c,clearSelectedValue:xc,closeOptionsPopover:gc,createInitialState:uc,openOptionsPopover:mc,resetSelection:vc,selectSelectedValue:yc,selectState:fc,selectViewData:hc,setHoveredAddOption:Sc,setHoveredOption:wc,updateSelectedValue:bc},Symbol.toStringTag,{value:"Module"})),Js=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},kc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?Js(e.tooltip):Js(e.showCompactTooltip),Ec=(e,t)=>{let{store:i,dispatchEvent:s}=e,r=t._event,n,o=i.selectHeader();r.currentTarget.id==="headerLabel"?n=o.labelPath:r.currentTarget.id==="headerImage"?n=o.image.path:r.currentTarget.id==="header"&&(n=o.path),s(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},$c=(e,t)=>{let{store:i,dispatchEvent:s,render:r}=e,n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=i.selectItem(o);i.hideTooltip({}),r(),s(new CustomEvent("item-click",{detail:{item:l},bubbles:!0,composed:!0}))},Cc=(e,t)=>{let{props:i,store:s,render:r}=e;if(!kc(i)||(i.mode||"full")==="full")return;let n=t._event,o=n.currentTarget.dataset.itemId||n.currentTarget.id.slice(4),l=s.selectItem(o);if(!l||l.type==="groupLabel")return;let p=n.currentTarget.getBoundingClientRect(),a=l.tooltip||l.label||l.title;a&&(s.showTooltip({x:p.right,y:p.top+p.height/2,place:"r",content:a}),r())},Oc=e=>{let{store:t,render:i}=e;t.hideTooltip({}),i()},Ic=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:Ec,handleItemClick:$c,handleItemMouseEnter:Cc,handleItemMouseLeave:Oc},Symbol.toStringTag,{value:"Module"})),Tc=()=>Object.freeze({tooltipState:{open:!1,x:0,y:0,place:"r",content:""}}),Lc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","tooltip","showCompactTooltip","w","bwr"],Vc=(e={})=>Object.entries(e).filter(([t])=>!Lc.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),it=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},xi=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},Rc=(e={})=>e.tooltip!==void 0&&e.tooltip!==null?xi(e.tooltip):xi(e.showCompactTooltip),Nc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64,Zs=(e={})=>e.label!==void 0&&e.label!==null?e.label:e.title!==void 0&&e.title!==null?e.title:"";function Hi(e,t=null){let i=[];for(let s of e){let r=s.id||s.href||s.path,n=r!=null&&t===r,o=Zs(s);if(i.push({id:r,label:o,title:s.title??o,href:s.href,type:s.type||"item",icon:s.icon,testId:s.testId,tooltip:s.tooltip,path:s.path,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let l of s.items){let p=l.id||l.href||l.path,a=p!=null&&t===p,c=Zs(l);i.push({id:p,label:c,title:l.title??c,href:l.href,type:l.type||"item",icon:l.icon,testId:l.testId,tooltip:l.tooltip,path:l.path,hrefAttr:l.href?`href=${l.href}`:"",isSelected:a,itemBgc:a?"ac":"bg",itemHoverBgc:a?"ac":"mu"})}}return i}var Dc=({state:e,props:t})=>{let i=it(t.header)||t.header,s=it(t.items)||t.items,r=t.selectedItemId,n=Vc(t),o=t.mode||"full",l=i||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=s?Hi(s,r):[],a=!xi(t.hideHeader),c=Rc(t),d=t.bwr||"xs",u=Nc(t.w,o),f=o==="full"?"fs":"c",h=o==="full"?"fs":"c",y=o==="full"?"lg":"sm",m=o==="full"?"md":"sm",b=o==="shrunk-lg"?48:40,g=o==="shrunk-lg"?28:20,_=o==="shrunk-lg"?"md":"sm",S=o==="full",A=o==="full",k=c&&!S,C=o==="full"?"fs":"c",O=o==="full"?"":`ah=${h}`,V=o==="full"?"f":b;return{containerAttrString:n,mode:o,header:l,items:p,sidebarWidth:u,headerAlign:f,itemAlign:h,headerPadding:y,itemPadding:m,itemHeight:b,iconSize:g,firstLetterSize:_,showLabels:S,showGroupLabels:A,itemContentAlign:C,itemAlignAttr:O,itemWidth:V,headerWidth:V,selectedItemId:r,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":"",listAttrString:o==="full"?"d=v sv":"d=v sv hsb",showHeader:a,enableCompactTooltip:k,rightBorderWidth:d,tooltipState:e.tooltipState||{open:!1,x:0,y:0,place:"r",content:""}}},jc=({props:e})=>it(e.header)||e.header,Pc=({state:e,props:t})=>{let i=it(t.items)||t.items;return(i?Hi(i):[]).find(s=>s.active)},Bc=({props:e},t)=>{let i=it(e.items)||e.items;return(i?Hi(i):[]).find(s=>s.id===t)},zc=({state:e})=>{},Wc=({state:e},t={})=>{let{x:i,y:s,place:r="r",content:n=""}=t;e.tooltipState={open:!0,x:i,y:s,place:r,content:n}},Mc=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},Fc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Tc,hideTooltip:Mc,selectActiveItem:Pc,selectHeader:jc,selectItem:Bc,selectViewData:Dc,setState:zc,showTooltip:Wc},Symbol.toStringTag,{value:"Module"})),Kc=e=>{let{store:t,props:i}=e;t.setValue({value:i.value??0})},Uc=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n}=e,o=i?.key!==s?.key,l=i?.value!==s?.value;if(o||l){let p=s?.value??0;r.setValue({value:p}),n()}},Hc=(e,t)=>{let{store:i,render:s,dispatchEvent:r}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;i.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),s(),r(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},qc=(e,t)=>{let{store:i,render:s,dispatchEvent:r}=e,n=t._event,o=Number(n.detail.value),l=(typeof n.composedPath=="function"?n.composedPath():[]).find(p=>p?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;i.setValue({value:o}),l&&typeof l.setAttribute=="function"&&l.setAttribute("value",String(o)),s(),r(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))},Yc=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Kc,handleOnUpdate:Uc,handleValueChange:Hc,handleValueInput:qc},Symbol.toStringTag,{value:"Module"})),Gc=()=>Object.freeze({value:0}),Jc=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),Zc=({state:e},t={})=>{e.value=t.value},Xc=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Gc,selectViewData:Jc,setValue:Zc},Symbol.toStringTag,{value:"Module"})),Qc=e=>{},eu=(e,t)=>{let{dispatchEvent:i,props:s}=e,r=t._event,n=parseInt(r.currentTarget.id.slice(3),10),o=s.data?.rows?.[n];o&&i(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},tu=(e,t)=>{let{store:i,render:s,dispatchEvent:r}=e,n=t._event.currentTarget.dataset.columnKey,o=i.selectSortInfo(),l="asc";o.column===n&&(o.direction==="asc"?l="desc":o.direction==="desc"&&(l=null)),l?i.setSortColumn({column:n,direction:l}):i.clearSort(),s(),r(new CustomEvent("header-click",{detail:{column:n,direction:l,sortInfo:l?{column:n,direction:l}:null}}))},iu=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Qc,handleHeaderClick:tu,handleRowClick:eu},Symbol.toStringTag,{value:"Module"})),su=()=>Object.freeze({sortColumn:null,sortDirection:null}),ru=["id","class","style","slot","data"],nu=(e={})=>Object.entries(e).filter(([t])=>!ru.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),ou=(e,t)=>{let i=t.split("."),s=e;for(let r of i){if(s==null)return null;s=s[r]}return s},au=({state:e,props:t})=>{let i=nu(t),s=t.data||{columns:[],rows:[]},r=s.rows.map((n,o)=>{let l=s.columns.map(p=>{let a=ou(n,p.key);return{key:p.key,value:a!=null?String(a):""}});return{index:o,cells:l}});return{containerAttrString:i,columns:s.columns||[],rows:r||[]}},lu=({state:e})=>e,pu=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),du=({state:e},{column:t,direction:i}={})=>{e.sortColumn=t,e.sortDirection=i},cu=({state:e})=>{e.sortColumn=null,e.sortDirection=null},uu=Object.freeze(Object.defineProperty({__proto__:null,clearSort:cu,createInitialState:su,selectSortInfo:pu,selectState:lu,selectViewData:au,setSortColumn:du},Symbol.toStringTag,{value:"Module"})),hu=(e,t)=>{let{dispatchEvent:i}=e,s=t._event.currentTarget.dataset.id;i(new CustomEvent("item-click",{detail:{id:s}}))},fu=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:hu},Symbol.toStringTag,{value:"Module"})),yu=()=>Object.freeze({}),mu=["id","class","style","slot","items","selectedTab"],gu=(e={})=>Object.entries(e).filter(([t])=>!mu.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),bu=({props:e})=>{let t=gu(e),i=e.items||[],s=e.selectedTab,r=i.map(n=>({...n,isSelected:n.id===s,bgColor:n.id===s?"ac":"",borderColor:n.id===s?"":"tr",textColor:n.id===s?"":"mu-fg"}));return{containerAttrString:t,items:r,selectedTab:s}},vu=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:yu,selectViewData:bu},Symbol.toStringTag,{value:"Module"})),wu=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",Zr=e=>Array.isArray(e)?[...e]:[],Xr=e=>{if(!e||typeof e.getBoundingClientRect!="function")return;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Si=({store:e,props:t})=>e.selectHasSelectedValues()?e.selectSelectedValues():Zr(t.selectedValues),Qr=({store:e,props:t})=>Array.isArray(t?.draftSelectedValues)?Zr(t.draftSelectedValues):e.getState().isOpen?e.selectDraftSelectedValues():Si({store:e,props:t}),_u=({dispatchEvent:e,value:t,operation:i,changedValue:s,label:r,index:n,item:o})=>{e(new CustomEvent("value-change",{detail:{value:t,operation:i,changedValue:s,label:r,index:n,item:o},bubbles:!0}))},xu=({dispatchEvent:e,value:t})=>{e(new CustomEvent("draft-value-change",{detail:{value:t},bubbles:!0}))},ze=({dispatchEvent:e,open:t})=>{e(new CustomEvent("open-change",{detail:{open:t},bubbles:!0}))},qi=({store:e,props:t,refs:i}={})=>{let s=Xr(i?.trigger);return s?(e.openOptionsPopover({position:s,values:Qr({store:e,props:t})}),!0):!1},Su=e=>{let{store:t,props:i,render:s,refs:r}=e,n=!1;i.selectedValues!==void 0&&(t.updateSelectedValues({values:i.selectedValues,syncDraft:i.draftSelectedValues===void 0,preserveDraft:Array.isArray(i.draftSelectedValues)}),n=!0),Array.isArray(i.draftSelectedValues)&&(t.updateDraftSelectedValues({values:i.draftSelectedValues}),n=!0),i.open===!0&&!i.disabled&&qi(e)&&(n=!0),n&&s()},Au=e=>{let{props:t,render:i,store:s,dispatchEvent:r}=e;if(t.disabled){t.open===!0&&ze({dispatchEvent:r,open:!1});return}t.open===!0&&!s.getState().isOpen&&qi(e)&&i()},ku=(e,t)=>{let{oldProps:i,newProps:s}=t,{store:r,render:n,refs:o}=e,l=!1;if(s?.disabled&&!i?.disabled){let p=r.getState().isOpen;r.closeOptionsPopover({}),p&&ze({dispatchEvent:e.dispatchEvent,open:!1}),l=!0}if(i.selectedValues!==s.selectedValues&&(r.updateSelectedValues({values:s.selectedValues,syncDraft:s.draftSelectedValues===void 0,preserveDraft:Array.isArray(s.draftSelectedValues)}),l=!0),i.draftSelectedValues!==s.draftSelectedValues&&(r.updateDraftSelectedValues({values:Array.isArray(s?.draftSelectedValues)?s.draftSelectedValues:Si({store:r,props:s})}),l=!0),i.open!==s.open&&s.open!==void 0&&(s.open?s.disabled?ze({dispatchEvent:e.dispatchEvent,open:!1}):qi({store:r,props:s,refs:o})&&(l=!0):(r.closeOptionsPopover({}),l=!0)),i.options!==s.options){let p=Si({store:r,props:s}).length>0;(r.getState().isOpen||p)&&(l=!0)}l&&n()},en=(e,t)=>{let{store:i,render:s,refs:r,props:n,dispatchEvent:o}=e;if(n.disabled)return;t._event.stopPropagation();let l=Xr(r.trigger);l&&(i.openOptionsPopover({position:l,values:Qr({store:i,props:n})}),ze({dispatchEvent:o,open:!0}),s())},Eu=(e,t)=>{let i=t._event;i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),en(e,t))},$u=e=>{let{store:t,render:i,dispatchEvent:s}=e;t.closeOptionsPopover({}),ze({dispatchEvent:s,open:!1}),i()},tn=(e,t)=>{let{render:i,props:s,store:r,dispatchEvent:n}=e;if(s.disabled)return;let o=t._event;o.stopPropagation();let l=o.currentTarget.id.slice(6),p=Number(l),a=s.options[p];!a||wu(a)!=="item"||(r.toggleDraftSelectedValue({value:a.value}),xu({dispatchEvent:n,value:r.selectDraftSelectedValues()}),i())},Cu=(e,t)=>{let i=t._event;i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),tn(e,t))},Ou=(e,t)=>{let{store:i,props:s,render:r,dispatchEvent:n}=e;if(s.disabled)return;t._event.stopPropagation();let o=i.selectDraftSelectedValues();i.commitDraftSelectedValues({}),s.onChange&&typeof s.onChange=="function"&&s.onChange(o),_u({dispatchEvent:n,value:o,operation:"set",changedValue:void 0,label:void 0,index:null,item:void 0}),ze({dispatchEvent:n,open:!1}),r()},Iu=(e,t)=>{let{props:i,dispatchEvent:s}=e;i.disabled||i.noAdd||(t._event.stopPropagation(),s(new CustomEvent("add-option-click",{bubbles:!0,composed:!0})))},Tu=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:Iu,handleAfterMount:Au,handleBeforeMount:Su,handleOnUpdate:ku,handleOptionClick:tn,handleOptionKeyDown:Cu,handlePopoverClose:$u,handleSubmitClick:Ou,handleTriggerClick:en,handleTriggerKeyDown:Eu},Symbol.toStringTag,{value:"Module"})),sn=e=>{if(!e||typeof e.getBoundingClientRect!="function")return null;let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.bottom+12),w:Math.max(Math.round(t.width),240)}},Tt=e=>Array.isArray(e)?[...e]:[],xt=e=>{typeof e.render=="function"&&e.render()},rn=e=>e.store?.selectHasSelectedValues?.()?e.store?.selectSelectedValues?.()||[]:Tt(e.props?.selectedValues),Yi=(e,t=[])=>{let i=sn(e.refs?.trigger);return!i||!e.store?.openOptionsPopover?!1:(e.store.openOptionsPopover({position:i,values:t}),!0)},nn=(e,t=[],i=!1)=>e.store?.getState?.()?.isOpen&&e.store?.updateDraftSelectedValues?(e.store.updateDraftSelectedValues({values:t}),!0):i?Yi(e,t):!1,Lu=function(e={}){let t=this.store?.getState?.(),i=Array.isArray(e.values)?Tt(e.values):this.store?.selectDraftSelectedValues?.()||[];if(t?.isOpen){let s=sn(this.refs?.trigger);s&&this.store.openOptionsPopover({position:s,values:i})}else e.keepOpen&&Yi(this,i.length>0?i:rn(this));xt(this)},Vu=function(e={}){let t=Tt(e.values);nn(this,t,!!e.keepOpen)&&xt(this)},Ru=function(e={}){if(!Object.prototype.hasOwnProperty.call(e||{},"value"))return;let t=this.store?.getState?.(),i=t?.isOpen?this.store?.selectDraftSelectedValues?.()||[]:rn(this);if(i.some(r=>le(r,e.value))){e.keepOpen&&!t?.isOpen&&Yi(this,i)&&xt(this);return}let s=[...Tt(i),e.value];nn(this,s,!!e.keepOpen)&&xt(this)},Nu=Object.freeze(Object.defineProperty({__proto__:null,appendDraftSelectedValue:Ru,refreshPopover:Lu,setDraftSelectedValues:Vu},Symbol.toStringTag,{value:"Module"})),Du=["id","class","style","slot","placeholder","options","open","selectedValues","draftSelectedValues","onChange","addOption","noAdd","disabled"],ju=(e={})=>Object.entries(e).filter(([t])=>!Du.includes(t)).map(([t,i])=>`${t}=${i}`).join(" "),Pu=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),on=(e={})=>e.type==="section"?"section":e.type==="separator"?"separator":"item",an=(e={})=>on(e)==="item",ln=(e={})=>typeof e.icon=="string"&&e.icon.length>0?e.icon:"",Bu=(e={})=>typeof e.shortcut=="string"&&e.shortcut.length>0?e.shortcut:typeof e.suffixText=="string"&&e.suffixText.length>0?e.suffixText:"",ye=e=>Array.isArray(e)?[...e]:[],zu=(e=[],t=[])=>e.length!==t.length?!1:e.every((i,s)=>le(i,t[s])),Wu=(e=[],t)=>e.some(i=>le(i,t)),pn=({state:e,props:t})=>e.hasSelectedValues?ye(e.selectedValues):ye(t.selectedValues),Mu=({state:e,props:t})=>e.isOpen?ye(e.draftSelectedValues):pn({state:e,props:t}),Fu=e=>e==null?"":String(e),Ku=(e=[],t)=>e.find(i=>an(i)&&le(i.value,t)),Ai=({isSelected:e=!0,isAddChip:t=!1}={})=>{let i=["--tag-border-radius: var(--border-radius-md)","--muted-foreground: var(--foreground)"];return(t||!e)&&i.push("--muted: color-mix(in srgb, var(--muted) 82%, var(--background) 18%)"),`${i.join("; ")};`},Uu=({option:e={},index:t,selectedValues:i=[],hasIconColumn:s=!1})=>{let r=on(e),n=r==="section",o=r==="separator",l=r==="item";if(n||o)return{...e,index:t,type:r,isSection:n,isSeparator:o,isItem:l};let p=Wu(i,e.value),a=ln(e),c=Bu(e),d=p?c||"Added":c;return{...e,index:t,type:r,isSection:n,isSeparator:o,isItem:l,isSelected:p,hasIconSlot:s,icon:a,hasIcon:a.length>0,cursor:"pointer",tagStyle:Ai({isSelected:p}),suffixText:d,hasSuffixText:d.length>0}},Hu=()=>Object.freeze({isOpen:!1,position:{x:0,y:0,w:240},selectedValues:[],draftSelectedValues:[],hasSelectedValues:!1}),qu=({state:e,props:t})=>{let i=ju(t),s=!!t.disabled,r=pn({state:e,props:t}),n=Mu({state:e,props:t}),o=(e.isOpen||r.length>0)&&Array.isArray(t.options)?t.options:[],l=o.some(f=>an(f)&&Pu(f,"icon")),p=o.map((f,h)=>Uu({option:f,index:h,selectedValues:n,hasIconColumn:l})),a=r.map((f,h)=>{let y=Ku(o,f),m=y?ln(y):"";return{value:f,selectionIndex:h,label:y?.label||Fu(f),icon:m,hasIcon:m.length>0,testId:`tag-select-tag-${h}`}}),c=p.some(f=>f.isItem),d=!zu(r,n),u=a.length>0?a.map(f=>({...f,tagStyle:Ai({isSelected:!0})})):[{value:void 0,selectionIndex:"",label:t.placeholder||"Add tag",icon:"",testId:"",tagStyle:Ai({isAddChip:!0})}];return{containerAttrString:i,isDisabled:s,isOpen:e.isOpen,position:e.position,options:p,hasSelectableOptions:c,placeholder:t.placeholder||"Add tag",triggerTags:u,triggerCursor:s?"not-allowed":"pointer",triggerTabIndex:s?-1:0,showAddOption:!s&&!t.noAdd,addOptionLabel:t.addOption?.label||"Add tag",hasDraftChanges:d,submitDisabled:s,submitLabel:"Save"}},Yu=({state:e})=>ye(e.selectedValues),Gu=({state:e})=>!!e.hasSelectedValues,Ju=({state:e})=>ye(e.draftSelectedValues),Zu=({state:e},t={})=>{let{position:i,values:s}=t;e.position={...e.position,...i||{}},e.draftSelectedValues=ye(s),e.isOpen=!0},Xu=({state:e})=>{e.isOpen=!1,e.draftSelectedValues=[]},Qu=({state:e},t={})=>{e.draftSelectedValues=ye(t.values)},eh=({state:e},t={})=>{let i=ye(t.values);e.selectedValues=i,e.hasSelectedValues=!0,(t.syncDraft||!e.isOpen)&&!t.preserveDraft&&(e.draftSelectedValues=[...i])},th=({state:e},t={})=>{let i=ye(e.draftSelectedValues),s=t.value,r=i.findIndex(n=>le(n,s));if(r>=0){e.draftSelectedValues=i.filter((n,o)=>o!==r);return}e.draftSelectedValues=[...i,s]},ih=({state:e})=>{e.selectedValues=ye(e.draftSelectedValues),e.hasSelectedValues=!0,e.isOpen=!1,e.draftSelectedValues=[]},sh=Object.freeze(Object.defineProperty({__proto__:null,closeOptionsPopover:Xu,commitDraftSelectedValues:ih,createInitialState:Hu,openOptionsPopover:Zu,selectDraftSelectedValues:Ju,selectHasSelectedValues:Gu,selectSelectedValues:Yu,selectViewData:qu,toggleDraftSelectedValue:th,updateDraftSelectedValues:Qu,updateSelectedValues:eh},Symbol.toStringTag,{value:"Module"})),rh=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),nh=()=>Object.freeze({}),Xs={sm:{textSize:"sm",padding:"md",maxWidth:"min(320px, calc(100vw - 16px))"},md:{textSize:"sm",padding:"md",maxWidth:"min(360px, calc(100vw - 16px))"},lg:{textSize:"md",padding:"lg",maxWidth:"min(420px, calc(100vw - 16px))"}},oh=({props:e})=>{let t=Xs[e.s]?e.s:"sm",i=Xs[t];return{open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||"",textSize:i.textSize,padding:i.padding,contentStyle:`padding: 0; min-width: 0; max-width: ${i.maxWidth};`}},ah=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:nh,selectViewData:oh},Symbol.toStringTag,{value:"Module"})),lh=async e=>{let{props:t,store:i,render:s,refs:r}=e,{waveformData:n}=t;i.setWaveformData({data:n}),s();let o=r.canvas;o&&dn(n,o)},ph=async(e,t)=>{let{store:i,render:s,refs:r,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}i.setWaveformData({data:o}),s();let l=r.canvas;l&&dn(o,l)};async function dn(e,t){let i=t.getContext("2d"),s=t.getBoundingClientRect(),r=s.width,n=s.height;t.width=r,t.height=n;let o=t.width,l=t.height;if(i.clearRect(0,0,o,l),i.fillStyle="#1a1a1a",i.fillRect(0,0,o,l),!e||!e.amplitudes)return;let p=e.amplitudes,a=l/2,c=i.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,o/p.length),u=.2;for(let f=0;f<p.length;f++){let h=p[f]/255*(l*.85),y=f*d,m=a-h/2;i.fillStyle=c,i.fillRect(y,m,Math.max(1,d*(1-u)),h)}i.strokeStyle="rgba(255, 255, 255, 0.1)",i.lineWidth=1,i.beginPath(),i.moveTo(0,a),i.lineTo(o,a),i.stroke(),i.shadowBlur=10,i.shadowColor="#2196F3"}var dh=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:lh,handleOnUpdate:ph},Symbol.toStringTag,{value:"Module"})),ch=()=>Object.freeze({waveformData:null}),uh=({state:e},t={})=>{e.waveformData=t.data},hh=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),fh=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:ch,selectViewData:hh,setWaveformData:uh},Symbol.toStringTag,{value:"Module"})),cn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),un=e=>e.replace(/-([a-z0-9])/g,(t,i)=>i.toUpperCase()),ki=e=>{if(e!=null)return e===""?!0:e},St=(e,t)=>{let i=e.getAttribute(t);if(i!==null)return ki(i);let s=cn(t);if(s!==t){let r=e.getAttribute(s);if(r!==null)return ki(r)}},hi=Symbol("rtglReactivePropValues"),fi=Symbol("rtglNativeHostStyle"),yh=(e,t)=>{let i=Object.getPrototypeOf(e);for(;i;){let s=Object.getOwnPropertyDescriptor(i,t);if(s)return s;i=Object.getPrototypeOf(i)}},hn=e=>{if(!e||typeof e!="object")return;if(Object.prototype.hasOwnProperty.call(e,fi))return e[fi];let t=yh(e,"style"),i;return typeof t?.get=="function"?i=t.get.call(e):e.style&&typeof e.style=="object"&&(i=e.style),i&&typeof i=="object"&&Object.defineProperty(e,fi,{value:i,enumerable:!1,configurable:!1,writable:!1}),i},mh=e=>(Object.prototype.hasOwnProperty.call(e,hi)||Object.defineProperty(e,hi,{value:Object.create(null),enumerable:!1,configurable:!1,writable:!1}),e[hi]),gh=({source:e,allowedKeys:t=[],onPropChange:i})=>{let s=mh(e);t.includes("style")&&hn(e),t.forEach(r=>{if(typeof r!="string"||r.length===0)return;let n=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,o=Object.prototype.hasOwnProperty.call(e,r);o&&delete e[r],Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return Object.prototype.hasOwnProperty.call(s,r)?s[r]:St(e,r)},set(l){let p=Object.prototype.hasOwnProperty.call(s,r)?s[r]:St(e,r);l===void 0?delete s[r]:s[r]=l,p!==l&&i?.({propName:r,oldValue:p,newValue:l})}}),o&&(s[r]=n)})},bh=(e,t)=>{let i=new Set(t);return new Proxy({},{get(s,r){if(typeof r=="string"&&i.has(r)){let n=e[r];return n!==void 0?n:St(e,r)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,r){return typeof r=="string"&&i.has(r)},ownKeys(){return[...i]},getOwnPropertyDescriptor(s,r){if(typeof r=="string"&&i.has(r))return{configurable:!0,enumerable:!0,get:()=>{let n=e[r];return n!==void 0?n:St(e,r)}}}})},vh=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let i=e.methods;if(!i||typeof i!="object"||Array.isArray(i))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(i,"type")&&i.type!=="object")throw new Error("methods.type must be 'object'.");if(!i.properties||typeof i.properties!="object"||Array.isArray(i.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let s of Object.keys(i.properties))if(!t.includes(s))throw new Error(`method '${s}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ei={NOT:0},E=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},se=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},Qs=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let i=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${i}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let i of t)if(e.trim().endsWith(i))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},wh=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,i]=e.split(" in ");if(!i||i.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let s=t.includes(",")?t.split(",").map(r=>r.trim()):[t.trim()];for(let r of s){if(!r)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},_h=(e,t,i=!1)=>{if(t===null)return new se(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new se(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return i?new se(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new se(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},xh=(e,t)=>{let i=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new se(`Unknown function '${e}' (${i})`)},fn=(e,t,i={})=>{let s={},r={};i&&typeof i=="object"&&(i.functions!==void 0||i.partials!==void 0?(s=i.functions||{},r=i.partials||{}):typeof i=="object"&&(s=i));let n=N(e,{functions:s,partials:r},t,{});return n===void 0?{}:n},N=(e,t,i,s)=>{if(t.functions,e.var&&!e.type)return H(e.var,i,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return H(e.path,i,s);if(e.type===v.INTERPOLATION)return Ah(e.parts,t,i,s);switch(e.type){case v.FUNCTION:return yn(e,t,i,s);case v.BINARY:return mn(e,t,i,s);case v.UNARY:return gn(e,t,i,s);case v.CONDITIONAL:return Eh(e,t,i,s);case v.LOOP:return Th(e,t,i,s);case v.OBJECT:return Vh(e,t,i,s);case v.ARRAY:return Rh(e,t,i,s);case v.PARTIAL:return Nh(e,t,i,s);case v.PATH_REFERENCE:return Dh(e,t,i,s);default:throw new Error(`Unknown node type: ${e.type}`)}},er=new Map,Sh=e=>{let t=[],i="",s=!1;for(let r=0;r<e.length;r++){let n=e[r];if(n==="[")i&&(t.push({type:"property",value:i}),i=""),s=!0;else if(n==="]"){if(s&&i){let o=i.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let l=o.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:o});i=""}s=!1}else i+=n}return i&&t.push({type:"property",value:i}),t},H=(e,t,i)=>{if(!e)return;if(e in i)return i[e];let s=er.get(e);if(!s){let n=[],o="",l=0;for(let p=0;p<e.length;p++){let a=e[p];a==="["?(l++,o+=a):a==="]"?(l--,o+=a):a==="."&&l===0?o&&(n.push(o),o=""):o+=a}o&&n.push(o),s=[];for(let p of n){let a=Sh(p.trim());s.push(...a)}er.set(e,s)}let r=t;for(let n=0;n<s.length;n++){let o=s[n];if(o.type==="property"&&o.value in i){r=i[o.value];continue}if(r==null)return;(o.type==="property"||o.type==="index")&&(r=r[o.value])}return r},Ah=(e,t,i,s)=>{let r=[];for(let n of e)if(typeof n=="string")r.push(n);else{let o=N(n,t,i,s);r.push(o!=null?String(o):"")}return r.join("")},yn=(e,t,i,s)=>{let r=t.functions||t,n=r[e.name];if(!n)throw xh(e.name,r);let o=e.args.map(l=>N(l,t,i,s));return n(...o)},We=(e,t,i,s)=>{if(e.var&&!e.type)return H(e.var,i,s);switch(e.type){case v.VARIABLE:return H(e.path,i,s);case v.LITERAL:return e.value;case v.BINARY:return mn(e,t,i,s);case v.UNARY:return gn(e,t,i,s);case v.FUNCTION:return yn(e,t,i,s);default:return N(e,t,i,s)}},mn=(e,t,i,s)=>{if(e.op===P.AND||e.op===P.OR){let o=We(e.left,t,i,s),l=We(e.right,t,i,s);switch(e.op){case P.AND:return o&&l;case P.OR:return o||l}}let r=N(e.left,t,i,s),n=N(e.right,t,i,s);switch(e.op){case P.EQ:return r==n;case P.NEQ:return r!=n;case P.GT:return r>n;case P.LT:return r<n;case P.GTE:return r>=n;case P.LTE:return r<=n;case P.IN:return Array.isArray(n)?n.includes(r):!1;case P.ADD:if(typeof r!="number"||typeof n!="number")throw new se(`Arithmetic operations require numbers. Got ${typeof r} + ${typeof n}`);return r+n;case P.SUBTRACT:if(typeof r!="number"||typeof n!="number")throw new se(`Arithmetic operations require numbers. Got ${typeof r} - ${typeof n}`);return r-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},gn=(e,t,i,s)=>{let r=e.op===Ei.NOT?We(e.operand,t,i,s):N(e.operand,t,i,s);switch(e.op){case Ei.NOT:return!r;default:throw new Error(`Unknown unary operator: ${e.op}`)}},kh=(e,t,i,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let r=e.conditions[0];if(r.type===v.VARIABLE)if(H(r.path,i,s)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,i,s):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=H(a.path,i,s);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=H(d.path,i,s);c.push(u!=null?String(u):"")}else{let u=N(d,t,i,s);c.push(u!=null?String(u):"")}o[p]=c.join("")}else o[p]=N(a,t,i,s)}return o}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let o={};for(let l of n.properties){let p=l.parsedKey?N(l.parsedKey,t,i,s):l.key,a=l.value;if(a.type===v.LITERAL)o[p]=a.value;else if(a.type===v.VARIABLE)o[p]=H(a.path,i,s);else if(a.type===v.INTERPOLATION){let c=[];for(let d of a.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let u=H(d.path,i,s);c.push(u!=null?String(u):"")}else{let u=N(d,t,i,s);c.push(u!=null?String(u):"")}o[p]=c.join("")}else o[p]=N(a,t,i,s)}return o}}}return null},Eh=(e,t,i,s)=>{let r=kh(e,t,i,s);if(r!==null)return r;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||We(o,t,i,s))return N(e.bodies[n],t,i,s)}return bn},$h=(e,t)=>{let i=e.body,s=e.itemVar;if(i.type===v.CONDITIONAL&&i.conditions.length===1&&i.conditions[0].type===v.VARIABLE){let r=i.conditions[0].path,n=i.bodies[0];if(r.startsWith(s+".")){let o=r.substring(s.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let a=t[p];if(a[o]){let c={};for(let d of n.properties){let u=d.key,f=d.value;if(f.type===v.LITERAL)c[u]=f.value;else if(f.type===v.VARIABLE){let h=f.path;if(h===s)c[u]=a;else if(h.startsWith(s+".")){let y=h.substring(s.length+1);c[u]=a[y]}else return null}else if(f.type===v.INTERPOLATION){let h=[],y=!0;for(let m of f.parts)if(typeof m=="string")h.push(m);else if(m.type===v.VARIABLE){let b=m.path;if(b===s)h.push(a!=null?String(a):"");else if(b.startsWith(s+".")){let g=b.substring(s.length+1),_=a[g];h.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[u]=h.join("")}else return null}l.push(c)}}return l}}}return null},Ch=(e,t)=>{let i=e.body,s=e.itemVar,r=$h(e,t);if(r!==null)return r;if(i.type===v.OBJECT&&i.properties.length<=5&&!i.whenCondition){for(let l of i.properties)if(l.parsedKey)return null;let n=[],o=!0;for(let l of i.properties){let p=l.key,a=l.value;if(a.type===v.LITERAL)n.push({key:p,type:"literal",value:a.value});else if(a.type===v.VARIABLE){let c=a.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let d=c.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop",prop:d});else{o=!1;break}}else{o=!1;break}}else if(a.type===v.INTERPOLATION&&a.parts.length===1){let c=a.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===s)n.push({key:p,type:"item_string"});else if(d.startsWith(s+".")){let u=d.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop_string",prop:u});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let a=t[p];l[p]={id:a.id,title:a.title!=null?String(a.title):"",completed:a.completed}}else for(let p=0;p<t.length;p++){let a=t[p],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=a;else if(d.type==="prop")c[d.key]=a[d.prop];else if(d.type==="item_string")c[d.key]=a!=null?String(a):"";else if(d.type==="prop_string"){let u=a[d.prop];c[d.key]=u!=null?String(u):""}l[p]=c}return l}}return null},Oh=(e,t,i,s,r)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let a=0;a<r.length;a++){let c=r[a],d={},u={...s,[l]:c,...p&&{[p]:a}};u.__paths__||(u.__paths__=s.__paths__||{});let f=e.iterable.path||"";if(s&&s.__paths__&&f){let h=f.split("."),y=h[0];y in s.__paths__&&(f=s.__paths__[y],h.length>1&&(f+="."+h.slice(1).join(".")))}u.__paths__={...u.__paths__,[l]:`${f}[${a}]`,...p&&{[p]:a}};for(let h of o.properties){let y=h.parsedKey?N(h.parsedKey,t,i,u):h.key,m=h.value;if(m.type===v.LITERAL)d[y]=m.value;else if(m.type===v.VARIABLE){let b=m.path;if(b===l)d[y]=c;else if(b===p)d[y]=a;else if(b.startsWith(l+".")){let g=b.substring(l.length+1);!g.includes(".")&&!g.includes("[")?d[y]=c[g]:d[y]=H(b,i,{...s,[l]:c,...p&&{[p]:a}})}else d[y]=H(b,i,{...s,[l]:c,...p&&{[p]:a}})}else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=g.path,S;if(_===l)S=c;else if(_===p)S=a;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?S=c[A]:S=H(_,i,{...s,[l]:c,...p&&{[p]:a}})}else S=H(_,i,{...s,[l]:c,...p&&{[p]:a}});b.push(S!=null?String(S):"")}else{let _={...s,[l]:c,...p&&{[p]:a}},S=N(g,t,i,_);b.push(S!=null?String(S):"")}d[y]=b.join("")}else{let b={...s,[l]:c,...p&&{[p]:a}};d[y]=N(m,t,i,b)}}n.push(d)}return n}return null},Ih=(e,t,i)=>{let s=e.body;if(s.type===v.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let r=s.properties[0].value;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE&&r.conditions[0].path==="item.visible"){let n=r.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let o=n.properties[0],l=n.properties[1];if(o.key==="id"&&o.value.type===v.VARIABLE&&o.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];for(let a=0;a<t.length;a++){let c=t[a];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),p.push(d)}}return p}}}}return null},Th=(e,t,i,s)=>{let r=N(e.iterable,t,i,s);if(!Array.isArray(r)){let a,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let u=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");a=`${e.iterable.name}(${u})`}else a=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${a}`;throw _h(d,r,c)}if(!e.indexVar){let a=Ih(e,r,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Ch(e,r);if(a!==null)return a}let n=Oh(e,t,i,s,r);if(n!==null)return n;let o=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let a=l.split("."),c=a[0];c in s.__paths__&&(l=s.__paths__[c],a.length>1&&(l+="."+a.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(a=>a.type===v.OBJECT&&a.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let a=0;a<r.length;a++){let c=e.indexVar?{...s,[e.itemVar]:r[a],[e.indexVar]:a}:{...s,[e.itemVar]:r[a]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${a}]`},e.indexVar&&(c.__paths__[e.indexVar]=a);let d=N(e.body,t,i,c);if(Array.isArray(d)&&d.length===1&&!p){let u=d[0];o.push(u===void 0?{}:u)}else o.push(d===void 0?{}:d)}return o},Lh=(e,t,i,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let r=e.properties[0],n=r.parsedKey?N(r.parsedKey,t,i,s):r.key,o=r.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let l={},p={},a=!0;for(let c of o.properties){let d=c.parsedKey?N(c.parsedKey,t,i,s):c.key,u=c.value;if(u.type===v.LITERAL)p[d]=u.value;else if(u.type===v.VARIABLE)p[d]=H(u.path,i,s);else if(u.type===v.INTERPOLATION){let f=[];for(let h of u.parts)if(typeof h=="string")f.push(h);else if(h.type===v.VARIABLE){let y=H(h.path,i,s);f.push(y!=null?String(y):"")}else{a=!1;break}if(!a)break;p[d]=f.join("")}else if(u.type===v.OBJECT&&u.properties.length<=5){let f={};for(let h of u.properties){let y=h.key,m=h.value;if(m.type===v.LITERAL)f[y]=m.value;else if(m.type===v.VARIABLE)f[y]=H(m.path,i,s);else if(m.type===v.INTERPOLATION){let b=[];for(let g of m.parts)if(typeof g=="string")b.push(g);else if(g.type===v.VARIABLE){let _=H(g.path,i,s);b.push(_!=null?String(_):"")}else{a=!1;break}if(!a)break;f[y]=b.join("")}else{a=!1;break}}if(!a)break;p[d]=f}else{a=!1;break}}if(a)return l[n]=p,l}}return null},Vh=(e,t,i,s)=>{let r=t.functions||t;if(e.whenCondition&&!We(e.whenCondition,r,i,s))return;let n=Lh(e,t,i,s);if(n!==null)return n;if(e.fast){let p={};for(let a of e.properties){let c=a.parsedKey?N(a.parsedKey,t,i,s):a.key,d=a.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=H(d.path,i,s);else if(d.type===v.INTERPOLATION){let u=[];for(let f of d.parts)if(typeof f=="string")u.push(f);else if(f.type===v.VARIABLE){let h=H(f.path,i,s);u.push(h!=null?String(h):"")}else{let h=N(f,t,i,s);u.push(h!=null?String(h):"")}p[c]=u.join("")}else p[c]=N(d,t,i,s)}return p}let o={},l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let a=N(p.value,t,i,s);if(!l&&a!==null&&a!==void 0)return Array.isArray(a)&&a.length===1?a[0]:a;typeof a=="object"&&a!==null&&!Array.isArray(a)&&Object.assign(o,a)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return N(p.value,t,i,s)}else{let a=p.value;if(a&&a.type===v.OBJECT&&a.properties){let c=a.properties.find(d=>d.key.startsWith("$for "));if(c){let d=N(c.value,t,i,s);d!==void 0&&(o[p.key]=d)}else{let d=N(p.value,t,i,s);d!==void 0&&(o[p.key]=d)}}else{let c=p.parsedKey?N(p.parsedKey,t,i,s):p.key,d=N(p.value,t,i,s);d!==void 0&&(o[c]=d)}}return o},bn={},Rh=(e,t,i,s)=>{let r=[];for(let n of e.items)if(n.type===v.LOOP){let o=N(n,t,i,s);Array.isArray(o)&&n.flatten!==!1?r.push(...o):r.push(o)}else{let o=N(n,t,i,s);o!==bn&&o!==void 0&&r.push(o)}return r},Nh=(e,t,i,s)=>{let{name:r,data:n,whenCondition:o}=e,l=t.partials||{},p=t.functions||t;if(o&&!We(o,p,i,s))return;if(!l[r])throw new se(`Partial '${r}' is not defined`);let a=s._partialStack||[];if(a.includes(r))throw new se(`Circular partial reference detected: ${r}`);let c=l[r],d=i,u={...s,_partialStack:[...a,r]};if(s){d={...i};for(let f of Object.keys(s))f.startsWith("_")||(d[f]=s[f])}if(n){let f=N(n,t,i,s);d={...d,...f}}return N(c,t,d,u)},Dh=(e,t,i,s)=>{let{path:r}=e,n=r.split("."),o=n[0],l=n.slice(1);if(!s||!(o in s))throw new se(`Path reference '#{${r}}' refers to '${o}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(o in s.__paths__))throw new se(`Path reference '#{${r}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[o];if(typeof p=="number"){if(l.length>0)throw new se(`Path reference '#{${r}}' - cannot access properties on index variable '${o}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},jh=/\$\{([^}]*)\}/g,Ph=/#\{([^}]*)\}/g,vn=(e,t={})=>{let i=e.match(/^(\w+)\((.*)\)$/);if(!i)return{isFunction:!1};let[,s,r]=i,n=Bh(r,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:n}},Bh=(e,t={})=>e.trim()?zh(e).map(i=>Wh(i.trim(),t)):[],zh=e=>{let t=[],i="",s=0,r=!1,n="";for(let o=0;o<e.length;o++){let l=e[o],p=o>0?e[o-1]:"";!r&&(l==='"'||l==="'")?(r=!0,n=l,i+=l):r&&l===n&&p!=="\\"?(r=!1,n="",i+=l):!r&&l==="("?(s++,i+=l):!r&&l===")"?(s--,i+=l):!r&&l===","&&s===0?(t.push(i),i=""):i+=l}return i&&t.push(i),t},Wh=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let i=vn(e,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};let s=e.trim(),r=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:o,type:l}of r){let p=0;for(;p<s.length;){let a=Ne(s.substring(p),o);if(a===-1)break;let c=p+a;c>n&&(n=c),p=c+o.length}}if(n!==-1)try{return Q(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},wn=/^\w+\(.*\)$/,Mh=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Fh=e=>{if(!(!e||e.trim()===""||wn.test(e))&&Mh.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},tr=e=>{let t=e.trim();if(wn.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},At=(e,t={})=>{let i=e.trim();Fh(i);let s=vn(i,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(i.includes("[")&&!/[\s+\-*/%|&?:]/.test(i)){let r=0;for(let n of i)n==="["?r++:n==="]"&&r--;if(r!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:i}},_n=(e,t={})=>{let i=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(i=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),i=i.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),i=i.replace(/\\(\$\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${s.length}__`;return s.push(c),d}),i=i.replace(/\\(#\{[^}]*\})/g,(a,c)=>{let d=`__ESCAPED_${s.length}__`;return s.push(c),d}),i=i.replace(/\\DOUBLE_ESC_VAR/g,"\\"),i=i.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let r=[...i.matchAll(jh)],n=[...i.matchAll(Ph)],o=[...r.map(a=>({match:a,type:"variable"})),...n.map(a=>({match:a,type:"pathref"}))].sort((a,c)=>a.match.index-c.match.index);if(o.length===0){let a=i;for(let c=0;c<s.length;c++)a=a.replace(`__ESCAPED_${c}__`,s[c]);return{type:v.LITERAL,value:a}}if(o.length===1&&o[0].match[0]===i&&s.length===0){let{match:a,type:c}=o[0];try{return c==="variable"?At(a[1],t):tr(a[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:i};throw d}}let l=[],p=0;for(let{match:a,type:c}of o){let[d,u]=a,f=a.index;if(f>p){let h=i.substring(p,f);for(let y=0;y<s.length;y++)h=h.replace(`__ESCAPED_${y}__`,s[y]);h&&l.push(h)}try{let h;c==="variable"?h=At(u.trim(),t):h=tr(u.trim()),l.push(h)}catch(h){if(h.message==="Invalid array index syntax")l.push(d);else throw h}p=f+d.length}if(p<i.length){let a=i.substring(p);for(let c=0;c<s.length;c++)a=a.replace(`__ESCAPED_${c}__`,s[c]);a&&l.push(a)}return{type:v.INTERPOLATION,parts:l}},Ce=(e,t)=>typeof e=="string"?_n(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Uh(e,t):Hh(e,t):{type:v.LITERAL,value:e},Kh=e=>{let{$each:t,...i}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let s=t.trim();if(s==="")throw new E("$each value must be a non-empty string");if(Object.keys(i).length===0)throw new E("Empty $each body not allowed");if(i.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${s}`]:i}},Uh=(e,t)=>{let i=[],s=!1;for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Kh(n),a=Object.keys(p);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let c=ir(a[0],p[a[0]],t,!0);i.push(c),s=!0;continue}}catch(p){throw p instanceof E?p:new E(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=ir(l[0],n[l[0]],t);i.push(p),s=!0;continue}}let o=Ce(n,t);i.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(s=!0)}return{type:v.ARRAY,items:i,fast:!s}},Hh=(e,t)=>{let i=[],s=!1,r=null,n=Object.entries(e),o=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],a=[];for(let[b]of n)for(let g of p)if(b===g||b.startsWith(g+" ")||b.startsWith(g+"#")){a.push(g);break}if(a.length>0)throw new E(`Cannot use $partial with ${a.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...u}=e,f={},h=!1;for(let[b,g]of Object.entries(u)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=g,h=!0}let y=null;if(h&&(y=Ce(f,t),y.type===v.OBJECT)){let b=!1;for(let g of y.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){b=!0;break}b&&(y.fast=!1)}let m={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=Q(d,t)}else b={type:v.LITERAL,value:d};m.whenCondition=b}return m}for(let[p,a]of n)if(p==="$when"){if(r!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(a==null)throw new E("Missing condition expression after '$when'");let c=typeof a=="string"?a:JSON.stringify(a);if(c.trim()==="")throw new E("Empty condition expression after '$when'");r=Q(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[p,a]=n[o];if(p==="$when"){o++;continue}if(p==="$each")throw new E("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let c=qh(n,o,t);i.push({key:p,value:c.node}),s=!0,o=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new E(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new E("Missing condition expression after '$if'");{let c=Ce(a,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(s=!0);let d=_n(p,t),u={key:p,value:c};(d.type!==v.LITERAL||d.value!==p)&&(u.parsedKey=d),i.push(u),o++}}}let l={type:v.OBJECT,properties:i,fast:!s};return r&&(l.whenCondition=r),l},qh=(e,t,i={})=>{let s=[],r=[],n=t,[o,l]=e[n],p=null,a;if(o.startsWith("$if#")){let d=o.match(/^\$if#(\w+)\s+(.+)$/);if(d)p=d[1],a=d[2];else throw new E(`Invalid conditional syntax: ${o}`)}else a=o.substring(4),a.endsWith(":")&&(a=a.slice(0,-1).trim());Qs(a);let c=Q(a,i);for(s.push(c),r.push(Ce(l,i)),n++;n<e.length;){let[d,u]=e[n],f=!1,h;if(p?d.startsWith(`$elif#${p} `)?(h=d.substring(`$elif#${p} `.length),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d===`$else#${p}`||d===`$else#${p}:`)&&(f=!0,h=null):d.startsWith("$elif ")?(h=d.substring(6),h.endsWith(":")&&(h=h.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,h=null),f){if(h===null)s.push(null);else{Qs(h);let y=Q(h,i);s.push(y)}if(r.push(Ce(u,i)),n++,h===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:r,id:p},nextIndex:n}},Q=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let a=e.slice(1,-1),c=0,d=!0;for(let u=0;u<a.length;u++)if(a[u]==="("?c++:a[u]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Q(a,t)}let i=Ne(e,"||");if(i!==-1)return{type:v.BINARY,op:P.OR,left:Q(e.substring(0,i).trim(),t),right:Q(e.substring(i+2).trim(),t)};let s=Ne(e,"&&");if(s!==-1)return{type:v.BINARY,op:P.AND,left:Q(e.substring(0,s).trim(),t),right:Q(e.substring(s+2).trim(),t)};let r=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:a,type:c}of r){let d=Ne(e,a);if(d!==-1)return{type:v.BINARY,op:c,left:Q(e.substring(0,d).trim(),t),right:Q(e.substring(d+a.length).trim(),t)}}let n=-1,o=null,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:a,type:c}of l){let d=0;for(;d<e.length;){let u=Ne(e.substring(d),a);if(u===-1)break;let f=d+u;f>n&&(n=f,o={op:a,type:c}),d=f+a.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:Q(e.substring(0,n).trim(),t),right:Q(e.substring(n+o.op.length).trim(),t)};let p=[" * "," / "," % "];for(let a of p)if(Ne(e,a)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${a}"`);return e.startsWith("!")?{type:v.UNARY,op:Ei.NOT,operand:Q(e.substring(1).trim(),t)}:xn(e,t)},Ne=(e,t)=>{let i=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")i++;else if(e[s]===")")i--;else if(i===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Yh=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},xn=(e,t)=>{let i=e.trim();if(i.match(/^(\w+)\((.*)\)$/))return At(i,t);let s=Yh(i);if(s.type===v.LITERAL)return s;if(/^[a-zA-Z_$][\w.$]*$/.test(i))return{type:v.VARIABLE,path:i};try{return At(i,t)}catch(r){if(r.message&&r.message.includes("not supported"))return s;throw r}},Gh=(e,t=!1)=>{try{wh(e)}catch(i){if(i instanceof E&&t){let s=i.message.replace(/\$for/g,"$each");throw new E(s.replace("Parse Error: ",""))}throw i}},ir=(e,t,i,s=!1)=>{let r=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(r);if(!n){let m=s?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",m)}')`)}let o=n[1],l=n[2].trim();Gh(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let m=s?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${m} ${l}')`)}let a=p[1].trim(),c=p[2].trim(),d,u=null;if(a.includes(",")){let m=a.split(",").map(b=>b.trim());if(m.length!==2)throw new E(`Invalid loop variables: ${a}. Expected format: "item" or "item, index"`);d=m[0],u=m[1]}else d=a;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(u&&f.includes(u))throw new E(`Reserved variable name: ${u}`);let h=xn(c,i),y=Ce(t,i);return{type:v.LOOP,itemVar:d,indexVar:u,iterable:h,body:y,flatten:o!=="nested"}},$i=(e,t={})=>{let{functions:i={}}=t;return Ce(e,i)},Jh=()=>Date.now(),Zh=Object.freeze(Object.defineProperty({__proto__:null,now:Jh},Symbol.toStringTag,{value:"Module"})),Sn=(e,t,i={})=>{let{functions:s={},partials:r={}}=i,n={...Zh,...s},o=$i(e,{functions:n}),l={};for(let[p,a]of Object.entries(r))l[p]=$i(a,{functions:n});return fn(o,t,{functions:n,partials:l})},st=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Xh=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([i,s])=>{if(i==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof s=="function"){if(i in e)throw new Error(`[Methods] Cannot define method '${i}' because it already exists on the component instance.`);Object.defineProperty(e,i,{configurable:!0,enumerable:!1,writable:!1,value:(r={})=>{let n=r===void 0?{}:r;if(!st(n))throw new Error(`[Methods] Method '${i}' expects payload to be an object.`);return s.call(e,n)}})}})},An=Symbol.for("immer-nothing"),sr=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Me=Object.getPrototypeOf;function Fe(e){return!!e&&!!e[oe]}function Oe(e){return e?kn(e)||Array.isArray(e)||!!e[sr]||!!e.constructor?.[sr]||Vt(e)||Rt(e):!1}var Qh=Object.prototype.constructor.toString();function kn(e){if(!e||typeof e!="object")return!1;let t=Me(e);if(t===null)return!0;let i=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return i===Object?!0:typeof i=="function"&&Function.toString.call(i)===Qh}function kt(e,t){Lt(e)===0?Reflect.ownKeys(e).forEach(i=>{t(i,e[i],e)}):e.forEach((i,s)=>t(s,i,e))}function Lt(e){let t=e[oe];return t?t.type_:Array.isArray(e)?1:Vt(e)?2:Rt(e)?3:0}function Ci(e,t){return Lt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function En(e,t,i){let s=Lt(e);s===2?e.set(t,i):s===3?e.add(i):e[t]=i}function ef(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vt(e){return e instanceof Map}function Rt(e){return e instanceof Set}function ke(e){return e.copy_||e.base_}function Oi(e,t){if(Vt(e))return new Map(e);if(Rt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let i=kn(e);if(t===!0||t==="class_only"&&!i){let s=Object.getOwnPropertyDescriptors(e);delete s[oe];let r=Reflect.ownKeys(s);for(let n=0;n<r.length;n++){let o=r[n],l=s[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Me(e),s)}else{let s=Me(e);if(s!==null&&i)return{...e};let r=Object.create(s);return Object.assign(r,e)}}function Gi(e,t=!1){return Nt(e)||Fe(e)||!Oe(e)||(Lt(e)>1&&(e.set=e.add=e.clear=e.delete=tf),Object.freeze(e),t&&Object.entries(e).forEach(([i,s])=>Gi(s,!0))),e}function tf(){ce(2)}function Nt(e){return Object.isFrozen(e)}var sf={};function Ie(e){let t=sf[e];return t||ce(0,e),t}var rt;function $n(){return rt}function rf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rr(e,t){t&&(Ie("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ii(e){Ti(e),e.drafts_.forEach(nf),e.drafts_=null}function Ti(e){e===rt&&(rt=e.parent_)}function nr(e){return rt=rf(rt,e)}function nf(e){let t=e[oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function or(e,t){t.unfinalizedDrafts_=t.drafts_.length;let i=t.drafts_[0];return e!==void 0&&e!==i?(i[oe].modified_&&(Ii(t),ce(4)),Oe(e)&&(e=Et(t,e),t.parent_||$t(t,e)),t.patches_&&Ie("Patches").generateReplacementPatches_(i[oe].base_,e,t.patches_,t.inversePatches_)):e=Et(t,i,[]),Ii(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==An?e:void 0}function Et(e,t,i){if(Nt(t))return t;let s=t[oe];if(!s)return kt(t,(r,n)=>ar(e,s,t,r,n,i)),t;if(s.scope_!==e)return t;if(!s.modified_)return $t(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let r=s.copy_,n=r,o=!1;s.type_===3&&(n=new Set(r),r.clear(),o=!0),kt(n,(l,p)=>ar(e,s,r,l,p,i,o)),$t(e,r,!1),i&&e.patches_&&Ie("Patches").generatePatches_(s,i,e.patches_,e.inversePatches_)}return s.copy_}function ar(e,t,i,s,r,n,o){if(Fe(r)){let l=n&&t&&t.type_!==3&&!Ci(t.assigned_,s)?n.concat(s):void 0,p=Et(e,r,l);if(En(i,s,p),Fe(p))e.canAutoFreeze_=!1;else return}else o&&i.add(r);if(Oe(r)&&!Nt(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Et(e,r),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(i,s)&&$t(e,r)}}function $t(e,t,i=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Gi(t,i)}function of(e,t){let i=Array.isArray(e),s={type_:i?1:0,scope_:t?t.scope_:$n(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},r=s,n=Ji;i&&(r=[s],n=nt);let{revoke:o,proxy:l}=Proxy.revocable(r,n);return s.draft_=l,s.revoke_=o,l}var Ji={get(e,t){if(t===oe)return e;let i=ke(e);if(!Ci(i,t))return af(e,i,t);let s=i[t];return e.finalized_||!Oe(s)?s:s===yi(e.base_,t)?(mi(e),e.copy_[t]=Vi(s,e)):s},has(e,t){return t in ke(e)},ownKeys(e){return Reflect.ownKeys(ke(e))},set(e,t,i){let s=Cn(ke(e),t);if(s?.set)return s.set.call(e.draft_,i),!0;if(!e.modified_){let r=yi(ke(e),t),n=r?.[oe];if(n&&n.base_===i)return e.copy_[t]=i,e.assigned_[t]=!1,!0;if(ef(i,r)&&(i!==void 0||Ci(e.base_,t)))return!0;mi(e),Li(e)}return e.copy_[t]===i&&(i!==void 0||t in e.copy_)||Number.isNaN(i)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=i,e.assigned_[t]=!0),!0},deleteProperty(e,t){return yi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,mi(e),Li(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let i=ke(e),s=Reflect.getOwnPropertyDescriptor(i,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:i[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return Me(e.base_)},setPrototypeOf(){ce(12)}},nt={};kt(Ji,(e,t)=>{nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nt.deleteProperty=function(e,t){return nt.set.call(this,e,t,void 0)};nt.set=function(e,t,i){return Ji.set.call(this,e[0],t,i,e[0])};function yi(e,t){let i=e[oe];return(i?ke(i):e)[t]}function af(e,t,i){let s=Cn(t,i);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function Cn(e,t){if(!(t in e))return;let i=Me(e);for(;i;){let s=Object.getOwnPropertyDescriptor(i,t);if(s)return s;i=Me(i)}}function Li(e){e.modified_||(e.modified_=!0,e.parent_&&Li(e.parent_))}function mi(e){e.copy_||(e.copy_=Oi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var lf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,i,s)=>{if(typeof t=="function"&&typeof i!="function"){let n=i;i=t;let o=this;return function(l=n,...p){return o.produce(l,a=>i.call(this,a,...p))}}typeof i!="function"&&ce(6),s!==void 0&&typeof s!="function"&&ce(7);let r;if(Oe(t)){let n=nr(this),o=Vi(t,void 0),l=!0;try{r=i(o),l=!1}finally{l?Ii(n):Ti(n)}return rr(n,s),or(r,n)}else if(!t||typeof t!="object"){if(r=i(t),r===void 0&&(r=t),r===An&&(r=void 0),this.autoFreeze_&&Gi(r,!0),s){let n=[],o=[];Ie("Patches").generateReplacementPatches_(t,r,n,o),s(n,o)}return r}else ce(1,t)},this.produceWithPatches=(t,i)=>{if(typeof t=="function")return(n,...o)=>this.produceWithPatches(n,l=>t(l,...o));let s,r;return[this.produce(t,i,(n,o)=>{s=n,r=o}),s,r]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Oe(e)||ce(8),Fe(e)&&(e=pf(e));let t=nr(this),i=Vi(e,void 0);return i[oe].isManual_=!0,Ti(t),i}finishDraft(e,t){let i=e&&e[oe];(!i||!i.isManual_)&&ce(9);let{scope_:s}=i;return rr(s,t),or(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let i;for(i=t.length-1;i>=0;i--){let r=t[i];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}i>-1&&(t=t.slice(i+1));let s=Ie("Patches").applyPatches_;return Fe(e)?s(e,t):this.produce(e,r=>s(r,t))}};function Vi(e,t){let i=Vt(e)?Ie("MapSet").proxyMap_(e,t):Rt(e)?Ie("MapSet").proxySet_(e,t):of(e,t);return(t?t.scope_:$n()).drafts_.push(i),i}function pf(e){return Fe(e)||ce(10,e),On(e)}function On(e){if(!Oe(e)||Nt(e))return e;let t=e[oe],i;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,i=Oi(e,t.scope_.immer_.useStrictShallowCopy_)}else i=Oi(e,!0);return kt(i,(s,r)=>{En(i,s,On(r))}),t&&(t.finalized_=!1),i}var ae=new lf,df=ae.produce;ae.produceWithPatches.bind(ae);ae.setAutoFreeze.bind(ae);ae.setUseStrictShallowCopy.bind(ae);ae.applyPatches.bind(ae);ae.createDraft.bind(ae);ae.finishDraft.bind(ae);var cf=(e,t,i,s={})=>{let{createInitialState:r,...n}=e,o={},l={},p={},a=c=>({state:c,props:t,constants:i,i18n:s.getI18n?.()||{},locale:s.locale});return r&&(p=r({props:t,constants:i})),Object.entries(n).forEach(([c,d])=>{if(c.startsWith("select")){o[c]=(...u)=>d(a(p),...u);return}l[c]=(u={})=>{let f=u===void 0?{}:u;if(!st(f))throw new Error(`[Store] Action '${c}' expects payload to be an object.`);return p=df(p,h=>d(a(h),f)),p}}),{getState:()=>p,...l,...o}},In=e=>!st(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{In(t)}),Object.freeze(e)),uf=({setupConstants:e,fileConstants:t})=>{let i=st(e)?e:{},s=st(t)?t:{};return In({...i,...s})},hf=(e,t)=>{if(!t||typeof t!="object")return"";let i="",s=n=>Object.entries(n).map(([o,l])=>` ${o}: ${l};`).join(`
|
|
1613
|
+
`),r=(n,o)=>{if(typeof o!="object"||o===null)return"";if(n.startsWith("@")){let p=Object.entries(o).map(([a,c])=>{let d=s(c);return` ${a} {
|
|
1510
1614
|
${d.split(`
|
|
1511
|
-
`).map(
|
|
1615
|
+
`).map(u=>u?` ${u}`:"").join(`
|
|
1512
1616
|
`)}
|
|
1513
1617
|
}`}).join(`
|
|
1514
1618
|
`);return`${n} {
|
|
1515
1619
|
${p}
|
|
1516
|
-
}`}let l=
|
|
1620
|
+
}`}let l=s(o);return`${n} {
|
|
1517
1621
|
${l}
|
|
1518
|
-
}`};return Object.entries(t).forEach(([n,o])=>{let l=
|
|
1622
|
+
}`};return Object.entries(t).forEach(([n,o])=>{let l=r(n,o);l&&(i+=(i?`
|
|
1519
1623
|
|
|
1520
|
-
`:"")+l)}),s},Os=e=>Array.isArray(e)?e.reduce((t,s)=>{if(Array.isArray(s))t.push(...Os(s));else{if(s&&typeof s=="object"){let r=Object.entries(s);if(r.length>0){let[i,n]=r[0];Array.isArray(n)&&(s={[i]:Os(n)})}}t.push(s)}return t},[]):e,hs=":",qh=new Set(["__proto__","constructor","prototype"]),Yh=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,si=e=>Yh.test(e),ri=(e,t)=>{if(!t)return e;let s=[],r="",i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!i&&o===".")r&&(s.push(r),r="");else if(!i&&o==="[")r&&(s.push(r),r=""),i=!0;else if(i&&o==="]"){if(r){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))s.push(r.slice(1,-1));else{let l=Number(r);s.push(Number.isNaN(l)?r:l)}r=""}i=!1}else r+=o}return r&&s.push(r),s.reduce((n,o)=>{if(n==null)return;let l=typeof o=="number"?o:String(o);if(!(typeof l=="string"&&qh.has(l)))return n[l]},e)},Gh=e=>e.replace(/-([a-z0-9])/g,(t,s)=>s.toUpperCase()),Jh=({attrsString:e="",viewData:t={},tagName:s,isWebComponent:r})=>{let i={},n={},o=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,S)=>{let A=Gh(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${s}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${s}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},p=(g,_)=>{if(!si(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${s}'.`)};if(!e)return{attrs:i,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(hs)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=ri(t,k);C!==void 0&&(A=C)}l(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);p(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=ri(t,A),k&&(i[S]=""),r&&S!=="id"&&l(S,!!k,"boolean attribute-form");continue}p(g,"binding"),i[g]=_,r&&g!=="id"&&l(g,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(g=>{h=h.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(h))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(hs)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),o(_),i[_]="",r&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!si(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${s}'.`);!d.has(g)&&!g.startsWith(hs)&&!g.includes("=")&&(i[g]="",r&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}},Ts=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,Zh=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,xn=/^\$\{([^{}]+)\}$/,Xh=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,ii=new WeakSet,qs=(e,t,s)=>{let r=new Set(e);return t&&r.add(t),s&&r.add(s),r},Qh=(e,t)=>{if(typeof e!="string")return t;let s=e.match(Zh);return s?qs(t,s[1],s[2]):t},Sn=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ts.lastIndex=0;let t;for(;(t=Ts.exec(e))!==null;){let s=t[1];if(s.startsWith("."))return{bindingName:s,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!s.startsWith(":"))continue;let r=t[2]!==void 0||t[3]!==void 0,i=t[2]??t[3]??t[4]??"";if(r||!xn.test(i))return{bindingName:s,rawValue:i,key:e}}return null},Ls=(e,t=new Set)=>{if(Array.isArray(e)){for(let s of e){let r=Ls(s,t);if(r)return r}return null}if(!e||typeof e!="object")return null;for(let[s,r]of Object.entries(e)){let i=Sn(s);if(i)return i;let n=Qh(s,t),o=Ls(r,n);if(o)return o}return null},Ne=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let s of e){let r=Ne(s,t);if(r)return r}return null}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);return Ne(e.body,s)}if(e.type===v.ARRAY&&Array.isArray(e.items))return Ne(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let s of e.properties){let r=Sn(s.key);if(r)return r;let i=Ne(s.value,t);if(i)return i}return null}for(let s of Object.values(e)){let r=Ne(s,t);if(r)return r}return null},ef=e=>Ss([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,tf=e=>{let t=e.match(xn);return t?t[1].trim():null},sf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},rf=(e,t)=>{let s=!1,r=e.replace(Ts,(i,n,o,l,p)=>{if(!n.startsWith(":"))return i;let a=o??l??p??"",c=tf(a);if(!c||!Xh.test(c))return i;let d=sf(c);if(!d)return i;let h=t.has(d)?`#{${c}}`:c;return h===a?i:(s=!0,`${n}=${h}`)});return s?r:e},Re=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(s=>Re(s,t));return}if(e.type===v.LOOP){let s=qs(t,e.itemVar,e.indexVar);Re(e.body,s);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(s=>Re(s,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(s=>{let r=rf(s.key,t);if(r!==s.key){s.key=r;let i=ef(r);i?s.parsedKey=i:delete s.parsedKey}Re(s.value,t)});return}Object.values(e).forEach(s=>{Re(s,t)})}},nf=e=>e?e.type&&typeof e.type=="number"?Ne(e):Ls(e):null,of=e=>{if(!e||typeof e!="object"||ii.has(e))return;let t=nf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);Re(e),ii.add(e)},af=/^[a-z][a-zA-Z0-9]*\*?$/,lf=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,pf=/^[a-z][a-zA-Z0-9]*$/,ni=new Set(["window","document"]),An=e=>Object.entries(e||{}).map(([t,s])=>{if(ni.has(t))return{refKey:t,refConfig:s,targetType:"global",isWildcard:!1,prefix:t};let r="id",i=t;t.startsWith(".")?(r="class",i=t.slice(1)):t.startsWith("#")&&(r="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(ni.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(r==="id"&&!af.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(r==="class"&&!lf.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),l=o?i.slice(0,-1):i;return{refKey:t,refConfig:s,targetType:r,isWildcard:o,prefix:l}}),df=e=>{if(!pf.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},oi=({value:e,prefix:t,isWildcard:s})=>typeof e!="string"||e.length===0?!1:s?e.startsWith(t):e===t,kn=({elementIdForRefs:e,classNames:t=[],refMatchers:s})=>{let r=[],i=Array.isArray(t)?t:[];return s.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){oi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&r.push({...n,matchedValue:e});return}let o=i.find(l=>oi({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));o&&r.push({...n,matchedValue:o})}),r.length===0?null:(r.sort((n,o)=>{let l=n.targetType==="id"?2:1,p=o.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),r[0])},Je=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected boolean.`)},ai=({optionName:e,optionValue:t,eventType:s,refKey:r})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${s}' on ref '${r}'. Expected non-negative number.`)},cf=({eventType:e,eventConfig:t,refKey:s})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${s}'.`);let r=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(Je({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:s}),Je({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:s}),Je({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:s}),Je({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:s}),Je({optionName:"once",optionValue:t.once,eventType:e,refKey:s}),ai({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:s}),ai({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:s}),r&&i)throw new Error(`[Parser] Event '${e}' on ref '${s}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:r,hasThrottle:i}},En=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),uf=({eventConfig:e,handlers:t,onMissingHandler:s,parseAndRenderFn:r})=>{let i=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof r!="function"?o:r(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=i(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=i(n);t[e.handler]({...o,_event:n})}:(e.handler&&s?.(e.handler),null)},hf=({eventConfig:e,callback:t,hasDebounce:s,hasThrottle:r,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(i)||{},h=c.currentTarget||o;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(i,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(i,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),s){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=p(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw a(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(i,d);return}if(r){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=l();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(i,d),t(c);return}n.set(i,d);return}n.set(i,d),t(c)},$n=({eventType:e,eventConfig:t,refKey:s,handlers:r,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:a=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=cf({eventType:e,eventConfig:t,refKey:s}),u=uf({eventConfig:t,handlers:r,onMissingHandler:p,parseAndRenderFn:l});return u?hf({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:a,setTimeoutFn:c,clearTimeoutFn:d}):null},ff=({h:e,template:t,viewData:s,refs:r,handlers:i,createComponentUpdateHook:n})=>{of(t);let o=nn(t,s,{}),l=Os(o),p=yf({h:e,items:l,refs:r,handlers:i,viewData:s,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},yf=({h:e,items:t,refs:s={},handlers:r={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=An(s),l=o.some(a=>a.targetType==="id");function p(a,c=""){return a.map((d,h)=>{let f=c?`${c}.${h}`:String(h);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let u=Object.entries(d);if(u.length===0)return null;let[y,m]=u[0];if(!isNaN(Number(y)))return Array.isArray(m)?p(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],f):String(m);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=Jh({attrsString:g,viewData:i,tagName:S,isWebComponent:A}))}catch(H){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${H.message}`)}let I=b.match(/#([^.#\s]+)/);I&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=I[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(H=>H.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Oe=>{Z[Oe]=!0});let H=b.match(/#([^.#\s]+)/);H&&(ge=H[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=p(m,f):we=[],ge&&!A&&(k.id=ge);let Vt=Object.create(null);if(o.length>0){l&&V&&df(V);let H=kn({elementIdForRefs:V,classNames:J,refMatchers:o});if(H){let Oe=H.refKey,Js=H.matchedValue||V||Oe;if(H.refConfig&&H.refConfig.eventListeners){let Ln=H.refConfig.eventListeners,Vn=En(r);Object.entries(Ln).forEach(([Nt,Nn])=>{let Rn=`${Oe}:${Js}:${Nt}`,Zs=$n({eventType:Nt,eventConfig:Nn,refKey:Oe,handlers:r,eventRateLimitState:Vn,stateKey:Rn,parseAndRenderFn:fn,onMissingHandler:jn=>{console.warn(`[Parser] Handler '${jn}' for refKey '${Oe}' (matching '${Js}') is referenced but not found in available handlers.`)}});Zs&&(Vt[Nt]=Zs)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Vt).length>0&&(be.on=Vt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let H=n({selector:b,tagName:S});H&&(be.hook=H)}try{return e(S,be,we)}catch(H){throw new Error(`[Parser] Error creating virtual node for '${S}': ${H.message}`)}}).filter(Boolean)}return p(t)},mf=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>({...e,refs:t,dispatchEvent:s,store:r,render:i}),gf=({store:e,render:t,parseAndRenderFn:s})=>r=>{let{_event:i,_action:n}=r,o=s(r,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},bf=({handlers:e,deps:t,parseAndRenderFn:s})=>{let r={handleCallStoreAction:gf({store:t.store,render:t.render,parseAndRenderFn:s})};return Object.keys(e||{}).forEach(i=>{r[i]=n=>e[i](t,n)}),r},vf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},wf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let s=e.handleBeforeMount(t);return vf(s)},_f=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},xf=({attributeName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let l=n(e),p={};i.forEach(h=>{let f=r.props[h];f!==void 0&&(p[h]=f)});let a={...p},c=o(t),d=o(s);return c===void 0?delete a[l]:a[l]=c,d===void 0?delete p[l]:p[l]=d,{changedProp:l,oldProps:a,newProps:p}},Sf=({propName:e,oldValue:t,newValue:s,deps:r,propsSchemaKeys:i})=>{let n={};i.forEach(l=>{let p=r.props[l];p!==void 0&&(n[l]=p)});let o={...n};return t===void 0?delete o[e]:o[e]=t,s===void 0?delete n[e]:n[e]=s,{changedProp:e,oldProps:o,newProps:n}},Af=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,kf=({refs:e={},handlers:t={},targets:s={window:globalThis.window,document:globalThis.document},parseAndRenderFn:r,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let o=[],l=new Set,p=En(t);return Object.entries(e).forEach(([a,c])=>{if(a!=="window"&&a!=="document")return;let d=Af({refKey:a,targets:s});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${a}:${h}`;l.add(u);let y=$n({eventType:h,eventConfig:f,refKey:a,handlers:t,eventRateLimitState:p,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:r,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:m=>{n(`[Runtime] Handler '${m}' for global ref '${a}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),o.push(()=>{d.removeEventListener(h,y)}))})}),()=>{o.forEach(a=>a()),l.forEach(a=>{let c=p.get(a);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(a)})}},Ef=e=>An(e),$f=e=>{let t=[],s=e?.data?.class;s&&typeof s=="object"&&Object.entries(s).forEach(([i,n])=>{n&&t.push(i)});let r=e?.data?.attrs?.class;return typeof r=="string"&&r.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]},Cf=({rootVNode:e,refs:t})=>{let s={},r=Ef(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,l=$f(n),p=kn({elementIdForRefs:o,classNames:l,refMatchers:r});if(n.elm&&p){let a=o||p.refKey;s[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),s},If=({propsSchemaKeys:e=[],toKebabCase:t})=>{let s=new Set(["key"]);return e.forEach(r=>{s.add(r),s.add(t(r))}),[...s]},Of=({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i})=>mf({baseDeps:e,refs:t,dispatchEvent:s,store:r,render:i}),Tf=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(s=>{delete e[s]}),Object.assign(e,t),e),Lf=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let s=e?.__eventRateLimitState;if(!(s instanceof Map))return 0;let r=0;return s.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),r+=1)}),s.clear(),r},Ys=({instance:e})=>Of({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Vf=({instance:e,parseAndRenderFn:t,renderFn:s,createTransformedHandlersFn:r=bf,runBeforeMountFn:i=wf,attachGlobalRefListenersFn:n=kf,runAfterMountFn:o=_f})=>{let l=Ys({instance:e});return e.transformedHandlers=r({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),s(),o({handlers:e.handlers,deps:l}),l},Nf=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Lf({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Rf=({instance:e,attributeName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=xf({attributeName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:sn,normalizeAttributeValue:_s});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},jf=({instance:e,propName:t,oldValue:s,newValue:r,scheduleFrameFn:i})=>{if(!(s===r||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Ys({instance:e}),o=Sf({propName:t,oldValue:s,newValue:r,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},Df=({instance:e,createComponentUpdateHookFn:t,parseViewFn:s=ff,collectRefElementsFn:r=Cf,onError:i=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=s({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=r({rootVNode:e._oldVNode,refs:e.refs});return Tf({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}},Pf=`
|
|
1624
|
+
`:"")+l)}),i},Ri=e=>Array.isArray(e)?e.reduce((t,i)=>{if(Array.isArray(i))t.push(...Ri(i));else{if(i&&typeof i=="object"){let s=Object.entries(i);if(s.length>0){let[r,n]=s[0];Array.isArray(n)&&(i={[r]:Ri(n)})}}t.push(i)}return t},[]):e,gi=":",ff=new Set(["__proto__","constructor","prototype"]),yf=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,lr=e=>yf.test(e),pr=(e,t)=>{if(!t)return e;let i=[],s="",r=!1;for(let n=0;n<t.length;n++){let o=t[n];if(!r&&o===".")s&&(i.push(s),s="");else if(!r&&o==="[")s&&(i.push(s),s=""),r=!0;else if(r&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))i.push(s.slice(1,-1));else{let l=Number(s);i.push(Number.isNaN(l)?s:l)}s=""}r=!1}else s+=o}return s&&i.push(s),i.reduce((n,o)=>{if(n==null)return;let l=typeof o=="number"?o:String(o);if(!(typeof l=="string"&&ff.has(l)))return n[l]},e)},mf=e=>e.replace(/-([a-z0-9])/g,(t,i)=>i.toUpperCase()),gf=({attrsString:e="",viewData:t={},tagName:i,isWebComponent:s})=>{let r={},n={},o=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,S)=>{let A=mf(g);if(!A)throw new Error(`[Parser] Invalid ${S} prop name on '${i}'.`);if(Object.prototype.hasOwnProperty.call(n,A))throw new Error(`[Parser] Duplicate prop binding '${A}' on '${i}'. Use only one of 'name=value' or ':name=\${expr}'.`);n[A]=_},p=(g,_)=>{if(!lr(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${i}'.`)};if(!e)return{attrs:r,props:n};let a=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=a.exec(e))!==null;){let g=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(g),g.startsWith(".")){r[g]=_;continue}if(g.startsWith(gi)){let S=g.substring(1),A=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],C=pr(t,k);C!==void 0&&(A=C)}l(S,A,"property-form");continue}if(g.startsWith("?")){let S=g.substring(1);p(S,"boolean toggle");let A=_;o(S);let k;A==="true"?k=!0:A==="false"||A===""?k=!1:k=pr(t,A),k&&(r[S]=""),s&&S!=="id"&&l(S,!!k,"boolean attribute-form");continue}p(g,"binding"),r[g]=_,s&&g!=="id"&&l(g,_,"attribute-form")}let u=e,f=[],h,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(h=y.exec(e))!==null;)f.push(h[0]);f.forEach(g=>{u=u.replace(g," ")});let m=/(\S+?)(?=\s|$)/g,b;for(;(b=m.exec(u))!==null;){let g=b[1];if(!g.startsWith(".")&&!(d.has(g)||g.startsWith(gi)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),o(_),r[_]="",s&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!lr(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${i}'.`);!d.has(g)&&!g.startsWith(gi)&&!g.includes("=")&&(r[g]="",s&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:r,props:n}},Ni=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,bf=/^\$for\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*,\s*([A-Za-z_][A-Za-z0-9_]*))?\s+in\s+.+$/,Tn=/^\$\{([^{}]+)\}$/,vf=/^[A-Za-z_][A-Za-z0-9_]*(?:(?:\.[A-Za-z_][A-Za-z0-9_]*)|\[(?:\d+|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\])*$/,dr=new WeakSet,Zi=(e,t,i)=>{let s=new Set(e);return t&&s.add(t),i&&s.add(i),s},wf=(e,t)=>{if(typeof e!="string")return t;let i=e.match(bf);return i?Zi(t,i[1],i[2]):t},Ln=e=>{if(typeof e!="string"||!e.includes(":")&&!e.includes("."))return null;Ni.lastIndex=0;let t;for(;(t=Ni.exec(e))!==null;){let i=t[1];if(i.startsWith("."))return{bindingName:i,rawValue:t[2]??t[3]??t[4]??"",key:e};if(!i.startsWith(":"))continue;let s=t[2]!==void 0||t[3]!==void 0,r=t[2]??t[3]??t[4]??"";if(s||!Tn.test(r))return{bindingName:i,rawValue:r,key:e}}return null},Di=(e,t=new Set)=>{if(Array.isArray(e)){for(let i of e){let s=Di(i,t);if(s)return s}return null}if(!e||typeof e!="object")return null;for(let[i,s]of Object.entries(e)){let r=Ln(i);if(r)return r;let n=wf(i,t),o=Di(s,n);if(o)return o}return null},De=(e,t=new Set)=>{if(!e||typeof e!="object")return null;if(Array.isArray(e)){for(let i of e){let s=De(i,t);if(s)return s}return null}if(e.type===v.LOOP){let i=Zi(t,e.itemVar,e.indexVar);return De(e.body,i)}if(e.type===v.ARRAY&&Array.isArray(e.items))return De(e.items,t);if(e.type===v.OBJECT&&Array.isArray(e.properties)){for(let i of e.properties){let s=Ln(i.key);if(s)return s;let r=De(i.value,t);if(r)return r}return null}for(let i of Object.values(e)){let s=De(i,t);if(s)return s}return null},_f=e=>$i([{[e]:""}])?.items?.[0]?.properties?.[0]?.parsedKey,xf=e=>{let t=e.match(Tn);return t?t[1].trim():null},Sf=e=>{let t=e.match(/^([A-Za-z_][A-Za-z0-9_]*)/);return t?t[1]:null},Af=(e,t)=>{let i=!1,s=e.replace(Ni,(r,n,o,l,p)=>{if(!n.startsWith(":"))return r;let a=o??l??p??"",c=xf(a);if(!c||!vf.test(c))return r;let d=Sf(c);if(!d)return r;let u=t.has(d)?`#{${c}}`:c;return u===a?r:(i=!0,`${n}=${u}`)});return i?s:e},je=(e,t=new Set)=>{if(!(!e||typeof e!="object")){if(Array.isArray(e)){e.forEach(i=>je(i,t));return}if(e.type===v.LOOP){let i=Zi(t,e.itemVar,e.indexVar);je(e.body,i);return}if(e.type===v.ARRAY&&Array.isArray(e.items)){e.items.forEach(i=>je(i,t));return}if(e.type===v.OBJECT&&Array.isArray(e.properties)){e.properties.forEach(i=>{let s=Af(i.key,t);if(s!==i.key){i.key=s;let r=_f(s);r?i.parsedKey=r:delete i.parsedKey}je(i.value,t)});return}Object.values(e).forEach(i=>{je(i,t)})}},kf=e=>e?e.type&&typeof e.type=="number"?De(e):Di(e):null,Ef=e=>{if(!e||typeof e!="object"||dr.has(e))return;let t=kf(e);if(t)throw new Error(`Property-form bindings must use ':prop=\${value}' syntax. Found '${t.bindingName}=${t.rawValue}' in '${t.key}'.`);je(e),dr.add(e)},$f=/^[a-z][a-zA-Z0-9]*\*?$/,Cf=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,Of=/^[a-z][a-zA-Z0-9]*$/,cr=new Set(["window","document"]),Vn=e=>Object.entries(e||{}).map(([t,i])=>{if(cr.has(t))return{refKey:t,refConfig:i,targetType:"global",isWildcard:!1,prefix:t};let s="id",r=t;t.startsWith(".")?(s="class",r=t.slice(1)):t.startsWith("#")&&(s="id",r=t.slice(1));let n=r.endsWith("*")?r.slice(0,-1):r;if(cr.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(s==="id"&&!$f.test(r))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(s==="class"&&!Cf.test(r))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=r.endsWith("*"),l=o?r.slice(0,-1):r;return{refKey:t,refConfig:i,targetType:s,isWildcard:o,prefix:l}}),If=e=>{if(!Of.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},ur=({value:e,prefix:t,isWildcard:i})=>typeof e!="string"||e.length===0?!1:i?e.startsWith(t):e===t,Rn=({elementIdForRefs:e,classNames:t=[],refMatchers:i})=>{let s=[],r=Array.isArray(t)?t:[];return i.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){ur({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&s.push({...n,matchedValue:e});return}let o=r.find(l=>ur({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));o&&s.push({...n,matchedValue:o})}),s.length===0?null:(s.sort((n,o)=>{let l=n.targetType==="id"?2:1,p=o.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),s[0])},et=({optionName:e,optionValue:t,eventType:i,refKey:s})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${i}' on ref '${s}'. Expected boolean.`)},hr=({optionName:e,optionValue:t,eventType:i,refKey:s})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${i}' on ref '${s}'. Expected non-negative number.`)},Tf=({eventType:e,eventConfig:t,refKey:i})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${i}'.`);let s=Object.prototype.hasOwnProperty.call(t,"debounce"),r=Object.prototype.hasOwnProperty.call(t,"throttle");if(et({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:i}),et({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:i}),et({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:i}),et({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:i}),et({optionName:"once",optionValue:t.once,eventType:e,refKey:i}),hr({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:i}),hr({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:i}),s&&r)throw new Error(`[Parser] Event '${e}' on ref '${i}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:s,hasThrottle:r}},Nn=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Lf=({eventConfig:e,handlers:t,onMissingHandler:i,parseAndRenderFn:s,getPayloadContext:r})=>{let n=o=>{let l=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};if(typeof s!="function")return l;let p=typeof r=="function"?r():{};return s(l,{...p&&typeof p=="object"?p:{},_event:o})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return o=>{let l=n(o);t.handleCallStoreAction({...l,_event:o,_action:e.action})}}return e.handler&&t[e.handler]?o=>{let l=n(o);t[e.handler]({...l,_event:o})}:(e.handler&&i?.(e.handler),null)},Vf=({eventConfig:e,callback:t,hasDebounce:i,hasThrottle:s,stateKey:r,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:a=clearTimeout})=>c=>{let d=n.get(r)||{},u=c.currentTarget||o;if(e.once)if(u){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(u)){n.set(r,d);return}d.onceTargets.add(u)}else if(d.onceTriggered){n.set(r,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(r,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),i){d.debounceTimer&&a(d.debounceTimer),d.debounceTimer=p(()=>{let f=d.debounceTimer;try{t(c)}catch(h){throw a(f),d.debounceTimer=null,h}d.debounceTimer=null},e.debounce),n.set(r,d);return}if(s){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=l();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(r,d),t(c);return}n.set(r,d);return}n.set(r,d),t(c)},Dn=({eventType:e,eventConfig:t,refKey:i,handlers:s,eventRateLimitState:r,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:l,getPayloadContext:p,onMissingHandler:a,nowFn:c=Date.now,setTimeoutFn:d=setTimeout,clearTimeoutFn:u=clearTimeout})=>{let{hasDebounce:f,hasThrottle:h}=Tf({eventType:e,eventConfig:t,refKey:i}),y=Lf({eventConfig:t,handlers:s,onMissingHandler:a,parseAndRenderFn:l,getPayloadContext:p});return y?Vf({eventConfig:t,callback:y,hasDebounce:f,hasThrottle:h,stateKey:n,eventRateLimitState:r,fallbackCurrentTarget:o,nowFn:c,setTimeoutFn:d,clearTimeoutFn:u}):null},Rf=({h:e,template:t,viewData:i,refs:s,handlers:r,createComponentUpdateHook:n})=>{Ef(t);let o=fn(t,i,{}),l=Ri(o),p=Nf({h:e,items:l,refs:s,handlers:r,viewData:i,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},Nf=({h:e,items:t,refs:i={},handlers:s={},viewData:r={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let o=Vn(i),l=o.some(a=>a.targetType==="id");function p(a,c=""){return a.map((d,u)=>{let f=c?`${c}.${u}`:String(u);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let h=Object.entries(d);if(h.length===0)return null;let[y,m]=h[0];if(!isNaN(Number(y)))return Array.isArray(m)?p(m,f):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],f):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,g,_=y.indexOf(" ");_===-1?(b=y,g=""):(b=y.substring(0,_),g=y.substring(_+1).trim());let S=b.split(/[.#]/)[0],A=S.includes("-"),k,C;try{({attrs:k,props:C}=gf({attrsString:g,viewData:r,tagName:S,isWebComponent:A}))}catch(q){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${g}': ${q.message}`)}let O=b.match(/#([^.#\s]+)/);O&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=O[1]);let V=null;k.id&&(V=k.id);let z=(b.match(/\.([^.#]+)/g)||[]).map(q=>q.substring(1)),B=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],J=[...new Set([...z,...B])],Z=Object.create(null),ge=null;if(!A){z.forEach(Le=>{Z[Le]=!0});let q=b.match(/#([^.#\s]+)/);q&&(ge=q[1])}let we;typeof m=="string"||typeof m=="number"?we=String(m):Array.isArray(m)?we=p(m,f):we=[],ge&&!A&&(k.id=ge);let Dt=Object.create(null);if(o.length>0){l&&V&&If(V);let q=Rn({elementIdForRefs:V,classNames:J,refMatchers:o});if(q){let Le=q.refKey,es=q.matchedValue||V||Le;if(q.refConfig&&q.refConfig.eventListeners){let Wn=q.refConfig.eventListeners,Mn=Nn(s);Object.entries(Wn).forEach(([jt,Fn])=>{let Kn=`${Le}:${es}:${jt}`,ts=Dn({eventType:jt,eventConfig:Fn,refKey:Le,handlers:s,eventRateLimitState:Mn,stateKey:Kn,parseAndRenderFn:Sn,getPayloadContext:()=>r,onMissingHandler:Un=>{console.warn(`[Parser] Handler '${Un}' for refKey '${Le}' (matching '${es}') is referenced but not found in available handlers.`)}});ts&&(Dt[jt]=ts)})}}}let be={};if(V?be.key=V:b&&(be.key=`${b}-${f}`),Object.keys(k).length>0&&(be.attrs=k),Object.keys(Z).length>0&&(be.class=Z),Object.keys(Dt).length>0&&(be.on=Dt),Object.keys(C).length>0&&(be.props=C),A&&typeof n=="function"){let q=n({selector:b,tagName:S});q&&(be.hook=q)}try{return e(S,be,we)}catch(q){throw new Error(`[Parser] Error creating virtual node for '${S}': ${q.message}`)}}).filter(Boolean)}return p(t)},Df=({baseDeps:e,refs:t,dispatchEvent:i,store:s,render:r})=>{let n={...e,refs:t,dispatchEvent:i,store:s,render:r};return e?.__rtglI18nRuntime&&(Object.defineProperty(n,"i18n",{enumerable:!0,configurable:!0,get(){return e.__rtglI18nRuntime.getMessages()}}),n.locale=e.__rtglI18nRuntime.locale),n},jf=({store:e,render:t,parseAndRenderFn:i})=>s=>{let{_event:r,_action:n}=s,o=i(s,{_event:r});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Pf=({handlers:e,deps:t,parseAndRenderFn:i})=>{let s={handleCallStoreAction:jf({store:t.store,render:t.render,parseAndRenderFn:i})};return Object.keys(e||{}).forEach(r=>{s[r]=n=>e[r](t,n)}),s},Bf=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},zf=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let i=e.handleBeforeMount(t);return Bf(i)},Wf=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Mf=({attributeName:e,oldValue:t,newValue:i,deps:s,propsSchemaKeys:r,toCamelCase:n,normalizeAttributeValue:o})=>{let l=n(e),p={};r.forEach(u=>{let f=s.props[u];f!==void 0&&(p[u]=f)});let a={...p},c=o(t),d=o(i);return c===void 0?delete a[l]:a[l]=c,d===void 0?delete p[l]:p[l]=d,{changedProp:l,oldProps:a,newProps:p}},Ff=({propName:e,oldValue:t,newValue:i,deps:s,propsSchemaKeys:r})=>{let n={};r.forEach(l=>{let p=s.props[l];p!==void 0&&(n[l]=p)});let o={...n};return t===void 0?delete o[e]:o[e]=t,i===void 0?delete n[e]:n[e]=i,{changedProp:e,oldProps:o,newProps:n}},Kf=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Uf=({refs:e={},handlers:t={},targets:i={window:globalThis.window,document:globalThis.document},parseAndRenderFn:s,getPayloadContext:r,timing:n={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:o=console.warn})=>{let l=[],p=new Set,a=Nn(t);return Object.entries(e).forEach(([c,d])=>{if(c!=="window"&&c!=="document")return;let u=Kf({refKey:c,targets:i});!u||!d?.eventListeners||Object.entries(d.eventListeners).forEach(([f,h])=>{let y=`${c}:${f}`;p.add(y);let m=Dn({eventType:f,eventConfig:h,refKey:c,handlers:t,eventRateLimitState:a,stateKey:y,fallbackCurrentTarget:u,parseAndRenderFn:s,getPayloadContext:r,nowFn:n.nowFn,setTimeoutFn:n.setTimeoutFn,clearTimeoutFn:n.clearTimeoutFn,onMissingHandler:b=>{o(`[Runtime] Handler '${b}' for global ref '${c}' is referenced but not found in available handlers.`)}});m&&(u.addEventListener(f,m),l.push(()=>{u.removeEventListener(f,m)}))})}),()=>{l.forEach(c=>c()),p.forEach(c=>{let d=a.get(c);d&&d.debounceTimer&&n.clearTimeoutFn(d.debounceTimer),a.delete(c)})}},Hf=e=>Vn(e),qf=e=>{let t=[],i=e?.data?.class;i&&typeof i=="object"&&Object.entries(i).forEach(([r,n])=>{n&&t.push(r)});let s=e?.data?.attrs?.class;return typeof s=="string"&&s.split(/\s+/).filter(Boolean).forEach(r=>t.push(r)),[...new Set(t)]},Yf=({rootVNode:e,refs:t})=>{let i={},s=Hf(t),r=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,l=qf(n),p=Rn({elementIdForRefs:o,classNames:l,refMatchers:s});if(n.elm&&p){let a=o||p.refKey;i[a]=n.elm}Array.isArray(n.children)&&n.children.forEach(r)};return r(e),i},Gf=({propsSchemaKeys:e=[],toKebabCase:t})=>{let i=new Set(["key"]);return e.forEach(s=>{i.add(s),i.add(t(s))}),[...i]},Jf=({baseDeps:e,refs:t,dispatchEvent:i,store:s,render:r})=>Df({baseDeps:e,refs:t,dispatchEvent:i,store:s,render:r}),Zf=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(i=>{delete e[i]}),Object.assign(e,t),e),Xf=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let i=e?.__eventRateLimitState;if(!(i instanceof Map))return 0;let s=0;return i.forEach(r=>{r&&r.debounceTimer&&(t(r.debounceTimer),s+=1)}),i.clear(),s},Xi=({instance:e})=>Jf({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Qf=({instance:e,parseAndRenderFn:t,renderFn:i,createTransformedHandlersFn:s=Pf,runBeforeMountFn:r=zf,attachGlobalRefListenersFn:n=Uf,runAfterMountFn:o=Wf})=>{let l=Xi({instance:e});return e.transformedHandlers=s({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=r({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t,getPayloadContext:()=>e.viewData}),i(),o({handlers:e.handlers,deps:l}),l},ey=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Xf({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),ty=({instance:e,attributeName:t,oldValue:i,newValue:s,scheduleFrameFn:r})=>{if(!(i===s||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xi({instance:e}),o=Mf({attributeName:t,oldValue:i,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:un,normalizeAttributeValue:ki});e.handlers.handleOnUpdate(n,o);return}r(()=>{e.render()})}},iy=({instance:e,propName:t,oldValue:i,newValue:s,scheduleFrameFn:r})=>{if(!(i===s||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=Xi({instance:e}),o=Ff({propName:t,oldValue:i,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys});e.handlers.handleOnUpdate(n,o);return}r(()=>{e.render()})}},sy=({instance:e,createComponentUpdateHookFn:t,parseViewFn:i=Rf,collectRefElementsFn:s=Yf,onError:r=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=i({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let o=s({rootVNode:e._oldVNode,refs:e.refs});return Zf({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return r(n),e._oldVNode||null}},ry=`
|
|
1521
1625
|
a, a:link, a:visited, a:hover, a:active {
|
|
1522
1626
|
display: contents;
|
|
1523
1627
|
color: inherit;
|
|
@@ -1529,4 +1633,4 @@ ${l}
|
|
|
1529
1633
|
font: inherit;
|
|
1530
1634
|
cursor: pointer;
|
|
1531
1635
|
}
|
|
1532
|
-
`,Gs="data-rtgl-render-target",Cn="__rtglRenderTarget",Vs=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Gs)!==null:e[Cn]===!0,li=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Gs,""):e[Cn]=!0)},Bf=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Gs}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(Vs)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(Vs)??e.children[0]:e.firstElementChild},zf=({host:e,cssText:t,createStyleSheet:s=()=>new CSSStyleSheet,createElement:r=i=>document.createElement(i)})=>{let i=e.shadowRoot??e.attachShadow({mode:"open"}),n=s();n.replaceSync(Pf);let o=[n];if(t){let a=s();a.replaceSync(t),o.push(a)}i.adoptedStyleSheets=o;let l=Bf(i);l?(l.style.cssText="display: contents;",Vs(l)||li(l)):(l=r("div"),l.style.cssText="display: contents;",li(l),i.appendChild(l)),l.parentNode!==i&&i.appendChild(l);let p=rn(e);return p&&typeof p=="object"&&(p.display="contents"),{shadow:i,renderTarget:l,adoptedStyleSheets:o}},Ns=(e,t=requestAnimationFrame)=>t(e),Wf=({scheduleFrameFn:e=Ns}={})=>({update:(t,s)=>{let r=t.data?.props||{},i=s.data?.props||{};if(JSON.stringify(r)===JSON.stringify(i))return;let n=s.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:r,newProps:i})}}))}}),Mf=({elementName:e,propsSchema:t,propsSchemaKeys:s,template:r,refs:i,styles:n,handlers:o,methods:l,constants:p,store:a,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),m}connectedCallback(){let m=zf({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,Vf({instance:this,parseAndRenderFn:fn,renderFn:this.render})}disconnectedCallback(){Nf({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){Rf({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}render=()=>{Df({instance:this,createComponentUpdateHookFn:Wf})}}class u extends f{static get observedAttributes(){return If({propsSchemaKeys:s,toKebabCase:tn})}constructor(){super(),this.constants=Uh({setupConstants:h?.constants,fileConstants:p}),this.propsSchema=t,Zu({source:this,allowedKeys:s,onPropChange:({propName:m,oldValue:b,newValue:g})=>{jf({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Ns})}}),this.props=t?Xu(this,s):{},this._propsSchemaKeys=s,this.elementName=e,this.styles=n,this.store=Kh(a,this.props,this.constants),this.template=r,this.handlers=o,this.methods=l,this.refs=i,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},Lh(this,this.methods),this._snabbdomH=d,this.cssText=Hh(e,n)}}return u};function st(e,t,s,r,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:s,text:r,elm:i,key:n}}var kt=Array.isArray;function yt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Ff(e,t){return document.createElement(e,t)}function Kf(e,t,s){return document.createElementNS(e,t,s)}function Uf(){return Ae(document.createDocumentFragment())}function Hf(e){return document.createTextNode(e)}function qf(e){return document.createComment(e)}function Yf(e,t,s){if(me(e)){let r=e;for(;r&&me(r);)r=Ae(r).parent;e=r??e}me(t)&&(t=Ae(t,e)),s&&me(s)&&(s=Ae(s).firstChildNode),e.insertBefore(t,s)}function Gf(e,t){e.removeChild(t)}function Jf(e,t){me(t)&&(t=Ae(t,e)),e.appendChild(t)}function In(e){if(me(e)){for(;e&&me(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Zf(e){var t;if(me(e)){let s=Ae(e),r=In(s);if(r&&s.lastChildNode){let i=Array.from(r.childNodes),n=i.indexOf(s.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Xf(e){return e.tagName}function Qf(e,t){e.textContent=t}function ey(e){return e.textContent}function ty(e){return e.nodeType===1}function sy(e){return e.nodeType===3}function ry(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ae(e,t){var s,r,i;let n=e;return(s=n.parent)!==null&&s!==void 0||(n.parent=t??null),(r=n.firstChildNode)!==null&&r!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var iy={createElement:Ff,createElementNS:Kf,createTextNode:Hf,createDocumentFragment:Uf,createComment:qf,insertBefore:Yf,removeChild:Gf,appendChild:Jf,parentNode:In,nextSibling:Zf,tagName:Xf,setTextContent:Qf,getTextContent:ey,isElement:ty,isText:sy,isComment:ry,isDocumentFragment:me};function ft(e){return e===void 0}function se(e){return e!==void 0}var fs=st("",{},[],void 0,void 0);function Ze(e,t){var s,r;let i=e.key===t.key,n=((s=e.data)===null||s===void 0?void 0:s.is)===((r=t.data)===null||r===void 0?void 0:r.is),o=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&l}function ny(){throw new Error("The document fragment is not supported on this platform.")}function oy(e,t){return e.isElement(t)}function ay(e,t){return e.isDocumentFragment(t)}function ly(e,t,s){var r;let i={};for(let n=t;n<=s;++n){let o=(r=e[n])===null||r===void 0?void 0:r.key;o!==void 0&&(i[o]=n)}return i}var py=["create","update","remove","destroy","pre","post"];function dy(e,t,s){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=iy;for(let u of py)for(let y of e){let m=y[u];m!==void 0&&r[u].push(m)}function n(u){let y=u.id?"#"+u.id:"",m=u.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return st(i.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function o(u){return st(void 0,{},[],void 0,u)}function l(u,y){return function(){if(--y===0){let m=i.parentNode(u);m!==null&&i.removeChild(m,u)}}}function p(u,y){var m,b,g,_;let S,A=u.data;if(A!==void 0){let I=(m=A.hook)===null||m===void 0?void 0:m.init;se(I)&&(I(u),A=u.data)}let k=u.children,C=u.sel;if(C==="!")ft(u.text)&&(u.text=""),u.elm=i.createComment(u.text);else if(C==="")u.elm=i.createTextNode(u.text);else if(C!==void 0){let I=C.indexOf("#"),V=C.indexOf(".",I),z=I>0?I:C.length,B=V>0?V:C.length,J=I!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Z=u.elm=se(A)&&se(S=A.ns)?i.createElementNS(S,J,A):i.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<r.create.length;++S)r.create[S](fs,u);if(yt(u.text)&&(!kt(k)||k.length===0)&&i.appendChild(Z,i.createTextNode(u.text)),kt(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&i.appendChild(Z,p(we,y))}let ge=u.data.hook;se(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,fs,u),ge.insert&&y.push(u))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&u.children){for(u.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:ny)(),S=0;S<r.create.length;++S)r.create[S](fs,u);for(S=0;S<u.children.length;++S){let I=u.children[S];I!=null&&i.appendChild(u.elm,p(I,y))}}else u.elm=i.createTextNode(u.text);return u.elm}function a(u,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&i.insertBefore(u,p(S,_),y)}}function c(u){var y,m;let b=u.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,u);for(let g=0;g<r.destroy.length;++g)r.destroy[g](u);if(u.children!==void 0)for(let g=0;g<u.children.length;++g){let _=u.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(se(k.sel)){c(k),S=r.remove.length+1,A=l(k.elm,S);for(let I=0;I<r.remove.length;++I)r.remove[I](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;se(C)?C(k,A):A()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):i.removeChild(u,k.elm)}}function h(u,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,I=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:I==null?I=m[++_]:V==null?V=m[--C]:Ze(A,I)?(f(A,I,b),A=y[++g],I=m[++_]):Ze(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):Ze(A,V)?(f(A,V,b),i.insertBefore(u,A.elm,i.nextSibling(k.elm)),A=y[++g],V=m[--C]):Ze(k,I)?(f(k,I,b),i.insertBefore(u,k.elm,A.elm),k=y[--S],I=m[++_]):(z===void 0&&(z=ly(y,g,S)),B=z[I.key],ft(B)?(i.insertBefore(u,p(I,b),A.elm),I=m[++_]):ft(z[V.key])?(i.insertBefore(u,p(V,b),i.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==I.sel?i.insertBefore(u,p(I,b),A.elm):(f(J,I,b),y[B]=void 0,i.insertBefore(u,J.elm,A.elm)),I=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(u,Z,m,_,C,b)),g<=S&&d(u,y,g,S)}function f(u,y,m){var b,g,_,S,A,k,C,I;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,u,y);let z=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||se(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=u.data)!==null&&S!==void 0||(u.data={});for(let Z=0;Z<r.update.length;++Z)r.update[Z](u,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,u,y)}let B=u.children,J=y.children;ft(y.text)?se(B)&&se(J)?B!==J&&h(z,B,J,m):se(J)?(se(u.text)&&i.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):se(B)?d(z,B,0,B.length-1):se(u.text)&&i.setTextContent(z,""):u.text!==y.text&&(se(B)&&d(z,B,0,B.length-1),i.setTextContent(z,y.text)),(I=V?.postpatch)===null||I===void 0||I.call(V,u,y)}return function(u,y){let m,b,g,_=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for(oy(i,u)?u=n(u):ay(i,u)&&(u=o(u)),Ze(u,y)?f(u,y,_):(b=u.elm,g=i.parentNode(b),p(y,_),g!==null&&(i.insertBefore(g,y.elm,i.nextSibling(b)),d(g,[u],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<r.post.length;++m)r.post[m]();return y}}function pi(e,t){let s,r,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(r in n)n[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)s=o[r],s!==n[r]&&i.classList[s?"add":"remove"](r)}}var cy={create:pi,update:pi};function di(e,t){let s,r,i,n=t.elm,o=e.data.props,l=t.data.props;if(!(!o&&!l)&&o!==l){o=o||{},l=l||{};for(s in l)r=l[s],i=o[s],i!==r&&(s!=="value"||n[s]!==r)&&(n[s]=r)}}var uy={create:di,update:di},hy="http://www.w3.org/1999/xlink",fy="http://www.w3.org/2000/xmlns/",yy="http://www.w3.org/XML/1998/namespace",ci=58,my=120,gy=109;function ui(e,t){let s,r=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(s in n){let o=n[s];i[s]!==o&&(o===!0?r.setAttribute(s,""):o===!1?r.removeAttribute(s):s.charCodeAt(0)!==my?r.setAttribute(s,o):s.charCodeAt(3)===ci?r.setAttributeNS(yy,s,o):s.charCodeAt(5)===ci?s.charCodeAt(1)===gy?r.setAttributeNS(fy,s,o):r.setAttributeNS(hy,s,o):r.setAttribute(s,o))}for(s in i)s in n||r.removeAttribute(s)}}var by={create:ui,update:ui},hi=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,vy=function(e){hi(function(){hi(e)})},Rs=!1;function wy(e,t,s){vy(function(){e[t]=s})}function fi(e,t){let s,r,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let l="delayed"in n;for(r in n)r in o||(r[0]==="-"&&r[1]==="-"?i.style.removeProperty(r):i.style[r]="");for(r in o)if(s=o[r],r==="delayed"&&o.delayed)for(let p in o.delayed)s=o.delayed[p],(!l||s!==n.delayed[p])&&wy(i.style,p,s);else r!=="remove"&&s!==n[r]&&(r[0]==="-"&&r[1]==="-"?i.style.setProperty(r,s):i.style[r]=s)}function _y(e){let t,s,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(s in t)r.style[s]=t[s]}function xy(e,t){let s=e.data.style;if(!s||!s.remove){t();return}Rs||(e.elm.offsetLeft,Rs=!0);let r,i=e.elm,n=0,o=s.remove,l=0,p=[];for(r in o)p.push(r),i.style[r]=o[r];let a=getComputedStyle(i)["transition-property"].split(", ");for(;n<a.length;++n)p.indexOf(a[n])!==-1&&l++;i.addEventListener("transitionend",function(c){c.target===i&&--l,l===0&&t()})}function Sy(){Rs=!1}var Ay={pre:Sy,create:fi,update:fi,destroy:_y,remove:xy};function On(e,t,s){if(typeof e=="function")e.call(t,s,t);else if(typeof e=="object")for(let r=0;r<e.length;r++)On(e[r],t,s)}function ky(e,t){let s=e.type,r=t.data.on;r&&r[s]&&On(r[s],t,e)}function Ey(){return function e(t){ky(t,e.vnode)}}function ys(e,t){let s=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,l;if(s!==n){if(s&&r)if(n)for(l in s)n[l]||i.removeEventListener(l,r,!1);else for(l in s)i.removeEventListener(l,r,!1);if(n){let p=t.listener=e.listener||Ey();if(p.vnode=t,s)for(l in n)s[l]||o.addEventListener(l,p,!1);else for(l in n)o.addEventListener(l,p,!1)}}}var $y={create:ys,update:ys,destroy:ys},Cy=()=>dy([cy,uy,by,Ay,$y]);function Tn(e,t,s){if(e.ns="http://www.w3.org/2000/svg",s!=="foreignObject"&&t!==void 0)for(let r=0;r<t.length;++r){let i=t[r];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Tn(n,i.children,i.sel)}}function Iy(e,t,s){let r={},i,n,o;if(s!==void 0?(t!==null&&(r=t),kt(s)?i=s:yt(s)?n=s.toString():s&&s.sel&&(i=[s])):t!=null&&(kt(t)?i=t:yt(t)?n=t.toString():t&&t.sel?i=[t]:r=t),i!==void 0)for(o=0;o<i.length;++o)yt(i[o])&&(i[o]=st(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Tn(r,i,e),st(e,r,i,n,void 0)}var Oy=Cy(),Ty=({handlers:e,methods:t,constants:s,schema:r,view:i,store:n},o)=>{if(!i)throw new Error("view is not defined");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=r,{template:p,refs:a,styles:c}=i;Qu({schema:l,methodExports:Object.keys(t||{})});let d=l.componentName,h=l.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>sn(u)))]:[];return Mf({elementName:d,propsSchema:h,propsSchemaKeys:f,template:p,refs:a,styles:c,handlers:e,methods:t,constants:s,store:n,patch:Oy,h:Iy,deps:o})},Ly=e=>{let t={};return{once:(s,r)=>{t[s]||(t[s]=[]);let i=(...n)=>{r(...n),t[s]=t[s].filter(o=>o!==i)};return t[s].push(i),()=>{t[s]=(t[s]??[]).filter(n=>n!==i)}},emit:(s,...r)=>{t[s]&&[...t[s]].forEach(i=>{i(...r)})},showAlert:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:s=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Vy=Ly(),Ny={globalUI:Vy},Ry={components:Ny},jy={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Dy={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Py={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},By={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},zy={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},Wy={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},My={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Fy={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},Ky={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},Uy={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Hy={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},qy={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},Yy={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},Gy={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Jy={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},Zy={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},Xy={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},Qy={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} content-g=md content-w=240 content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},em={componentName:"rtgl-segmented-control",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},tm={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${i} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},sm={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},rm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm"]}}],fast:!1}],fast:!1}},im={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},nm={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:'rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId} aria-label="${item.label}"',value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.label.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"},' aria-label="',{type:1,path:"item.label"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"listAttrString"}]}}],fast:!1},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},om={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},am={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},lm={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},pm={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},dm={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},cm={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},um={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},hm={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},fm={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},ym={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"},' no-overlay content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},mm={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},gm={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=mo;x.components.accordionItem.schema=jy;x.components.accordionItem.store=xo;x.components.accordionItem.view=Dy;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ao;x.components.breadcrumb.schema=Py;x.components.breadcrumb.store=Vo;x.components.breadcrumb.view=By;x.components.card={};x.components.card.schema=zy;x.components.card.store=Po;x.components.card.view=Wy;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=Fo;x.components.dropdownMenu.schema=My;x.components.dropdownMenu.store=Go;x.components.dropdownMenu.view=Fy;x.components.form={};x.components.form.handlers=yl;x.components.form.methods=kl;x.components.form.schema=Ky;x.components.form.store=il;x.components.form.view=Uy;x.components.globalUi={};x.components.globalUi.handlers=Gl;x.components.globalUi.schema=Hy;x.components.globalUi.store=_p;x.components.globalUi.view=qy;x.components.navbar={};x.components.navbar.handlers=Sp;x.components.navbar.schema=Yy;x.components.navbar.store=Tp;x.components.navbar.view=Gy;x.components.pageOutline={};x.components.pageOutline.handlers=Rp;x.components.pageOutline.schema=Jy;x.components.pageOutline.store=Fp;x.components.pageOutline.view=Zy;x.components.popoverInput={};x.components.popoverInput.handlers=Zp;x.components.popoverInput.schema=Xy;x.components.popoverInput.store=nd;x.components.popoverInput.view=Qy;x.components.segmentedControl={};x.components.segmentedControl.handlers=fd;x.components.segmentedControl.schema=em;x.components.segmentedControl.store=$d;x.components.segmentedControl.view=tm;x.components.select={};x.components.select.handlers=Bd;x.components.select.schema=sm;x.components.select.store=ic;x.components.select.view=rm;x.components.sidebar={};x.components.sidebar.handlers=dc;x.components.sidebar.schema=im;x.components.sidebar.store=Sc;x.components.sidebar.view=nm;x.components.sliderInput={};x.components.sliderInput.handlers=Cc;x.components.sliderInput.schema=om;x.components.sliderInput.store=Lc;x.components.sliderInput.view=am;x.components.table={};x.components.table.handlers=jc;x.components.table.schema=lm;x.components.table.store=Hc;x.components.table.view=pm;x.components.tabs={};x.components.tabs.handlers=Yc;x.components.tabs.schema=dm;x.components.tabs.store=Qc;x.components.tabs.view=cm;x.components.tagSelect={};x.components.tagSelect.handlers=cu;x.components.tagSelect.methods=yu;x.components.tagSelect.schema=um;x.components.tagSelect.store=Du;x.components.tagSelect.view=hm;x.components.tooltip={};x.components.tooltip.handlers=Pu;x.components.tooltip.schema=fm;x.components.tooltip.store=Wu;x.components.tooltip.view=ym;x.components.waveform={};x.components.waveform.handlers=Ku;x.components.waveform.schema=mm;x.components.waveform.store=Yu;x.components.waveform.view=gm;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let s=x[e][t],r=Ty({...s},Ry[e]),i=s.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,r)})});customElements.define("rtgl-button",sr({}));customElements.define("rtgl-carousel",ar({}));customElements.define("rtgl-grid",lr({}));customElements.define("rtgl-view",dr({}));customElements.define("rtgl-text",ur({}));customElements.define("rtgl-image",yr({}));customElements.define("rtgl-tag",gr({}));customElements.define("rtgl-svg",vr({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",wr({}));customElements.define("rtgl-input-time",_r({}));customElements.define("rtgl-input-datetime",xr({}));customElements.define("rtgl-input-number",Sr({}));customElements.define("rtgl-textarea",Ar({}));customElements.define("rtgl-color-picker",kr({}));customElements.define("rtgl-slider",Er({}));customElements.define("rtgl-checkbox",$r({}));customElements.define("rtgl-dialog",Cr({}));customElements.define("rtgl-popover",Tr({}));})();
|
|
1636
|
+
`,Qi="data-rtgl-render-target",jn="__rtglRenderTarget",ji=e=>!e||typeof e!="object"?!1:typeof e.getAttribute=="function"?e.getAttribute(Qi)!==null:e[jn]===!0,fr=e=>{!e||typeof e!="object"||(typeof e.setAttribute=="function"?e.setAttribute(Qi,""):e[jn]=!0)},ny=e=>{if(!(!e||typeof e!="object"))return typeof e.querySelector=="function"?e.querySelector(`[${Qi}]`)??e.firstElementChild:Array.isArray(e.childNodes)?e.childNodes.find(ji)??e.childNodes[0]:Array.isArray(e.children)?e.children.find(ji)??e.children[0]:e.firstElementChild},oy=({host:e,cssText:t,createStyleSheet:i=()=>new CSSStyleSheet,createElement:s=r=>document.createElement(r)})=>{let r=e.shadowRoot??e.attachShadow({mode:"open"}),n=i();n.replaceSync(ry);let o=[n];if(t){let a=i();a.replaceSync(t),o.push(a)}r.adoptedStyleSheets=o;let l=ny(r);l?(l.style.cssText="display: contents;",ji(l)||fr(l)):(l=s("div"),l.style.cssText="display: contents;",fr(l),r.appendChild(l)),l.parentNode!==r&&r.appendChild(l);let p=hn(e);return p&&typeof p=="object"&&(p.display="contents"),{shadow:r,renderTarget:l,adoptedStyleSheets:o}},Pi=(e,t=requestAnimationFrame)=>t(e),ay=({scheduleFrameFn:e=Pi}={})=>({update:(t,i)=>{let s=t.data?.props||{},r=i.data?.props||{};if(JSON.stringify(s)===JSON.stringify(r))return;let n=i.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let o={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(o,{oldProps:s,newProps:r})}}))}}),ly=({elementName:e,propsSchema:t,propsSchemaKeys:i,template:s,refs:r,styles:n,handlers:o,methods:l,constants:p,store:a,patch:c,h:d,deps:u})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;i18nRuntime;_i18nUnsubscribe;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let m={};return this.store.selectViewData&&(m=this.store.selectViewData()),{...m,i18n:this.i18nRuntime?.getMessages?.()||{}}}connectedCallback(){let m=oy({host:this,cssText:this.cssText});this.shadow=m.shadow,this.renderTarget=m.renderTarget,this.i18nRuntime?.subscribe&&!this._i18nUnsubscribe&&(this._i18nUnsubscribe=this.i18nRuntime.subscribe(()=>{this.render()})),Qf({instance:this,parseAndRenderFn:Sn,renderFn:this.render})}disconnectedCallback(){this._i18nUnsubscribe&&(this._i18nUnsubscribe(),this._i18nUnsubscribe=void 0),ey({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(m,b,g){ty({instance:this,attributeName:m,oldValue:b,newValue:g,scheduleFrameFn:Pi})}render=()=>{sy({instance:this,createComponentUpdateHookFn:ay})}}class h extends f{static get observedAttributes(){return Gf({propsSchemaKeys:i,toKebabCase:cn})}constructor(){super(),this.constants=uf({setupConstants:u?.constants,fileConstants:p}),this.propsSchema=t,gh({source:this,allowedKeys:i,onPropChange:({propName:m,oldValue:b,newValue:g})=>{iy({instance:this,propName:m,oldValue:b,newValue:g,scheduleFrameFn:Pi})}}),this.props=t?bh(this,i):{},this._propsSchemaKeys=i,this.elementName=e,this.styles=n,this.i18nRuntime=u?.__rtglI18nRuntime,this.store=cf(a,this.props,this.constants,{getI18n:()=>this.i18nRuntime?.getMessages?.()||{},locale:this.i18nRuntime?.locale}),this.template=s,this.handlers=o,this.methods=l,this.refs=r,this.patch=c,this.deps={...u,locale:this.i18nRuntime?.locale||u?.locale,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},this.i18nRuntime&&Object.defineProperty(this.deps,"i18n",{enumerable:!0,configurable:!0,get:()=>this.i18nRuntime.getMessages()}),Xh(this,this.methods),this._snabbdomH=d,this.cssText=hf(e,n)}}return h};function ot(e,t,i,s,r){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:i,text:s,elm:r,key:n}}var Ct=Array.isArray;function bt(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function py(e,t){return document.createElement(e,t)}function dy(e,t,i){return document.createElementNS(e,t,i)}function cy(){return Ee(document.createDocumentFragment())}function uy(e){return document.createTextNode(e)}function hy(e){return document.createComment(e)}function fy(e,t,i){if(me(e)){let s=e;for(;s&&me(s);)s=Ee(s).parent;e=s??e}me(t)&&(t=Ee(t,e)),i&&me(i)&&(i=Ee(i).firstChildNode),e.insertBefore(t,i)}function yy(e,t){e.removeChild(t)}function my(e,t){me(t)&&(t=Ee(t,e)),e.appendChild(t)}function Pn(e){if(me(e)){for(;e&&me(e);)e=Ee(e).parent;return e??null}return e.parentNode}function gy(e){var t;if(me(e)){let i=Ee(e),s=Pn(i);if(s&&i.lastChildNode){let r=Array.from(s.childNodes),n=r.indexOf(i.lastChildNode);return(t=r[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function by(e){return e.tagName}function vy(e,t){e.textContent=t}function wy(e){return e.textContent}function _y(e){return e.nodeType===1}function xy(e){return e.nodeType===3}function Sy(e){return e.nodeType===8}function me(e){return e.nodeType===11}function Ee(e,t){var i,s,r;let n=e;return(i=n.parent)!==null&&i!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(r=n.lastChildNode)!==null&&r!==void 0||(n.lastChildNode=e.lastChild),n}var Ay={createElement:py,createElementNS:dy,createTextNode:uy,createDocumentFragment:cy,createComment:hy,insertBefore:fy,removeChild:yy,appendChild:my,parentNode:Pn,nextSibling:gy,tagName:by,setTextContent:vy,getTextContent:wy,isElement:_y,isText:xy,isComment:Sy,isDocumentFragment:me};function gt(e){return e===void 0}function ie(e){return e!==void 0}var bi=ot("",{},[],void 0,void 0);function tt(e,t){var i,s;let r=e.key===t.key,n=((i=e.data)===null||i===void 0?void 0:i.is)===((s=t.data)===null||s===void 0?void 0:s.is),o=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&r&&n&&l}function ky(){throw new Error("The document fragment is not supported on this platform.")}function Ey(e,t){return e.isElement(t)}function $y(e,t){return e.isDocumentFragment(t)}function Cy(e,t,i){var s;let r={};for(let n=t;n<=i;++n){let o=(s=e[n])===null||s===void 0?void 0:s.key;o!==void 0&&(r[o]=n)}return r}var Oy=["create","update","remove","destroy","pre","post"];function Iy(e,t,i){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=Ay;for(let h of Oy)for(let y of e){let m=y[h];m!==void 0&&s[h].push(m)}function n(h){let y=h.id?"#"+h.id:"",m=h.getAttribute("class"),b=m?"."+m.split(" ").join("."):"";return ot(r.tagName(h).toLowerCase()+y+b,{},[],void 0,h)}function o(h){return ot(void 0,{},[],void 0,h)}function l(h,y){return function(){if(--y===0){let m=r.parentNode(h);m!==null&&r.removeChild(m,h)}}}function p(h,y){var m,b,g,_;let S,A=h.data;if(A!==void 0){let O=(m=A.hook)===null||m===void 0?void 0:m.init;ie(O)&&(O(h),A=h.data)}let k=h.children,C=h.sel;if(C==="!")gt(h.text)&&(h.text=""),h.elm=r.createComment(h.text);else if(C==="")h.elm=r.createTextNode(h.text);else if(C!==void 0){let O=C.indexOf("#"),V=C.indexOf(".",O),z=O>0?O:C.length,B=V>0?V:C.length,J=O!==-1||V!==-1?C.slice(0,Math.min(z,B)):C,Z=h.elm=ie(A)&&ie(S=A.ns)?r.createElementNS(S,J,A):r.createElement(J,A);for(z<B&&Z.setAttribute("id",C.slice(z+1,B)),V>0&&Z.setAttribute("class",C.slice(B+1).replace(/\./g," ")),S=0;S<s.create.length;++S)s.create[S](bi,h);if(bt(h.text)&&(!Ct(k)||k.length===0)&&r.appendChild(Z,r.createTextNode(h.text)),Ct(k))for(S=0;S<k.length;++S){let we=k[S];we!=null&&r.appendChild(Z,p(we,y))}let ge=h.data.hook;ie(ge)&&((b=ge.create)===null||b===void 0||b.call(ge,bi,h),ge.insert&&y.push(h))}else if(!((g=void 0)===null||g===void 0)&&g.fragments&&h.children){for(h.elm=((_=r.createDocumentFragment)!==null&&_!==void 0?_:ky)(),S=0;S<s.create.length;++S)s.create[S](bi,h);for(S=0;S<h.children.length;++S){let O=h.children[S];O!=null&&r.appendChild(h.elm,p(O,y))}}else h.elm=r.createTextNode(h.text);return h.elm}function a(h,y,m,b,g,_){for(;b<=g;++b){let S=m[b];S!=null&&r.insertBefore(h,p(S,_),y)}}function c(h){var y,m;let b=h.data;if(b!==void 0){(m=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||m===void 0||m.call(y,h);for(let g=0;g<s.destroy.length;++g)s.destroy[g](h);if(h.children!==void 0)for(let g=0;g<h.children.length;++g){let _=h.children[g];_!=null&&typeof _!="string"&&c(_)}}}function d(h,y,m,b){for(var g,_;m<=b;++m){let S,A,k=y[m];if(k!=null)if(ie(k.sel)){c(k),S=s.remove.length+1,A=l(k.elm,S);for(let O=0;O<s.remove.length;++O)s.remove[O](k,A);let C=(_=(g=k?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;ie(C)?C(k,A):A()}else k.children?(c(k),d(h,k.children,0,k.children.length-1)):r.removeChild(h,k.elm)}}function u(h,y,m,b){let g=0,_=0,S=y.length-1,A=y[0],k=y[S],C=m.length-1,O=m[0],V=m[C],z,B,J,Z;for(;g<=S&&_<=C;)A==null?A=y[++g]:k==null?k=y[--S]:O==null?O=m[++_]:V==null?V=m[--C]:tt(A,O)?(f(A,O,b),A=y[++g],O=m[++_]):tt(k,V)?(f(k,V,b),k=y[--S],V=m[--C]):tt(A,V)?(f(A,V,b),r.insertBefore(h,A.elm,r.nextSibling(k.elm)),A=y[++g],V=m[--C]):tt(k,O)?(f(k,O,b),r.insertBefore(h,k.elm,A.elm),k=y[--S],O=m[++_]):(z===void 0&&(z=Cy(y,g,S)),B=z[O.key],gt(B)?(r.insertBefore(h,p(O,b),A.elm),O=m[++_]):gt(z[V.key])?(r.insertBefore(h,p(V,b),r.nextSibling(k.elm)),V=m[--C]):(J=y[B],J.sel!==O.sel?r.insertBefore(h,p(O,b),A.elm):(f(J,O,b),y[B]=void 0,r.insertBefore(h,J.elm,A.elm)),O=m[++_]));_<=C&&(Z=m[C+1]==null?null:m[C+1].elm,a(h,Z,m,_,C,b)),g<=S&&d(h,y,g,S)}function f(h,y,m){var b,g,_,S,A,k,C,O;let V=(b=y.data)===null||b===void 0?void 0:b.hook;(g=V?.prepatch)===null||g===void 0||g.call(V,h,y);let z=y.elm=h.elm;if(h===y)return;if(y.data!==void 0||ie(y.text)&&y.text!==h.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(S=h.data)!==null&&S!==void 0||(h.data={});for(let Z=0;Z<s.update.length;++Z)s.update[Z](h,y);(C=(k=(A=y.data)===null||A===void 0?void 0:A.hook)===null||k===void 0?void 0:k.update)===null||C===void 0||C.call(k,h,y)}let B=h.children,J=y.children;gt(y.text)?ie(B)&&ie(J)?B!==J&&u(z,B,J,m):ie(J)?(ie(h.text)&&r.setTextContent(z,""),a(z,null,J,0,J.length-1,m)):ie(B)?d(z,B,0,B.length-1):ie(h.text)&&r.setTextContent(z,""):h.text!==y.text&&(ie(B)&&d(z,B,0,B.length-1),r.setTextContent(z,y.text)),(O=V?.postpatch)===null||O===void 0||O.call(V,h,y)}return function(h,y){let m,b,g,_=[];for(m=0;m<s.pre.length;++m)s.pre[m]();for(Ey(r,h)?h=n(h):$y(r,h)&&(h=o(h)),tt(h,y)?f(h,y,_):(b=h.elm,g=r.parentNode(b),p(y,_),g!==null&&(r.insertBefore(g,y.elm,r.nextSibling(b)),d(g,[h],0,0))),m=0;m<_.length;++m)_[m].data.hook.insert(_[m]);for(m=0;m<s.post.length;++m)s.post[m]();return y}}function yr(e,t){let i,s,r=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(o,s)&&r.classList.remove(s);for(s in o)i=o[s],i!==n[s]&&r.classList[i?"add":"remove"](s)}}var Ty={create:yr,update:yr};function mr(e,t){let i,s,r,n=t.elm,o=e.data.props,l=t.data.props;if(!(!o&&!l)&&o!==l){o=o||{},l=l||{};for(i in l)s=l[i],r=o[i],r!==s&&(i!=="value"||n[i]!==s)&&(n[i]=s)}}var Ly={create:mr,update:mr},Vy="http://www.w3.org/1999/xlink",Ry="http://www.w3.org/2000/xmlns/",Ny="http://www.w3.org/XML/1998/namespace",gr=58,Dy=120,jy=109;function br(e,t){let i,s=t.elm,r=e.data.attrs,n=t.data.attrs;if(!(!r&&!n)&&r!==n){r=r||{},n=n||{};for(i in n){let o=n[i];r[i]!==o&&(o===!0?s.setAttribute(i,""):o===!1?s.removeAttribute(i):i.charCodeAt(0)!==Dy?s.setAttribute(i,o):i.charCodeAt(3)===gr?s.setAttributeNS(Ny,i,o):i.charCodeAt(5)===gr?i.charCodeAt(1)===jy?s.setAttributeNS(Ry,i,o):s.setAttributeNS(Vy,i,o):s.setAttribute(i,o))}for(i in r)i in n||s.removeAttribute(i)}}var Py={create:br,update:br},vr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,By=function(e){vr(function(){vr(e)})},Bi=!1;function zy(e,t,i){By(function(){e[t]=i})}function wr(e,t){let i,s,r=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let l="delayed"in n;for(s in n)s in o||(s[0]==="-"&&s[1]==="-"?r.style.removeProperty(s):r.style[s]="");for(s in o)if(i=o[s],s==="delayed"&&o.delayed)for(let p in o.delayed)i=o.delayed[p],(!l||i!==n.delayed[p])&&zy(r.style,p,i);else s!=="remove"&&i!==n[s]&&(s[0]==="-"&&s[1]==="-"?r.style.setProperty(s,i):r.style[s]=i)}function Wy(e){let t,i,s=e.elm,r=e.data.style;if(!(!r||!(t=r.destroy)))for(i in t)s.style[i]=t[i]}function My(e,t){let i=e.data.style;if(!i||!i.remove){t();return}Bi||(e.elm.offsetLeft,Bi=!0);let s,r=e.elm,n=0,o=i.remove,l=0,p=[];for(s in o)p.push(s),r.style[s]=o[s];let a=getComputedStyle(r)["transition-property"].split(", ");for(;n<a.length;++n)p.indexOf(a[n])!==-1&&l++;r.addEventListener("transitionend",function(c){c.target===r&&--l,l===0&&t()})}function Fy(){Bi=!1}var Ky={pre:Fy,create:wr,update:wr,destroy:Wy,remove:My};function Bn(e,t,i){if(typeof e=="function")e.call(t,i,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)Bn(e[s],t,i)}function Uy(e,t){let i=e.type,s=t.data.on;s&&s[i]&&Bn(s[i],t,e)}function Hy(){return function e(t){Uy(t,e.vnode)}}function vi(e,t){let i=e.data.on,s=e.listener,r=e.elm,n=t&&t.data.on,o=t&&t.elm,l;if(i!==n){if(i&&s)if(n)for(l in i)n[l]||r.removeEventListener(l,s,!1);else for(l in i)r.removeEventListener(l,s,!1);if(n){let p=t.listener=e.listener||Hy();if(p.vnode=t,i)for(l in n)i[l]||o.addEventListener(l,p,!1);else for(l in n)o.addEventListener(l,p,!1)}}}var qy={create:vi,update:vi,destroy:vi},Yy=()=>Iy([Ty,Ly,Py,Ky,qy]);function zn(e,t,i){if(e.ns="http://www.w3.org/2000/svg",i!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let r=t[s];if(typeof r=="string")continue;let n=r.data;n!==void 0&&zn(n,r.children,r.sel)}}function Gy(e,t,i){let s={},r,n,o;if(i!==void 0?(t!==null&&(s=t),Ct(i)?r=i:bt(i)?n=i.toString():i&&i.sel&&(r=[i])):t!=null&&(Ct(t)?r=t:bt(t)?n=t.toString():t&&t.sel?r=[t]:s=t),r!==void 0)for(o=0;o<r.length;++o)bt(r[o])&&(r[o]=ot(void 0,void 0,void 0,r[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&zn(s,r,e),ot(e,s,r,n,void 0)}var Jy=Yy(),Zy=({handlers:e,methods:t,constants:i,schema:s,view:r,store:n},o)=>{if(!r)throw new Error("view is not defined");if(!s||typeof s!="object"||Array.isArray(s))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=s,{template:p,refs:a,styles:c}=r;vh({schema:l,methodExports:Object.keys(t||{})});let d=l.componentName,u=l.propsSchema,f=u?.properties?[...new Set(Object.keys(u.properties).map(h=>un(h)))]:[];return ly({elementName:d,propsSchema:u,propsSchemaKeys:f,template:p,refs:a,styles:c,handlers:e,methods:t,constants:i,store:n,patch:Jy,h:Gy,deps:o})},Xy=e=>{let t={};return{once:(i,s)=>{t[i]||(t[i]=[]);let r=(...n)=>{s(...n),t[i]=t[i].filter(o=>o!==r)};return t[i].push(r),()=>{t[i]=(t[i]??[]).filter(n=>n!==r)}},emit:(i,...s)=>{t[i]&&[...t[i]].forEach(r=>{r(...s)})},showAlert:async i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showComponentDialog:async i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showToast:i=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},Qy=Xy(),em={globalUI:Qy},_r={components:em},tm={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},im={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},sm={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},rm={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},nm={componentName:"rtgl-card",propsSchema:{type:"object",properties:{head:{type:"string"},desc:{type:"string"},size:{type:"string",enum:["sm","md","lg"]}}},events:[],methods:{type:"object",properties:{}}},om={styles:{":host":{display:"block"},slot:{display:"block","min-width":0},".rtgl-card-body":{"min-width":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ${cardAttrString} ${containerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if hasHeader",value:{type:6,conditions:[{type:1,path:"hasHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="rtgl-card-header" d=v w=f ${headerAttrString}',value:{type:9,items:[{type:8,properties:[{key:"$if head",value:{type:6,conditions:[{type:1,path:"head"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-heading" s=${headingSize} w=f',value:{type:1,path:"head"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-heading" s=',{type:1,path:"headingSize"}," w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if desc",value:{type:6,conditions:[{type:1,path:"desc"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-text class="rtgl-card-desc" s=${subheadingSize} c=mu-fg w=f',value:{type:1,path:"desc"},parsedKey:{type:2,parts:['rtgl-text class="rtgl-card-desc" s=',{type:1,path:"subheadingSize"}," c=mu-fg w=f"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card-header" d=v w=f ',{type:1,path:"headerAttrString"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"div class=rtgl-card-body",value:{type:9,items:[{type:8,properties:[{key:"slot",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:['rtgl-view class="rtgl-card" d=v w=f bgc=bg bw=xs bc=bo br=xl shadow=sm ',{type:1,path:"cardAttrString"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},am={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["section","item","separator","label"]},id:{type:"string"},icon:{type:"string"},path:{type:"string"},href:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},overlay:{type:"boolean"},"no-overlay":{type:"boolean"},"sm-place":{type:"string"},"md-place":{type:"string"},"lg-place":{type:"string"},"xl-place":{type:"string"},"sm-overlay":{type:"boolean"},"md-overlay":{type:"boolean"},"lg-overlay":{type:"boolean"},"xl-overlay":{type:"boolean"},"sm-no-overlay":{type:"boolean"},"md-no-overlay":{type:"boolean"},"lg-no-overlay":{type:"boolean"},"xl-no-overlay":{type:"boolean"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},lm={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"},".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} ${popoverAttrString} content-w=${w} content-h=${h} content-sv=true content-g=xs content-pv=sm",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSection",value:{type:6,conditions:[{type:1,path:"item.isSection"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f p=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} p=md cur=pointer bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if item.hasIconSlot",value:{type:6,conditions:[{type:1,path:"item.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if item.hasIcon",value:{type:6,conditions:[{type:1,path:"item.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=${item.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=",{type:1,path:"item.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} w=1fg ellipsis",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if item.hasSuffixText",value:{type:6,conditions:[{type:1,path:"item.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${item.suffixTextColor} ta=e",value:{type:1,path:"item.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"item.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," p=md cur=pointer bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," ",{type:1,path:"popoverAttrString"}," content-w=",{type:1,path:"w"}," content-h=",{type:1,path:"h"}," content-sv=true content-g=xs content-pv=sm"]}}],fast:!1}],fast:!1}},pm={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},dm={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "tag-select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"tag-select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-tag-select#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} :selectedValues=${field._selectedValues} :placeholder=${field.placeholder} :addOption=${field.addOption} ?no-add=${field.noAdd} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tag-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," :selectedValues=",{type:1,path:"field._selectedValues"}," :placeholder=",{type:1,path:"field.placeholder"}," :addOption=",{type:1,path:"field.addOption"}," ?no-add=",{type:1,path:"field.noAdd"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "segmented-control"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"segmented-control"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-segmented-control#field${field._idx} data-field-name=${field.name} w=f :options=${field.options} ?no-clear=${field.noClear} :selectedValue=${field._selectedValue} :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-segmented-control#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=",{type:1,path:"field.options"}," ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=",{type:1,path:"field._selectedValue"}," :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},cm={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},um={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},componentDialogBodyHost:{},"componentDialogAction*":{eventListeners:{click:{handler:"handleComponentDialogAction"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},styles:{".toast-layer":{"pointer-events":"none"},".toast-card":{"pointer-events":"auto","box-sizing":"border-box",width:"33vw","max-width":"calc(100vw - 2 * var(--spacing-lg))",opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1)","will-change":"opacity, transform"},".toast-card-top":{animation:"toast-in-top 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-bottom":{animation:"toast-in-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1)"},".toast-card-md":{width:"50vw"},".toast-card-lg":{width:"80vw"},".toast-card-top.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -0.5)) scale(0.98)"},".toast-card-bottom.toast-card-exiting":{opacity:0,transform:"translateY(calc(var(--spacing-sm) * 0.5)) scale(0.98)"},".toast-message":{"overflow-wrap":"anywhere"},"@keyframes toast-in-top":{from:{opacity:0,transform:"translateY(calc(var(--spacing-sm) * -1)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@keyframes toast-in-bottom":{from:{opacity:0,transform:"translateY(var(--spacing-sm)) scale(0.96)"},to:{opacity:1,transform:"translateY(0) scale(1)"}},"@media (prefers-reduced-motion: reduce)":{".toast-card":{animation:"none",transition:"none"}},"@media only screen and (max-width: 768px)":{".toast-card":{width:"calc(100vw - 2 * var(--spacing-lg))"}}},template:{type:9,items:[{type:8,properties:[{key:"$if topToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"topToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-top" pos=fix edge=t z=2100 w=f ah=c g=sm ph=md pt=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"topToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-top toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-top toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if bottomToasts.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"bottomToasts.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-layer toast-layer-bottom" pos=fix edge=b z=2100 w=f ah=c g=sm ph=md pb=xl',value:{type:9,items:[{type:7,itemVar:"toast",indexVar:"i",iterable:{type:1,path:"bottomToasts"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view class="toast-card toast-card-bottom toast-card-${toast.size} toast-card-${toast.phase}" key=toast-${toast.id} bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text class=toast-message ta=c w=f",value:{type:1,path:"toast.message"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view class="toast-card toast-card-bottom toast-card-',{type:1,path:"toast.size"}," toast-card-",{type:1,path:"toast.phase"},'" key=toast-',{type:1,path:"toast.id"}," bgc=su bc=bo bw=xs br=md shadow=md ph=xl pv=lg"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=${formDialogConfig.form} :defaultValues=${formDialogConfig.defaultValues} :context=${formDialogConfig.context} ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=",{type:1,path:"formDialogConfig.form"}," :defaultValues=",{type:1,path:"formDialogConfig.defaultValues"}," :context=",{type:1,path:"formDialogConfig.context"}," ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if isComponentDialogOpen",value:{type:6,conditions:[{type:1,path:"isComponentDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title || componentDialogConfig.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"componentDialogConfig.title"},right:{type:1,path:"componentDialogConfig.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if componentDialogConfig.title",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"componentDialogConfig.title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if componentDialogConfig.description",value:{type:6,conditions:[{type:1,path:"componentDialogConfig.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"componentDialogConfig.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-${componentDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view#componentDialogBodyHost w=f key=component-dialog-body-",{type:1,path:"componentDialogConfig.key"}]}}],fast:!0},{type:8,properties:[{key:"$if componentDialogConfig.actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"componentDialogConfig.actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"componentDialogConfig.actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#componentDialogAction${button._globalIdx} data-action-id=${button.id} data-action-index=${button._globalIdx} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#componentDialogAction",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," data-action-index=",{type:1,path:"button._globalIdx"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen && !isComponentDialogOpen",value:{type:6,conditions:[{type:4,op:6,left:{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}},right:{type:5,op:0,operand:{type:1,path:"isComponentDialogOpen"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if config.title",value:{type:6,conditions:[{type:1,path:"config.title"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} ${dropdownConfig.popoverAttrString} :items=${dropdownConfig.items} key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," ",{type:1,path:"dropdownConfig.popoverAttrString"}," :items=",{type:1,path:"dropdownConfig.items"}," key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},hm={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},fm={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},ym={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},mm={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},gm={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},bm={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} content-g=md content-w=240 content-pv=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," content-g=md content-w=240 content-pv=sm"]}}],fast:!0}],fast:!0}},vm={componentName:"rtgl-segmented-control",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},wm={refs:{"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},keydown:{handler:"handleAddOptionKeyDown"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ${containerAttrString} role="group" aria-label=${ariaLabel}',value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${i} d=h av=c ah=c w=1fg ph=lg pv=md cur=${option.cursor} bgc=${option.bgc} bwl=${option.borderLeftWidth} bc=bo data-testid=${option.testId} role="button" tabindex=${option.tabIndex} aria-pressed=${option.isSelected} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${option.textColor} ta=c",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.textColor"}," ta=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," d=h av=c ah=c w=1fg ph=lg pv=md cur=",{type:1,path:"option.cursor"}," bgc=",{type:1,path:"option.bgc"}," bwl=",{type:1,path:"option.borderLeftWidth"}," bc=bo data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=',{type:1,path:"option.tabIndex"}," aria-pressed=",{type:1,path:"option.isSelected"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!0}],fast:!0},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=${addOptionBgc} bwl=${addOptionBorderLeftWidth} bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac ta=c",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd d=h av=c ah=c w=1fg ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"}," bwl=",{type:1,path:"addOptionBorderLeftWidth"},' bc=bo data-testid="segmented-control-add-option" role="button" tabindex=0']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h bw=xs bc=bo br=md bgc=bg overflow=hidden ",{type:1,path:"containerAttrString"},' role="group" aria-label=',{type:1,path:"ariaLabel"}]}}],fast:!1}],fast:!1}},_m={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},xm={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"},keydown:{handler:"handleButtonKeyDown"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=${selectButtonHoverBorderColor} br=md bgc=su cur=${selectButtonCursor} ${containerAttrString} data-testid="select-button" role="button" tabindex=${selectButtonTabIndex} aria-disabled=${isDisabled}',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if hasSelectedIcon",value:{type:6,conditions:[{type:1,path:"hasSelectedIcon"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg svg=${selectedIcon} wh=16 c=${selectedIconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"selectedIcon"}," wh=16 c=",{type:1,path:"selectedIconColor"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if hasSelectedSuffixText",value:{type:6,conditions:[{type:1,path:"hasSelectedSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${selectedSuffixTextColor} ta=e",value:{type:1,path:"selectedSuffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"selectedSuffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:['rtgl-view#selectButton style="display: inline-flex;" d=h av=c h=32 ph=md bw=xs bc=bo h-bc=',{type:1,path:"selectButtonHoverBorderColor"}," br=md bgc=su cur=",{type:1,path:"selectButtonCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="select-button" role="button" tabindex=',{type:1,path:"selectButtonTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${option.index} w=f ph=lg pv=md cur=pointer bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=1fg",value:{type:9,items:[{type:8,properties:[{key:"$if option.hasIconSlot",value:{type:6,conditions:[{type:1,path:"option.hasIconSlot"}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if option.hasIcon",value:{type:6,conditions:[{type:1,path:"option.hasIcon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${option.icon} c=${option.iconColor}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"option.icon"}," c=",{type:1,path:"option.iconColor"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'div class=icon-placeholder aria-hidden="true"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-text s=sm c=${option.c} w=1fg ellipsis",value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"option.c"}," w=1fg ellipsis"]}}],fast:!0}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if option.hasSuffixText",value:{type:6,conditions:[{type:1,path:"option.hasSuffixText"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=${option.suffixTextColor} ta=e",value:{type:1,path:"option.suffixText"},parsedKey:{type:2,parts:["rtgl-text s=xs c=",{type:1,path:"option.suffixTextColor"}," ta=e"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=sm",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs content-wh=300 content-g=xs content-sv=true content-pv=sm"]}}],fast:!1}],fast:!1}},Sm={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},tooltip:{type:"boolean",default:!1},showCompactTooltip:{type:"boolean",default:!1,description:"Deprecated alias for tooltip. Use tooltip instead."},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{label:{type:"string"},title:{type:"string",description:"Deprecated item text field. Use label instead."},slug:{type:"string"},type:{type:"string",description:"Item row type. Supports item, groupLabel, divider, and spacer."},tooltip:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},Am={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"},mouseenter:{handler:"handleItemMouseEnter"},mouseleave:{handler:"handleItemMouseLeave"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg ph=${headerPadding} pb=lg g=xs ah=${ah} ${listAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "divider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"divider"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"spacer"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1 w=f bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view h=1fg w=f",value:{type:0,value:null}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:'rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId} aria-label="${item.label}"',value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.label.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"},' aria-label="',{type:1,path:"item.label"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"listAttrString"}]}}],fast:!1},{type:8,properties:[{key:"$if enableCompactTooltip",value:{type:6,conditions:[{type:1,path:"enableCompactTooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-tooltip#tooltip s="md" ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place=${tooltipState.place} content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:['rtgl-tooltip#tooltip s="md" ?open=',{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"}," place=",{type:1,path:"tooltipState.place"},' content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},km={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},Em={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},$m={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},Cm={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1},flatten:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Om={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},Im={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},flatten:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},Tm={componentName:"rtgl-tag-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["section","item","separator"]},label:{type:"string"},value:{type:"any"},icon:{type:"string"},shortcut:{type:"string"},suffixText:{type:"string"},testId:{type:"string"}}}},selectedValues:{type:"array",items:{type:"any"}},draftSelectedValues:{type:"array",items:{type:"any"}},open:{type:"boolean"},onChange:{type:"function"},addOption:{type:"object",properties:{label:{type:"string"}}},noAdd:{type:"boolean"},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"draft-value-change":{},"open-change":{},"add-option-click":{}},methods:{type:"object",properties:{refreshPopover:{description:"Recomputes the open popover position and rerenders the current options and draft values.",params:["values","keepOpen"],returns:"void"},setDraftSelectedValues:{description:"Replaces the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["values","keepOpen"],returns:"void"},appendDraftSelectedValue:{description:"Adds a value to the draft-only selection without committing `selectedValues`; optionally reopens the popover around the trigger when `keepOpen` is true.",params:["value","keepOpen"],returns:"void"}}}},Lm={refs:{trigger:{eventListeners:{click:{handler:"handleTriggerClick"},keydown:{handler:"handleTriggerKeyDown"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},keydown:{handler:"handleOptionKeyDown"}}},submitButton:{eventListeners:{click:{handler:"handleSubmitClick"}}},addOptionButton:{eventListeners:{click:{handler:"handleAddOptionClick"}}}},styles:{".icon-placeholder":{width:"16px",height:"16px","flex-shrink":0}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-view#trigger d=h av=c g=sm cur=${triggerCursor} ${containerAttrString} data-testid="tag-select-trigger" role="button" tabindex=${triggerTabIndex} aria-disabled=${isDisabled} style="min-height: 24px;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c wrap g=sm w=1fg",value:{type:9,items:[{type:7,itemVar:"tag",indexVar:"i",iterable:{type:1,path:"triggerTags"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-tag data-selection-index=${tag.selectionIndex} pre=${tag.icon} data-testid=${tag.testId} v=mu style="${tag.tagStyle}"',value:{type:1,path:"tag.label"},parsedKey:{type:2,parts:["rtgl-tag data-selection-index=",{type:1,path:"tag.selectionIndex"}," pre=",{type:1,path:"tag.icon"}," data-testid=",{type:1,path:"tag.testId"},' v=mu style="',{type:1,path:"tag.tagStyle"},'"']}}],fast:!0}],fast:!0},flatten:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#trigger d=h av=c g=sm cur=",{type:1,path:"triggerCursor"}," ",{type:1,path:"containerAttrString"},' data-testid="tag-select-trigger" role="button" tabindex=',{type:1,path:"triggerTabIndex"}," aria-disabled=",{type:1,path:"isDisabled"},' style="min-height: 24px;"']}}],fast:!1},{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=bs content-w=${position.w} content-g=sm content-sv=true content-ph=md content-pv=md",value:{type:9,items:[{type:8,properties:[{key:"$if !hasSelectableOptions",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"hasSelectableOptions"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:0,value:"No tags available"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h wrap g=sm w=f",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"$if option.isSection",value:{type:6,conditions:[{type:1,path:"option.isSection"},{type:1,path:"option.isItem"},{type:1,path:"option.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f pt=xs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-view#option${option.index} cur=${option.cursor} data-testid=${option.testId} role="button" tabindex=0 aria-pressed=${option.isSelected}',value:{type:9,items:[{type:8,properties:[{key:'rtgl-tag v=mu pre=${option.icon} style="${option.tagStyle}"',value:{type:1,path:"option.label"},parsedKey:{type:2,parts:["rtgl-tag v=mu pre=",{type:1,path:"option.icon"},' style="',{type:1,path:"option.tagStyle"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"option.index"}," cur=",{type:1,path:"option.cursor"}," data-testid=",{type:1,path:"option.testId"},' role="button" tabindex=0 aria-pressed=',{type:1,path:"option.isSelected"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 bgc=mu mv=xs",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},flatten:!0},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-button#addOptionButton v=gh s=sm pre=plus data-testid="tag-select-add-option"',value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h av=c g=sm w=f pt=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=${submitDisabled}',value:{type:1,path:"submitLabel"},parsedKey:{type:2,parts:['rtgl-button#submitButton v=pr s=sm data-testid="tag-select-submit" ?disabled=',{type:1,path:"submitDisabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=bs content-w=",{type:1,path:"position.w"}," content-g=sm content-sv=true content-ph=md content-pv=md"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}},Vm={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},s:{type:"string",enum:["sm","md","lg"]},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Rm={template:{type:9,items:[{type:8,properties:[{key:'rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay content-bgc=mu content-style="${contentStyle}"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view p=${padding} ah=s av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s s=${textSize} c=fg",value:{type:1,path:"content"},parsedKey:{type:2,parts:["rtgl-text ta=s s=",{type:1,path:"textSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view p=",{type:1,path:"padding"}," ah=s av=c"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"},' no-overlay content-bgc=mu content-style="',{type:1,path:"contentStyle"},'"']}}],fast:!0}],fast:!0},refs:{}},Nm={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},Dm={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=To;x.components.accordionItem.schema=tm;x.components.accordionItem.store=jo;x.components.accordionItem.view=im;x.components.breadcrumb={};x.components.breadcrumb.handlers=Bo;x.components.breadcrumb.schema=sm;x.components.breadcrumb.store=Yo;x.components.breadcrumb.view=rm;x.components.card={};x.components.card.schema=nm;x.components.card.store=Qo;x.components.card.view=om;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=ra;x.components.dropdownMenu.schema=am;x.components.dropdownMenu.store=ca;x.components.dropdownMenu.view=lm;x.components.form={};x.components.form.handlers=Tl;x.components.form.methods=Wl;x.components.form.schema=pm;x.components.form.store=wl;x.components.form.view=dm;x.components.globalUi={};x.components.globalUi.handlers=cp;x.components.globalUi.schema=cm;x.components.globalUi.store=Wp;x.components.globalUi.view=um;x.components.navbar={};x.components.navbar.handlers=Fp;x.components.navbar.schema=hm;x.components.navbar.store=Zp;x.components.navbar.view=fm;x.components.pageOutline={};x.components.pageOutline.handlers=td;x.components.pageOutline.schema=ym;x.components.pageOutline.store=pd;x.components.pageOutline.view=mm;x.components.popoverInput={};x.components.popoverInput.handlers=gd;x.components.popoverInput.schema=gm;x.components.popoverInput.store=kd;x.components.popoverInput.view=bm;x.components.segmentedControl={};x.components.segmentedControl.handlers=Rd;x.components.segmentedControl.schema=vm;x.components.segmentedControl.store=qd;x.components.segmentedControl.view=wm;x.components.select={};x.components.select.handlers=nc;x.components.select.schema=_m;x.components.select.store=Ac;x.components.select.view=xm;x.components.sidebar={};x.components.sidebar.handlers=Ic;x.components.sidebar.schema=Sm;x.components.sidebar.store=Fc;x.components.sidebar.view=Am;x.components.sliderInput={};x.components.sliderInput.handlers=Yc;x.components.sliderInput.schema=km;x.components.sliderInput.store=Xc;x.components.sliderInput.view=Em;x.components.table={};x.components.table.handlers=iu;x.components.table.schema=$m;x.components.table.store=uu;x.components.table.view=Cm;x.components.tabs={};x.components.tabs.handlers=fu;x.components.tabs.schema=Om;x.components.tabs.store=vu;x.components.tabs.view=Im;x.components.tagSelect={};x.components.tagSelect.handlers=Tu;x.components.tagSelect.methods=Nu;x.components.tagSelect.schema=Tm;x.components.tagSelect.store=sh;x.components.tagSelect.view=Lm;x.components.tooltip={};x.components.tooltip.handlers=rh;x.components.tooltip.schema=Vm;x.components.tooltip.store=ah;x.components.tooltip.view=Rm;x.components.waveform={};x.components.waveform.handlers=dh;x.components.waveform.schema=Nm;x.components.waveform.store=fh;x.components.waveform.view=Dm;var jm={};Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let i=x[e][t],s={..._r&&_r[e]||{},...jm},r=Zy({...i},s),n=i.schema?.componentName;if(!n)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(n,r)})});customElements.define("rtgl-button",os({}));customElements.define("rtgl-carousel",cs({}));customElements.define("rtgl-grid",us({}));customElements.define("rtgl-view",fs({}));customElements.define("rtgl-text",ms({}));customElements.define("rtgl-image",vs({}));customElements.define("rtgl-tag",_s({}));customElements.define("rtgl-svg",Ss({}));customElements.define("rtgl-input",ve({}));customElements.define("rtgl-input-date",As({}));customElements.define("rtgl-input-time",ks({}));customElements.define("rtgl-input-datetime",Es({}));customElements.define("rtgl-input-number",$s({}));customElements.define("rtgl-textarea",Cs({}));customElements.define("rtgl-color-picker",Os({}));customElements.define("rtgl-slider",Is({}));customElements.define("rtgl-checkbox",Ts({}));customElements.define("rtgl-dialog",Ls({}));customElements.define("rtgl-popover",js({}));})();
|