@rettangoli/ui 0.1.1-rc1 → 0.1.2-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,34 +1,34 @@
1
1
 
2
2
  # Rettangoli
3
3
 
4
- A set of primitives that are all the necessary to build a UI framework
5
-
6
- The following:
7
- * rtgl-view
8
- * rtgl-text
9
- * rtgl-image
10
- * rtgl-svg
11
- * rtgl-button
12
- * rtgl-input
13
- * rtgl-textarea
14
-
15
- All UI components should be able to be built from the above primitives
4
+ ## Development
16
5
 
6
+ ### Folder Structure
17
7
 
18
- ## Development
8
+ ```
9
+ src/
10
+ ├── primitives/ # Basic web components built from scratch, no dependencies
11
+ └── components/ # Pre-built components using @rettangoli/fe
12
+ vt/ # Uses @rettangoli/vt visual testing library
13
+ ├── reference/ # Golden screenshots for visual testing
14
+ └── specs/ # HTML test specifications
15
+ ```
19
16
 
20
17
  ### Install dependencies
21
18
 
22
-
19
+ Use npx to install `rtgl` cli globally. You run into issues if try to use `bunx`.
23
20
 
24
21
  ```bash
25
- bun install
22
+ npx i -g rtgl
26
23
  ```
27
24
 
25
+ Install dependencies
28
26
 
27
+ ```bash
28
+ bun install
29
+ ```
29
30
 
30
-
31
- ### Generate test screens
31
+ ### Generate specification screens
32
32
 
33
33
  Bundles the code to be used for `rettangoli-vt`
34
34
 
@@ -39,11 +39,68 @@ bun run build:dev
39
39
  Uses `rettangoli-vt` to generates test screens
40
40
 
41
41
  ```bash
42
- bun run ../rettangoli-cli/cli.js vt generate --skip-screenshots
42
+ bun run vt:generate
43
+ ```
44
+
45
+ Test for any change using `rettangoli-vt`
46
+
47
+ ```bash
48
+ bun run vt:report
49
+ ```
50
+
51
+ Accept the changes by updating the reference screenshots
52
+
53
+ ```bash
54
+ bun run vt:accept
43
55
  ```
44
56
 
45
57
  You can then access the generates screens
46
58
 
47
59
  ```bash
48
- bunx serve ./viz/_site
60
+ bun run serve
61
+ ```
62
+
63
+ Open http://localhost:3000/view to see the specification screens
64
+
65
+
66
+ ## Usage
67
+
68
+ ### Install via CDN
69
+
70
+ Use via CDN iife (Immediately Invoked Function Expression) us [JSDeliver](https://www.jsdelivr.com/package/npm/@rettangoli/ui)
71
+
72
+ Primitives only. This might be useful if you want a light weight version and use only the primitives.
73
+
74
+ ```html
75
+ <script src="https://cdn.jsdelivr.net/npm/@rettangoli/ui@latest/dist/rettangoli-layout.iife.min.js"></script>
76
+ ```
77
+
78
+ All primitives and components
79
+
80
+ ```html
81
+ <script src="https://cdn.jsdelivr.net/npm/@rettangoli/ui@latest/dist/rettangoli-ui.iife.min.js"></script>
82
+ ```
83
+
84
+ ### Install via NPM
85
+
86
+ Install package
87
+
88
+ ```bash
89
+ npm install @rettangoli/ui
90
+ ```
91
+
92
+ Import the package. This allows you to configure more flexible options and to treeshake only the code that you need.
93
+
94
+ ```js
95
+ import { RettangoliView } '@rettangoli/ui';
96
+ customElements.define("rtgl-view", RettangoliView({}));
49
97
  ```
98
+
99
+ ### Stylesheet file
100
+
101
+ Make sure you import a stylesheet file from your html file. [Example](./src/vt/static/public/theme.css)
102
+
103
+
104
+
105
+
106
+
@@ -688,8 +688,8 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
688
688
  font-weight: var(--xs-font-weight);
689
689
  line-height: var(--xs-line-height);
690
690
  letter-spacing: var(--xs-letter-spacing);
691
- padding-left: var(--spacing-sm);
692
- padding-right: var(--spacing-sm);
691
+ padding-left: var(--spacing-md);
692
+ padding-right: var(--spacing-md);
693
693
  height: 24px;
694
694
  }
695
695
  input:focus {
@@ -700,7 +700,7 @@ var rettangoli=(()=>{function h(e,...t){let s="";return e.forEach((r,g)=>{s+=r+(
700
700
  }
701
701
  ${b}
702
702
  ${m}
703
- `))}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._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("keydown",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-keydown",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){if(["type","placeholder","disabled","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),d=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),a==="f"?this._styles[i].width="var(--width-stretch)":a!==void 0&&(this._styles[i].width=a,this._styles[i]["min-width"]=a,this._styles[i]["max-width"]=a),d==="f"?this._styles[i].height="100%":d!==void 0&&(this._styles[i].height=d,this._styles[i]["min-height"]=d,this._styles[i]["max-height"]=d),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let g=w(this._styles,"input");g!==this._lastStyleString&&(this._styleElement.textContent=g,this._lastStyleString=g)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},G=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
703
+ `))}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._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){if(["type","placeholder","disabled","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),d=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),a==="f"?this._styles[i].width="var(--width-stretch)":a!==void 0&&(this._styles[i].width=a,this._styles[i]["min-width"]=a,this._styles[i]["max-width"]=a),d==="f"?this._styles[i].height="100%":d!==void 0&&(this._styles[i].height=d,this._styles[i]["min-height"]=d,this._styles[i]["max-height"]=d),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let g=w(this._styles,"input");g!==this._lastStyleString&&(this._styleElement.textContent=g,this._lastStyleString=g)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},G=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(h`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)Cr(e,r,{get:t[r],enumerable:!0})};function O(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Or=["xs","sm","md","lg","xl"],wt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},U=Object.keys(wt),q=e=>e.concat(Or.flatMap(t=>e.map(r=>`${t}-${r}`))),xt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},B=(e,t={})=>{let r="";for(let[s,i]of Object.entries(xt)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,d]of Object.entries(a)){let u=wt[n],g=d.startsWith("--")?`var(${d})`:d,E=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(u){let c=u.split(" ").map(h=>`${h}: ${g};`).join(" ");r+=`
1
+ var rettangoli=(()=>{var Or=Object.defineProperty;var D=(e,t)=>{for(var r in t)Or(e,r,{get:t[r],enumerable:!0})};function O(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Ir=["xs","sm","md","lg","xl"],wt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},q=Object.keys(wt),J=e=>e.concat(Ir.flatMap(t=>e.map(r=>`${t}-${r}`))),xt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},K=(e,t={})=>{let r="";for(let[s,i]of Object.entries(xt)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,d]of Object.entries(a)){let u=wt[n],g=d.startsWith("--")?`var(${d})`:d,E=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(u){let c=u.split(" ").map(h=>`${h}: ${g};`).join(" ");r+=`
2
2
  :host([${E}="${l}"])${o}{
3
3
  ${c}
4
4
  }
@@ -12,7 +12,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
12
12
  :host([${T}="${l}"]:hover)${o}{
13
13
  ${d}
14
14
  }
15
- `}}s!=="default"&&(r+="}")}return r};function Ir(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Tr=e=>/%$/.test(e),N=e=>{if(e!==void 0)return Tr(e)?e:Ir(e)?`${e}px`:Object.keys($).includes(e)?`var(${$[e]})`:e},$={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function J(e,t=":host"){let r="";for(let[s,i]of Object.entries(xt)){s!=="default"&&(r+=`${i} {
15
+ `}}s!=="default"&&(r+="}")}return r};function Tr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Nr=e=>/%$/.test(e),N=e=>{if(e!==void 0)return Nr(e)?e:Tr(e)?`${e}px`:Object.keys($).includes(e)?`var(${$[e]})`:e},$={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="";for(let[s,i]of Object.entries(xt)){s!=="default"&&(r+=`${i} {
16
16
  `);let n="";for(let[a,o]of Object.entries(e[s]))o!=null&&(n+=`${a}: ${o};
17
17
  `);r+=`${t} {
18
18
  ${n.trim()}
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var Nr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$,s:{sm:`
61
+ `;var Lr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},Lr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},_t=B(Nr,Lr);var ie=O`
107
+ `}},jr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},_t=K(Lr,jr);var ie=O`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
329
329
  justify-content: center;
330
330
  }
331
331
  }
332
- `;var jr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},V=B(jr);var Et=O`
332
+ `;var Pr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},M=K(Pr);var Et=O`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
347
347
  flex-wrap: nowrap;
348
348
  }
349
349
 
350
- `;var pe={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Pr={bgc:{pr:`
350
+ `;var pe={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Dr={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
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:pe,bwt:pe,bwr:pe,bwb:pe,bwl:pe,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"}},ue=B(Pr);var Dr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},M=B(Dr);var Oe=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:pe,bwt:pe,bwr:pe,bwb:pe,bwl:pe,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"}},ue=K(Dr);var Vr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},R=K(Vr);var Oe=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
  }
@@ -409,8 +409,8 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
409
409
  ${se}
410
410
  ${Et}
411
411
  ${kt}
412
+ ${R}
412
413
  ${M}
413
- ${V}
414
414
  ${ue}
415
415
  ${ie}
416
416
 
@@ -427,7 +427,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
427
427
  bottom: 0;
428
428
  z-index: 1;
429
429
  }
430
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...q([...U,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=J(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},At=({render:e,html:t})=>Oe;var Vr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
430
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","target","op",...J([...q,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=Y(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},At=({render:e,html:t})=>Oe;var Mr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
431
431
  font-size: var(--h1-font-size);
432
432
  font-weight: var(--h1-font-weight);
433
433
  line-height: var(--h1-line-height);
@@ -467,7 +467,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
467
467
  font-weight: var(--xs-font-weight);
468
468
  line-height: var(--xs-line-height);
469
469
  letter-spacing: var(--xs-letter-spacing);
470
- `}},$t=B(Vr);var Mr={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},fe=B(Mr);var Ie=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
470
+ `}},$t=K(Mr);var zr={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},fe=K(zr);var Ie=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -500,8 +500,8 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
500
500
  }
501
501
  ${$t}
502
502
  ${fe}
503
+ ${R}
503
504
  ${M}
504
- ${V}
505
505
  `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=N(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},Ct=({render:e,html:t})=>Ie;var Te=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
506
506
  :host {
507
507
  border-style: solid;
@@ -539,9 +539,9 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
539
539
  }
540
540
 
541
541
  ${ue}
542
+ ${R}
542
543
  ${M}
543
- ${V}
544
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return q([...U,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("o")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=J(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},Ot=({render:e,html:t})=>Te;var It=O`
544
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return J([...q,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("o")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),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);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},Ot=({render:e,html:t})=>Te;var It=O`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -664,7 +664,7 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
664
664
  ${fe}
665
665
  ${It}
666
666
  ${se}
667
- ${V}
667
+ ${M}
668
668
  `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=N(t===null?this.getAttribute("w"):t),s=N(t===null?this.getAttribute("h"):t);r&&(this.style.width=r),s&&(this.style.height=s)}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Tt=({render:e,html:t})=>Ne;var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
669
669
  :host {
670
670
  display: contents;
@@ -688,8 +688,8 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
688
688
  font-weight: var(--xs-font-weight);
689
689
  line-height: var(--xs-line-height);
690
690
  letter-spacing: var(--xs-letter-spacing);
691
- padding-left: var(--spacing-sm);
692
- padding-right: var(--spacing-sm);
691
+ padding-left: var(--spacing-md);
692
+ padding-right: var(--spacing-md);
693
693
  height: 24px;
694
694
  }
695
695
  input:focus {
@@ -698,9 +698,9 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
698
698
  input:disabled {
699
699
  cursor: not-allowed;
700
700
  }
701
+ ${R}
701
702
  ${M}
702
- ${V}
703
- `))}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._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("keydown",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","s",...q([...U,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-keydown",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","s"].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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=J(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Nt=({render:e,html:t})=>Le;var je=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
703
+ `))}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._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","s",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","s"].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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),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");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Nt=({render:e,html:t})=>Le;var je=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -723,8 +723,8 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
723
723
  textarea:focus {
724
724
  border-color: var(--foreground);
725
725
  }
726
+ ${R}
726
727
  ${M}
727
- ${V}
728
728
  `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,s){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder")}},Lt=({render:e,html:t})=>je;var Pe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
729
729
  :host {
730
730
  display: contents;
@@ -746,9 +746,9 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
746
746
  cursor: not-allowed;
747
747
  opacity: 0.5;
748
748
  }
749
+ ${R}
749
750
  ${M}
750
- ${V}
751
- `))}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="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...q([...U,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=J(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},jt=({render:e,html:t})=>Pe;var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
751
+ `))}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="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),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="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},jt=({render:e,html:t})=>Pe;var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
752
752
  :host {
753
753
  display: contents;
754
754
  }
