@rettangoli/ui 0.1.2-rc2 → 0.1.2-rc4
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.
|
@@ -387,7 +387,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
|
|
|
387
387
|
left: 0;
|
|
388
388
|
top: 0;
|
|
389
389
|
height: 100%;
|
|
390
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:n,pr:n,pb:n,pl:n,p:n,ph:n,pv:n,g:n,gv:n,gh:n,bw:E,bwt:E,bwr:E,bwb:E,bwl:E,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border"},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"}},k=p(st);var rt={mt:n,mr:n,mb:n,ml:n,m:n,mh:n,mv:n},b=p(rt);var C=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
|
|
390
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:n,pr:n,pb:n,pl:n,p:n,ph:n,pv:n,g:n,gv:n,gh:n,bw:E,bwt:E,bwr:E,bwb:E,bwl:E,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",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"}},k=p(st);var rt={mt:n,mr:n,mb:n,ml:n,m:n,mh:n,mv:n},b=p(rt);var C=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
|
|
391
391
|
slot {
|
|
392
392
|
display: contents;
|
|
393
393
|
}
|
|
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var D=(e,t)=>{for(var r in t)N
|
|
|
387
387
|
left: 0;
|
|
388
388
|
top: 0;
|
|
389
389
|
height: 100%;
|
|
390
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:$,pr:$,pb:$,pl:$,p:$,ph:$,pv:$,g:$,gv:$,gh:$,bw:ce,bwt:ce,bwr:ce,bwb:ce,bwl:ce,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border"},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"}},fe=K(zr);var Wr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},z=K(Wr);var Te=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
|
|
390
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:$,pr:$,pb:$,pl:$,p:$,ph:$,pv:$,g:$,gv:$,gh:$,bw:ce,bwt:ce,bwr:ce,bwb:ce,bwl:ce,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",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"}},fe=K(zr);var Wr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},z=K(Wr);var Te=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
|
|
391
391
|
slot {
|
|
392
392
|
display: contents;
|
|
393
393
|
}
|
|
@@ -803,7 +803,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var D=(e,t)=>{for(var r in t)N
|
|
|
803
803
|
}
|
|
804
804
|
${z}
|
|
805
805
|
${R}
|
|
806
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){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 a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Dt=({render:e,html:t})=>Re;var Me={};D(Me,{handleClickDialogueOverlay:()=>Br});var Br=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};D(ze,{INITIAL_STATE:()=>Kr,selectState:()=>qr,setState:()=>Jr,toViewData:()=>Ur});var Kr=Object.freeze({}),Ur=({state:e,props:t})=>({isOpen:t.isOpen,w:t.w||600,position:{x:0,y:0}}),qr=({state:e})=>e,Jr=e=>{};var Vt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"},w:{type:"string"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:null,template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=fix cor=full ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-overlay pos=fix cor=full ah=c av=c bgc=bg op=0.5",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=10vh",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=${w} br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=",{type:1,path:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var We={};D(We,{handleClickMenuItem:()=>Gr,handleClickPopoverOverlay:()=>Yr});var Yr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Gr=(e,t)=>{let{dispatchEvent:r}=t,s=parseInt(e.currentTarget.id.replace("option-","")),i=t.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var Fe={};D(Fe,{INITIAL_STATE:()=>Xr,selectState:()=>Zr,setState:()=>es,toViewData:()=>Qr});var Xr=Object.freeze({}),Qr=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),Zr=({state:e})=>e,es=e=>{};var Rt={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popover:{eventListeners:{"click-overlay":{handler:"handleClickPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",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 == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm 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#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var He={};D(He,{handleActionClick:()=>rs,handleColorPickerChange:()=>ns,handleInputChange:()=>ss,handleOnMount:()=>ts,handleSelectChange:()=>is,handleSliderChange:()=>as});var ts=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},ye=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{fieldName:e,fieldValue:t,formValues:r}}))},rs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},ss=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},is=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.selectedValue}),ye(i,e.detail.selectedValue,r.selectFormValues(),s))},ns=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},as=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))};var Be={};D(Be,{INITIAL_STATE:()=>os,selectFormValues:()=>ds,selectState:()=>hs,setDefaultValues:()=>fs,setFormFieldValue:()=>ms,setState:()=>us,toViewData:()=>cs});var os=Object.freeze({formValues:{}}),ls=["id","class","style","slot"],ps=e=>Object.entries(e).filter(([t])=>!ls.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),cs=({state:e,props:t,attrs:r})=>({containerAttrString:ps(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),hs=({state:e})=>e,ds=({state:e})=>e.formValues,us=e=>{},fs=(e,t)=>{e.formValues=t||{}},ms=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var Mt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"}},required:["id","label","inputType"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["id","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"}},required:["id","label","inputType"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["id","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{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:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.id} w=f placeholder=${field.placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.id"}," w=f placeholder=",{type:1,path:"field.placeholder"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.id} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=formValues[field.id]",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.id"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=formValues[field.id]"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.id} value=${field.value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.id"}," value=",{type:1,path:"field.value"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.id} min=${field.min} max=${field.max} step=${field.step} value=${field.value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{type:1,path:"field.id"}," min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," value=",{type:1,path:"field.value"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{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.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};D(Ke,{handleClickStart:()=>ys});var ys=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ue={};D(Ue,{INITIAL_STATE:()=>gs,selectPath:()=>xs,setState:()=>_s,toViewData:()=>ws});var gs=Object.freeze({}),bs=["id","class","style","slot"],vs=e=>Object.entries(e).filter(([t])=>!bs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ws=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:vs(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},xs=({props:e})=>e.start.path,_s=e=>{};var zt={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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}};var qe={};D(qe,{handleOnMount:()=>ks});var Wt=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(a=>{let o=a.getBoundingClientRect();o.top<=20&&o.top>n&&(n=o.top,i=a.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},Ss=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),a=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(a),Wt(n,t),s();let o=Wt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},ks=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=Ss(r,e);return()=>{s()}})};var Je={};D(Je,{INITIAL_STATE:()=>Es,selectCurrentId:()=>Cs,selectState:()=>$s,setContentContainer:()=>Ts,setCurrentId:()=>Is,setItems:()=>Os,toViewData:()=>As});var Es=Object.freeze({items:[],currentId:null,contentContainer:null}),As=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),$s=({state:e})=>e,Cs=({state:e})=>e.currentId,Os=(e,t)=>{e.items=t},Is=(e,t)=>{e.currentId=t},Ts=(e,t)=>{e.contentContainer=t};var Ft={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm 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 pv=xs av=c href=${item.href}",value:{type:9,items:[{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 pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};D(Ye,{handleClickOverlay:()=>Ls});var Ls=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Ge={};D(Ge,{INITIAL_STATE:()=>Ns,selectState:()=>js,toViewData:()=>Ps});var Ns=Object.freeze({}),Ps=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),js=({state:e})=>e;var Ht={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#popoverOverlay pos=fix cor=full",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=mu',value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view#popoverContainer pos=fix style="left: ',{type:1,path:"position.x"},"px; top: ",{type:1,path:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Xe={};D(Xe,{handleButtonClick:()=>Vs,handleClickOptionsPopoverOverlay:()=>Rs,handleOnMount:()=>Ds,handleOptionClick:()=>Ms});var Ds=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>n.value===r.selectedValue);i&&(t.update(n=>{n.selectedValue=i.value,n.selectedLabel=i.label}),s())}},Vs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Rs=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Ms=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var Qe={};D(Qe,{INITIAL_STATE:()=>zs,closeOptionsPopover:()=>Bs,openOptionsPopover:()=>Hs,selectState:()=>Fs,toViewData:()=>Ws,updateSelectOption:()=>Ks});var zs=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Ws=({state:e,props:t})=>{let r=t.placeholder||"Select an option",s=e.selectedValue!==null?e.selectedValue:t.selectedValue;if(s!=null&&t.options){let n=t.options.find(a=>a.value===s);n&&(r=n.label)}else e.selectedLabel&&(r=e.selectedLabel);let i=(t.options||[]).map(n=>({...n,isSelected:n.value===s,bgc:n.value===s?"mu":""}));return{isOpen:e.isOpen,position:e.position,options:i,selectedValue:s,selectedLabel:r,placeholder:t.placeholder||"Select an option"}},Fs=({state:e})=>e,Hs=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Bs=e=>{e.isOpen=!1},Ks=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Bt={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{eventListeners:{"click-overlay":{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:9,items:[{type:1,path:"selectedLabel"}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",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} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ze={};D(Ze,{handleHeaderClick:()=>Us,handleItemClick:()=>qs});var Us=(e,t)=>{let{store:r,dispatchEvent:s}=t,i,n=r.selectHeader();e.currentTarget.id==="header-label"?i=n.labelPath:e.currentTarget.id==="header-image"?i=n.image.path:e.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},qs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var tt={};D(tt,{INITIAL_STATE:()=>Js,selectActiveItem:()=>Zs,selectHeader:()=>Qs,selectItem:()=>ei,setState:()=>ti,toViewData:()=>Xs});var Js=Object.freeze({}),Ys=["id","class","style","slot"],Gs=e=>Object.entries(e).filter(([t])=>!Ys.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function et(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Xs=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=Gs(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],u=o==="full"?272:64,y=o==="full"?"fs":"c",E=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,b=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:u,headerAlign:y,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:f,showLabels:g,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:b,headerWidth:b,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Qs=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Zs=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),ei=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?et(i):[]).find(a=>a.id===s)},ti=e=>{};var Kt={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",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 == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{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.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p title="${item.title}"',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.title"}}],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.title"}}],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.title.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:"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=p title="',{type:1,path:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};D(rt,{handleHeaderClick:()=>ii,handleOnMount:()=>ri,handleRowClick:()=>si});var ri=e=>{},si=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},ii=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var st={};D(st,{INITIAL_STATE:()=>ni,clearSort:()=>ui,selectSortInfo:()=>hi,selectState:()=>ci,setSortColumn:()=>di,toViewData:()=>pi});var ni=Object.freeze({sortColumn:null,sortDirection:null}),ai=["id","class","style","slot"],oi=e=>Object.entries(e).filter(([t])=>!ai.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),li=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},pi=({state:e,props:t,attrs:r})=>{let s=oi(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let u=li(a,h.key);return{key:h.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},ci=({state:e})=>e,hi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),di=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},ui=e=>{e.sortColumn=null,e.sortDirection=null};var Ut={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!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-${row.index}",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}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],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}};var Qt=Symbol.for("immer-nothing"),qt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function U(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function ae(e){return!!e&&!!e[F]}function Z(e){return e?Zt(e)||Array.isArray(e)||!!e[qt]||!!e.constructor?.[qt]||xe(e)||_e(e):!1}var fi=Object.prototype.constructor.toString();function Zt(e){if(!e||typeof e!="object")return!1;let t=ne(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===fi}function ge(e,t){we(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function we(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:xe(e)?2:_e(e)?3:0}function at(e,t){return we(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function er(e,t,r){let s=we(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function mi(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xe(e){return e instanceof Map}function _e(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function ot(e,t){if(xe(e))return new Map(e);if(_e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Zt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[F];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(ne(e),s)}else{let s=ne(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function dt(e,t=!1){return Se(e)||ae(e)||!Z(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=yi),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>dt(s,!0))),e}function yi(){U(2)}function Se(e){return Object.isFrozen(e)}var gi={};function ee(e){let t=gi[e];return t||U(0,e),t}var he;function tr(){return he}function bi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lt(e){pt(e),e.drafts_.forEach(vi),e.drafts_=null}function pt(e){e===he&&(he=e.parent_)}function Yt(e){return he=bi(he,e)}function vi(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Gt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(lt(t),U(4)),Z(e)&&(e=be(t,e),t.parent_||ve(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=be(t,r,[]),lt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Qt?e:void 0}function be(e,t,r){if(Se(t))return t;let s=t[F];if(!s)return ge(t,(i,n)=>Xt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ve(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),ge(n,(o,l)=>Xt(e,s,i,o,l,r,a)),ve(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Xt(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!at(t.assigned_,s)?n.concat(s):void 0,l=be(e,i,o);if(er(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!Se(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;be(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ve(e,i)}}function ve(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dt(t,r)}function wi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:tr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=ut;r&&(i=[s],n=de);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var ut={get(e,t){if(t===F)return e;let r=Q(e);if(!at(r,t))return xi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===it(e.base_,t)?(nt(e),e.copy_[t]=ht(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=rr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=it(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(mi(r,i)&&(r!==void 0||at(e.base_,t)))return!0;nt(e),ct(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return it(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nt(e),ct(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){U(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){U(12)}},de={};ge(ut,(e,t)=>{de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)};de.set=function(e,t,r){return ut.set.call(this,e[0],t,r,e[0])};function it(e,t){let r=e[F];return(r?Q(r):e)[t]}function xi(e,t,r){let s=rr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function rr(e,t){if(!(t in e))return;let r=ne(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ne(r)}}function ct(e){e.modified_||(e.modified_=!0,e.parent_&&ct(e.parent_))}function nt(e){e.copy_||(e.copy_=ot(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _i=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(l=n,...h){return a.produce(l,u=>r.call(this,u,...h))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Yt(this),a=ht(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?lt(n):pt(n)}return Jt(n,s),Gt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Qt&&(i=void 0),this.autoFreeze_&&dt(i,!0),s){let n=[],a=[];ee("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else U(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Z(e)||U(8),ae(e)&&(e=Si(e));let t=Yt(this),r=ht(e,void 0);return r[F].isManual_=!0,pt(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return Jt(s,t),Gt(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=ee("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ht(e,t){let r=xe(e)?ee("MapSet").proxyMap_(e,t):_e(e)?ee("MapSet").proxySet_(e,t):wi(e,t);return(t?t.scope_:tr()).drafts_.push(r),r}function Si(e){return ae(e)||U(10,e),sr(e)}function sr(e){if(!Z(e)||Se(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ot(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ot(e,!0);return ge(r,(s,i)=>{er(r,s,sr(i))}),t&&(t.finalized_=!1),r}var H=new _i,ir=H.produce,qa=H.produceWithPatches.bind(H),Ja=H.setAutoFreeze.bind(H),Ya=H.setUseStrictShallowCopy.bind(H),Ga=H.applyPatches.bind(H),Xa=H.createDraft.bind(H),Qa=H.finishDraft.bind(H);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},ke={NOT:0};var oe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var nr=(e,t)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new oe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},ar=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)};var ki=(e,t,r={})=>V(e,r,t,{}),V=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return or(e.path,r,s);case N.INTERPOLATION:return Ei(e.parts,t,r,s);case N.FUNCTION:return lr(e,t,r,s);case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.CONDITIONAL:return Ai(e,t,r,s);case N.LOOP:return $i(e,t,r,s);case N.OBJECT:return Ci(e,t,r,s);case N.ARRAY:return Oi(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},or=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n=0;n<s.length;n++){let a=s[n];if(r.hasOwnProperty(a)){i=r[a];continue}if(i==null)return;i=i[a]}return i},Ei=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=V(n,t,r,s);i+=a!=null?String(a):""}return i},lr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw ar(e.name,t);let n=e.args.map(a=>V(a,t,r,s));return i(...n)},Ee=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return or(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.FUNCTION:return lr(e,t,r,s);default:return V(e,t,r,s)}},pr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Ee(e.left,t,r,s),o=Ee(e.right,t,r,s);switch(e.op){case B.AND:return a&&o;case B.OR:return a||o}}let i=V(e.left,t,r,s),n=V(e.right,t,r,s);switch(e.op){case B.EQ:return i==n;case B.NEQ:return i!=n;case B.GT:return i>n;case B.LT:return i<n;case B.GTE:return i>=n;case B.LTE:return i<=n;case B.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},cr=(e,t,r,s)=>{let i=e.op===ke.NOT?Ee(e.operand,t,r,s):V(e.operand,t,r,s);switch(e.op){case ke.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ai=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Ee(n,t,r,s))return V(e.bodies[i],t,r,s)}return{}},$i=(e,t,r,s)=>{let i=V(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw nr(a,i)}let n=[];for(let a=0;a<i.length;a++){let o=Object.create(s);o[e.itemVar]=i[a],e.indexVar&&(o[e.indexVar]=a);let l=V(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Ci=(e,t,r,s)=>{let i={},n=null,a=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){a=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let l=V(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===N.OBJECT&&l.properties){let h=l.properties.find(u=>u.key.startsWith("$for "));if(h){let u=V(h.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=V(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let h=o.parsedKey?V(o.parsedKey,t,r,s):o.key,u=V(o.value,t,r,s);u!==void 0&&(i[h]=u)}}return i},Oi=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=V(n,t,r,s);i.push(a)}else i.push(V(n,t,r,s));return i},Ae=ki;var $e=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...$e(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:$e(n)})}}t.push(r)}return t},[]):e;var Li=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},hr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ae(t,r,{}),a=$e(n),o=Ni({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ni=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,h)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let u=Object.entries(l);if(u.length===0)return console.warn("Skipping empty object item:",l),null;let[y,E]=u[0];if(!isNaN(Number(y)))return Array.isArray(E)?n(E,`${o}.${y}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${y}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let T,p,c=y.indexOf(" ");c===-1?(T=y,p=""):(T=y.substring(0,c),p=y.substring(c+1).trim());let d=T.split(/[.#]/)[0],f=d.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let I=v[1].substring(1),P=v[4];_[I]=Li(i,P)}else g[v[1]]=v[2]||v[3]||v[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=m[1]);let x=null;g.id?x=g.id:f&&(x=d);let b=Object.create(null),k=null;if(f)k=d;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let P=I.substring(1);b[P]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${y}`):w=[],k&&!f&&(g.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let I="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(v)}catch(P){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${I}`,P)}}else x===v&&S.push(v)}),S.length>0){S.sort((I,P)=>{let M=!I.includes("*"),X=!P.includes("*");return M&&!X?-1:!M&&X?1:P.length-I.length});let v=S[0];if(r[v]&&r[v].eventListeners){let I=r[v].eventListeners;Object.entries(I).forEach(([P,M])=>{M.handler&&s[M.handler]?A[P]=X=>{s[M.handler](X)}:M.handler&&console.warn(`[Parser] Handler '${M.handler}' for refKey '${v}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let C={};if(x)C.key=x;else if(T){let S=o?`${o}.${h}`:String(h);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);C.key+=`-${v}`}}Object.keys(g).length>0&&(C.attrs=g),Object.keys(b).length>0&&(C.class=b),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,v)=>{let I=S.data?.props||{},P=v.data?.props||{},M=S.data?.attrs||{},X=v.data?.attrs||{},Ir=JSON.stringify(I)!==JSON.stringify(P),Tr=JSON.stringify(M)!==JSON.stringify(X);if(Ir||Tr){let j=v.elm;j&&j.render&&typeof j.render=="function"&&(j.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(j.render(),j.removeAttribute("isDirty"),j.handlers&&j.handlers.handleOnUpdate){let Lr={...j.deps||{},store:j.store,render:j.render.bind(j),handlers:j.handlers,dispatchEvent:j.dispatchEvent.bind(j),refIds:j.refIds||{},getRefIds:()=>j.refIds||{}};j.handlers.handleOnUpdate({oldProps:I,newProps:P,oldAttrs:M,newAttrs:X},Lr)}}))}}});try{return e(d,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Pi=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
|
|
806
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){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 a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Dt=({render:e,html:t})=>Re;var Me={};D(Me,{handleClickDialogueOverlay:()=>Br});var Br=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};D(ze,{INITIAL_STATE:()=>Kr,selectState:()=>qr,setState:()=>Jr,toViewData:()=>Ur});var Kr=Object.freeze({}),Ur=({state:e,props:t})=>({isOpen:t.isOpen,w:t.w||600,position:{x:0,y:0}}),qr=({state:e})=>e,Jr=e=>{};var Vt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"},w:{type:"string"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:null,template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=fix cor=full ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-overlay pos=fix cor=full ah=c av=c bgc=bg op=0.5",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=10vh",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=${w} br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=",{type:1,path:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var We={};D(We,{handleClickMenuItem:()=>Gr,handleClickPopoverOverlay:()=>Yr});var Yr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Gr=(e,t)=>{let{dispatchEvent:r}=t,s=parseInt(e.currentTarget.id.replace("option-","")),i=t.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var Fe={};D(Fe,{INITIAL_STATE:()=>Xr,selectState:()=>Zr,setState:()=>es,toViewData:()=>Qr});var Xr=Object.freeze({}),Qr=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),Zr=({state:e})=>e,es=e=>{};var Rt={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popover:{eventListeners:{"click-overlay":{handler:"handleClickPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md",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 == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm 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#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var He={};D(He,{handleActionClick:()=>rs,handleColorPickerChange:()=>ns,handleInputChange:()=>ss,handleOnMount:()=>ts,handleSelectChange:()=>is,handleSliderChange:()=>as});var ts=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},ye=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{fieldName:e,fieldValue:t,formValues:r}}))},rs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},ss=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},is=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.selectedValue}),ye(i,e.detail.selectedValue,r.selectFormValues(),s))},ns=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},as=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({fieldName:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))};var Be={};D(Be,{INITIAL_STATE:()=>os,selectFormValues:()=>ds,selectState:()=>hs,setDefaultValues:()=>fs,setFormFieldValue:()=>ms,setState:()=>us,toViewData:()=>cs});var os=Object.freeze({formValues:{}}),ls=["id","class","style","slot"],ps=e=>Object.entries(e).filter(([t])=>!ls.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),cs=({state:e,props:t,attrs:r})=>({containerAttrString:ps(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),hs=({state:e})=>e,ds=({state:e})=>e.formValues,us=e=>{},fs=(e,t)=>{e.formValues=t||{}},ms=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var Mt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"inputText"},placeholder:{type:"string"}},required:["id","label","inputType"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["id","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{type:"string"}},required:["id","label","inputType"],additionalProperties:!1},{type:"object",properties:{id:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"}},required:["id","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"fields"},body:{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:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.id} w=f placeholder=${field.placeholder}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.id"}," w=f placeholder=",{type:1,path:"field.placeholder"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#select-${field.id} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=formValues[field.id]",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.id"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=formValues[field.id]"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.id} value=${field.value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.id"}," value=",{type:1,path:"field.value"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider-${field.id} min=${field.min} max=${field.max} step=${field.step} value=${field.value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{type:1,path:"field.id"}," min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," value=",{type:1,path:"field.value"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{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.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};D(Ke,{handleClickStart:()=>ys});var ys=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ue={};D(Ue,{INITIAL_STATE:()=>gs,selectPath:()=>xs,setState:()=>_s,toViewData:()=>ws});var gs=Object.freeze({}),bs=["id","class","style","slot"],vs=e=>Object.entries(e).filter(([t])=>!bs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ws=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:vs(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},xs=({props:e})=>e.start.path,_s=e=>{};var zt={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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}};var qe={};D(qe,{handleOnMount:()=>ks});var Wt=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(a=>{let o=a.getBoundingClientRect();o.top<=20&&o.top>n&&(n=o.top,i=a.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},Ss=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),a=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(a),Wt(n,t),s();let o=Wt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},ks=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=Ss(r,e);return()=>{s()}})};var Je={};D(Je,{INITIAL_STATE:()=>Es,selectCurrentId:()=>Cs,selectState:()=>$s,setContentContainer:()=>Ts,setCurrentId:()=>Is,setItems:()=>Os,toViewData:()=>As});var Es=Object.freeze({items:[],currentId:null,contentContainer:null}),As=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),$s=({state:e})=>e,Cs=({state:e})=>e.currentId,Os=(e,t)=>{e.items=t},Is=(e,t)=>{e.currentId=t},Ts=(e,t)=>{e.contentContainer=t};var Ft={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm 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 pv=xs av=c href=${item.href}",value:{type:9,items:[{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 pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};D(Ye,{handleClickOverlay:()=>Ls});var Ls=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Ge={};D(Ge,{INITIAL_STATE:()=>Ns,selectState:()=>js,toViewData:()=>Ps});var Ns=Object.freeze({}),Ps=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),js=({state:e})=>e;var Ht={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#popoverOverlay pos=fix cor=full",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=mu',value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view#popoverContainer pos=fix style="left: ',{type:1,path:"position.x"},"px; top: ",{type:1,path:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Xe={};D(Xe,{handleButtonClick:()=>Vs,handleClickOptionsPopoverOverlay:()=>Rs,handleOnMount:()=>Ds,handleOptionClick:()=>Ms});var Ds=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>n.value===r.selectedValue);i&&(t.update(n=>{n.selectedValue=i.value,n.selectedLabel=i.label}),s())}},Vs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Rs=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Ms=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var Qe={};D(Qe,{INITIAL_STATE:()=>zs,closeOptionsPopover:()=>Bs,openOptionsPopover:()=>Hs,selectState:()=>Fs,toViewData:()=>Ws,updateSelectOption:()=>Ks});var zs=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Ws=({state:e,props:t})=>{let r=t.placeholder||"Select an option",s=e.selectedValue!==null?e.selectedValue:t.selectedValue;if(s!=null&&t.options){let n=t.options.find(a=>a.value===s);n&&(r=n.label)}else e.selectedLabel&&(r=e.selectedLabel);let i=(t.options||[]).map(n=>({...n,isSelected:n.value===s,bgc:n.value===s?"mu":""}));return{isOpen:e.isOpen,position:e.position,options:i,selectedValue:s,selectedLabel:r,placeholder:t.placeholder||"Select an option"}},Fs=({state:e})=>e,Hs=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Bs=e=>{e.isOpen=!1},Ks=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Bt={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{eventListeners:{"click-overlay":{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:9,items:[{type:1,path:"selectedLabel"}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true",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} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ze={};D(Ze,{handleHeaderClick:()=>Us,handleItemClick:()=>qs});var Us=(e,t)=>{let{store:r,dispatchEvent:s}=t,i,n=r.selectHeader();e.currentTarget.id==="header-label"?i=n.labelPath:e.currentTarget.id==="header-image"?i=n.image.path:e.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},qs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var tt={};D(tt,{INITIAL_STATE:()=>Js,selectActiveItem:()=>Zs,selectHeader:()=>Qs,selectItem:()=>ei,setState:()=>ti,toViewData:()=>Xs});var Js=Object.freeze({}),Ys=["id","class","style","slot"],Gs=e=>Object.entries(e).filter(([t])=>!Ys.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function et(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Xs=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=Gs(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],u=o==="full"?272:64,y=o==="full"?"fs":"c",E=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,b=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:u,headerAlign:y,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:f,showLabels:g,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:b,headerWidth:b,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Qs=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Zs=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),ei=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?et(i):[]).find(a=>a.id===s)},ti=e=>{};var Kt={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}",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 == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{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.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p title="${item.title}"',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.title"}}],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.title"}}],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.title.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:"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=p title="',{type:1,path:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};D(rt,{handleHeaderClick:()=>ii,handleOnMount:()=>ri,handleRowClick:()=>si});var ri=e=>{},si=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},ii=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var st={};D(st,{INITIAL_STATE:()=>ni,clearSort:()=>ui,selectSortInfo:()=>hi,selectState:()=>ci,setSortColumn:()=>di,toViewData:()=>pi});var ni=Object.freeze({sortColumn:null,sortDirection:null}),ai=["id","class","style","slot"],oi=e=>Object.entries(e).filter(([t])=>!ai.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),li=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},pi=({state:e,props:t,attrs:r})=>{let s=oi(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let u=li(a,h.key);return{key:h.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},ci=({state:e})=>e,hi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),di=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},ui=e=>{e.sortColumn=null,e.sortDirection=null};var Ut={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{type:1,path:"column.key"}]}}],fast:!0}],fast:!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-${row.index}",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}}],fast:!1},parsedKey:{type:2,parts:["tr#row-",{type:1,path:"row.index"}]}}],fast:!1}],fast:!1}}],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}};var Qt=Symbol.for("immer-nothing"),qt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function U(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function ae(e){return!!e&&!!e[F]}function Z(e){return e?Zt(e)||Array.isArray(e)||!!e[qt]||!!e.constructor?.[qt]||xe(e)||_e(e):!1}var fi=Object.prototype.constructor.toString();function Zt(e){if(!e||typeof e!="object")return!1;let t=ne(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===fi}function ge(e,t){we(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function we(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:xe(e)?2:_e(e)?3:0}function at(e,t){return we(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function er(e,t,r){let s=we(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function mi(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xe(e){return e instanceof Map}function _e(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function ot(e,t){if(xe(e))return new Map(e);if(_e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Zt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[F];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(ne(e),s)}else{let s=ne(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function dt(e,t=!1){return Se(e)||ae(e)||!Z(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=yi),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>dt(s,!0))),e}function yi(){U(2)}function Se(e){return Object.isFrozen(e)}var gi={};function ee(e){let t=gi[e];return t||U(0,e),t}var he;function tr(){return he}function bi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lt(e){pt(e),e.drafts_.forEach(vi),e.drafts_=null}function pt(e){e===he&&(he=e.parent_)}function Yt(e){return he=bi(he,e)}function vi(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Gt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(lt(t),U(4)),Z(e)&&(e=be(t,e),t.parent_||ve(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=be(t,r,[]),lt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Qt?e:void 0}function be(e,t,r){if(Se(t))return t;let s=t[F];if(!s)return ge(t,(i,n)=>Xt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ve(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),ge(n,(o,l)=>Xt(e,s,i,o,l,r,a)),ve(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Xt(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!at(t.assigned_,s)?n.concat(s):void 0,l=be(e,i,o);if(er(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!Se(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;be(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ve(e,i)}}function ve(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dt(t,r)}function wi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:tr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=ut;r&&(i=[s],n=de);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var ut={get(e,t){if(t===F)return e;let r=Q(e);if(!at(r,t))return xi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===it(e.base_,t)?(nt(e),e.copy_[t]=ht(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=rr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=it(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(mi(r,i)&&(r!==void 0||at(e.base_,t)))return!0;nt(e),ct(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return it(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nt(e),ct(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){U(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){U(12)}},de={};ge(ut,(e,t)=>{de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)};de.set=function(e,t,r){return ut.set.call(this,e[0],t,r,e[0])};function it(e,t){let r=e[F];return(r?Q(r):e)[t]}function xi(e,t,r){let s=rr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function rr(e,t){if(!(t in e))return;let r=ne(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ne(r)}}function ct(e){e.modified_||(e.modified_=!0,e.parent_&&ct(e.parent_))}function nt(e){e.copy_||(e.copy_=ot(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _i=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(l=n,...h){return a.produce(l,u=>r.call(this,u,...h))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Yt(this),a=ht(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?lt(n):pt(n)}return Jt(n,s),Gt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Qt&&(i=void 0),this.autoFreeze_&&dt(i,!0),s){let n=[],a=[];ee("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else U(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Z(e)||U(8),ae(e)&&(e=Si(e));let t=Yt(this),r=ht(e,void 0);return r[F].isManual_=!0,pt(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return Jt(s,t),Gt(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=ee("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ht(e,t){let r=xe(e)?ee("MapSet").proxyMap_(e,t):_e(e)?ee("MapSet").proxySet_(e,t):wi(e,t);return(t?t.scope_:tr()).drafts_.push(r),r}function Si(e){return ae(e)||U(10,e),sr(e)}function sr(e){if(!Z(e)||Se(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ot(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ot(e,!0);return ge(r,(s,i)=>{er(r,s,sr(i))}),t&&(t.finalized_=!1),r}var H=new _i,ir=H.produce,qa=H.produceWithPatches.bind(H),Ja=H.setAutoFreeze.bind(H),Ya=H.setUseStrictShallowCopy.bind(H),Ga=H.applyPatches.bind(H),Xa=H.createDraft.bind(H),Qa=H.finishDraft.bind(H);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},ke={NOT:0};var oe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var nr=(e,t)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new oe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},ar=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)};var ki=(e,t,r={})=>V(e,r,t,{}),V=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return or(e.path,r,s);case N.INTERPOLATION:return Ei(e.parts,t,r,s);case N.FUNCTION:return lr(e,t,r,s);case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.CONDITIONAL:return Ai(e,t,r,s);case N.LOOP:return $i(e,t,r,s);case N.OBJECT:return Ci(e,t,r,s);case N.ARRAY:return Oi(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},or=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n=0;n<s.length;n++){let a=s[n];if(r.hasOwnProperty(a)){i=r[a];continue}if(i==null)return;i=i[a]}return i},Ei=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=V(n,t,r,s);i+=a!=null?String(a):""}return i},lr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw ar(e.name,t);let n=e.args.map(a=>V(a,t,r,s));return i(...n)},Ee=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return or(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.FUNCTION:return lr(e,t,r,s);default:return V(e,t,r,s)}},pr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Ee(e.left,t,r,s),o=Ee(e.right,t,r,s);switch(e.op){case B.AND:return a&&o;case B.OR:return a||o}}let i=V(e.left,t,r,s),n=V(e.right,t,r,s);switch(e.op){case B.EQ:return i==n;case B.NEQ:return i!=n;case B.GT:return i>n;case B.LT:return i<n;case B.GTE:return i>=n;case B.LTE:return i<=n;case B.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},cr=(e,t,r,s)=>{let i=e.op===ke.NOT?Ee(e.operand,t,r,s):V(e.operand,t,r,s);switch(e.op){case ke.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ai=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Ee(n,t,r,s))return V(e.bodies[i],t,r,s)}return{}},$i=(e,t,r,s)=>{let i=V(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw nr(a,i)}let n=[];for(let a=0;a<i.length;a++){let o=Object.create(s);o[e.itemVar]=i[a],e.indexVar&&(o[e.indexVar]=a);let l=V(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Ci=(e,t,r,s)=>{let i={},n=null,a=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){a=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let l=V(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===N.OBJECT&&l.properties){let h=l.properties.find(u=>u.key.startsWith("$for "));if(h){let u=V(h.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=V(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let h=o.parsedKey?V(o.parsedKey,t,r,s):o.key,u=V(o.value,t,r,s);u!==void 0&&(i[h]=u)}}return i},Oi=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=V(n,t,r,s);i.push(a)}else i.push(V(n,t,r,s));return i},Ae=ki;var $e=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...$e(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:$e(n)})}}t.push(r)}return t},[]):e;var Li=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},hr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ae(t,r,{}),a=$e(n),o=Ni({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ni=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,h)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let u=Object.entries(l);if(u.length===0)return console.warn("Skipping empty object item:",l),null;let[y,E]=u[0];if(!isNaN(Number(y)))return Array.isArray(E)?n(E,`${o}.${y}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${y}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let T,p,c=y.indexOf(" ");c===-1?(T=y,p=""):(T=y.substring(0,c),p=y.substring(c+1).trim());let d=T.split(/[.#]/)[0],f=d.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let I=v[1].substring(1),P=v[4];_[I]=Li(i,P)}else g[v[1]]=v[2]||v[3]||v[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=m[1]);let x=null;g.id?x=g.id:f&&(x=d);let b=Object.create(null),k=null;if(f)k=d;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let P=I.substring(1);b[P]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${y}`):w=[],k&&!f&&(g.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let I="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(v)}catch(P){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${I}`,P)}}else x===v&&S.push(v)}),S.length>0){S.sort((I,P)=>{let M=!I.includes("*"),X=!P.includes("*");return M&&!X?-1:!M&&X?1:P.length-I.length});let v=S[0];if(r[v]&&r[v].eventListeners){let I=r[v].eventListeners;Object.entries(I).forEach(([P,M])=>{M.handler&&s[M.handler]?A[P]=X=>{s[M.handler](X)}:M.handler&&console.warn(`[Parser] Handler '${M.handler}' for refKey '${v}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let C={};if(x)C.key=x;else if(T){let S=o?`${o}.${h}`:String(h);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);C.key+=`-${v}`}}Object.keys(g).length>0&&(C.attrs=g),Object.keys(b).length>0&&(C.class=b),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,v)=>{let I=S.data?.props||{},P=v.data?.props||{},M=S.data?.attrs||{},X=v.data?.attrs||{},Ir=JSON.stringify(I)!==JSON.stringify(P),Tr=JSON.stringify(M)!==JSON.stringify(X);if(Ir||Tr){let j=v.elm;j&&j.render&&typeof j.render=="function"&&(j.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(j.render(),j.removeAttribute("isDirty"),j.handlers&&j.handlers.handleOnUpdate){let Lr={...j.deps||{},store:j.store,render:j.render.bind(j),handlers:j.handlers,dispatchEvent:j.dispatchEvent.bind(j),refIds:j.refIds||{},getRefIds:()=>j.refIds||{}};j.handlers.handleOnUpdate({oldProps:I,newProps:P,oldAttrs:M,newAttrs:X},Lr)}}))}}});try{return e(d,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Pi=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
|
|
807
807
|
`),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,h])=>{let u=s(h);return` ${l} {
|
|
808
808
|
${u.split(`
|
|
809
809
|
`).map(y=>y?` ${y}`:"").join(`
|
package/package.json
CHANGED
|
@@ -44,7 +44,7 @@ template:
|
|
|
44
44
|
- rtgl-button#select-button v=ol:
|
|
45
45
|
- ${selectedLabel}
|
|
46
46
|
- rtgl-popover#popover .isOpen=isOpen .position=position:
|
|
47
|
-
- rtgl-view wh=300 g=xs slot=content bgc=background br=md:
|
|
47
|
+
- rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true:
|
|
48
48
|
- $for option, i in options:
|
|
49
49
|
- rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}:
|
|
50
50
|
- rtgl-text: ${option.label}
|