@@ -801,9 +801,9 @@ var rettangoli=(()=>{var Cr=Object.defineProperty;var P=(e,t)=>{for(var r in t)C
801
801
  input[type="range"]:disabled::-moz-range-thumb {
802
802
  cursor: not-allowed;
803
803
  }
804
+ ${R}
804
805
  ${M}
805
- ${V}
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",...q([...U,"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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=J(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()}},Pt=({render:e,html:t})=>De;var Ve={};P(Ve,{INITIAL_STATE:()=>zr,selectState:()=>Wr,setState:()=>Fr,toViewData:()=>Rr});var zr=Object.freeze({}),Rr=({state:e,props:t})=>({isOpen:t.isOpen,w:t.w||600,position:{x:0,y:0}}),Wr=({state:e})=>e,Fr=e=>{};var Dt={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=",{var:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Me={};P(Me,{handleClickDialogueOverlay:()=>Hr});var Hr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};P(ze,{handleHeaderClick:()=>Br,handleItemClick:()=>Kr});var Br=(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}))},Kr=(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 Vt={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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"header.href"}," d=h av=c ah=",{var:"headerAlign"}," g=lg w=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"headerAlign"}," g=lg w=",{var:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{var:"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=",{var:"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=",{var:"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=",{var:"iconSize"}," svg=",{var:"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=",{var:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{var:"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-",{var:"item.id"}," ",{var:"item.hrefAttr"}," h=",{var:"itemHeight"}," av=c ",{var:"itemAlignAttr"}," ph=",{var:"itemPadding"}," w=",{var:"itemWidth"}," h-bgc=",{var:"item.itemHoverBgc"}," br=lg bgc=",{var:"item.itemBgc"},' cur=p title="',{var:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{var:"headerPadding"}," pb=lg g=xs ah=",{var:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{var:"sidebarWidth"}," bwr=xs ah=",{var:"ah"}," ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var We={};P(We,{INITIAL_STATE:()=>Ur,selectActiveItem:()=>Xr,selectHeader:()=>Gr,selectItem:()=>Qr,setState:()=>Zr,toViewData:()=>Yr});var Ur=Object.freeze({}),qr=["id","class","style","slot"],Jr=e=>Object.entries(e).filter(([t])=>!qr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Re(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 Yr=({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=Jr(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},d=i?Re(i,n):[],u=o==="full"?272:64,g=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,h=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",y=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,v=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:d,sidebarWidth:u,headerAlign:g,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:h,firstLetterSize:f,showLabels:y,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:v,headerWidth:v,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Gr=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Xr=({state:e,props:t})=>(t.items?Re(t.items):[]).find(s=>s.active),Qr=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?Re(i):[]).find(a=>a.id===s)},Zr=e=>{};var Fe={};P(Fe,{handleClickOverlay:()=>es});var es=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Mt={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: ',{var:"position.x"},"px; top: ",{var:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var He={};P(He,{INITIAL_STATE:()=>ts,selectState:()=>ss,toViewData:()=>rs});var ts=Object.freeze({}),rs=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),ss=({state:e})=>e;var Be={};P(Be,{INITIAL_STATE:()=>is,selectFormValues:()=>ps,selectState:()=>ls,setDefaultValues:()=>ds,setFormFieldValue:()=>hs,setState:()=>cs,toViewData:()=>os});var is=Object.freeze({formValues:{}}),ns=["id","class","style","slot"],as=e=>Object.entries(e).filter(([t])=>!ns.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),os=({state:e,props:t,attrs:r})=>({containerAttrString:as(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),ls=({state:e})=>e,ps=({state:e})=>e.formValues,cs=e=>{},ds=(e,t)=>{e.formValues=t||{}},hs=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var Ke={};P(Ke,{handleActionClick:()=>fs,handleColorPickerChange:()=>ys,handleInputChange:()=>ms,handleOnMount:()=>us,handleSelectChange:()=>gs,handleSliderChange:()=>vs});var us=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},fs=(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()}}))},ms=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("input-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})},gs=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("select-","");s&&e.detail.selectedValue!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.selectedValue})},ys=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("colorpicker-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})},vs=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("slider-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})};var zt={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-keydown":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}}},events:{},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-",{var:"field.id"}," w=f placeholder=",{var:"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-",{var:"field.id"}," w=f .options=fields[",{var:"i"},"].options .placeholder=fields[",{var:"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-",{var:"field.id"}," value=",{var:"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-",{var:"field.id"}," min=",{var:"field.min"}," max=",{var:"field.max"}," step=",{var:"field.step"}," value=",{var:"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-",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ue={};P(Ue,{INITIAL_STATE:()=>bs,closeOptionsPopover:()=>Ss,openOptionsPopover:()=>_s,selectState:()=>xs,toViewData:()=>ws,updateSelectOption:()=>ks});var bs=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"}},xs=({state:e})=>e,_s=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Ss=e=>{e.isOpen=!1},ks=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var qe={};P(qe,{handleButtonClick:()=>As,handleClickOptionsPopoverOverlay:()=>$s,handleOnMount:()=>Es,handleOptionClick:()=>Cs});var Es=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())}},As=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},$s=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Cs=(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 Rt={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-",{var:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{var:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Je={};P(Je,{INITIAL_STATE:()=>Os,selectCurrentId:()=>Ns,selectState:()=>Ts,setContentContainer:()=>Ps,setCurrentId:()=>js,setItems:()=>Ls,toViewData:()=>Is});var Os=Object.freeze({items:[],currentId:null,contentContainer:null}),Is=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Ts=({state:e})=>e,Ns=({state:e})=>e.currentId,Ls=(e,t)=>{e.items=t},js=(e,t)=>{e.currentId=t},Ps=(e,t)=>{e.contentContainer=t};var Wt={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=",{var:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{var:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};P(Ye,{handleOnMount:()=>Vs});var Ft=(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())},Ds=(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),Ft(n,t),s();let o=Ft.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},Vs=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=Ds(r,e);return()=>{s()}})};var Ge={};P(Ge,{INITIAL_STATE:()=>Ms,selectPath:()=>Fs,setState:()=>Hs,toViewData:()=>Ws});var Ms=Object.freeze({}),zs=["id","class","style","slot"],Rs=e=>Object.entries(e).filter(([t])=>!zs.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:Rs(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Fs=({props:e})=>e.start.path,Hs=e=>{};var Ht={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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Xe={};P(Xe,{handleClickStart:()=>Bs});var Bs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Bt={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-",{var:"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 Qe={};P(Qe,{handleClickMenuItem:()=>Us,handleClickPopoverOverlay:()=>Ks});var Ks=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Us=(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 Ze={};P(Ze,{INITIAL_STATE:()=>qs,selectState:()=>Ys,setState:()=>Gs,toViewData:()=>Js});var qs=Object.freeze({}),Js=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),Ys=({state:e})=>e,Gs=e=>{};var et={};P(et,{INITIAL_STATE:()=>Xs,clearSort:()=>ni,selectSortInfo:()=>si,selectState:()=>ri,setSortColumn:()=>ii,toViewData:()=>ti});var Xs=Object.freeze({sortColumn:null,sortDirection:null}),Qs=["id","class","style","slot"],Zs=e=>Object.entries(e).filter(([t])=>!Qs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ei=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},ti=({state:e,props:t,attrs:r})=>{let s=Zs(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(d=>{let u=ei(a,d.key);return{key:d.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},ri=({state:e})=>e,si=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),ii=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},ni=e=>{e.sortColumn=null,e.sortDirection=null};var tt={};P(tt,{handleHeaderClick:()=>li,handleOnMount:()=>ai,handleRowClick:()=>oi});var ai=e=>{},oi=(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}}))},li=(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 Kt={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-",{var:"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-",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Xt=Symbol.for("immer-nothing"),Ut=Symbol.for("immer-draftable"),W=Symbol.for("immer-state");function K(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[W]}function X(e){return e?Qt(e)||Array.isArray(e)||!!e[Ut]||!!e.constructor?.[Ut]||be(e)||we(e):!1}var pi=Object.prototype.constructor.toString();function Qt(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)===pi}function me(e,t){ve(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ve(e){let t=e[W];return t?t.type_:Array.isArray(e)?1:be(e)?2:we(e)?3:0}function it(e,t){return ve(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Zt(e,t,r){let s=ve(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function ci(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function be(e){return e instanceof Map}function we(e){return e instanceof Set}function G(e){return e.copy_||e.base_}function nt(e,t){if(be(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Qt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[W];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 ct(e,t=!1){return xe(e)||ae(e)||!X(e)||(ve(e)>1&&(e.set=e.add=e.clear=e.delete=di),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ct(s,!0))),e}function di(){K(2)}function xe(e){return Object.isFrozen(e)}var hi={};function Q(e){let t=hi[e];return t||K(0,e),t}var ce;function er(){return ce}function ui(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qt(e,t){t&&(Q("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function at(e){ot(e),e.drafts_.forEach(fi),e.drafts_=null}function ot(e){e===ce&&(ce=e.parent_)}function Jt(e){return ce=ui(ce,e)}function fi(e){let t=e[W];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Yt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[W].modified_&&(at(t),K(4)),X(e)&&(e=ge(t,e),t.parent_||ye(t,e)),t.patches_&&Q("Patches").generateReplacementPatches_(r[W].base_,e,t.patches_,t.inversePatches_)):e=ge(t,r,[]),at(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Xt?e:void 0}function ge(e,t,r){if(xe(t))return t;let s=t[W];if(!s)return me(t,(i,n)=>Gt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ye(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),me(n,(o,l)=>Gt(e,s,i,o,l,r,a)),ye(e,i,!1),r&&e.patches_&&Q("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Gt(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!it(t.assigned_,s)?n.concat(s):void 0,l=ge(e,i,o);if(Zt(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(X(i)&&!xe(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ge(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ye(e,i)}}function ye(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ct(t,r)}function mi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:er(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=dt;r&&(i=[s],n=de);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var dt={get(e,t){if(t===W)return e;let r=G(e);if(!it(r,t))return gi(e,r,t);let s=r[t];return e.finalized_||!X(s)?s:s===rt(e.base_,t)?(st(e),e.copy_[t]=pt(s,e)):s},has(e,t){return t in G(e)},ownKeys(e){return Reflect.ownKeys(G(e))},set(e,t,r){let s=tr(G(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=rt(G(e),t),n=i?.[W];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ci(r,i)&&(r!==void 0||it(e.base_,t)))return!0;st(e),lt(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 rt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,st(e),lt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=G(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){K(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){K(12)}},de={};me(dt,(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 dt.set.call(this,e[0],t,r,e[0])};function rt(e,t){let r=e[W];return(r?G(r):e)[t]}function gi(e,t,r){let s=tr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function tr(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 lt(e){e.modified_||(e.modified_=!0,e.parent_&&lt(e.parent_))}function st(e){e.copy_||(e.copy_=nt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var yi=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,...d){return a.produce(l,u=>r.call(this,u,...d))}}typeof r!="function"&&K(6),s!==void 0&&typeof s!="function"&&K(7);let i;if(X(t)){let n=Jt(this),a=pt(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?at(n):ot(n)}return qt(n,s),Yt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Xt&&(i=void 0),this.autoFreeze_&&ct(i,!0),s){let n=[],a=[];Q("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else K(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){X(e)||K(8),ae(e)&&(e=vi(e));let t=Jt(this),r=pt(e,void 0);return r[W].isManual_=!0,ot(t),r}finishDraft(e,t){let r=e&&e[W];(!r||!r.isManual_)&&K(9);let{scope_:s}=r;return qt(s,t),Yt(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=Q("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function pt(e,t){let r=be(e)?Q("MapSet").proxyMap_(e,t):we(e)?Q("MapSet").proxySet_(e,t):mi(e,t);return(t?t.scope_:er()).drafts_.push(r),r}function vi(e){return ae(e)||K(10,e),rr(e)}function rr(e){if(!X(e)||xe(e))return e;let t=e[W],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=nt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=nt(e,!0);return me(r,(s,i)=>{Zt(r,s,rr(i))}),t&&(t.finalized_=!1),r}var F=new yi,sr=F.produce,Fa=F.produceWithPatches.bind(F),Ha=F.setAutoFreeze.bind(F),Ba=F.setUseStrictShallowCopy.bind(F),Ka=F.applyPatches.bind(F),Ua=F.createDraft.bind(F),qa=F.finishDraft.bind(F);var L={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},H={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},_e={NOT:0};var bi=e=>{let{ast:t,functions:r,data:s}=e;return D(t,r,s,{})},D=(e,t,r,s)=>{switch(e.type){case L.LITERAL:return e.value;case L.VARIABLE:return ht(e.path,r,s);case L.INTERPOLATION:return wi(e.parts,t,r,s);case L.FUNCTION:return ir(e,t,r,s);case L.BINARY:return nr(e,t,r,s);case L.UNARY:return ar(e,t,r,s);case L.CONDITIONAL:return xi(e,t,r,s);case L.LOOP:return _i(e,t,r,s);case L.OBJECT:return Si(e,t,r,s);case L.ARRAY:return ki(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ht=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n of s){if(i==null)return;r.hasOwnProperty(n)?i=r[n]:i=i[n]}return i},wi=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else if(n.var){let a=ht(n.var,r,s);i+=a!=null?String(a):""}else if(n.func){let a=t[n.func]?.(...n.args||[]);i+=a!=null?String(a):""}return i},ir=(e,t,r,s)=>{let i=t[e.name];if(!i)throw new Error(`Function '${e.name}' is not defined`);let n=e.args.map(a=>D(a,t,r,s));return i(...n)},Se=(e,t,r,s)=>{switch(e.type){case L.VARIABLE:return ht(e.path,r,s);case L.LITERAL:return e.value;case L.BINARY:return nr(e,t,r,s);case L.UNARY:return ar(e,t,r,s);case L.FUNCTION:return ir(e,t,r,s);default:return D(e,t,r,s)}},nr=(e,t,r,s)=>{if(e.op===H.AND||e.op===H.OR){let a=Se(e.left,t,r,s),o=Se(e.right,t,r,s);switch(e.op){case H.AND:return a&&o;case H.OR:return a||o}}let i=D(e.left,t,r,s),n=D(e.right,t,r,s);switch(e.op){case H.EQ:return i==n;case H.NEQ:return i!=n;case H.GT:return i>n;case H.LT:return i<n;case H.GTE:return i>=n;case H.LTE:return i<=n;case H.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ar=(e,t,r,s)=>{let i=e.op===_e.NOT?Se(e.operand,t,r,s):D(e.operand,t,r,s);switch(e.op){case _e.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},xi=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Se(n,t,r,s))return D(e.bodies[i],t,r,s)}return{}},_i=(e,t,r,s)=>{let i=D(e.iterable,t,r,s);if(!Array.isArray(i))return[];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=D(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Si=(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=D(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===L.OBJECT&&l.properties){let d=l.properties.find(u=>u.key.startsWith("$for "));if(d){let u=D(d.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=D(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let d=o.parsedKey?D(o.parsedKey,t,r,s):o.key,u=D(o.value,t,r,s);u!==void 0&&(i[d]=u)}}return i},ki=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===L.LOOP){let a=D(n,t,r,s);i.push(a)}else i.push(D(n,t,r,s));return i},ke=bi;var Ee=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Ee(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]:Ee(n)})}}t.push(r)}return t},[]):e;var $i=(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)},or=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=ke({ast:t,data:r}),a=Ee(n),o=Ci({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ci=({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,d)=>{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[g,E]=u[0];if(!isNaN(Number(g)))return Array.isArray(E)?n(E,`${o}.${g}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${g}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",g);let T,p,c=g.indexOf(" ");c===-1?(T=g,p=""):(T=g.substring(0,c),p=g.substring(c+1).trim());let h=T.split(/[.#]/)[0],f=h.includes("-"),y={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,b;for(;(b=S.exec(p))!==null;)if(b[1].startsWith(".")){let I=b[1].substring(1),j=b[4];_[I]=$i(i,j)}else y[b[1]]=b[2]||b[3]||b[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(y,"id")&&(y.id=m[1]);let x=null;y.id?x=y.id:f&&(x=h);let v=Object.create(null),k=null;if(f)k=h;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let j=I.substring(1);v[j]=!0});let b=T.match(/#([^.#\s]+)/);b&&(k=b[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${g}`):w=[],k&&!f&&(y.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(b=>{if(b.includes("*")){let I="^"+b.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(b)}catch(j){console.warn(`[Parser] Invalid regex pattern created from refKey '${b}': ${I}`,j)}}else x===b&&S.push(b)}),S.length>0){S.sort((I,j)=>{let R=!I.includes("*"),te=!j.includes("*");return R&&!te?-1:!R&&te?1:j.length-I.length});let b=S[0];if(r[b]&&r[b].eventListeners){let I=r[b].eventListeners;Object.entries(I).forEach(([j,R])=>{R.handler&&s[R.handler]?A[j]=te=>{s[R.handler](te)}:R.handler&&console.warn(`[Parser] Handler '${R.handler}' for refKey '${b}' (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}.${d}`:String(d);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let b=JSON.stringify(_).substring(0,50);C.key+=`-${b}`}}Object.keys(y).length>0&&(C.attrs=y),Object.keys(v).length>0&&(C.class=v),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_,f&&(C.hook={update:(S,b)=>{let I=S.data?.props||{},j=b.data?.props||{},R=S.data?.attrs||{},te=b.data?.attrs||{},Ar=JSON.stringify(I)!==JSON.stringify(j),$r=JSON.stringify(R)!==JSON.stringify(te);if(Ar||$r){let re=b.elm;re&&re.render&&typeof re.render=="function"&&(re.setAttribute("isDirty","true"),requestAnimationFrame(()=>{re.render(),re.removeAttribute("isDirty")}))}}}));try{return e(h,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:h,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Oi=(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=N(o===null?this.getAttribute(a("w")):o),d=N(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),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),d==="f"?this._styles[n].height="100%":d!==void 0&&(this._styles[n].height=d,this._styles[n]["min-height"]=d,this._styles[n]["max-height"]=d),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()}},Pt=({render:e,html:t})=>De;var Ve={};D(Ve,{handleClickDialogueOverlay:()=>Rr});var Rr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var Me={};D(Me,{INITIAL_STATE:()=>Wr,selectState:()=>Hr,setState:()=>Br,toViewData:()=>Fr});var Wr=Object.freeze({}),Fr=({state:e,props:t})=>({isOpen:t.isOpen,w:t.w||600,position:{x:0,y:0}}),Hr=({state:e})=>e,Br=e=>{};var Dt={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=",{var:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var ze={};D(ze,{handleClickMenuItem:()=>Ur,handleClickPopoverOverlay:()=>Kr});var Kr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Ur=(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 Re={};D(Re,{INITIAL_STATE:()=>qr,selectState:()=>Yr,setState:()=>Gr,toViewData:()=>Jr});var qr=Object.freeze({}),Jr=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),Yr=({state:e})=>e,Gr=e=>{};var Vt={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-",{var:"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 We={};D(We,{handleActionClick:()=>Qr,handleColorPickerChange:()=>ts,handleInputChange:()=>Zr,handleOnMount:()=>Xr,handleSelectChange:()=>es,handleSliderChange:()=>rs});var Xr=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},Qr=(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()}}))},Zr=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("input-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})},es=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("select-","");s&&e.detail.selectedValue!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.selectedValue})},ts=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("colorpicker-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})},rs=(e,t)=>{let{store:r}=t,s=e.currentTarget.id.replace("slider-","");s&&e.detail.value!==void 0&&r.setFormFieldValue({fieldName:s,value:e.detail.value})};var Fe={};D(Fe,{INITIAL_STATE:()=>ss,selectFormValues:()=>ls,selectState:()=>os,setDefaultValues:()=>cs,setFormFieldValue:()=>ds,setState:()=>ps,toViewData:()=>as});var ss=Object.freeze({formValues:{}}),is=["id","class","style","slot"],ns=e=>Object.entries(e).filter(([t])=>!is.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),as=({state:e,props:t,attrs:r})=>({containerAttrString:ns(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),os=({state:e})=>e,ls=({state:e})=>e.formValues,ps=e=>{},cs=(e,t)=>{e.formValues=t||{}},ds=(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:{},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-",{var:"field.id"}," w=f placeholder=",{var:"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-",{var:"field.id"}," w=f .options=fields[",{var:"i"},"].options .placeholder=fields[",{var:"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-",{var:"field.id"}," value=",{var:"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-",{var:"field.id"}," min=",{var:"field.min"}," max=",{var:"field.max"}," step=",{var:"field.step"}," value=",{var:"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-",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var He={};D(He,{handleClickStart:()=>hs});var hs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Be={};D(Be,{INITIAL_STATE:()=>us,selectPath:()=>ys,setState:()=>vs,toViewData:()=>gs});var us=Object.freeze({}),fs=["id","class","style","slot"],ms=e=>Object.entries(e).filter(([t])=>!fs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),gs=({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:ms(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ys=({props:e})=>e.start.path,vs=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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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=",{var:"start.image.width"}," h=",{var:"start.image.height"}," src=",{var:"start.image.src"}," alt=",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};D(Ke,{handleOnMount:()=>ws});var Rt=(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())},bs=(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),Rt(n,t),s();let o=Rt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},ws=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=bs(r,e);return()=>{s()}})};var Ue={};D(Ue,{INITIAL_STATE:()=>xs,selectCurrentId:()=>ks,selectState:()=>Ss,setContentContainer:()=>$s,setCurrentId:()=>As,setItems:()=>Es,toViewData:()=>_s});var xs=Object.freeze({items:[],currentId:null,contentContainer:null}),_s=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Ss=({state:e})=>e,ks=({state:e})=>e.currentId,Es=(e,t)=>{e.items=t},As=(e,t)=>{e.currentId=t},$s=(e,t)=>{e.contentContainer=t};var Wt={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=",{var:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view pv=xs av=c href=",{var:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var qe={};D(qe,{handleClickOverlay:()=>Cs});var Cs=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Je={};D(Je,{INITIAL_STATE:()=>Os,selectState:()=>Ts,toViewData:()=>Is});var Os=Object.freeze({}),Is=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),Ts=({state:e})=>e;var Ft={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: ',{var:"position.x"},"px; top: ",{var:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Ye={};D(Ye,{handleButtonClick:()=>Ls,handleClickOptionsPopoverOverlay:()=>js,handleOnMount:()=>Ns,handleOptionClick:()=>Ps});var Ns=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())}},Ls=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},js=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Ps=(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 Ge={};D(Ge,{INITIAL_STATE:()=>Ds,closeOptionsPopover:()=>Rs,openOptionsPopover:()=>zs,selectState:()=>Ms,toViewData:()=>Vs,updateSelectOption:()=>Ws});var Ds=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Vs=({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"}},Ms=({state:e})=>e,zs=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Rs=e=>{e.isOpen=!1},Ws=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Ht={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-",{var:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{var:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Xe={};D(Xe,{handleHeaderClick:()=>Fs,handleItemClick:()=>Hs});var Fs=(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}))},Hs=(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 Ze={};D(Ze,{INITIAL_STATE:()=>Bs,selectActiveItem:()=>Ys,selectHeader:()=>Js,selectItem:()=>Gs,setState:()=>Xs,toViewData:()=>qs});var Bs=Object.freeze({}),Ks=["id","class","style","slot"],Us=e=>Object.entries(e).filter(([t])=>!Ks.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Qe(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 qs=({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=Us(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},d=i?Qe(i,n):[],u=o==="full"?272:64,g=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,h=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",y=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,v=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:d,sidebarWidth:u,headerAlign:g,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:h,firstLetterSize:f,showLabels:y,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:v,headerWidth:v,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Js=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Ys=({state:e,props:t})=>(t.items?Qe(t.items):[]).find(s=>s.active),Gs=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?Qe(i):[]).find(a=>a.id===s)},Xs=e=>{};var Bt={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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"header.href"}," d=h av=c ah=",{var:"headerAlign"}," g=lg w=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"header.image.width"}," h=",{var:"header.image.height"}," src=",{var:"header.image.src"},' alt="',{var:"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=",{var:"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=",{var:"headerAlign"}," g=lg w=",{var:"headerWidth"}," cur=p"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{var:"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=",{var:"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=",{var:"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=",{var:"iconSize"}," svg=",{var:"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=",{var:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{var:"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-",{var:"item.id"}," ",{var:"item.hrefAttr"}," h=",{var:"itemHeight"}," av=c ",{var:"itemAlignAttr"}," ph=",{var:"itemPadding"}," w=",{var:"itemWidth"}," h-bgc=",{var:"item.itemHoverBgc"}," br=lg bgc=",{var:"item.itemBgc"},' cur=p title="',{var:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f ph=",{var:"headerPadding"}," pb=lg g=xs ah=",{var:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{var:"sidebarWidth"}," bwr=xs ah=",{var:"ah"}," ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var et={};D(et,{handleHeaderClick:()=>ei,handleOnMount:()=>Qs,handleRowClick:()=>Zs});var Qs=e=>{},Zs=(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}}))},ei=(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 tt={};D(tt,{INITIAL_STATE:()=>ti,clearSort:()=>pi,selectSortInfo:()=>oi,selectState:()=>ai,setSortColumn:()=>li,toViewData:()=>ni});var ti=Object.freeze({sortColumn:null,sortDirection:null}),ri=["id","class","style","slot"],si=e=>Object.entries(e).filter(([t])=>!ri.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ii=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},ni=({state:e,props:t,attrs:r})=>{let s=si(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(d=>{let u=ii(a,d.key);return{key:d.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},ai=({state:e})=>e,oi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),li=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},pi=e=>{e.sortColumn=null,e.sortDirection=null};var Kt={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-",{var:"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-",{var:"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 ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Xt=Symbol.for("immer-nothing"),Ut=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?Qt(e)||Array.isArray(e)||!!e[Ut]||!!e.constructor?.[Ut]||be(e)||we(e):!1}var ci=Object.prototype.constructor.toString();function Qt(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)===ci}function me(e,t){ve(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ve(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:be(e)?2:we(e)?3:0}function it(e,t){return ve(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Zt(e,t,r){let s=ve(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function di(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function be(e){return e instanceof Map}function we(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function nt(e,t){if(be(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Qt(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 ct(e,t=!1){return xe(e)||ae(e)||!Z(e)||(ve(e)>1&&(e.set=e.add=e.clear=e.delete=hi),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ct(s,!0))),e}function hi(){U(2)}function xe(e){return Object.isFrozen(e)}var ui={};function ee(e){let t=ui[e];return t||U(0,e),t}var ce;function er(){return ce}function fi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function at(e){ot(e),e.drafts_.forEach(mi),e.drafts_=null}function ot(e){e===ce&&(ce=e.parent_)}function Jt(e){return ce=fi(ce,e)}function mi(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Yt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(at(t),U(4)),Z(e)&&(e=ge(t,e),t.parent_||ye(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=ge(t,r,[]),at(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Xt?e:void 0}function ge(e,t,r){if(xe(t))return t;let s=t[F];if(!s)return me(t,(i,n)=>Gt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ye(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),me(n,(o,l)=>Gt(e,s,i,o,l,r,a)),ye(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Gt(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!it(t.assigned_,s)?n.concat(s):void 0,l=ge(e,i,o);if(Zt(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!xe(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ge(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ye(e,i)}}function ye(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ct(t,r)}function gi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:er(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=dt;r&&(i=[s],n=de);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var dt={get(e,t){if(t===F)return e;let r=Q(e);if(!it(r,t))return yi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===rt(e.base_,t)?(st(e),e.copy_[t]=pt(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=tr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=rt(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(di(r,i)&&(r!==void 0||it(e.base_,t)))return!0;st(e),lt(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 rt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,st(e),lt(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={};me(dt,(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 dt.set.call(this,e[0],t,r,e[0])};function rt(e,t){let r=e[F];return(r?Q(r):e)[t]}function yi(e,t,r){let s=tr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function tr(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 lt(e){e.modified_||(e.modified_=!0,e.parent_&&lt(e.parent_))}function st(e){e.copy_||(e.copy_=nt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vi=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,...d){return a.produce(l,u=>r.call(this,u,...d))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Jt(this),a=pt(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?at(n):ot(n)}return qt(n,s),Yt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Xt&&(i=void 0),this.autoFreeze_&&ct(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=bi(e));let t=Jt(this),r=pt(e,void 0);return r[F].isManual_=!0,ot(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return qt(s,t),Yt(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 pt(e,t){let r=be(e)?ee("MapSet").proxyMap_(e,t):we(e)?ee("MapSet").proxySet_(e,t):gi(e,t);return(t?t.scope_:er()).drafts_.push(r),r}function bi(e){return ae(e)||U(10,e),rr(e)}function rr(e){if(!Z(e)||xe(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=nt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=nt(e,!0);return me(r,(s,i)=>{Zt(r,s,rr(i))}),t&&(t.finalized_=!1),r}var H=new vi,sr=H.produce,Ha=H.produceWithPatches.bind(H),Ba=H.setAutoFreeze.bind(H),Ka=H.setUseStrictShallowCopy.bind(H),Ua=H.applyPatches.bind(H),qa=H.createDraft.bind(H),Ja=H.finishDraft.bind(H);var L={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},_e={NOT:0};var wi=e=>{let{ast:t,functions:r,data:s}=e;return V(t,r,s,{})},V=(e,t,r,s)=>{switch(e.type){case L.LITERAL:return e.value;case L.VARIABLE:return ht(e.path,r,s);case L.INTERPOLATION:return xi(e.parts,t,r,s);case L.FUNCTION:return ir(e,t,r,s);case L.BINARY:return nr(e,t,r,s);case L.UNARY:return ar(e,t,r,s);case L.CONDITIONAL:return _i(e,t,r,s);case L.LOOP:return Si(e,t,r,s);case L.OBJECT:return ki(e,t,r,s);case L.ARRAY:return Ei(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ht=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n of s){if(i==null)return;r.hasOwnProperty(n)?i=r[n]:i=i[n]}return i},xi=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else if(n.var){let a=ht(n.var,r,s);i+=a!=null?String(a):""}else if(n.func){let a=t[n.func]?.(...n.args||[]);i+=a!=null?String(a):""}return i},ir=(e,t,r,s)=>{let i=t[e.name];if(!i)throw new Error(`Function '${e.name}' is not defined`);let n=e.args.map(a=>V(a,t,r,s));return i(...n)},Se=(e,t,r,s)=>{switch(e.type){case L.VARIABLE:return ht(e.path,r,s);case L.LITERAL:return e.value;case L.BINARY:return nr(e,t,r,s);case L.UNARY:return ar(e,t,r,s);case L.FUNCTION:return ir(e,t,r,s);default:return V(e,t,r,s)}},nr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Se(e.left,t,r,s),o=Se(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}`)}},ar=(e,t,r,s)=>{let i=e.op===_e.NOT?Se(e.operand,t,r,s):V(e.operand,t,r,s);switch(e.op){case _e.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},_i=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Se(n,t,r,s))return V(e.bodies[i],t,r,s)}return{}},Si=(e,t,r,s)=>{let i=V(e.iterable,t,r,s);if(!Array.isArray(i))return[];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},ki=(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===L.OBJECT&&l.properties){let d=l.properties.find(u=>u.key.startsWith("$for "));if(d){let u=V(d.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 d=o.parsedKey?V(o.parsedKey,t,r,s):o.key,u=V(o.value,t,r,s);u!==void 0&&(i[d]=u)}}return i},Ei=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===L.LOOP){let a=V(n,t,r,s);i.push(a)}else i.push(V(n,t,r,s));return i},ke=wi;var Ee=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Ee(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]:Ee(n)})}}t.push(r)}return t},[]):e;var Ci=(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)},or=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=ke({ast:t,data:r}),a=Ee(n),o=Oi({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Oi=({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,d)=>{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[g,E]=u[0];if(!isNaN(Number(g)))return Array.isArray(E)?n(E,`${o}.${g}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${g}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",g);let T,p,c=g.indexOf(" ");c===-1?(T=g,p=""):(T=g.substring(0,c),p=g.substring(c+1).trim());let h=T.split(/[.#]/)[0],f=h.includes("-"),y={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,b;for(;(b=S.exec(p))!==null;)if(b[1].startsWith(".")){let I=b[1].substring(1),j=b[4];_[I]=Ci(i,j)}else y[b[1]]=b[2]||b[3]||b[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(y,"id")&&(y.id=m[1]);let x=null;y.id?x=y.id:f&&(x=h);let v=Object.create(null),k=null;if(f)k=h;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let j=I.substring(1);v[j]=!0});let b=T.match(/#([^.#\s]+)/);b&&(k=b[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${g}`):w=[],k&&!f&&(y.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(b=>{if(b.includes("*")){let I="^"+b.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(b)}catch(j){console.warn(`[Parser] Invalid regex pattern created from refKey '${b}': ${I}`,j)}}else x===b&&S.push(b)}),S.length>0){S.sort((I,j)=>{let z=!I.includes("*"),X=!j.includes("*");return z&&!X?-1:!z&&X?1:j.length-I.length});let b=S[0];if(r[b]&&r[b].eventListeners){let I=r[b].eventListeners;Object.entries(I).forEach(([j,z])=>{z.handler&&s[z.handler]?A[j]=X=>{s[z.handler](X)}:z.handler&&console.warn(`[Parser] Handler '${z.handler}' for refKey '${b}' (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}.${d}`:String(d);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let b=JSON.stringify(_).substring(0,50);C.key+=`-${b}`}}Object.keys(y).length>0&&(C.attrs=y),Object.keys(v).length>0&&(C.class=v),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,b)=>{let I=S.data?.props||{},j=b.data?.props||{},z=S.data?.attrs||{},X=b.data?.attrs||{},Ar=JSON.stringify(I)!==JSON.stringify(j),$r=JSON.stringify(z)!==JSON.stringify(X);if(Ar||$r){let P=b.elm;P&&P.render&&typeof P.render=="function"&&(P.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(P.render(),P.removeAttribute("isDirty"),P.handlers&&P.handlers.handleOnUpdate){let Cr={...P.deps||{},store:P.store,render:P.render.bind(P),handlers:P.handlers,dispatchEvent:P.dispatchEvent.bind(P),refIds:P.refIds||{},getRefIds:()=>P.refIds||{}};P.handlers.handleOnUpdate({oldProps:I,newProps:j,oldAttrs:z,newAttrs:X},Cr)}}))}}});try{return e(h,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:h,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Ii=(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,d])=>{let u=s(d);return` ${l} {
808
808
  ${u.split(`
809
809
  `).map(g=>g?` ${g}`:"").join(`
@@ -815,7 +815,7 @@ ${o}
815
815
  ${o}
816
816
  }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
817
817
 
818
- `:"")+o)}),r},Ii=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Ti(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Ni(e,t){let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i))return e[i]},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,i){return typeof i=="string"&&r.has(i)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,i){if(typeof i=="string"&&r.has(i))return{configurable:!0,enumerable:!0,get:()=>e[i]}}})}var ut=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
818
+ `:"")+o)}),r},Ti=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Ni(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Li(e,t){let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i))return e[i]},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,i){return typeof i=="string"&&r.has(i)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,i){if(typeof i=="string"&&r.has(i))return{configurable:!0,enumerable:!0,get:()=>e[i]}}})}var ut=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
819
819
  a, a:link, a:visited, a:hover, a:active {
820
820
  display: contents;
821
821
  color: inherit;
@@ -827,4 +827,4 @@ ${o}
827
827
  font: inherit;
828
828
  cursor: pointer;
829
829
  }
830
- `);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.subscriptions&&(this.unsubscribeAll=Ii(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){r!==s&&this.render&&requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t=or({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),r={},s=i=>{i.data?.attrs&&i.data.attrs.id&&(r[i.data.attrs.id]=i),i.children&&i.children.forEach(s)};s(t),this.refIds=r,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,t):this._oldVNode=this.patch(this.renderTarget,t)}catch(t){console.error("Error during patching:",t)}}},Li=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([d,u])=>{d.startsWith("select")?a[d]=(...g)=>u({state:l,props:t,attrs:r},...g):o[d]=g=>(l=sr(l,E=>u(E,g)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},ji=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:d,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class g extends ut{static get observedAttributes(){return["key"]}constructor(){super();let T=Ti(this);this.propsSchema=o,this.props=o?Ni(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=Li(r,this.props,T),this.template=l,this.handlers=e,this.refs=d,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Oi(a,u)}}return g},ft=ji;function Z(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var oe=Array.isArray;function le(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Pi(e,t){return document.createElement(e,t)}function Di(e,t,r){return document.createElementNS(e,t,r)}function Vi(){return ee(document.createDocumentFragment())}function Mi(e){return document.createTextNode(e)}function zi(e){return document.createComment(e)}function Ri(e,t,r){if(Y(e)){let s=e;for(;s&&Y(s);)s=ee(s).parent;e=s??e}Y(t)&&(t=ee(t,e)),r&&Y(r)&&(r=ee(r).firstChildNode),e.insertBefore(t,r)}function Wi(e,t){e.removeChild(t)}function Fi(e,t){Y(t)&&(t=ee(t,e)),e.appendChild(t)}function pr(e){if(Y(e)){for(;e&&Y(e);)e=ee(e).parent;return e??null}return e.parentNode}function Hi(e){var t;if(Y(e)){let r=ee(e),s=pr(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Bi(e){return e.tagName}function Ki(e,t){e.textContent=t}function Ui(e){return e.textContent}function qi(e){return e.nodeType===1}function Ji(e){return e.nodeType===3}function Yi(e){return e.nodeType===8}function Y(e){return e.nodeType===11}function ee(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var cr={createElement:Pi,createElementNS:Di,createTextNode:Mi,createDocumentFragment:Vi,createComment:zi,insertBefore:Ri,removeChild:Wi,appendChild:Fi,parentNode:pr,nextSibling:Hi,tagName:Bi,setTextContent:Ki,getTextContent:Ui,isElement:qi,isText:Ji,isComment:Yi,isDocumentFragment:Y};function Ae(e){return e===void 0}function z(e){return e!==void 0}var mt=Z("",{},[],void 0,void 0);function he(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function Gi(){throw new Error("The document fragment is not supported on this platform.")}function Xi(e,t){return e.isElement(t)}function Qi(e,t){return e.isDocumentFragment(t)}function Zi(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var en=["create","update","remove","destroy","pre","post"];function dr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:cr;for(let p of en)for(let c of e){let h=c[p];h!==void 0&&s[p].push(h)}function n(p){let c=p.id?"#"+p.id:"",h=p.getAttribute("class"),f=h?"."+h.split(" ").join("."):"";return Z(i.tagName(p).toLowerCase()+c+f,{},[],void 0,p)}function a(p){return Z(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let f=i.parentNode(p);f!==null&&i.removeChild(f,p)}}}function l(p,c){var h,f,y,_;let m,x=p.data;if(x!==void 0){let w=(h=x.hook)===null||h===void 0?void 0:h.init;z(w)&&(w(p),x=p.data)}let v=p.children,k=p.sel;if(k==="!")Ae(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(k==="")p.elm=i.createTextNode(p.text);else if(k!==void 0){let w=k.indexOf("#"),A=k.indexOf(".",w),C=w>0?w:k.length,S=A>0?A:k.length,b=w!==-1||A!==-1?k.slice(0,Math.min(C,S)):k,I=p.elm=z(x)&&z(m=x.ns)?i.createElementNS(m,b,x):i.createElement(b,x);for(C<S&&I.setAttribute("id",k.slice(C+1,S)),A>0&&I.setAttribute("class",k.slice(S+1).replace(/\./g," ")),m=0;m<s.create.length;++m)s.create[m](mt,p);if(le(p.text)&&(!oe(v)||v.length===0)&&i.appendChild(I,i.createTextNode(p.text)),oe(v))for(m=0;m<v.length;++m){let R=v[m];R!=null&&i.appendChild(I,l(R,c))}let j=p.data.hook;z(j)&&((f=j.create)===null||f===void 0||f.call(j,mt,p),j.insert&&c.push(p))}else if(!((y=r?.experimental)===null||y===void 0)&&y.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Gi)(),m=0;m<s.create.length;++m)s.create[m](mt,p);for(m=0;m<p.children.length;++m){let w=p.children[m];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function d(p,c,h,f,y,_){for(;f<=y;++f){let m=h[f];m!=null&&i.insertBefore(p,l(m,_),c)}}function u(p){var c,h;let f=p.data;if(f!==void 0){(h=(c=f?.hook)===null||c===void 0?void 0:c.destroy)===null||h===void 0||h.call(c,p);for(let y=0;y<s.destroy.length;++y)s.destroy[y](p);if(p.children!==void 0)for(let y=0;y<p.children.length;++y){let _=p.children[y];_!=null&&typeof _!="string"&&u(_)}}}function g(p,c,h,f){for(var y,_;h<=f;++h){let m,x,v=c[h];if(v!=null)if(z(v.sel)){u(v),m=s.remove.length+1,x=o(v.elm,m);for(let w=0;w<s.remove.length;++w)s.remove[w](v,x);let k=(_=(y=v?.data)===null||y===void 0?void 0:y.hook)===null||_===void 0?void 0:_.remove;z(k)?k(v,x):x()}else v.children?(u(v),g(p,v.children,0,v.children.length-1)):i.removeChild(p,v.elm)}}function E(p,c,h,f){let y=0,_=0,m=c.length-1,x=c[0],v=c[m],k=h.length-1,w=h[0],A=h[k],C,S,b,I;for(;y<=m&&_<=k;)x==null?x=c[++y]:v==null?v=c[--m]:w==null?w=h[++_]:A==null?A=h[--k]:he(x,w)?(T(x,w,f),x=c[++y],w=h[++_]):he(v,A)?(T(v,A,f),v=c[--m],A=h[--k]):he(x,A)?(T(x,A,f),i.insertBefore(p,x.elm,i.nextSibling(v.elm)),x=c[++y],A=h[--k]):he(v,w)?(T(v,w,f),i.insertBefore(p,v.elm,x.elm),v=c[--m],w=h[++_]):(C===void 0&&(C=Zi(c,y,m)),S=C[w.key],Ae(S)?(i.insertBefore(p,l(w,f),x.elm),w=h[++_]):Ae(C[A.key])?(i.insertBefore(p,l(A,f),i.nextSibling(v.elm)),A=h[--k]):(b=c[S],b.sel!==w.sel?i.insertBefore(p,l(w,f),x.elm):(T(b,w,f),c[S]=void 0,i.insertBefore(p,b.elm,x.elm)),w=h[++_]));_<=k&&(I=h[k+1]==null?null:h[k+1].elm,d(p,I,h,_,k,f)),y<=m&&g(p,c,y,m)}function T(p,c,h){var f,y,_,m,x,v,k,w;let A=(f=c.data)===null||f===void 0?void 0:f.hook;(y=A?.prepatch)===null||y===void 0||y.call(A,p,c);let C=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||z(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(m=p.data)!==null&&m!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(k=(v=(x=c.data)===null||x===void 0?void 0:x.hook)===null||v===void 0?void 0:v.update)===null||k===void 0||k.call(v,p,c)}let S=p.children,b=c.children;Ae(c.text)?z(S)&&z(b)?S!==b&&E(C,S,b,h):z(b)?(z(p.text)&&i.setTextContent(C,""),d(C,null,b,0,b.length-1,h)):z(S)?g(C,S,0,S.length-1):z(p.text)&&i.setTextContent(C,""):p.text!==c.text&&(z(S)&&g(C,S,0,S.length-1),i.setTextContent(C,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,h){let f,y,_,m=[];for(f=0;f<s.pre.length;++f)s.pre[f]();for(Xi(i,c)?c=n(c):Qi(i,c)&&(c=a(c)),he(c,h)?T(c,h,m):(y=c.elm,_=i.parentNode(y),l(h,m),_!==null&&(i.insertBefore(_,h.elm,i.nextSibling(y)),g(_,[c],0,0))),f=0;f<m.length;++f)m[f].data.hook.insert(m[f]);for(f=0;f<s.post.length;++f)s.post[f]();return h}}function hr(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var ur={create:hr,update:hr};function fr(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var mr={create:fr,update:fr};var tn="http://www.w3.org/1999/xlink",rn="http://www.w3.org/2000/xmlns/",sn="http://www.w3.org/XML/1998/namespace";function gr(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(sn,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(rn,r,a):s.setAttributeNS(tn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var yr={create:gr,update:gr};var vr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,nn=function(e){vr(function(){vr(e)})},gt=!1;function an(e,t,r){nn(function(){e[t]=r})}function br(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let o="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&an(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function on(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function ln(e,t){let r=e.data.style;if(!r||!r.remove){t();return}gt||(e.elm.offsetLeft,gt=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&o++;i.addEventListener("transitionend",function(g){g.target===i&&--o,o===0&&t()})}function pn(){gt=!1}var wr={pre:pn,create:br,update:br,destroy:on,remove:ln};function xr(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)xr(e[s],t,r)}function cn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&xr(s[r],t,e)}function dn(){return function e(t){cn(t,e.vnode)}}function yt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||dn();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var _r={create:yt,update:yt,destroy:yt};var hn=()=>dr([ur,mr,yr,wr,_r]),vt=hn;function Sr(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Sr(n,i.children,i.sel)}}function bt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),oe(r)?i=r:le(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(oe(t)?i=t:le(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)le(i[a])&&(i[a]=Z(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Sr(s,i,e),Z(e,s,i,n,void 0)}var un={},kr={components:un},Er=vt();var $e={components:{dialog:{store:Ve,view:Dt,handlers:Me},sidebar:{handlers:ze,view:Vt,store:We},popover:{handlers:Fe,view:Mt,store:He},form:{store:Be,handlers:Ke,view:zt},select:{store:Ue,handlers:qe,view:Rt},pageOutline:{store:Je,view:Wt,handlers:Ye},navbar:{store:Ge,view:Ht,handlers:Xe},dropdownMenu:{view:Bt,handlers:Qe,store:Ze},table:{store:et,handlers:tt,view:Kt}}};Object.keys($e).forEach(e=>{Object.keys($e[e]).forEach(t=>{let r=ft({...$e[e][t],patch:Er,h:bt},kr[e]);customElements.define($e[e][t].view.elementName,r)})});customElements.define("rtgl-button",St({}));customElements.define("rtgl-view",At({}));customElements.define("rtgl-text",Ct({}));customElements.define("rtgl-image",Ot({}));customElements.define("rtgl-svg",Tt({}));customElements.define("rtgl-input",Nt({}));customElements.define("rtgl-textarea",Lt({}));customElements.define("rtgl-color-picker",jt({}));customElements.define("rtgl-slider",Pt({}));})();
830
+ `);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.subscriptions&&(this.unsubscribeAll=Ti(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){r!==s&&this.render&&requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=or({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},ji=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([d,u])=>{d.startsWith("select")?a[d]=(...g)=>u({state:l,props:t,attrs:r},...g):o[d]=g=>(l=sr(l,E=>u(E,g)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},Pi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:d,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class g extends ut{static get observedAttributes(){return["key"]}constructor(){super();let T=Ni(this);this.propsSchema=o,this.props=o?Li(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=ji(r,this.props,T),this.template=l,this.handlers=e,this.refs=d,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Ii(a,u)}}return g},ft=Pi;function te(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var oe=Array.isArray;function le(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Di(e,t){return document.createElement(e,t)}function Vi(e,t,r){return document.createElementNS(e,t,r)}function Mi(){return re(document.createDocumentFragment())}function zi(e){return document.createTextNode(e)}function Ri(e){return document.createComment(e)}function Wi(e,t,r){if(G(e)){let s=e;for(;s&&G(s);)s=re(s).parent;e=s??e}G(t)&&(t=re(t,e)),r&&G(r)&&(r=re(r).firstChildNode),e.insertBefore(t,r)}function Fi(e,t){e.removeChild(t)}function Hi(e,t){G(t)&&(t=re(t,e)),e.appendChild(t)}function pr(e){if(G(e)){for(;e&&G(e);)e=re(e).parent;return e??null}return e.parentNode}function Bi(e){var t;if(G(e)){let r=re(e),s=pr(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Ki(e){return e.tagName}function Ui(e,t){e.textContent=t}function qi(e){return e.textContent}function Ji(e){return e.nodeType===1}function Yi(e){return e.nodeType===3}function Gi(e){return e.nodeType===8}function G(e){return e.nodeType===11}function re(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var cr={createElement:Di,createElementNS:Vi,createTextNode:zi,createDocumentFragment:Mi,createComment:Ri,insertBefore:Wi,removeChild:Fi,appendChild:Hi,parentNode:pr,nextSibling:Bi,tagName:Ki,setTextContent:Ui,getTextContent:qi,isElement:Ji,isText:Yi,isComment:Gi,isDocumentFragment:G};function Ae(e){return e===void 0}function W(e){return e!==void 0}var mt=te("",{},[],void 0,void 0);function he(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function Xi(){throw new Error("The document fragment is not supported on this platform.")}function Qi(e,t){return e.isElement(t)}function Zi(e,t){return e.isDocumentFragment(t)}function en(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var tn=["create","update","remove","destroy","pre","post"];function dr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:cr;for(let p of tn)for(let c of e){let h=c[p];h!==void 0&&s[p].push(h)}function n(p){let c=p.id?"#"+p.id:"",h=p.getAttribute("class"),f=h?"."+h.split(" ").join("."):"";return te(i.tagName(p).toLowerCase()+c+f,{},[],void 0,p)}function a(p){return te(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let f=i.parentNode(p);f!==null&&i.removeChild(f,p)}}}function l(p,c){var h,f,y,_;let m,x=p.data;if(x!==void 0){let w=(h=x.hook)===null||h===void 0?void 0:h.init;W(w)&&(w(p),x=p.data)}let v=p.children,k=p.sel;if(k==="!")Ae(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(k==="")p.elm=i.createTextNode(p.text);else if(k!==void 0){let w=k.indexOf("#"),A=k.indexOf(".",w),C=w>0?w:k.length,S=A>0?A:k.length,b=w!==-1||A!==-1?k.slice(0,Math.min(C,S)):k,I=p.elm=W(x)&&W(m=x.ns)?i.createElementNS(m,b,x):i.createElement(b,x);for(C<S&&I.setAttribute("id",k.slice(C+1,S)),A>0&&I.setAttribute("class",k.slice(S+1).replace(/\./g," ")),m=0;m<s.create.length;++m)s.create[m](mt,p);if(le(p.text)&&(!oe(v)||v.length===0)&&i.appendChild(I,i.createTextNode(p.text)),oe(v))for(m=0;m<v.length;++m){let z=v[m];z!=null&&i.appendChild(I,l(z,c))}let j=p.data.hook;W(j)&&((f=j.create)===null||f===void 0||f.call(j,mt,p),j.insert&&c.push(p))}else if(!((y=r?.experimental)===null||y===void 0)&&y.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Xi)(),m=0;m<s.create.length;++m)s.create[m](mt,p);for(m=0;m<p.children.length;++m){let w=p.children[m];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function d(p,c,h,f,y,_){for(;f<=y;++f){let m=h[f];m!=null&&i.insertBefore(p,l(m,_),c)}}function u(p){var c,h;let f=p.data;if(f!==void 0){(h=(c=f?.hook)===null||c===void 0?void 0:c.destroy)===null||h===void 0||h.call(c,p);for(let y=0;y<s.destroy.length;++y)s.destroy[y](p);if(p.children!==void 0)for(let y=0;y<p.children.length;++y){let _=p.children[y];_!=null&&typeof _!="string"&&u(_)}}}function g(p,c,h,f){for(var y,_;h<=f;++h){let m,x,v=c[h];if(v!=null)if(W(v.sel)){u(v),m=s.remove.length+1,x=o(v.elm,m);for(let w=0;w<s.remove.length;++w)s.remove[w](v,x);let k=(_=(y=v?.data)===null||y===void 0?void 0:y.hook)===null||_===void 0?void 0:_.remove;W(k)?k(v,x):x()}else v.children?(u(v),g(p,v.children,0,v.children.length-1)):i.removeChild(p,v.elm)}}function E(p,c,h,f){let y=0,_=0,m=c.length-1,x=c[0],v=c[m],k=h.length-1,w=h[0],A=h[k],C,S,b,I;for(;y<=m&&_<=k;)x==null?x=c[++y]:v==null?v=c[--m]:w==null?w=h[++_]:A==null?A=h[--k]:he(x,w)?(T(x,w,f),x=c[++y],w=h[++_]):he(v,A)?(T(v,A,f),v=c[--m],A=h[--k]):he(x,A)?(T(x,A,f),i.insertBefore(p,x.elm,i.nextSibling(v.elm)),x=c[++y],A=h[--k]):he(v,w)?(T(v,w,f),i.insertBefore(p,v.elm,x.elm),v=c[--m],w=h[++_]):(C===void 0&&(C=en(c,y,m)),S=C[w.key],Ae(S)?(i.insertBefore(p,l(w,f),x.elm),w=h[++_]):Ae(C[A.key])?(i.insertBefore(p,l(A,f),i.nextSibling(v.elm)),A=h[--k]):(b=c[S],b.sel!==w.sel?i.insertBefore(p,l(w,f),x.elm):(T(b,w,f),c[S]=void 0,i.insertBefore(p,b.elm,x.elm)),w=h[++_]));_<=k&&(I=h[k+1]==null?null:h[k+1].elm,d(p,I,h,_,k,f)),y<=m&&g(p,c,y,m)}function T(p,c,h){var f,y,_,m,x,v,k,w;let A=(f=c.data)===null||f===void 0?void 0:f.hook;(y=A?.prepatch)===null||y===void 0||y.call(A,p,c);let C=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||W(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(m=p.data)!==null&&m!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(k=(v=(x=c.data)===null||x===void 0?void 0:x.hook)===null||v===void 0?void 0:v.update)===null||k===void 0||k.call(v,p,c)}let S=p.children,b=c.children;Ae(c.text)?W(S)&&W(b)?S!==b&&E(C,S,b,h):W(b)?(W(p.text)&&i.setTextContent(C,""),d(C,null,b,0,b.length-1,h)):W(S)?g(C,S,0,S.length-1):W(p.text)&&i.setTextContent(C,""):p.text!==c.text&&(W(S)&&g(C,S,0,S.length-1),i.setTextContent(C,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,h){let f,y,_,m=[];for(f=0;f<s.pre.length;++f)s.pre[f]();for(Qi(i,c)?c=n(c):Zi(i,c)&&(c=a(c)),he(c,h)?T(c,h,m):(y=c.elm,_=i.parentNode(y),l(h,m),_!==null&&(i.insertBefore(_,h.elm,i.nextSibling(y)),g(_,[c],0,0))),f=0;f<m.length;++f)m[f].data.hook.insert(m[f]);for(f=0;f<s.post.length;++f)s.post[f]();return h}}function hr(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var ur={create:hr,update:hr};function fr(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var mr={create:fr,update:fr};var rn="http://www.w3.org/1999/xlink",sn="http://www.w3.org/2000/xmlns/",nn="http://www.w3.org/XML/1998/namespace";function gr(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(nn,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(sn,r,a):s.setAttributeNS(rn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var yr={create:gr,update:gr};var vr=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,an=function(e){vr(function(){vr(e)})},gt=!1;function on(e,t,r){an(function(){e[t]=r})}function br(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let o="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&on(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function ln(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function pn(e,t){let r=e.data.style;if(!r||!r.remove){t();return}gt||(e.elm.offsetLeft,gt=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&o++;i.addEventListener("transitionend",function(g){g.target===i&&--o,o===0&&t()})}function cn(){gt=!1}var wr={pre:cn,create:br,update:br,destroy:ln,remove:pn};function xr(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)xr(e[s],t,r)}function dn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&xr(s[r],t,e)}function hn(){return function e(t){dn(t,e.vnode)}}function yt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||hn();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var _r={create:yt,update:yt,destroy:yt};var un=()=>dr([ur,mr,yr,wr,_r]),vt=un;function Sr(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&Sr(n,i.children,i.sel)}}function bt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),oe(r)?i=r:le(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(oe(t)?i=t:le(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)le(i[a])&&(i[a]=te(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Sr(s,i,e),te(e,s,i,n,void 0)}var fn={},kr={components:fn},Er=vt();var $e={components:{dialog:{handlers:Ve,store:Me,view:Dt},dropdownMenu:{handlers:ze,store:Re,view:Vt},form:{handlers:We,store:Fe,view:Mt},navbar:{handlers:He,store:Be,view:zt},pageOutline:{handlers:Ke,store:Ue,view:Wt},popover:{handlers:qe,store:Je,view:Ft},select:{handlers:Ye,store:Ge,view:Ht},sidebar:{handlers:Xe,store:Ze,view:Bt},table:{handlers:et,store:tt,view:Kt}}};Object.keys($e).forEach(e=>{Object.keys($e[e]).forEach(t=>{let r=ft({...$e[e][t],patch:Er,h:bt},kr[e]);customElements.define($e[e][t].view.elementName,r)})});customElements.define("rtgl-button",St({}));customElements.define("rtgl-view",At({}));customElements.define("rtgl-text",Ct({}));customElements.define("rtgl-image",Ot({}));customElements.define("rtgl-svg",Tt({}));customElements.define("rtgl-input",Nt({}));customElements.define("rtgl-textarea",Lt({}));customElements.define("rtgl-color-picker",jt({}));customElements.define("rtgl-slider",Pt({}));})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/ui",
3
- "version": "0.1.1-rc1",
3
+ "version": "0.1.2-rc1",
4
4
  "description": "A UI component library for building web interfaces.",
5
5
  "main": "dist/rettangoli-esm.min.js",
6
6
  "type": "module",
@@ -22,8 +22,12 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "scripts": {
25
- "build:dev": "bun run ../rettangoli-cli/cli.js fe build && bun run esbuild-dev.js",
26
- "build": "bun run ../rettangoli-cli/cli.js fe build && bun run esbuild.js"
25
+ "build:dev": "rtgl fe build && bun run esbuild-dev.js",
26
+ "build": "rtgl fe build && bun run esbuild.js",
27
+ "vt:generate": "rtgl fe build && bun run esbuild-dev.js && rtgl vt generate --skip-screenshots",
28
+ "vt:report": "bun run build:dev && rtgl vt generate && rtgl vt report",
29
+ "vt:accept": "rtgl vt accept",
30
+ "serve": "bunx serve .rettangoli/vt/_site"
27
31
  },
28
32
  "devDependencies": {
29
33
  "esbuild": "^0.20.0",
@@ -132,7 +132,7 @@ refs:
132
132
  handler: handleActionClick
133
133
  input-*:
134
134
  eventListeners:
135
- input-keydown:
135
+ input-change:
136
136
  handler: handleInputChange
137
137
  select-*:
138
138
  eventListeners:
@@ -38,8 +38,8 @@ class RettangoliInputElement extends HTMLElement {
38
38
  font-weight: var(--xs-font-weight);
39
39
  line-height: var(--xs-line-height);
40
40
  letter-spacing: var(--xs-letter-spacing);
41
- padding-left: var(--spacing-sm);
42
- padding-right: var(--spacing-sm);
41
+ padding-left: var(--spacing-md);
42
+ padding-right: var(--spacing-md);
43
43
  height: 24px;
44
44
  }
45
45
  input:focus {
@@ -78,7 +78,7 @@ class RettangoliInputElement extends HTMLElement {
78
78
  this.shadow.appendChild(this._inputElement);
79
79
 
80
80
  // Bind event handler
81
- this._inputElement.addEventListener('keydown', this._onChange);
81
+ this._inputElement.addEventListener('input', this._onChange);
82
82
  }
83
83
 
84
84
  static get observedAttributes() {
@@ -106,7 +106,7 @@ class RettangoliInputElement extends HTMLElement {
106
106
  }
107
107
 
108
108
  _onChange = (event) => {
109
- this.dispatchEvent(new CustomEvent('input-keydown', {
109
+ this.dispatchEvent(new CustomEvent('input-change', {
110
110
  detail: {
111
111
  value: this._inputElement.value,
112
112
  },
@@ -1,182 +0,0 @@
1
- /**
2
- * Subscribes to all observables and returns a functionthat will unsubscribe
3
- * from all observables when called
4
- * @param {*} observables
5
- * @returns
6
- */
7
- const subscribeAll = (observables) => {
8
- // Subscribe to all observables and store the subscription objects
9
- const subscriptions = observables.map((observable) => observable.subscribe());
10
-
11
- // Return a function that will unsubscribe from all observables when called
12
- return () => {
13
- for (const subscription of subscriptions) {
14
- if (subscription && typeof subscription.unsubscribe === "function") {
15
- subscription.unsubscribe();
16
- }
17
- }
18
- };
19
- };
20
-
21
- /**
22
- * Creates a base web component element to be used in environments
23
- * where the output is strings such as server side rendering environments
24
- * @param {Object} param
25
- * @param {Function} param.render - The render function to be used in the element. compliant with uhtml.render
26
- * @returns
27
- */
28
- export const createSsrBaseElement = ({ render }) => {
29
-
30
- class CSSStyleSheet {
31
- _css = "";
32
-
33
- get css() {
34
- return this._css;
35
- }
36
-
37
- replaceSync(css) {
38
- this._css = css;
39
- }
40
- }
41
- class SsrRenderTarget {
42
- innerHTML = "";
43
- adoptedStyleSheets = [];
44
- write(html) {
45
- this.innerHTML = html;
46
- }
47
- }
48
- class BaseBaseSsrElement {
49
- renderTarget = new SsrRenderTarget();
50
-
51
- constructor() {
52
- const styleSheet = new CSSStyleSheet();
53
- styleSheet.replaceSync(`:host { display: contents; }`);
54
- this.renderTarget.adoptedStyleSheets = [styleSheet];
55
- }
56
- }
57
- return class BaseSsrElement extends createGenericBaseElement({
58
- BaseElement: BaseBaseSsrElement,
59
- render,
60
- skipOnMount: true,
61
- }) {};
62
- };
63
-
64
- /**
65
- * Creates a base web component element to be used in web browser environments
66
- * @param {Object} param
67
- * @param {Function} param.render - The render function to be used in the element. compliant with uhtml.render
68
- * @returns
69
- */
70
- export const createWebComponentBaseElement = ({ render, styleSheet }) => {
71
- let actualStyleSheet;
72
-
73
- if (styleSheet) {
74
- actualStyleSheet = styleSheet;
75
- } else {
76
- actualStyleSheet = new CSSStyleSheet();
77
- actualStyleSheet.replaceSync(`:host { display: contents; }`);
78
- }
79
-
80
- return class BaseWebComponentElement extends createGenericBaseElement({
81
- BaseElement: HTMLElement,
82
- render,
83
- skipOnMount: false,
84
- }) {
85
- static get observedAttributes() {
86
- return ["key"];
87
- }
88
-
89
- constructor() {
90
- super();
91
- this.renderTarget = this.attachShadow({ mode: "closed" });
92
- }
93
-
94
- connectedCallback() {
95
- this.renderTarget.adoptedStyleSheets = [actualStyleSheet];
96
- this.baseOnMount();
97
- }
98
-
99
- disconnectedCallback() {
100
- this.baseOnUnmount();
101
- }
102
-
103
- attributeChangedCallback() {
104
- setTimeout(() => {
105
- this.reRender();
106
- }, 0);
107
- }
108
- };
109
- };
110
-
111
- /**
112
- * Creates a base web component element to be used in environments
113
- * where the output is strings such as server side rendering environments
114
- * @param {Object} param
115
- * @param {Object} param.BaseElement - The base element to be used in the element.
116
- * @param {Function} param.render - The render function to be used in the element. compliant with uhtml.render
117
- * @param {Boolean} param.skipOnMount - Whether to skip the onMount callback. Default is false.
118
- * @returns
119
- */
120
- export const createGenericBaseElement = ({ BaseElement, render, skipOnMount = false }) => {
121
- class GenericBaseElement extends BaseElement {
122
-
123
- _renderKey = 0;
124
- _unmountCallback;
125
- // renderTarget;
126
- disableFirstAutomatedRender = false;
127
-
128
- get renderKey() {
129
- return String(this._renderKey);
130
- }
131
-
132
- baseOnMount = () => {
133
- if (!skipOnMount && this.onMount) {
134
- this._unmountCallback = this.onMount();
135
- }
136
-
137
- if (!this.disableFirstAutomatedRender) {
138
- this.reRender();
139
- }
140
-
141
- if (this.attachedObservables) {
142
- if (Array.isArray(this.attachedObservables)) {
143
- this.unsubscribe = subscribeAll(this.attachedObservables);
144
- } else {
145
- this.unsubscribe = subscribeAll(this.attachedObservables());
146
- }
147
- } else if (this.subscriptions) {
148
- this.unsubscribe = subscribeAll(this.subscriptions);
149
- }
150
- };
151
-
152
- baseOnUnmount = () => {
153
- if (this._unmountCallback) {
154
- this._unmountCallback();
155
- }
156
- if (this.onUnmount) {
157
- this.onUnmount();
158
- }
159
- if (this.unsubscribe) {
160
- this.unsubscribe();
161
- }
162
- };
163
-
164
- /**
165
- * @deprecated
166
- * @see reRender
167
- */
168
- triggerRender = () => {
169
- this.reRender();
170
- };
171
-
172
- /**
173
- * ReRenders the component
174
- */
175
- reRender = () => {
176
- this._renderKey++;
177
- render(this.renderTarget, this.render());
178
- };
179
- }
180
-
181
- return GenericBaseElement;
182
- };
package/src/lib/uhtml.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Skipped minification because the original files appears to be already minified.
3
- * Original file: /npm/uhtml@4.7.0/keyed.js
4
- *
5
- * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6
- */
7
- const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),i=(e,t)=>t.reduceRight(o,e),o=(e,t)=>e.childNodes[t],{setPrototypeOf:c}=Object;let a;var u=(e,t,n)=>(a||(a=s()),n?a.setStartAfter(e):a.setStartBefore(e),a.setEndAfter(t),a.deleteContents(),e);const h=({firstChild:e,lastChild:t},n)=>u(e,t,n);let d=!1;const f=(e,t)=>d&&11===e.nodeType?1/t<0?t?h(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,p=e=>document.createComment(e);class g extends((e=>{function t(e){return c(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=p("<>");#t=p("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),d=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){h(this,!1)}replaceWith(e){h(this,!0).replaceWith(e)}valueOf(){const{parentNode:e}=this;if(e===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(e){let{firstChild:e,lastChild:t}=this;for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling)}this.replaceChildren(...this.#n)}return this}}const m=(e,t,n)=>e.setAttribute(t,n),b=(e,t)=>e.removeAttribute(t);let v;const C=(t,n,r)=>{r=r.slice(1),v||(v=new WeakMap);const s=v.get(t)||l(v,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},w=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},x=(e,t,n)=>e[n]=t,$=(e,t,n)=>x(e,t,n.slice(1)),y=(e,t,n)=>null==t?(b(e,n),t):x(e,t,n),N=(e,t)=>("function"==typeof t?t(e):t.current=e,t),O=(e,t,n)=>(null==t?b(e,n):m(e,n,t),t),k=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),A=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-0).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-0).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,f,e);switch(n.length){case 1:n[0].remove();case 0:break;default:u(f(n[0],0),f(n.at(-1),-0),!1)}return r},M=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?b(e,s):m(e,s,r)}return t}],["class",(e,t)=>y(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",N],["style",(e,t)=>null==t?y(e,t,"style"):x(e.style,t,"cssText")]]),W=(e,r,s)=>{switch(r[0]){case".":return $;case"?":return k;case"@":return C;default:return s||"ownerSVGElement"in e?"ref"===r?N:O:M.get(r)||(r in e?r.startsWith("on")?x:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?y:O:O)}},S=(e,t)=>(e.textContent=null==t?"":t,t),E=(e,t,n)=>({a:e,b:t,c:n}),T=()=>E(null,null,r);var B=e=>(t,n)=>{const{a:s,b:l,c:o}=e(t,n),c=document.importNode(s,!0);let a=r;if(l!==r){a=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:o,c:p}=l[n],g=s===t?e:e=i(c,t=s);a[n]=(u=o,h=g,d=p,f=o===A?[]:o===w?T():null,{v:r,u:u,t:h,n:d,c:f})}}var u,h,d,f;return((e,t)=>({b:e,c:t}))(o?c.firstChild:new g(c),a)};const D=/^(?:plaintext|script|style|textarea|title|xmp)$/i,j=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||j.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?A:w;r===w&&t.push(i),c.push(E(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(E(e,W(i,t,s),t)),b(i,a),a=`${I}${l++}`}!s&&D.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(E(e||H(i),S,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,E(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case A:s.v=A(s.t,X(s.c,e),s.v);break;case w:const t=e instanceof Y?U(s.c||(s.c=T()),e):(s.c=null,e);t!==s.v&&(s.v=w(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=T()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=T()){return U(e,this)}}
8
- /*! (c) Andrea Giammarchi - MIT */const ee=e=>(t,...n)=>new Y(e,t,n),te=ee(!1),ne=ee(!0),re=new WeakMap;var se=(e,t)=>((e,t)=>{const n=re.get(e)||l(re,e,T()),{b:r}=n,s="function"==typeof t?t():t,i=s instanceof Y?s.toDOM(n):s;return r!==i&&e.replaceChildren((n.b=i).valueOf()),e})(e,t)
9
- /*! (c) Andrea Giammarchi - MIT */;const le=new WeakMap,ie=e=>(t,n)=>{const r=le.get(t)||l(le,t,new Map);return r.get(n)||l(r,n,function(t,...n){return new Y(e,t,n).toDOM(this)}.bind(T()))},oe=ie(!1),ce=ie(!0);export{Y as Hole,M as attr,te as html,oe as htmlFor,se as render,ne as svg,ce as svgFor};