rettangoli-ui 0.1.0-rc1 → 0.1.0-rc3

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.
Files changed (51) hide show
  1. package/README.md +16 -27
  2. package/dist/rettangoli-iife-layout.min.js +360 -284
  3. package/dist/rettangoli-iife-ui.min.js +382 -548
  4. package/package.json +13 -5
  5. package/src/common/BaseElement.js +182 -0
  6. package/src/common.js +190 -0
  7. package/src/components/dialog/dialog.handlers.js +5 -0
  8. package/src/components/dialog/dialog.store.js +24 -0
  9. package/src/components/dialog/dialog.view.yaml +40 -0
  10. package/src/components/form/form.handlers.js +30 -0
  11. package/src/components/form/form.store.js +45 -0
  12. package/src/components/form/form.view.yaml +47 -0
  13. package/src/components/navbar/navbar.examples.yaml +86 -0
  14. package/src/components/navbar/navbar.handlers.js +10 -0
  15. package/src/components/navbar/navbar.store.js +46 -0
  16. package/src/components/navbar/navbar.view.yaml +74 -0
  17. package/src/components/pageOutline/pageOutline.handlers.js +69 -0
  18. package/src/components/pageOutline/pageOutline.store.js +40 -0
  19. package/src/components/pageOutline/pageOutline.view.yaml +34 -0
  20. package/src/components/popover/popover.handlers.js +17 -0
  21. package/src/components/popover/popover.store.js +37 -0
  22. package/src/components/popover/popover.view.yaml +50 -0
  23. package/src/components/select/select.handlers.js +15 -0
  24. package/src/components/select/select.store.js +25 -0
  25. package/src/components/select/select.view.yaml +38 -0
  26. package/src/components/sidebar/sidebar.handlers.js +36 -0
  27. package/src/components/sidebar/sidebar.store.js +125 -0
  28. package/src/components/sidebar/sidebar.view.yaml +186 -0
  29. package/src/entry-iife-layout.js +15 -0
  30. package/src/entry-iife-ui.js +18 -0
  31. package/src/index.js +17 -0
  32. package/src/lib/uhtml.js +9 -0
  33. package/src/primitives/button.js +263 -0
  34. package/src/primitives/image.js +234 -0
  35. package/src/primitives/input.js +208 -0
  36. package/src/primitives/svg.js +95 -0
  37. package/src/primitives/text.js +141 -0
  38. package/src/primitives/textarea.js +103 -0
  39. package/src/primitives/view.js +215 -0
  40. package/src/setup.js +16 -0
  41. package/src/styles/anchorStyles.js +13 -0
  42. package/src/styles/buttonMarginStyles.js +84 -0
  43. package/src/styles/cursorStyles.js +12 -0
  44. package/src/styles/flexChildStyles.js +43 -0
  45. package/src/styles/flexDirectionStyles.js +74 -0
  46. package/src/styles/marginStyles.js +13 -0
  47. package/src/styles/paddingSvgStyles.js +120 -0
  48. package/src/styles/scrollStyles.js +22 -0
  49. package/src/styles/textColorStyles.js +14 -0
  50. package/src/styles/textStyles.js +62 -0
  51. package/src/styles/viewStyles.js +119 -0
@@ -1,24 +1,24 @@
1
- var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDescriptor:ze}=Object,W=[],Ht=()=>document.createRange(),q=(t,e,n)=>(t.set(e,n),n),Fe=(t,e)=>e.reduceRight(je,t),je=(t,e)=>t.childNodes[e],{setPrototypeOf:Ie}=Object,F,zt=(t,e,n)=>(F||(F=Ht()),n?F.setStartAfter(t):F.setStartBefore(t),F.setEndAfter(e),F.deleteContents(),t),Rt=({firstChild:t,lastChild:e},n)=>zt(t,e,n),Ft=!1,yt=(t,e)=>Ft&&t.nodeType===11?1/e<0?e?Rt(t,!0):t.lastChild:e?t.valueOf():t.firstChild:t,Mt=t=>document.createComment(t),Ot=class extends(e=>{function n(o){return Ie(o,new.target.prototype)}return n.prototype=e.prototype,n})(DocumentFragment){#e=Mt("<>");#n=Mt("</>");#t=W;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#n),Ft=!0}get firstChild(){return this.#e}get lastChild(){return this.#n}get parentNode(){return this.#e.parentNode}remove(){Rt(this,!1)}replaceWith(e){Rt(this,!0).replaceWith(e)}valueOf(){let{parentNode:e}=this;if(e===this)this.#t===W&&(this.#t=[...this.childNodes]);else{if(e){let{firstChild:n,lastChild:o}=this;for(this.#t=[n];n!==o;)this.#t.push(n=n.nextSibling)}this.replaceChildren(...this.#t)}return this}},jt=(t,e,n)=>t.setAttribute(e,n),st=(t,e)=>t.removeAttribute(e),ot,Ve=(t,e,n)=>{n=n.slice(1),ot||(ot=new WeakMap);let o=ot.get(t)||q(ot,t,{}),r=o[n];return r&&r[0]&&t.removeEventListener(n,...r),r=Nt(e)?e:[e,!1],o[n]=r,r[0]&&t.addEventListener(n,...r),e},X=(t,e)=>{let{t:n,n:o}=t,r=!1;switch(typeof e){case"object":if(e!==null){(o||n).replaceWith(t.n=e.valueOf());break}case"undefined":r=!0;default:n.data=r?"":e,o&&(t.n=null,o.replaceWith(n))}return e},lt=(t,e,n)=>t[n]=e,Ue=(t,e,n)=>lt(t,e,n.slice(1)),kt=(t,e,n)=>e==null?(st(t,n),e):lt(t,e,n),It=(t,e)=>(typeof e=="function"?e(t):e.current=t,e),St=(t,e,n)=>(e==null?st(t,n):jt(t,n,e),e),Ke=(t,e,n)=>(t.toggleAttribute(n.slice(1),e),e),it=(t,e,n)=>{let{length:o}=e;if(t.data=`[${o}]`,o)return((r,i,l,s,a)=>{let c=l.length,f=i.length,d=c,h=0,u=0,g=null;for(;h<f||u<d;)if(f===h){let p=d<c?u?s(l[u-1],-0).nextSibling:s(l[d],0):a;for(;u<d;)r.insertBefore(s(l[u++],1),p)}else if(d===u)for(;h<f;)g&&g.has(i[h])||r.removeChild(s(i[h],-1)),h++;else if(i[h]===l[u])h++,u++;else if(i[f-1]===l[d-1])f--,d--;else if(i[h]===l[d-1]&&l[u]===i[f-1]){let p=s(i[--f],-0).nextSibling;r.insertBefore(s(l[u++],1),s(i[h++],-0).nextSibling),r.insertBefore(s(l[--d],1),p),i[f]=l[d]}else{if(!g){g=new Map;let p=u;for(;p<d;)g.set(l[p],p++)}if(g.has(i[h])){let p=g.get(i[h]);if(u<p&&p<d){let w=h,T=1;for(;++w<f&&w<d&&g.get(i[w])===p+T;)T++;if(T>p-u){let P=s(i[h],0);for(;u<p;)r.insertBefore(s(l[u++],1),P)}else r.replaceChild(s(l[u++],1),s(i[h++],-1))}else h++}else r.removeChild(s(i[h++],-1))}return l})(t.parentNode,n,e,yt,t);switch(n.length){case 1:n[0].remove();case 0:break;default:zt(yt(n[0],0),yt(n.at(-1),-0),!1)}return W},Ye=new Map([["aria",(t,e)=>{for(let n in e){let o=e[n],r=n==="role"?n:`aria-${n}`;o==null?st(t,r):jt(t,r,o)}return e}],["class",(t,e)=>kt(t,e,e==null?"class":"className")],["data",(t,e)=>{let{dataset:n}=t;for(let o in e)e[o]==null?delete n[o]:n[o]=e[o];return e}],["ref",It],["style",(t,e)=>e==null?kt(t,e,"style"):lt(t.style,e,"cssText")]]),qe=(t,e,n)=>{switch(e[0]){case".":return Ue;case"?":return Ke;case"@":return Ve;default:return n||"ownerSVGElement"in t?e==="ref"?It:St:Ye.get(e)||(e in t?e.startsWith("on")?lt:((o,r)=>{let i;do i=ze(o,r);while(!i&&(o=He(o)));return i})(t,e)?.set?kt:St:St)}},Xe=(t,e)=>(t.textContent=e??"",e),Y=(t,e,n)=>({a:t,b:e,c:n}),j=()=>Y(null,null,W),Vt=t=>(e,n)=>{let{a:o,b:r,c:i}=t(e,n),l=document.importNode(o,!0),s=W;if(r!==W){s=[];for(let h,u,g=0;g<r.length;g++){let{a:p,b:w,c:T}=r[g],P=p===u?h:h=Fe(l,u=p);s[g]=(a=w,c=P,f=T,d=w===it?[]:w===X?j():null,{v:W,u:a,t:c,n:f,c:d})}}var a,c,f,d;return((h,u)=>({b:h,c:u}))(i?l.firstChild:new Ot(l),s)},Ge=/^(?:plaintext|script|style|textarea|title|xmp)$/i,Je=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,Qe=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,Ze=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,tn=/[\x01\x02]/g,$t,At,rt=document.createElement("template"),en=(t,e)=>{if(e)return $t||($t=document.createElementNS("http://www.w3.org/2000/svg","svg"),At=Ht(),At.selectNodeContents($t)),At.createContextualFragment(t);rt.innerHTML=t;let{content:n}=rt;return rt=rt.cloneNode(!1),n},Ct=t=>{let e=[],n;for(;n=t.parentNode;)e.push(e.indexOf.call(n.childNodes,t)),t=n;return e},Wt=()=>document.createTextNode(""),nn=(t,e,n)=>{let o=en(((a,c,f)=>{let d=0;return a.join("").trim().replace(Qe,(h,u,g,p)=>`<${u}${g.replace(Ze,"=$2$1").trimEnd()}${p?f||Je.test(u)?" /":`></${u}`:""}>`).replace(tn,h=>h===""?`<!--${c+d++}-->`:c+d++)})(t,K,n),n),{length:r}=t,i=W;if(r>1){let a=[],c=document.createTreeWalker(o,129),f=0,d=`${K}${f++}`;for(i=[];f<r;){let h=c.nextNode();if(h.nodeType===8){if(h.data===d){let u=Nt(e[f-1])?it:X;u===X&&a.push(h),i.push(Y(Ct(h),u,null)),d=`${K}${f++}`}}else{let u;for(;h.hasAttribute(d);){u||(u=Ct(h));let g=h.getAttribute(d);i.push(Y(u,qe(h,g,n),g)),st(h,d),d=`${K}${f++}`}!n&&Ge.test(h.localName)&&h.textContent.trim()===`<!--${d}-->`&&(i.push(Y(u||Ct(h),Xe,null)),d=`${K}${f++}`)}}for(f=0;f<a.length;f++)a[f].replaceWith(Wt())}let{childNodes:l}=o,{length:s}=l;return s<1?(s=1,o.appendChild(Wt())):s===1&&r!==1&&l[0].nodeType!==1&&(s=0),q(Ut,t,Y(o,i,s===1))},Ut=new WeakMap,K="is\xB5",Kt=t=>(e,n)=>Ut.get(e)||nn(e,n,t),on=Vt(Kt(!1)),rn=Vt(Kt(!0)),Et=(t,{s:e,t:n,v:o})=>{if(t.a!==n){let{b:r,c:i}=(e?rn:on)(n,o);t.a=n,t.b=r,t.c=i}for(let{c:r}=t,i=0;i<r.length;i++){let l=o[i],s=r[i];switch(s.u){case it:s.v=it(s.t,sn(s.c,l),s.v);break;case X:let a=l instanceof D?Et(s.c||(s.c=j()),l):(s.c=null,l);a!==s.v&&(s.v=X(s,a));break;default:l!==s.v&&(s.v=s.u(s.t,l,s.n,s.v))}}return t.b},sn=(t,e)=>{let n=0,{length:o}=e;for(o<t.length&&t.splice(o);n<o;n++){let r=e[n];r instanceof D?e[n]=Et(t[n]||(t[n]=j()),r):t[n]=null}return e},D=class{constructor(e,n,o){this.s=e,this.t=n,this.v=o}toDOM(e=j()){return Et(e,this)}};var Yt=t=>(e,...n)=>new D(t,e,n),y=Yt(!1),Mn=Yt(!0),Bt=new WeakMap,S=(t,e)=>((n,o)=>{let r=Bt.get(n)||q(Bt,n,j()),{b:i}=r,l=typeof o=="function"?o():o,s=l instanceof D?l.toDOM(r):l;return i!==s&&n.replaceChildren((r.b=s).valueOf()),n})(t,e),Dt=new WeakMap,qt=t=>(e,n)=>{let o=Dt.get(e)||q(Dt,e,new Map);return o.get(n)||q(o,n,function(r,...i){return new D(t,r,i).toDOM(this)}.bind(j()))},Wn=qt(!1),Bn=qt(!0);function m(t,...e){let n="";return t.forEach((o,r)=>{n+=o+(e[r]||"")}),n}var ln=["xs","sm","md","lg","xl"],Xt={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"},Gt=Object.keys(Xt),Jt=t=>t.concat(ln.flatMap(e=>t.map(n=>`${e}-${n}`))),Qt={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)"},C=(t,e={})=>{let n="";for(let[o,r]of Object.entries(Qt)){o!=="default"&&(n+=`${r} {`);for(let[i,l]of Object.entries(t)){let s=e[i]?` ${e[i]} `:" ";for(let[a,c]of Object.entries(l)){let f=Xt[i],d=c.startsWith("--")?`var(${c})`:c,h=o==="default"?i:`${o}-${i}`,u=o==="default"?`h-${i}`:`${o}-h-${i}`;if(f){let p=f.split(" ").map(w=>`${w}: ${d};`).join(" ");n+=`
2
- :host([${h}="${a}"])${s}{
3
- ${p}
4
- }
5
- :host([${u}="${a}"]:hover)${s}{
6
- ${p}
7
- }
8
- `}else n+=`
9
- :host([${h}="${a}"])${s}{
1
+ var rettangoli=(()=>{var mr=Object.defineProperty;var D=(e,t)=>{for(var r in t)mr(e,r,{get:t[r],enumerable:!0})};function I(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var gr=["xs","sm","md","lg","xl"],ft={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"},Z=Object.keys(ft),ee=e=>e.concat(gr.flatMap(t=>e.map(r=>`${t}-${r}`))),ut={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)"},F=(e,t={})=>{let r="";for(let[s,i]of Object.entries(ut)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,u]of Object.entries(a)){let m=ft[n],x=u.startsWith("--")?`var(${u})`:u,$=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(m){let c=m.split(" ").map(h=>`${h}: ${x};`).join(" ");r+=`
2
+ :host([${$}="${l}"])${o}{
10
3
  ${c}
11
4
  }
12
- :host([${u}="${a}"]:hover)${s}{
5
+ :host([${T}="${l}"]:hover)${o}{
13
6
  ${c}
14
7
  }
15
- `}}o!=="default"&&(n+="}")}return n};function an(t){if(t===null||t.includes("/"))return!1;let e=String(t);return/[0-9]$/.test(e)}var cn=t=>/%$/.test(t),$=t=>{if(t!==void 0)return cn(t)?t:an(t)?`${t}px`:Object.keys(v).includes(t)?`var(${v[t]})`:t},v={xs:"--spacing-xs",s:"--spacing-s",m:"--spacing-m",l:"--spacing-l",xl:"--spacing-xl"};function at(t){let e="";for(let[n,o]of Object.entries(Qt)){n!=="default"&&(e+=`${o} {
16
- `);let r="";for(let[i,l]of Object.entries(t[n]))l!=null&&(r+=`${i}: ${l};
17
- `);e+=`:host {
18
- ${r.trim()}
8
+ `}else r+=`
9
+ :host([${$}="${l}"])${o}{
10
+ ${u}
11
+ }
12
+ :host([${T}="${l}"]:hover)${o}{
13
+ ${u}
14
+ }
15
+ `}}s!=="default"&&(r+="}")}return r};function yr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var vr=e=>/%$/.test(e),j=e=>{if(e!==void 0)return vr(e)?e:yr(e)?`${e}px`:Object.keys(E).includes(e)?`var(${E[e]})`:e},E={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function te(e,t=":host"){let r="";for(let[s,i]of Object.entries(ut)){s!=="default"&&(r+=`${i} {
16
+ `);let n="";for(let[a,o]of Object.entries(e[s]))o!=null&&(n+=`${a}: ${o};
17
+ `);r+=`${t} {
18
+ ${n.trim()}
19
19
  }
20
- `,n!=="default"&&(e+=`}
21
- `)}return e}var I=m`
20
+ `,s!=="default"&&(r+=`}
21
+ `)}return r}var re=I`
22
22
  :host([flex="0"]) {
23
23
  flex: 0;
24
24
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var dn={mt:v,mr:v,mb:v,ml:v,m:v,mh:v,mv:v,s:{sm:`
61
+ `;var br={mt:E,mr:E,mb:E,ml:E,m:E,mh:E,mv:E,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,141 +104,139 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},fn={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Zt=C(dn,fn);var te=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
108
- :host {
109
- display: contents;
110
- }
111
- slot {
112
- display: contents;
113
- }
107
+ `}},wr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},mt=F(br,wr);var se=I`
108
+ a, a:link, a:visited, a:hover, a:active {
109
+ color: inherit;
110
+ text-decoration: none;
111
+ background: none;
112
+ border: none;
113
+ padding: 0;
114
+ margin: 0;
115
+ font: inherit;
116
+ }
117
+ `;var $e=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
118
+ :host {
119
+ display: contents;
120
+ }
121
+ slot {
122
+ display: contents;
123
+ }
114
124
 
115
- button {
116
- display: flex;
117
- flex-direction: row;
118
- align-items: center;
119
- justify-content: center;
120
- gap: var(--spacing-s);
121
- border-width: 0px;
122
- border-style: solid;
123
- border-color: var(--border);
124
- padding: 0px;
125
- height: 32px;
126
- padding-left: 16px;
127
- padding-right: 16px;
128
- border-radius: 4px;
125
+ button {
126
+ display: flex;
127
+ flex-direction: row;
128
+ align-items: center;
129
+ justify-content: center;
130
+ gap: var(--spacing-sm);
131
+ border-width: 0px;
132
+ border-style: solid;
133
+ border-color: var(--border);
134
+ padding: 0px;
135
+ height: 32px;
136
+ padding-left: 16px;
137
+ padding-right: 16px;
138
+ border-radius: 4px;
129
139
 
130
- font-size: var(--sm-font-size);
131
- font-weight: var(--sm-font-weight);
132
- line-height: var(--sm-line-height);
133
- letter-spacing: var(--sm-letter-spacing);
140
+ font-size: var(--sm-font-size);
141
+ font-weight: var(--sm-font-weight);
142
+ line-height: var(--sm-line-height);
143
+ letter-spacing: var(--sm-letter-spacing);
134
144
 
135
- background-color: var(--primary);
136
- color: var(--primary-foreground);
137
- }
145
+ background-color: var(--primary);
146
+ color: var(--primary-foreground);
147
+ }
138
148
 
139
- button:hover {
140
- cursor: pointer;
141
- background-color: color-mix(
142
- in srgb,
143
- var(--primary) 85%,
144
- white 15%
145
- );
146
- }
149
+ button:hover {
150
+ cursor: pointer;
151
+ background-color: color-mix(
152
+ in srgb,
153
+ var(--primary) 85%,
154
+ white 15%
155
+ );
156
+ }
147
157
 
148
- button:disabled {
149
- cursor: not-allowed;
150
- }
158
+ button:disabled {
159
+ cursor: not-allowed;
160
+ }
151
161
 
152
- button:active {
153
- cursor: pointer;
154
- background-color: color-mix(
155
- in srgb,
156
- var(--primary) 80%,
157
- white 20%
158
- );
159
- }
162
+ button:active {
163
+ cursor: pointer;
164
+ background-color: color-mix(
165
+ in srgb,
166
+ var(--primary) 80%,
167
+ white 20%
168
+ );
169
+ }
160
170
 
161
- :host([v="pr"]) button:hover {
162
- background-color: color-mix(
163
- in srgb,
164
- var(--primary) 85%,
165
- white 15%
166
- );
167
- }
171
+ :host([v="pr"]) button:hover {
172
+ background-color: color-mix(
173
+ in srgb,
174
+ var(--primary) 85%,
175
+ white 15%
176
+ );
177
+ }
168
178
 
169
- :host([v="pr"]) button:active {
170
- background-color: color-mix(
171
- in srgb,
172
- var(--primary) 80%,
173
- white 20%
174
- );
175
- }
179
+ :host([v="pr"]) button:active {
180
+ background-color: color-mix(
181
+ in srgb,
182
+ var(--primary) 80%,
183
+ white 20%
184
+ );
185
+ }
176
186
 
177
- :host([v="se"]) button:hover {
178
- background-color: color-mix(
179
- in srgb,
180
- var(--secondary) 85%,
181
- white 15%
182
- );
183
- }
187
+ :host([v="se"]) button:hover {
188
+ background-color: color-mix(
189
+ in srgb,
190
+ var(--secondary) 85%,
191
+ white 15%
192
+ );
193
+ }
184
194
 
185
- :host([v="se"]) button:active {
186
- background-color: color-mix(
187
- in srgb,
188
- var(--secondary) 80%,
189
- white 20%
190
- );
191
- }
195
+ :host([v="se"]) button:active {
196
+ background-color: color-mix(
197
+ in srgb,
198
+ var(--secondary) 80%,
199
+ white 20%
200
+ );
201
+ }
192
202
 
193
- :host([v="de"]) button:hover {
194
- background-color: color-mix(
195
- in srgb,
196
- var(--destructive) 85%,
197
- white 15%
198
- );
199
- }
203
+ :host([v="de"]) button:hover {
204
+ background-color: color-mix(
205
+ in srgb,
206
+ var(--destructive) 85%,
207
+ white 15%
208
+ );
209
+ }
200
210
 
201
- :host([v="de"]) button:active {
202
- background-color: color-mix(
203
- in srgb,
204
- var(--destructive) 80%,
205
- white 20%
206
- );
207
- }
211
+ :host([v="de"]) button:active {
212
+ background-color: color-mix(
213
+ in srgb,
214
+ var(--destructive) 80%,
215
+ white 20%
216
+ );
217
+ }
208
218
 
209
- :host([v="ol"]) button:hover {
210
- background-color: var(--accent);
211
- }
219
+ :host([v="ol"]) button:hover {
220
+ background-color: var(--accent);
221
+ }
212
222
 
213
- :host([v="gh"]) button:hover {
214
- background-color: var(--accent);
215
- }
223
+ :host([v="gh"]) button:hover {
224
+ background-color: var(--accent);
225
+ }
216
226
 
217
- :host([v="lk"]) button:hover {
218
- text-decoration: underline;
219
- }
227
+ :host([v="lk"]) button:hover {
228
+ text-decoration: underline;
229
+ }
220
230
 
221
- ${Zt}
222
- ${I}
223
- `),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n],t(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled"]}_buttonRef={};_assingRef=r=>{this._buttonRef.current=r;let i=$(this.getAttribute("w"));i==="f"?this._buttonRef.current.style.width="100%":i!=null&&(this._buttonRef.current.style.width=i)};attributeChangedCallback(r,i,l){if(!this._buttonRef.current)return;let s=$(this.getAttribute("w"));s==="f"?this._buttonRef.current.style.width="var(--width-stretch)":s!=null&&(this._buttonRef.current.style.width=s,this._buttonRef.current.style.minWidth=s,this._buttonRef.current.style.maxWidth=s),t(this.shadow,this.render)}renderIcon=()=>{let r=this.getAttribute("icon"),i={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},l={sm:14,md:18,lg:22},s=i[this.getAttribute("v")]||"pr-fg",a=l[this.getAttribute("t")]||18;return r?e`
224
- <rtgl-svg svg="${r}" c="${s}" wh="${a}"></rtgl-svg>
225
- `:e``};render=()=>{let r=this.hasAttribute("disabled");return this.getAttribute("href")?e`
226
- <a
227
- href=${this.getAttribute("href")}
228
- target=${this.getAttribute("target")}
229
- style="text-decoration: none; display: contents; color: inherit;"
230
- >
231
- <button disabled="${r}">
232
- ${this.renderIcon()}
233
- <slot></slot>
234
- </button>
235
- </a>
236
- `:e`
237
- <button ref=${this._assingRef} disabled="${r}">
238
- ${this.renderIcon()}
239
- <slot></slot>
240
- </button>
241
- `}}};var ee=m`
231
+ ${se}
232
+
233
+ a {
234
+ display: contents;
235
+ }
236
+
237
+ ${mt}
238
+ ${re}
239
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let s=document.createElement("a");s.setAttribute("href",r);let i=this.getAttribute("target");i&&s.setAttribute("target",i),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},i=r[this.getAttribute("v")]||"pr-fg",n=s[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",i),this._iconElement.setAttribute("wh",n.toString()),this._buttonElement.insertBefore(this._iconElement,this._slotElement)}}_updateWidth(){let t=j(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},gt=({render:e,html:t})=>$e;var yt=I`
242
240
 
243
241
  :host([d="h"]) {
244
242
  flex-direction: row;
@@ -309,7 +307,7 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
309
307
  justify-content: center;
310
308
  }
311
309
  }
312
- `;var hn={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},b=C(hn);var ne=m`
310
+ `;var xr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},H=F(xr);var vt=I`
313
311
  :host([sh]:not([sv])) {
314
312
  overflow-x: scroll;
315
313
  flex-wrap: nowrap;
@@ -327,12 +325,14 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
327
325
  flex-wrap: nowrap;
328
326
  }
329
327
 
330
- `;var G={xs:"--border-width-xs",s:"--border-width-s",m:"--border-width-m",l:"--border-width-l",xl:"--border-width-xl"},un={bgc:{pr:`
328
+ `;var le={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},_r={bgc:{pr:`
331
329
  background-color: var(--primary);
332
330
  `,se:`
333
331
  background-color: var(--secondary);
334
332
  `,de:`
335
333
  background-color: var(--destructive);
334
+ `,fg:`
335
+ background-color: var(--foreground);
336
336
  `,bg:`
337
337
  background-color: var(--background);
338
338
  `,mu:`
@@ -365,37 +365,47 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
365
365
  left: 0;
366
366
  top: 0;
367
367
  height: 100%;
368
- `},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:v,pr:v,pb:v,pl:v,p:v,ph:v,pv:v,g:v,gv:v,gh:v,bw:G,bwt:G,bwr:G,bwb:G,bwl:G,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},br:{xs:"--border-radius-xs",s:"--border-radius-s",m:"--border-radius-m",l:"--border-radius-l",xl:"--border-radius-xl",f:"--border-radius-f"}},ct=C(un);var gn={mt:v,mr:v,mb:v,ml:v,m:v,mh:v,mv:v},x=C(gn);var oe=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
369
- slot {
370
- display: contents;
371
- }
372
- :host {
373
- display: flex;
374
- flex-direction: column;
375
- align-self: auto;
376
- align-content: flex-start;
377
- border-style: solid;
378
- border-width: 0;
379
- box-sizing: border-box;
380
- border-color: var(--border);
381
- }
368
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:E,pr:E,pb:E,pl:E,p:E,ph:E,pv:E,g:E,gv:E,gh:E,bw:le,bwt:le,bwr:le,bwb:le,bwl:le,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},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"}},de=F(_r);var Sr={mt:E,mr:E,mb:E,ml:E,m:E,mh:E,mv:E},U=F(Sr);var Oe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
369
+ slot {
370
+ display: contents;
371
+ }
372
+ :host {
373
+ display: flex;
374
+ flex-direction: column;
375
+ align-self: auto;
376
+ align-content: flex-start;
377
+ border-style: solid;
378
+ border-width: 0;
379
+ box-sizing: border-box;
380
+ border-color: var(--border);
381
+ }
382
382
 
383
- :host([fw="w"]) {
384
- flex-wrap: wrap;
385
- }
383
+ :host([fw="w"]) {
384
+ flex-wrap: wrap;
385
+ }
386
386
 
387
- ${I}
388
- ${ne}
389
- ${ee}
390
- ${x}
391
- ${b}
392
- ${ct}
393
- `),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n],t(this.shadow,this.render)}static get observedAttributes(){return Jt([...Gt,"wh","w","h","hidden","sh","sv"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(r,i,l){["default","sm","md","lg","xl"].forEach(s=>{let a=g=>`${s==="default"?"":`${s}-`}${g}`,c=this.getAttribute(a("wh")),f=$(c===null?this.getAttribute(a("w")):c),d=$(c===null?this.getAttribute(a("h")):c),h=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[s]["z-index"]=u),h!==null&&(this._styles[s].opacity=h),f==="f"?this._styles[s].width="var(--width-stretch)":f!==void 0&&(this._styles[s].width=f,this._styles[s]["min-width"]=f,this._styles[s]["max-width"]=f),d==="f"?this._styles[s].height="100%":d!==void 0&&(this._styles[s].height=d,this._styles[s]["min-height"]=d,this._styles[s]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[s].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[s].display="flex !important")}),t(this.shadow,this.render)}render=()=>e`
394
- <style>
395
- ${at(this._styles)}
396
- </style>
397
- <slot></slot>
398
- `}};var pn={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
387
+ ${re}
388
+ ${vt}
389
+ ${yt}
390
+ ${U}
391
+ ${H}
392
+ ${de}
393
+ ${se}
394
+
395
+ :host([href]) {
396
+ cursor: pointer;
397
+ position: relative;
398
+ }
399
+
400
+ :host([href]) a {
401
+ position: absolute;
402
+ top: 0;
403
+ left: 0;
404
+ right: 0;
405
+ bottom: 0;
406
+ z-index: 1;
407
+ }
408
+ `))}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",...ee([...Z,"wh","w","h","hidden","sh","sv"])]}_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=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=te(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},bt=({render:e,html:t})=>Oe;var kr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
399
409
  font-size: var(--h1-font-size);
400
410
  font-weight: var(--h1-font-weight);
401
411
  line-height: var(--h1-line-height);
@@ -435,76 +445,92 @@ var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDesc
435
445
  font-weight: var(--xs-font-weight);
436
446
  line-height: var(--xs-line-height);
437
447
  letter-spacing: var(--xs-letter-spacing);
438
- `}},re=C(pn);var mn={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},dt=C(mn);var ie=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
439
- :host {
440
- display: block;
441
- font-size: var(--md-font-size);
442
- font-weight: var(--md-font-weight);
443
- line-height: var(--md-line-height);
444
- letter-spacing: var(--md-letter-spacing);
445
- }
446
- slot {
447
- display: contents;
448
- }
449
- :host ::slotted(a) {
450
- text-decoration: var(--anchor-text-decoration);
451
- color: var(--anchor-color);
452
- }
453
- :host ::slotted(a:hover) {
454
- text-decoration: var(--anchor-text-decoration-hover);
455
- color: var(--anchor-color-hover);
456
- }
457
- ${re}
458
- ${dt}
459
- ${x}
460
- ${b}
461
- `);class o extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){let a=$(this.getAttribute("w"));this.hasAttribute("ellipsis")&&(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"),a==="f"?this.style.width="var(--width-stretch)":a!==void 0&&(this.style.width=a),t(this.shadow,this.render)}render=()=>e` <slot></slot> `}return o};var se=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
462
- :host {
463
- border-style: solid;
464
- box-sizing: border-box;
465
- overflow: hidden;
466
- border-width: 0;
467
- }
468
- slot {
469
- display: contents;
470
- }
471
- :host([of="con"]) img {
472
- object-fit: contain;
473
- }
474
- :host([of="cov"]) img {
475
- object-fit: cover;
476
- }
477
- :host([of="none"]) img {
478
- object-fit: none;
479
- }
480
- img {
481
- height: 100%;
482
- width: 100%;
483
- }
484
- ${ct}
485
- ${x}
486
- ${b}
487
- `),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};static get observedAttributes(){return["key","src","wh","w","h","hidden","height","width","s-wh","s-w","s-h"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(r,i,l){["default","sm","md","lg","xl"].forEach(s=>{let a=g=>`${s==="default"?"":`${s}-`}${g}`,c=this.getAttribute(a("wh")),f=$(c===null?this.getAttribute(a("w")):c),d=$(c===null?this.getAttribute(a("h")):c),h=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[s].zIndex=u),h!==null&&(this._styles[s].opacity=h),f==="f"?this._styles[s].width="var(--width-stretch)":f!==void 0&&(this._styles[s].width=f,this._styles[s]["min-width"]=f,this._styles[s]["max-width"]=f),d==="f"?this._styles[s].height="100%":d!==void 0&&(this._styles[s].height=d,this._styles[s]["min-height"]=d,this._styles[s]["max-height"]=d)}),t(this.shadow,this.render)}render=()=>e`
488
- <style>
489
- ${at(this._styles)}
490
- </style>
491
- <img
492
- src="${this.getAttribute("src")}"
493
- width="${this.getAttribute("width")}"
494
- height="${this.getAttribute("height")}"
495
- />
496
- `}};var le=m`
448
+ `}},wt=F(kr);var Ar={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},fe=F(Ar);var Ce=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
449
+ :host {
450
+ display: block;
451
+ font-size: var(--md-font-size);
452
+ font-weight: var(--md-font-weight);
453
+ line-height: var(--md-line-height);
454
+ letter-spacing: var(--md-letter-spacing);
455
+ }
456
+ slot {
457
+ display: contents;
458
+ }
459
+ :host ::slotted(a) {
460
+ text-decoration: var(--anchor-text-decoration);
461
+ color: var(--anchor-color);
462
+ }
463
+ :host ::slotted(a:hover) {
464
+ text-decoration: var(--anchor-text-decoration-hover);
465
+ color: var(--anchor-color-hover);
466
+ }
467
+ :host([href]) {
468
+ cursor: pointer;
469
+ position: relative;
470
+ }
471
+ :host([href]) a {
472
+ position: absolute;
473
+ top: 0;
474
+ left: 0;
475
+ right: 0;
476
+ bottom: 0;
477
+ z-index: 1;
478
+ }
479
+ ${wt}
480
+ ${fe}
481
+ ${U}
482
+ ${H}
483
+ `))}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=j(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)}},xt=({render:e,html:t})=>Ce;var Ie=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
484
+ :host {
485
+ border-style: solid;
486
+ box-sizing: border-box;
487
+ overflow: hidden;
488
+ border-width: 0;
489
+ }
490
+ slot {
491
+ display: contents;
492
+ }
493
+ :host([of="con"]) img {
494
+ object-fit: contain;
495
+ }
496
+ :host([of="cov"]) img {
497
+ object-fit: cover;
498
+ }
499
+ :host([of="none"]) img {
500
+ object-fit: none;
501
+ }
502
+ img {
503
+ height: 100%;
504
+ width: 100%;
505
+ }
506
+
507
+ ${se}
508
+
509
+ a {
510
+ display: block;
511
+ height: 100%;
512
+ width: 100%;
513
+ }
514
+
515
+ :host([href]) {
516
+ cursor: pointer;
517
+ }
518
+
519
+ ${de}
520
+ ${U}
521
+ ${H}
522
+ `))}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 ee([...Z,"key","src","href","target","wh","w","h","hidden","height","width"])}_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=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("o")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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()}},_t=({render:e,html:t})=>Ie;var St=I`
497
523
  :host([pt="xs"]) svg {
498
524
  padding-top: var(--spacing-xs);
499
525
  }
500
- :host([pt="s"]) svg {
501
- padding-top: var(--spacing-s);
526
+ :host([pt="sm"]) svg {
527
+ padding-top: var(--spacing-sm);
502
528
  }
503
- :host([pt="m"]) svg {
504
- padding-top: var(--spacing-m);
529
+ :host([pt="md"]) svg {
530
+ padding-top: var(--spacing-md);
505
531
  }
506
- :host([pt="l"]) svg {
507
- padding-top: var(--spacing-l);
532
+ :host([pt="lg"]) svg {
533
+ padding-top: var(--spacing-lg);
508
534
  }
509
535
  :host([pt="xl"]) svg {
510
536
  padding-top: var(--spacing-xl);
@@ -512,14 +538,14 @@ ${b}
512
538
  :host([pr="xs"]) svg {
513
539
  padding-right: var(--spacing-xs);
514
540
  }
515
- :host([pr="s"]) svg {
516
- padding-right: var(--spacing-s);
541
+ :host([pr="sm"]) svg {
542
+ padding-right: var(--spacing-sm);
517
543
  }
518
- :host([pr="m"]) svg {
519
- padding-right: var(--spacing-m);
544
+ :host([pr="md"]) svg {
545
+ padding-right: var(--spacing-md);
520
546
  }
521
- :host([pr="l"]) svg {
522
- padding-right: var(--spacing-l);
547
+ :host([pr="lg"]) svg {
548
+ padding-right: var(--spacing-lg);
523
549
  }
524
550
  :host([pr="xl"]) svg {
525
551
  padding-right: var(--spacing-xl);
@@ -527,14 +553,14 @@ ${b}
527
553
  :host([pb="xs"]) svg {
528
554
  padding-bottom: var(--spacing-xs);
529
555
  }
530
- :host([pb="s"]) svg {
531
- padding-bottom: var(--spacing-s);
556
+ :host([pb="sm"]) svg {
557
+ padding-bottom: var(--spacing-sm);
532
558
  }
533
- :host([pb="m"]) svg {
534
- padding-bottom: var(--spacing-m);
559
+ :host([pb="md"]) svg {
560
+ padding-bottom: var(--spacing-md);
535
561
  }
536
- :host([pb="l"]) svg {
537
- padding-bottom: var(--spacing-l);
562
+ :host([pb="lg"]) svg {
563
+ padding-bottom: var(--spacing-lg);
538
564
  }
539
565
  :host([pb="xl"]) svg {
540
566
  padding-bottom: var(--spacing-xl);
@@ -542,14 +568,14 @@ ${b}
542
568
  :host([pl="xs"]) svg {
543
569
  padding-left: var(--spacing-xs);
544
570
  }
545
- :host([pl="s"]) svg {
546
- padding-left: var(--spacing-s);
571
+ :host([pl="sm"]) svg {
572
+ padding-left: var(--spacing-sm);
547
573
  }
548
- :host([pl="m"]) svg {
549
- padding-left: var(--spacing-m);
574
+ :host([pl="md"]) svg {
575
+ padding-left: var(--spacing-md);
550
576
  }
551
- :host([pl="l"]) svg {
552
- padding-left: var(--spacing-l);
577
+ :host([pl="lg"]) svg {
578
+ padding-left: var(--spacing-lg);
553
579
  }
554
580
  :host([pl="xl"]) svg {
555
581
  padding-left: var(--spacing-xl);
@@ -557,14 +583,14 @@ ${b}
557
583
  :host([p="xs"]) svg {
558
584
  padding: var(--spacing-xs);
559
585
  }
560
- :host([p="s"]) svg {
561
- padding: var(--spacing-s);
586
+ :host([p="sm"]) svg {
587
+ padding: var(--spacing-sm);
562
588
  }
563
- :host([p="m"]) svg {
564
- padding: var(--spacing-m);
589
+ :host([p="md"]) svg {
590
+ padding: var(--spacing-md);
565
591
  }
566
- :host([p="l"]) svg {
567
- padding: var(--spacing-l);
592
+ :host([p="lg"]) svg {
593
+ padding: var(--spacing-lg);
568
594
  }
569
595
  :host([p="xl"]) svg {
570
596
  padding: var(--spacing-xl);
@@ -573,17 +599,17 @@ ${b}
573
599
  padding-left: var(--spacing-xs);
574
600
  padding-right: var(--spacing-xs);
575
601
  }
576
- :host([ph="s"]) svg {
577
- padding-left: var(--spacing-s);
578
- padding-right: var(--spacing-s);
602
+ :host([ph="sm"]) svg {
603
+ padding-left: var(--spacing-sm);
604
+ padding-right: var(--spacing-sm);
579
605
  }
580
- :host([ph="m"]) svg {
581
- padding-left: var(--spacing-m);
582
- padding-right: var(--spacing-m);
606
+ :host([ph="md"]) svg {
607
+ padding-left: var(--spacing-md);
608
+ padding-right: var(--spacing-md);
583
609
  }
584
- :host([ph="l"]) svg {
585
- padding-left: var(--spacing-l);
586
- padding-right: var(--spacing-l);
610
+ :host([ph="lg"]) svg {
611
+ padding-left: var(--spacing-lg);
612
+ padding-right: var(--spacing-lg);
587
613
  }
588
614
  :host([ph="xl"]) svg {
589
615
  padding-left: var(--spacing-xl);
@@ -593,295 +619,103 @@ ${b}
593
619
  padding-top: var(--spacing-xs);
594
620
  padding-bottom: var(--spacing-xs);
595
621
  }
596
- :host([pv="s"]) svg {
597
- padding-top: var(--spacing-s);
598
- padding-bottom: var(--spacing-s);
622
+ :host([pv="sm"]) svg {
623
+ padding-top: var(--spacing-sm);
624
+ padding-bottom: var(--spacing-sm);
599
625
  }
600
- :host([pv="m"]) svg {
601
- padding-top: var(--spacing-m);
602
- padding-bottom: var(--spacing-m);
626
+ :host([pv="md"]) svg {
627
+ padding-top: var(--spacing-md);
628
+ padding-bottom: var(--spacing-md);
603
629
  }
604
- :host([pv="l"]) svg {
605
- padding-top: var(--spacing-l);
606
- padding-bottom: var(--spacing-l);
630
+ :host([pv="lg"]) svg {
631
+ padding-top: var(--spacing-lg);
632
+ padding-bottom: var(--spacing-lg);
607
633
  }
608
634
  :host([pv="xl"]) svg {
609
635
  padding-top: var(--spacing-xl);
610
636
  padding-bottom: var(--spacing-xl);
611
637
  }
612
- `;var ae=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
613
- :host {
614
- color: var(--foreground);
615
- }
616
- ${dt}
617
- ${le}
618
- ${I}
619
- ${b}
620
- `),class ft extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return ft._icons}static addIcon(r,i){ft._icons[r]=i}connectedCallback(){this.render()}attributeChangedCallback(r,i,l){let s=this.getAttribute("wh"),a=$(s===null?this.getAttribute("w"):s),c=$(s===null?this.getAttribute("h"):s);a&&(this.style.width=a),c&&(this.style.height=c),this.render()}render=()=>{try{let r=this.getAttribute("svg"),i=ft._icons[r]||(window.rtglIcons||{})[r];if(i){this.shadow.innerHTML=i;return}}catch(r){console.log("error in rtgl-svg render",r)}this.shadow.innerHTML=""}}};var ce=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
621
- :host {
622
- display: contents;
623
- }
624
- input {
625
- background-color: var(--background);
626
- font-size: var(--sm-font-size);
627
- font-weight: var(--sm-font-weight);
628
- line-height: var(--sm-line-height);
629
- letter-spacing: var(--sm-letter-spacing);
630
- border: 1px solid var(--ring);
631
- border-radius: var(--border-radius-l);
632
- padding-left: var(--spacing-m);
633
- padding-right: var(--spacing-m);
634
- height: 32px;
635
- color: var(--foreground);
636
- outline: none;
637
- }
638
- input:focus {
639
- border-color: var(--foreground);
640
- }
641
- input:disabled {
642
- cursor: not-allowed;
643
- }
644
- ${x}
645
- ${b}
646
- `);class o extends HTMLElement{_inputRef={};constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){t(this.shadow,this.render)}get value(){return console.log("gettin gvalue",this._inputRef.current),this._inputRef.current.value}_onChange=i=>{this.onChange&&this.onChange(i.target.value)};render=()=>{let i=this.getAttribute("type")||"text",l=this.hasAttribute("disabled");return e`
647
- <input ref=${this._inputRef} @keydown=${this._onChange} placeholder="${this.getAttribute("placeholder")}" type="${i}" disabled="${l}" />
648
- `}}return o};var de=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
649
- :host {
650
- display: contents;
651
- }
652
- textarea {
653
- font-family: inherit;
654
- background-color: var(--background);
655
- font-size: var(--sm-font-size);
656
- font-weight: var(--sm-font-weight);
657
- line-height: var(--sm-line-height);
658
- letter-spacing: var(--sm-letter-spacing);
659
- border: 1px solid var(--ring);
660
- border-radius: var(--border-radius-l);
661
- padding-top: var(--spacing-m);
662
- padding-bottom: var(--spacing-m);
663
- padding-left: var(--spacing-m);
664
- padding-right: var(--spacing-m);
665
- color: var(--foreground);
666
- outline: none;
667
- }
668
- textarea:focus {
669
- border-color: var(--foreground);
670
- }
671
- ${x}
672
- ${b}
673
- `);class o extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){t(this.shadow,this.render)}render=()=>e`
674
- <textarea
675
- cols=${this.getAttribute("cols")}
676
- rows=${this.getAttribute("rows")}
677
- placeholder=${this.getAttribute("placeholder")}
678
- type="text">
679
- </textarea>
680
- `}return o};var _t=t=>{let e=t.map(n=>n.subscribe());return()=>{for(let n of e)n&&typeof n.unsubscribe=="function"&&n.unsubscribe()}};var R=({render:t,styleSheet:e})=>{let n;return e?n=e:(n=new CSSStyleSheet,n.replaceSync(":host { display: contents; }")),class extends vn({BaseElement:HTMLElement,render:t,skipOnMount:!1}){static get observedAttributes(){return["key"]}constructor(){super(),this.renderTarget=this.attachShadow({mode:"closed"})}connectedCallback(){this.renderTarget.adoptedStyleSheets=[n],this.baseOnMount()}disconnectedCallback(){this.baseOnUnmount()}attributeChangedCallback(){setTimeout(()=>{this.reRender()},0)}}},vn=({BaseElement:t,render:e,skipOnMount:n=!1})=>{class o extends t{_renderKey=0;_unmountCallback;disableFirstAutomatedRender=!1;get renderKey(){return String(this._renderKey)}baseOnMount=()=>{!n&&this.onMount&&(this._unmountCallback=this.onMount()),this.disableFirstAutomatedRender||this.reRender(),this.attachedObservables?Array.isArray(this.attachedObservables)?this.unsubscribe=_t(this.attachedObservables):this.unsubscribe=_t(this.attachedObservables()):this.subscriptions&&(this.unsubscribe=_t(this.subscriptions))};baseOnUnmount=()=>{this._unmountCallback&&this._unmountCallback(),this.onUnmount&&this.onUnmount(),this.unsubscribe&&this.unsubscribe()};triggerRender=()=>{this.reRender()};reRender=()=>{this._renderKey++,e(this.renderTarget,this.render())}}return o};var fe=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
681
- :host {
682
- display: contents;
683
- }
684
-
685
- button {
686
- background-color: var(--background);
687
- font-size: var(--sm-font-size);
688
- font-weight: var(--sm-font-weight);
689
- line-height: var(--sm-line-height);
690
- letter-spacing: var(--sm-letter-spacing);
691
- border: 1px solid var(--ring);
692
- border-radius: var(--border-radius-l);
693
- padding-left: var(--spacing-m);
694
- padding-right: var(--spacing-m);
695
- height: 32px;
696
- color: var(--foreground);
697
- outline: none;
698
- cursor: pointer;
699
- }
700
- button:focus {
701
- border-color: var(--foreground);
702
- }
703
-
704
- ${x}
705
- ${b}
706
- `);class o extends R({render:t,styleSheet:n}){_popoverRef={};_buttonRef={};options=[];close=()=>{this._popoverRef.current.close()};open=()=>{this._popoverRef.current.open(this._buttonRef.current)};select=i=>{this.onSelect&&this.onSelect(i),this.close()};render=()=>e`
707
- <!-- TODO style this button and use proper selected value -->
708
- <button ref=${this._buttonRef} onclick=${this.open}>Placeholder</button>
638
+ `;var Te=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
639
+ :host {
640
+ color: var(--foreground);
641
+ }
642
+ ${fe}
643
+ ${St}
644
+ ${re}
645
+ ${H}
646
+ `))}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=j(t===null?this.getAttribute("w"):t),s=j(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=""}},kt=({render:e,html:t})=>Te;var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(I`
647
+ :host {
648
+ display: contents;
649
+ }
650
+ input {
651
+ background-color: var(--background);
652
+ font-size: var(--sm-font-size);
653
+ font-weight: var(--sm-font-weight);
654
+ line-height: var(--sm-line-height);
655
+ letter-spacing: var(--sm-letter-spacing);
656
+ border: 1px solid var(--ring);
657
+ border-radius: var(--border-radius-lg);
658
+ padding-left: var(--spacing-md);
659
+ padding-right: var(--spacing-md);
660
+ height: 32px;
661
+ color: var(--foreground);
662
+ outline: none;
663
+ }
664
+ input:focus {
665
+ border-color: var(--foreground);
666
+ }
667
+ input:disabled {
668
+ cursor: not-allowed;
669
+ }
670
+ ${U}
671
+ ${H}
672
+ `))}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",...ee([...Z,"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"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=$=>`${n==="default"?"":`${n}-`}${$}`,o=this.getAttribute(a("wh")),l=j(o===null?this.getAttribute(a("w")):o),u=j(o===null?this.getAttribute(a("h")):o),m=this.getAttribute(a("op")),x=this.getAttribute(a("z"));x!==null&&(this._styles[n]["z-index"]=x),m!==null&&(this._styles[n].opacity=m),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),u==="f"?this._styles[n].height="100%":u!==void 0&&(this._styles[n].height=u,this._styles[n]["min-height"]=u,this._styles[n]["max-height"]=u),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=te(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()}},At=({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(I`
673
+ :host {
674
+ display: contents;
675
+ }
676
+ textarea {
677
+ font-family: inherit;
678
+ background-color: var(--background);
679
+ font-size: var(--sm-font-size);
680
+ font-weight: var(--sm-font-weight);
681
+ line-height: var(--sm-line-height);
682
+ letter-spacing: var(--sm-letter-spacing);
683
+ border: 1px solid var(--ring);
684
+ border-radius: var(--border-radius-lg);
685
+ padding-top: var(--spacing-md);
686
+ padding-bottom: var(--spacing-md);
687
+ padding-left: var(--spacing-md);
688
+ padding-right: var(--spacing-md);
689
+ color: var(--foreground);
690
+ outline: none;
691
+ }
692
+ textarea:focus {
693
+ border-color: var(--foreground);
694
+ }
695
+ ${U}
696
+ ${H}
697
+ `))}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")}},Et=({render:e,html:t})=>Le;var $t={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:{"@keyframes dialog-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#dialog-container":{animation:"dialog-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#dialog-overlay pos=fix cor=full ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-container pos=fix bw=xs p=lg bgc=bg w=600 br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Pe={};D(Pe,{INITIAL_STATE:()=>Er,selectState:()=>Or,setState:()=>Cr,toViewData:()=>$r});var Er=Object.freeze({}),$r=({state:e,props:t})=>({isOpen:t.isOpen,position:{x:0,y:0}}),Or=({state:e})=>e,Cr=e=>{};var je={};D(je,{handleClickDialogueOverlay:()=>Ir});var Ir=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var De={};D(De,{INITIAL_STATE:()=>Tr,selectState:()=>Lr,setOpen:()=>Pr,setState:()=>jr,toViewData:()=>Nr});var Tr=Object.freeze({isOpen:!1}),Nr=({state:e,props:t})=>({isOpen:e.isOpen,options:t.options||[]}),Lr=({state:e})=>e,Pr=e=>{e.open=!0},jr=e=>{};var Ot={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:null,items:{type:"array",items:{type:"object",properties:{id:{type:"string"},lalbel:{type:"string"},value:{type:"any"}}}}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:0,value:"Placeholder"}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content",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 w=f h-bgc=mu ph=lg pv=md cur=p br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var ze={};D(ze,{handleButtonClick:()=>zr,handleOnMount:()=>Dr});var Dr=e=>{},zr=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;i().popover.elm.transformedHandlers.open({position:{x:e.clientX,y:e.clientY}})};var Ct={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 Re={};D(Re,{handleClickStart:()=>Rr});var Rr=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Me={};D(Me,{INITIAL_STATE:()=>Mr,selectPath:()=>Hr,setState:()=>Br,toViewData:()=>Fr});var Mr=Object.freeze({}),Wr=["id","class","style","slot"],Vr=e=>Object.entries(e).filter(([t])=>!Wr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Fr=({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:Vr(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Hr=({props:e})=>e.start.path,Br=e=>{};var We={};D(We,{INITIAL_STATE:()=>Kr,selectState:()=>Jr,setClose:()=>Gr,setOpen:()=>Yr,toViewData:()=>Ur});var Kr=Object.freeze({isOpen:!1,position:{x:0,y:0}}),Ur=({state:e,props:t})=>t.isOpen!==void 0?{isOpen:t.isOpen,position:{x:0,y:0}}:{isOpen:e.isOpen,position:e.position},Jr=({state:e})=>e,Yr=(e,t)=>{e.isOpen=!0,e.position=t},Gr=e=>{e.isOpen=!1,e.position={x:0,y:0}};var Ve={};D(Ve,{handleClickOverlay:()=>qr,open:()=>Xr});var qr=(e,t)=>{let{props:r,dispatchEvent:s,store:i,render:n}=t;if(r.isOpen!==void 0){s(new CustomEvent("closePopover"));return}i.setClose(),n()},Xr=(e,t)=>{let{position:r}=e,{store:s,render:i}=t;s.setOpen(r),i()};var It={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"}}},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=bg',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=bg']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Fe={};D(Fe,{INITIAL_STATE:()=>Qr,selectFormValues:()=>ss,selectState:()=>rs,setDefaultValues:()=>ns,setFormFieldValue:()=>as,setState:()=>is,toViewData:()=>ts});var Qr=Object.freeze({formValues:{}}),Zr=["id","class","style","slot"],es=e=>Object.entries(e).filter(([t])=>!Zr.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ts=({state:e,props:t,attrs:r})=>({containerAttrString:es(r),title:t.form?.title||"",description:t?.form?.description||"",fields:t?.form?.fields||[],actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}),rs=({state:e})=>e,ss=({state:e})=>e.formValues,is=e=>{},ns=(e,t)=>{e.formValues=t||{}},as=(e,{fieldName:t,value:r})=>{e.formValues[t]=r};var He={};D(He,{handleActionClick:()=>ls,handleInputChange:()=>ps,handleOnMount:()=>os});var os=e=>{let{store:t,props:r}=e;t.setDefaultValues(r.defaultValues)},ls=(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()}}))},ps=(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})};var Tt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{type:"object",properties:{}},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-keydown":{handler:"handleInputChange"}}}},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=sm 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=sm w=f",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},{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",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{var:"field.id"}," w=f"]}}],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 Ke={};D(Ke,{INITIAL_STATE:()=>cs,selectActiveItem:()=>ms,selectHeader:()=>us,selectItem:()=>gs,setState:()=>ys,toViewData:()=>fs});var cs=Object.freeze({}),hs=["id","class","style","slot"],ds=e=>Object.entries(e).filter(([t])=>!hs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function Be(e){let t=[];for(let r of e)if(t.push({id:r.id||r.href||r.path,title:r.title,href:r.href,type:r.type||"item",icon:r.icon,hrefAttr:r.href?`href=${r.href}`:""}),r.items&&Array.isArray(r.items))for(let s of r.items)t.push({id:s.id||s.href||s.path,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:""});return t}var fs=({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=ds(r),a=r.mode||"full",o=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=i?Be(i):[],u=a==="full"?272:64,m=a==="full"?"fs":"c",x=a==="full"?"fs":"c",$=a==="full"?"lg":"sm",T=a==="full"?"md":"sm",p=a==="shrunk-lg"?48:40,c=a==="shrunk-lg"?28:20,h=a==="shrunk-lg"?"md":"sm",d=a==="full",g=a==="full",_=a==="full"?"fs":"c",f=a==="full"?"":`ah=${x}`,v=a==="full"?"f":p;return{containerAttrString:n,mode:a,header:o,items:l,sidebarWidth:u,headerAlign:m,itemAlign:x,headerPadding:$,itemPadding:T,itemHeight:p,iconSize:c,firstLetterSize:h,showLabels:d,showGroupLabels:g,itemContentAlign:_,itemAlignAttr:f,itemWidth:v,headerWidth:v}},us=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,ms=({state:e,props:t})=>(t.items?Be(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?Be(i):[]).find(a=>a.id===s)},ys=e=>{};var Nt={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"},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:{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 ${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",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=mu br=lg bgc=bg 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=mu br=lg bgc=bg 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"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{var:"sidebarWidth"}," bwr=xs ",{var:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ue={};D(Ue,{handleHeaderClick:()=>vs,handleItemClick:()=>bs});var vs=(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}))},bs=(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 Je={};D(Je,{INITIAL_STATE:()=>ws,selectCurrentId:()=>Ss,selectState:()=>_s,setContentContainer:()=>Es,setCurrentId:()=>As,setItems:()=>ks,toViewData:()=>xs});var ws=Object.freeze({items:[],currentId:null,contentContainer:null}),xs=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),_s=({state:e})=>e,Ss=({state:e})=>e.currentId,ks=(e,t)=>{e.items=t},As=(e,t)=>{e.currentId=t},Es=(e,t)=>{e.contentContainer=t};var Lt={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={};D(Ye,{handleOnMount:()=>Os});var Pt=(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())},$s=(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),Pt(n,t),s();let o=Pt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},Os=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=$s(r,e);return()=>{s()}})};var Wt=Symbol.for("immer-nothing"),jt=Symbol.for("immer-draftable"),R=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ie=Object.getPrototypeOf;function ne(e){return!!e&&!!e[R]}function G(e){return e?Vt(e)||Array.isArray(e)||!!e[jt]||!!e.constructor?.[jt]||ve(e)||be(e):!1}var Cs=Object.prototype.constructor.toString();function Vt(e){if(!e||typeof e!="object")return!1;let t=ie(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)===Cs}function ue(e,t){ye(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function ye(e){let t=e[R];return t?t.type_:Array.isArray(e)?1:ve(e)?2:be(e)?3:0}function Xe(e,t){return ye(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ft(e,t,r){let s=ye(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Is(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ve(e){return e instanceof Map}function be(e){return e instanceof Set}function Y(e){return e.copy_||e.base_}function Qe(e,t){if(ve(e))return new Map(e);if(be(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Vt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[R];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(ie(e),s)}else{let s=ie(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function st(e,t=!1){return we(e)||ne(e)||!G(e)||(ye(e)>1&&(e.set=e.add=e.clear=e.delete=Ts),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>st(s,!0))),e}function Ts(){K(2)}function we(e){return Object.isFrozen(e)}var Ns={};function q(e){let t=Ns[e];return t||K(0,e),t}var pe;function Ht(){return pe}function Ls(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Dt(e,t){t&&(q("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ze(e){et(e),e.drafts_.forEach(Ps),e.drafts_=null}function et(e){e===pe&&(pe=e.parent_)}function zt(e){return pe=Ls(pe,e)}function Ps(e){let t=e[R];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Rt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[R].modified_&&(Ze(t),K(4)),G(e)&&(e=me(t,e),t.parent_||ge(t,e)),t.patches_&&q("Patches").generateReplacementPatches_(r[R].base_,e,t.patches_,t.inversePatches_)):e=me(t,r,[]),Ze(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Wt?e:void 0}function me(e,t,r){if(we(t))return t;let s=t[R];if(!s)return ue(t,(i,n)=>Mt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ge(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),ue(n,(o,l)=>Mt(e,s,i,o,l,r,a)),ge(e,i,!1),r&&e.patches_&&q("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Mt(e,t,r,s,i,n,a){if(ne(i)){let o=n&&t&&t.type_!==3&&!Xe(t.assigned_,s)?n.concat(s):void 0,l=me(e,i,o);if(Ft(r,s,l),ne(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(G(i)&&!we(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;me(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ge(e,i)}}function ge(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&st(t,r)}function js(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:Ht(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=it;r&&(i=[s],n=ce);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var it={get(e,t){if(t===R)return e;let r=Y(e);if(!Xe(r,t))return Ds(e,r,t);let s=r[t];return e.finalized_||!G(s)?s:s===Ge(e.base_,t)?(qe(e),e.copy_[t]=rt(s,e)):s},has(e,t){return t in Y(e)},ownKeys(e){return Reflect.ownKeys(Y(e))},set(e,t,r){let s=Bt(Y(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=Ge(Y(e),t),n=i?.[R];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Is(r,i)&&(r!==void 0||Xe(e.base_,t)))return!0;qe(e),tt(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 Ge(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,qe(e),tt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Y(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 ie(e.base_)},setPrototypeOf(){K(12)}},ce={};ue(it,(e,t)=>{ce[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ce.deleteProperty=function(e,t){return ce.set.call(this,e,t,void 0)};ce.set=function(e,t,r){return it.set.call(this,e[0],t,r,e[0])};function Ge(e,t){let r=e[R];return(r?Y(r):e)[t]}function Ds(e,t,r){let s=Bt(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function Bt(e,t){if(!(t in e))return;let r=ie(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ie(r)}}function tt(e){e.modified_||(e.modified_=!0,e.parent_&&tt(e.parent_))}function qe(e){e.copy_||(e.copy_=Qe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zs=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,...u){return a.produce(l,m=>r.call(this,m,...u))}}typeof r!="function"&&K(6),s!==void 0&&typeof s!="function"&&K(7);let i;if(G(t)){let n=zt(this),a=rt(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?Ze(n):et(n)}return Dt(n,s),Rt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Wt&&(i=void 0),this.autoFreeze_&&st(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){G(e)||K(8),ne(e)&&(e=Rs(e));let t=zt(this),r=rt(e,void 0);return r[R].isManual_=!0,et(t),r}finishDraft(e,t){let r=e&&e[R];(!r||!r.isManual_)&&K(9);let{scope_:s}=r;return Dt(s,t),Rt(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 ne(e)?s(e,t):this.produce(e,i=>s(i,t))}};function rt(e,t){let r=ve(e)?q("MapSet").proxyMap_(e,t):be(e)?q("MapSet").proxySet_(e,t):js(e,t);return(t?t.scope_:Ht()).drafts_.push(r),r}function Rs(e){return ne(e)||K(10,e),Kt(e)}function Kt(e){if(!G(e)||we(e))return e;let t=e[R],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Qe(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Qe(e,!0);return ue(r,(s,i)=>{Ft(r,s,Kt(i))}),t&&(t.finalized_=!1),r}var M=new zs,Ut=M.produce,Qn=M.produceWithPatches.bind(M),Zn=M.setAutoFreeze.bind(M),ea=M.setUseStrictShallowCopy.bind(M),ta=M.applyPatches.bind(M),ra=M.createDraft.bind(M),sa=M.finishDraft.bind(M);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},W={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},xe={NOT:0};var Ms=e=>{let{ast:t,functions:r,data:s}=e;return P(t,r,s,{})},P=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return nt(e.path,r,s);case N.INTERPOLATION:return Ws(e.parts,t,r,s);case N.FUNCTION:return Jt(e,t,r,s);case N.BINARY:return Yt(e,t,r,s);case N.UNARY:return Gt(e,t,r,s);case N.CONDITIONAL:return Vs(e,t,r,s);case N.LOOP:return Fs(e,t,r,s);case N.OBJECT:return Hs(e,t,r,s);case N.ARRAY:return Bs(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},nt=(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},Ws=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else if(n.var){let a=nt(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},Jt=(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=>P(a,t,r,s));return i(...n)},_e=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return nt(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return Yt(e,t,r,s);case N.UNARY:return Gt(e,t,r,s);case N.FUNCTION:return Jt(e,t,r,s);default:return P(e,t,r,s)}},Yt=(e,t,r,s)=>{if(e.op===W.AND||e.op===W.OR){let a=_e(e.left,t,r,s),o=_e(e.right,t,r,s);switch(e.op){case W.AND:return a&&o;case W.OR:return a||o}}let i=P(e.left,t,r,s),n=P(e.right,t,r,s);switch(e.op){case W.EQ:return i==n;case W.NEQ:return i!=n;case W.GT:return i>n;case W.LT:return i<n;case W.GTE:return i>=n;case W.LTE:return i<=n;case W.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Gt=(e,t,r,s)=>{let i=e.op===xe.NOT?_e(e.operand,t,r,s):P(e.operand,t,r,s);switch(e.op){case xe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Vs=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||_e(n,t,r,s))return P(e.bodies[i],t,r,s)}return{}},Fs=(e,t,r,s)=>{let i=P(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=P(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Hs=(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=P(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===N.OBJECT&&l.properties){let u=l.properties.find(m=>m.key.startsWith("$for "));if(u){let m=P(u.value,t,r,s);m!==void 0&&(i[o.key]=m)}else{let m=P(o.value,t,r,s);m!==void 0&&(i[o.key]=m)}}else{let u=o.parsedKey?P(o.parsedKey,t,r,s):o.key,m=P(o.value,t,r,s);m!==void 0&&(i[u]=m)}}return i},Bs=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=P(n,t,r,s);i.push(a)}else i.push(P(n,t,r,s));return i},Se=Ms;var ke=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...ke(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]:ke(n)})}}t.push(r)}return t},[]):e;var Js=(e,t)=>t.split(".").reduce((r,s)=>r&&r[s],e),qt=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Se({ast:t,data:r}),a=ke(n),o=Ys({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ys=({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,u)=>{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 m=Object.entries(l);if(m.length===0)return console.warn("Skipping empty object item:",l),null;let[x,$]=m[0];if(!isNaN(Number(x)))return Array.isArray($)?n($,`${o}.${x}`):typeof $=="object"&&$!==null&&Object.entries($).length>0?n([$],`${o}.${x}`):String($);m.length>1&&console.warn("Item has multiple keys, processing only the first:",x);let T,p,c=x.indexOf(" ");c===-1?(T=x,p=""):(T=x.substring(0,c),p=x.substring(c+1).trim());let h=T.split(/[.#]/)[0],d=h.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,y;for(;(y=S.exec(p))!==null;)if(y[1].startsWith(".")){let C=y[1].substring(1),L=y[4];_[C]=Js(i,L)}else g[y[1]]=y[2]||y[3]||y[4]}let f=T.match(/#([^.#\s]+)/);f&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=f[1]);let v=null;g.id?v=g.id:d&&(v=h);let b=Object.create(null),k=null;if(d)k=h;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(C=>{let L=C.substring(1);b[L]=!0});let y=T.match(/#([^.#\s]+)/);y&&(k=y[1])}let w;typeof $=="string"||typeof $=="number"?w=String($):Array.isArray($)?w=n($,`${o}.${x}`):w=[],k&&!d&&(g.id=k);let A=Object.create(null);if(v&&r){let S=[];if(Object.keys(r).forEach(y=>{if(y.includes("*")){let C="^"+y.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(C).test(v)&&S.push(y)}catch(L){console.warn(`[Parser] Invalid regex pattern created from refKey '${y}': ${C}`,L)}}else v===y&&S.push(y)}),S.length>0){S.sort((C,L)=>{let V=!C.includes("*"),B=!L.includes("*");return V&&!B?-1:!V&&B?1:L.length-C.length});let y=S[0];if(r[y]&&r[y].eventListeners){let C=r[y].eventListeners;Object.entries(C).forEach(([L,V])=>{V.handler&&s[V.handler]?A[L]=B=>{s[V.handler](B)}:V.handler&&console.warn(`[Parser] Handler '${V.handler}' for refKey '${y}' (matching elementId '${v}') is referenced but not found in available handlers.`)})}}}let O={};if(v)O.key=v;else if(T){let S=o?`${o}.${u}`:String(u);if(O.key=`${T}-${S}`,Object.keys(_).length>0){let y=JSON.stringify(_).substring(0,50);O.key+=`-${y}`}}Object.keys(g).length>0&&(O.attrs=g),Object.keys(b).length>0&&(O.class=b),Object.keys(A).length>0&&(O.on=A),Object.keys(_).length>0&&(O.props=_,d&&(O.hook={update:(S,y)=>{let C=S.data?.props||{},L=y.data?.props||{};if(JSON.stringify(C)!==JSON.stringify(L)){let B=y.elm;B&&B.render&&typeof B.render=="function"&&(B.setAttribute("isDirty","true"),requestAnimationFrame(()=>{B.render(),B.removeAttribute("isDirty")}))}}}));try{return e(h,O,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:h,snabbdomData:O,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Gs=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
698
+ `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,u])=>{let m=s(u);return` ${l} {
699
+ ${m.split(`
700
+ `).map(x=>x?` ${x}`:"").join(`
701
+ `)}
702
+ }`}).join(`
703
+ `);return`${n} {
704
+ ${o}
705
+ }`}else{let o=s(a);return`${n} {
706
+ ${o}
707
+ }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
709
708
 
710
- <rtgl-popover ref=${this._popoverRef} placement="bottom-start">
711
- <rtgl-view wh="300" g="xs">
712
- ${this.options.map(({value:i,label:l})=>e`
713
- <rtgl-view
714
- w="f"
715
- h-bgc="mu"
716
- ph="l"
717
- pv="m"
718
- cur="p"
719
- br="m"
720
- onclick=${()=>this.select(i)}
721
- >
722
- <rtgl-text>${l}</rtgl-text>
723
- </rtgl-view>
724
- `)}
725
- </rtgl-view>
726
- </rtgl-popover>
727
- `}return o};var ht=Math.min,N=Math.max,J=Math.round;var E=t=>({x:t,y:t});function he(t,e){return typeof t=="function"?t(e):t}function ut(t){return t.split("-")[0]}function Tt(t){return t.split("-")[1]}function ue(t){return t==="x"?"y":"x"}function ge(t){return t==="y"?"height":"width"}function gt(t){return["top","bottom"].includes(ut(t))?"y":"x"}function pe(t){return ue(gt(t))}function Q(t){let{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function me(t,e,n){let{reference:o,floating:r}=t,i=gt(e),l=pe(e),s=ge(l),a=ut(e),c=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2,u;switch(a){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-r.width,y:d};break;default:u={x:o.x,y:o.y}}switch(Tt(e)){case"start":u[l]-=h*(n&&c?-1:1);break;case"end":u[l]+=h*(n&&c?-1:1);break}return u}var ve=async(t,e,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(e)),c=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:d}=me(c,o,a),h=o,u={},g=0;for(let p=0;p<s.length;p++){let{name:w,fn:T}=s[p],{x:P,y:nt,data:xt,reset:B}=await T({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:u,rects:c,platform:l,elements:{reference:t,floating:e}});f=P??f,d=nt??d,u={...u,[w]:{...u[w],...xt}},B&&g<=50&&(g++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(c=B.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:r}):B.rects),{x:f,y:d}=me(c,h,a)),p=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:u}};async function bn(t,e){let{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=ut(n),s=Tt(n),a=gt(n)==="y",c=["left","top"].includes(l)?-1:1,f=i&&a?-1:1,d=he(e,t),{mainAxis:h,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(u=s==="end"?g*-1:g),a?{x:u*f,y:h*c}:{x:h*c,y:u*f}}var be=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:r,y:i,placement:l,middlewareData:s}=e,a=await bn(e,t);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}};function mt(){return typeof window<"u"}function H(t){return xe(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(xe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xe(t){return mt()?t instanceof Node||t instanceof A(t).Node:!1}function O(t){return mt()?t instanceof Element||t instanceof A(t).Element:!1}function _(t){return mt()?t instanceof HTMLElement||t instanceof A(t).HTMLElement:!1}function we(t){return!mt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof A(t).ShadowRoot}function V(t){let{overflow:e,overflowX:n,overflowY:o,display:r}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ye(t){return["table","td","th"].includes(H(t))}function Z(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vt(t){let e=bt(),n=O(t)?k(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Se(t){let e=M(t);for(;_(e)&&!z(e);){if(vt(e))return e;if(Z(e))return null;e=M(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(H(t))}function k(t){return A(t).getComputedStyle(t)}function tt(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(H(t)==="html")return t;let e=t.assignedSlot||t.parentNode||we(t)&&t.host||L(t);return we(e)?e.host:e}function $e(t){let e=M(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&V(e)?e:$e(e)}function pt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=$e(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),l=A(r);if(i){let s=wt(l);return e.concat(l,l.visualViewport||[],V(r)?r:[],s&&n?pt(s):[])}return e.concat(r,pt(r,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Re(t){let e=k(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,r=_(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=J(n)!==i||J(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function Oe(t){return O(t)?t:t.contextElement}function U(t){let e=Oe(t);if(!_(e))return E(1);let n=e.getBoundingClientRect(),{width:o,height:r,$:i}=Re(e),l=(i?J(n.width):n.width)/o,s=(i?J(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}var wn=E(0);function ke(t){let e=A(t);return!bt()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==A(t)?!1:e}function et(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=Oe(t),l=E(1);e&&(o?O(o)&&(l=U(o)):l=U(t));let s=xn(i,n,o)?ke(i):E(0),a=(r.left+s.x)/l.x,c=(r.top+s.y)/l.y,f=r.width/l.x,d=r.height/l.y;if(i){let h=A(i),u=o&&O(o)?A(o):o,g=h,p=wt(g);for(;p&&o&&u!==g;){let w=U(p),T=p.getBoundingClientRect(),P=k(p),nt=T.left+(p.clientLeft+parseFloat(P.paddingLeft))*w.x,xt=T.top+(p.clientTop+parseFloat(P.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,d*=w.y,a+=nt,c+=xt,g=A(p),p=wt(g)}}return Q({width:f,height:d,x:a,y:c})}function Pt(t,e){let n=tt(t).scrollLeft;return e?e.left+n:et(L(t)).left+n}function Ee(t,e,n){n===void 0&&(n=!1);let o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:Pt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function yn(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t,i=r==="fixed",l=L(o),s=e?Z(e.floating):!1;if(o===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},c=E(1),f=E(0),d=_(o);if((d||!d&&!i)&&((H(o)!=="body"||V(l))&&(a=tt(o)),_(o))){let u=et(o);c=U(o),f.x=u.x+o.clientLeft,f.y=u.y+o.clientTop}let h=l&&!d&&!i?Ee(l,a,!0):E(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-a.scrollTop*c.y+f.y+h.y}}function Sn(t){return Array.from(t.getClientRects())}function $n(t){let e=L(t),n=tt(t),o=t.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=N(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),l=-n.scrollLeft+Pt(t),s=-n.scrollTop;return k(o).direction==="rtl"&&(l+=N(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:s}}function An(t,e){let n=A(t),o=L(t),r=n.visualViewport,i=o.clientWidth,l=o.clientHeight,s=0,a=0;if(r){i=r.width,l=r.height;let c=bt();(!c||c&&e==="fixed")&&(s=r.offsetLeft,a=r.offsetTop)}return{width:i,height:l,x:s,y:a}}function Cn(t,e){let n=et(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?U(t):E(1),l=t.clientWidth*i.x,s=t.clientHeight*i.y,a=r*i.x,c=o*i.y;return{width:l,height:s,x:a,y:c}}function Ae(t,e,n){let o;if(e==="viewport")o=An(t,n);else if(e==="document")o=$n(L(t));else if(O(e))o=Cn(e,n);else{let r=ke(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Q(o)}function _e(t,e){let n=M(t);return n===e||!O(n)||z(n)?!1:k(n).position==="fixed"||_e(n,e)}function Rn(t,e){let n=e.get(t);if(n)return n;let o=pt(t,[],!1).filter(s=>O(s)&&H(s)!=="body"),r=null,i=k(t).position==="fixed",l=i?M(t):t;for(;O(l)&&!z(l);){let s=k(l),a=vt(l);!a&&s.position==="fixed"&&(r=null),(i?!a&&!r:!a&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||V(l)&&!a&&_e(t,l))?o=o.filter(f=>f!==l):r=s,l=M(l)}return e.set(t,o),o}function On(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t,l=[...n==="clippingAncestors"?Z(e)?[]:Rn(e,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,f)=>{let d=Ae(e,f,r);return c.top=N(d.top,c.top),c.right=ht(d.right,c.right),c.bottom=ht(d.bottom,c.bottom),c.left=N(d.left,c.left),c},Ae(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function kn(t){let{width:e,height:n}=Re(t);return{width:e,height:n}}function En(t,e,n){let o=_(e),r=L(e),i=n==="fixed",l=et(t,!0,i,e),s={scrollLeft:0,scrollTop:0},a=E(0);if(o||!o&&!i)if((H(e)!=="body"||V(r))&&(s=tt(e)),o){let h=et(e,!0,i,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else r&&(a.x=Pt(r));let c=r&&!o&&!i?Ee(r,s):E(0),f=l.left+s.scrollLeft-a.x-c.x,d=l.top+s.scrollTop-a.y-c.y;return{x:f,y:d,width:l.width,height:l.height}}function Lt(t){return k(t).position==="static"}function Ce(t,e){if(!_(t)||k(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Te(t,e){let n=A(t);if(Z(t))return n;if(!_(t)){let r=M(t);for(;r&&!z(r);){if(O(r)&&!Lt(r))return r;r=M(r)}return n}let o=Ce(t,e);for(;o&&ye(o)&&Lt(o);)o=Ce(o,e);return o&&z(o)&&Lt(o)&&!vt(o)?n:o||Se(t)||n}var _n=async function(t){let e=this.getOffsetParent||Te,n=this.getDimensions,o=await n(t.floating);return{reference:En(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Tn(t){return k(t).direction==="rtl"}var Ln={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:L,getClippingRect:On,getOffsetParent:Te,getElementRects:_n,getClientRects:Sn,getDimensions:kn,getScale:U,isElement:O,isRTL:Tn};var Le=be;var Pe=(t,e,n)=>{let o=new Map,r={platform:Ln,...n},i={...r.platform,_c:o};return ve(t,e,{...r,platform:i})};var Me=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
728
- :host {
729
- display: contents;
730
- }
731
- slot {
732
- display: contents;
733
- }
734
-
735
- ${x}
736
- ${b}
737
-
738
- @keyframes popover-in {
739
- from {
740
- opacity: 0;
741
- transform: scale(0.95);
742
- }
743
- to {
744
- opacity: 1;
745
- transform: scale(1);
709
+ `:"")+o)}),r},qs=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Xs(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 Qs(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 at=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
710
+ a, a:link, a:visited, a:hover, a:active {
711
+ display: contents;
712
+ color: inherit;
713
+ text-decoration: none;
714
+ background: none;
715
+ border: none;
716
+ padding: 0;
717
+ margin: 0;
718
+ font: inherit;
719
+ cursor: pointer;
746
720
  }
747
- }
748
-
749
- .popover-content {
750
- animation: popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
751
- transform-origin: top;
752
- }
753
- `);class o extends R({render:t,styleSheet:n}){_isOpen=!1;_refElement;_floatingElement;open=i=>{this._isOpen=!0,this._refElement=i,this.reRender(),Pe(this._refElement,this._floatingElement,{placement:this.getAttribute("placement")||"bottom",middleware:[Le(12)]}).then(({x:l,y:s})=>{Object.assign(this._floatingElement.style,{left:`${l}px`,top:`${s}px`,position:"fixed"})})};close=()=>{this._isOpen=!1,this.reRender()};render=()=>this._isOpen?e`
754
- <rtgl-view onclick=${this.close} pos="fix" cor="full">
755
- <rtgl-view
756
- ref=${i=>this._floatingElement=i}
757
- bw="xs"
758
- p="l"
759
- class="popover-content"
760
- onclick=${i=>i.stopPropagation()}
761
- >
762
- <slot></slot>
763
- </rtgl-view>
764
- </rtgl-view>
765
- `:e``}return o};function Pn(t){let e=[];for(let n of t)if(e.push({title:n.title,slug:n.slug,type:n.type}),n.items&&Array.isArray(n.items))for(let o of n.items)e.push({title:o.title,slug:o.slug,type:o.type});return e}var We=({render:t,html:e})=>class extends R({render:t}){items=[];title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let o=this.getAttribute("title");o&&(console.log("titleAttribute",o),this.title=JSON.parse(decodeURIComponent(o)),this.reRender())};getItems=()=>{let o,r=this.getAttribute("items");return r?o=JSON.parse(decodeURIComponent(r)):o=this.items,Pn(o)};static get observedAttributes(){return["items"]}render=()=>e`
766
- <rtgl-view h="f" w="272" bwr="xs">
767
- <rtgl-view p="l">
768
- <a
769
- style="text-decoration: none; display: contents; color: inherit;"
770
- href=${this.title.href}
771
- >
772
- <rtgl-view d="h" av="c" g="l">
773
- ${this.title?.image?.src?e`<rtgl-image
774
- w=${this.title?.image?.width}
775
- h=${this.title?.image?.height}
776
- src=${this.title?.image?.src}
777
- alt=${this.title?.image?.alt||"Navbar"}
778
- />`:""}
779
- ${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
780
- </rtgl-view>
781
- </a>
782
- </rtgl-view>
783
- <rtgl-view w="f" ph="l" pb="l" g="xs">
784
- ${this.getItems().map((o,r)=>{let i=r===0;return o.type==="groupLabel"?e`
785
- <rtgl-view mt=${i?void 0:"m"} h="32" av="c" ph="m">
786
- <rtgl-text s="xs" c="mu-fg">${o.title}</rtgl-text>
787
- </rtgl-view>
788
- `:e`
789
- <a
790
- style="display: contents; text-decoration: none; color: inherit;"
791
- href=${o.slug}
792
- >
793
- <rtgl-view
794
- h="32"
795
- av="c"
796
- ph="m"
797
- w="f"
798
- h-bgc="mu"
799
- br="l"
800
- bgc="${o.active?"mu":"bg"}"
801
- cur="p"
802
- >
803
- <rtgl-text s="sm">${o.title}</rtgl-text>
804
- </rtgl-view>
805
- </a>
806
- `})}
807
- </rtgl-view>
808
- </rtgl-view>
809
- `};var Be=({render:t,html:e})=>class extends R({render:t}){items=[];_contentContainer;_selectedSlug;onUnmount=()=>{this._contentContainer.removeEventListener("scroll",this.checkCurrentHeading),window.removeEventListener("scroll",this.checkCurrentHeading)};checkCurrentHeading=()=>{let o=this._contentContainer.querySelectorAll("rtgl-text[id]"),r=Array.from(o),i=null,l=null,s=-1/0;r.forEach(a=>{let c=a.getBoundingClientRect();c.top<=100&&c.top>s&&(s=c.top,l=a.id)}),l&&l!==i&&(i=l,this._selectedSlug=l,this.reRender())};startListening=o=>{this._contentContainer=o;let r=this._contentContainer.querySelectorAll("rtgl-text[id]"),i=Array.from(r);this.items=i.map(l=>({slug:l.id,title:l.textContent})),o&&o.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),window.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),this.checkCurrentHeading()};render=()=>e`
810
- <rtgl-view h="f" w="272">
811
- <rtgl-view w="f" g="s" mt="xl">
812
- ${this.items.map(o=>{let r=`${this._selectedSlug}`===o.slug?"fg":"mu-fg",i=`#${o.slug}`;return e`
813
- <a
814
- style="display: contents; text-decoration: none; color: inherit;"
815
- href=${i}
816
- >
817
- <rtgl-text s="sm" c=${r}>${o.title}</rtgl-text>
818
- </a>
819
- `})}
820
- </rtgl-view>
821
- </rtgl-view>
822
- `};var De=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
823
- :host {
824
- display: contents;
825
- }
826
- slot {
827
- display: contents;
828
- }
829
- ${x}
830
- ${b}
831
- `);class o extends R({render:t,styleSheet:n}){title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let i=this.getAttribute("title");i&&(console.log("titleAttribute",i),this.title=JSON.parse(decodeURIComponent(i)),this.reRender())};render=()=>e`
832
- <rtgl-view d="h" h="48" av="c" w="f">
833
- <a
834
- style="text-decoration: none; display: contents; color: inherit;"
835
- href=${this.title.href}
836
- >
837
- <rtgl-view d="h" av="c" g="l">
838
- ${this.title?.image?.src?e`<rtgl-image
839
- w=${this.title?.image?.width}
840
- h=${this.title?.image?.height}
841
- src=${this.title?.image?.src}
842
- alt=${this.title?.image?.alt||"Navbar"}
843
- />`:""}
844
- ${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
845
- </rtgl-view>
846
- </a>
847
- <rtgl-view flex="1"></rtgl-view>
848
- <slot name="right"> </slot>
849
- </rtgl-view>
850
- `}return o};var Ne=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
851
- :host {
852
- display: contents;
853
- }
854
- ${x}
855
- ${b}
856
- `);class o extends R({render:t,styleSheet:n}){form={title:void 0,description:void 0,fields:[],actions:[]};values={};fieldStates={};static get observedAttributes(){return["key","w","ellipsis"]}_onChange=(i,l)=>{console.log("onChange",{name:i,value:l}),this.values[i]=l;let s=this.form?.fields?.find(a=>a.name===i)?.validations;if(s){for(let a of s)if(a.rule instanceof RegExp){let c=a.rule.test(l);this.fieldStates[i]||(this.fieldStates[i]={}),c?delete this.fieldStates[i].error:this.fieldStates[i].error=a.message}}this.reRender()};_onSubmit=i=>{this.onSubmit&&this.onSubmit({action:i,values:this.values,fieldStates:this.fieldStates})};render=()=>e`
857
- <rtgl-view p="m" w="f">
858
- <form style="display: contents;">
859
- <rtgl-text s="h2">${this.form.title}</rtgl-text>
860
- <rtgl-text c="mu-fg">${this.form.description}</rtgl-text>
861
- <rtgl-view g="l">
862
- ${this.form.fields.map(i=>{if(i.type==="groupLabel")return e`<rtgl-text s="h4">${i.content}</rtgl-text> `;let l;i.type==="input"&&(l=e`
863
- <rtgl-input
864
- .onChange=${this._onChange.bind(this,i.name)}
865
- type="text"
866
- name="${i.name}"
867
- />
868
- `);let s=this.fieldStates?.[i?.name]?.error;return e`
869
- <rtgl-view g="m">
870
- <rtgl-text s="sm" c=${s?"de":"fg"}>${i.label}</rtgl-text>
871
- ${l}
872
- <rtgl-text s="sm" c="mu-fg">${i.description}</rtgl-text>
873
- ${s?e`<rtgl-text s="sm" c="de">${s}</rtgl-text>`:""}
874
- </rtgl-view>
875
- `})}
876
- </rtgl-view>
877
- <rtgl-view g="m" mt="l" w="f">
878
- ${this.form.actions.map(i=>e`<rtgl-button
879
- w=${i.fill?"f":""}
880
- onclick=${this._onSubmit.bind(this,i.id)}
881
- >${i.content}</rtgl-button
882
- > `)}
883
- </rtgl-view>
884
- </form>
885
- </rtgl-view>
886
- `}return o};customElements.define("rtgl-button",te({render:S,html:y}));customElements.define("rtgl-view",oe({render:S,html:y}));customElements.define("rtgl-text",ie({render:S,html:y}));customElements.define("rtgl-image",se({render:S,html:y}));customElements.define("rtgl-svg",ae({render:S,html:y}));customElements.define("rtgl-input",ce({render:S,html:y}));customElements.define("rtgl-textarea",de({render:S,html:y}));customElements.define("rtgl-select",fe({render:S,html:y}));customElements.define("rtgl-popover",Me({render:S,html:y}));customElements.define("rtgl-sidebar",We({render:S,html:y}));customElements.define("rtgl-page-outline",Be({render:S,html:y}));customElements.define("rtgl-navbar",De({render:S,html:y}));customElements.define("rtgl-form",Ne({render:S,html:y}));})();
887
- /*! (c) Andrea Giammarchi - MIT */
721
+ `);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=qs(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}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=qt({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)}}},Zs=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([u,m])=>{u.startsWith("select")?a[u]=(...x)=>m({state:l,props:t,attrs:r},...x):o[u]=x=>(l=Ut(l,$=>m($,x)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},ei=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:u,styles:m}=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 x extends at{constructor(){super();let T=Xs(this);this.propsSchema=o,this.props=o?Qs(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=m,this.store=Zs(r,this.props,T),this.template=l,this.handlers=e,this.refs=u,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Gs(a,m)}}return x},ot=ei;function X(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 ae=Array.isArray;function oe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function ti(e,t){return document.createElement(e,t)}function ri(e,t,r){return document.createElementNS(e,t,r)}function si(){return Q(document.createDocumentFragment())}function ii(e){return document.createTextNode(e)}function ni(e){return document.createComment(e)}function ai(e,t,r){if(J(e)){let s=e;for(;s&&J(s);)s=Q(s).parent;e=s??e}J(t)&&(t=Q(t,e)),r&&J(r)&&(r=Q(r).firstChildNode),e.insertBefore(t,r)}function oi(e,t){e.removeChild(t)}function li(e,t){J(t)&&(t=Q(t,e)),e.appendChild(t)}function Qt(e){if(J(e)){for(;e&&J(e);)e=Q(e).parent;return e??null}return e.parentNode}function pi(e){var t;if(J(e)){let r=Q(e),s=Qt(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 ci(e){return e.tagName}function hi(e,t){e.textContent=t}function di(e){return e.textContent}function fi(e){return e.nodeType===1}function ui(e){return e.nodeType===3}function mi(e){return e.nodeType===8}function J(e){return e.nodeType===11}function Q(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 Zt={createElement:ti,createElementNS:ri,createTextNode:ii,createDocumentFragment:si,createComment:ni,insertBefore:ai,removeChild:oi,appendChild:li,parentNode:Qt,nextSibling:pi,tagName:ci,setTextContent:hi,getTextContent:di,isElement:fi,isText:ui,isComment:mi,isDocumentFragment:J};function Ae(e){return e===void 0}function z(e){return e!==void 0}var lt=X("",{},[],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 yi(e,t){return e.isElement(t)}function vi(e,t){return e.isDocumentFragment(t)}function bi(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 wi=["create","update","remove","destroy","pre","post"];function er(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:Zt;for(let p of wi)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"),d=h?"."+h.split(" ").join("."):"";return X(i.tagName(p).toLowerCase()+c+d,{},[],void 0,p)}function a(p){return X(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let d=i.parentNode(p);d!==null&&i.removeChild(d,p)}}}function l(p,c){var h,d,g,_;let f,v=p.data;if(v!==void 0){let w=(h=v.hook)===null||h===void 0?void 0:h.init;z(w)&&(w(p),v=p.data)}let b=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),O=w>0?w:k.length,S=A>0?A:k.length,y=w!==-1||A!==-1?k.slice(0,Math.min(O,S)):k,C=p.elm=z(v)&&z(f=v.ns)?i.createElementNS(f,y,v):i.createElement(y,v);for(O<S&&C.setAttribute("id",k.slice(O+1,S)),A>0&&C.setAttribute("class",k.slice(S+1).replace(/\./g," ")),f=0;f<s.create.length;++f)s.create[f](lt,p);if(oe(p.text)&&(!ae(b)||b.length===0)&&i.appendChild(C,i.createTextNode(p.text)),ae(b))for(f=0;f<b.length;++f){let V=b[f];V!=null&&i.appendChild(C,l(V,c))}let L=p.data.hook;z(L)&&((d=L.create)===null||d===void 0||d.call(L,lt,p),L.insert&&c.push(p))}else if(!((g=r?.experimental)===null||g===void 0)&&g.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:gi)(),f=0;f<s.create.length;++f)s.create[f](lt,p);for(f=0;f<p.children.length;++f){let w=p.children[f];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function u(p,c,h,d,g,_){for(;d<=g;++d){let f=h[d];f!=null&&i.insertBefore(p,l(f,_),c)}}function m(p){var c,h;let d=p.data;if(d!==void 0){(h=(c=d?.hook)===null||c===void 0?void 0:c.destroy)===null||h===void 0||h.call(c,p);for(let g=0;g<s.destroy.length;++g)s.destroy[g](p);if(p.children!==void 0)for(let g=0;g<p.children.length;++g){let _=p.children[g];_!=null&&typeof _!="string"&&m(_)}}}function x(p,c,h,d){for(var g,_;h<=d;++h){let f,v,b=c[h];if(b!=null)if(z(b.sel)){m(b),f=s.remove.length+1,v=o(b.elm,f);for(let w=0;w<s.remove.length;++w)s.remove[w](b,v);let k=(_=(g=b?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;z(k)?k(b,v):v()}else b.children?(m(b),x(p,b.children,0,b.children.length-1)):i.removeChild(p,b.elm)}}function $(p,c,h,d){let g=0,_=0,f=c.length-1,v=c[0],b=c[f],k=h.length-1,w=h[0],A=h[k],O,S,y,C;for(;g<=f&&_<=k;)v==null?v=c[++g]:b==null?b=c[--f]:w==null?w=h[++_]:A==null?A=h[--k]:he(v,w)?(T(v,w,d),v=c[++g],w=h[++_]):he(b,A)?(T(b,A,d),b=c[--f],A=h[--k]):he(v,A)?(T(v,A,d),i.insertBefore(p,v.elm,i.nextSibling(b.elm)),v=c[++g],A=h[--k]):he(b,w)?(T(b,w,d),i.insertBefore(p,b.elm,v.elm),b=c[--f],w=h[++_]):(O===void 0&&(O=bi(c,g,f)),S=O[w.key],Ae(S)?(i.insertBefore(p,l(w,d),v.elm),w=h[++_]):Ae(O[A.key])?(i.insertBefore(p,l(A,d),i.nextSibling(b.elm)),A=h[--k]):(y=c[S],y.sel!==w.sel?i.insertBefore(p,l(w,d),v.elm):(T(y,w,d),c[S]=void 0,i.insertBefore(p,y.elm,v.elm)),w=h[++_]));_<=k&&(C=h[k+1]==null?null:h[k+1].elm,u(p,C,h,_,k,d)),g<=f&&x(p,c,g,f)}function T(p,c,h){var d,g,_,f,v,b,k,w;let A=(d=c.data)===null||d===void 0?void 0:d.hook;(g=A?.prepatch)===null||g===void 0||g.call(A,p,c);let O=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={}),(f=p.data)!==null&&f!==void 0||(p.data={});for(let C=0;C<s.update.length;++C)s.update[C](p,c);(k=(b=(v=c.data)===null||v===void 0?void 0:v.hook)===null||b===void 0?void 0:b.update)===null||k===void 0||k.call(b,p,c)}let S=p.children,y=c.children;Ae(c.text)?z(S)&&z(y)?S!==y&&$(O,S,y,h):z(y)?(z(p.text)&&i.setTextContent(O,""),u(O,null,y,0,y.length-1,h)):z(S)?x(O,S,0,S.length-1):z(p.text)&&i.setTextContent(O,""):p.text!==c.text&&(z(S)&&x(O,S,0,S.length-1),i.setTextContent(O,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,h){let d,g,_,f=[];for(d=0;d<s.pre.length;++d)s.pre[d]();for(yi(i,c)?c=n(c):vi(i,c)&&(c=a(c)),he(c,h)?T(c,h,f):(g=c.elm,_=i.parentNode(g),l(h,f),_!==null&&(i.insertBefore(_,h.elm,i.nextSibling(g)),x(_,[c],0,0))),d=0;d<f.length;++d)f[d].data.hook.insert(f[d]);for(d=0;d<s.post.length;++d)s.post[d]();return h}}function tr(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 rr={create:tr,update:tr};function sr(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 ir={create:sr,update:sr};var xi="http://www.w3.org/1999/xlink",_i="http://www.w3.org/2000/xmlns/",Si="http://www.w3.org/XML/1998/namespace";function nr(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(Si,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(_i,r,a):s.setAttributeNS(xi,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var ar={create:nr,update:nr};var or=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,ki=function(e){or(function(){or(e)})},pt=!1;function Ai(e,t,r){ki(function(){e[t]=r})}function lr(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])&&Ai(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function Ei(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 $i(e,t){let r=e.data.style;if(!r||!r.remove){t();return}pt||(e.elm.offsetLeft,pt=!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 m=getComputedStyle(i)["transition-property"].split(", ");for(;n<m.length;++n)l.indexOf(m[n])!==-1&&o++;i.addEventListener("transitionend",function(x){x.target===i&&--o,o===0&&t()})}function Oi(){pt=!1}var pr={pre:Oi,create:lr,update:lr,destroy:Ei,remove:$i};function cr(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++)cr(e[s],t,r)}function Ci(e,t){let r=e.type,s=t.data.on;s&&s[r]&&cr(s[r],t,e)}function Ii(){return function e(t){Ci(t,e.vnode)}}function ct(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||Ii();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 hr={create:ct,update:ct,destroy:ct};var Ti=()=>er([rr,ir,ar,pr,hr]),ht=Ti;function dr(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&&dr(n,i.children,i.sel)}}function dt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),ae(r)?i=r:oe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(ae(t)?i=t:oe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)oe(i[a])&&(i[a]=X(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&dr(s,i,e),X(e,s,i,n,void 0)}var Ni={},fr={components:Ni},ur=ht();var Ee={components:{dialog:{view:$t,store:Pe,handlers:je},select:{store:De,view:Ot,handlers:ze},navbar:{view:Ct,handlers:Re,store:Me},popover:{store:We,handlers:Ve,view:It},form:{store:Fe,handlers:He,view:Tt},sidebar:{store:Ke,view:Nt,handlers:Ue},pageOutline:{store:Je,view:Lt,handlers:Ye}}};Object.keys(Ee).forEach(e=>{Object.keys(Ee[e]).forEach(t=>{let r=ot({...Ee[e][t],patch:ur,h:dt},fr[e]);customElements.define(Ee[e][t].view.elementName,r)})});customElements.define("rtgl-button",gt({}));customElements.define("rtgl-view",bt({}));customElements.define("rtgl-text",xt({}));customElements.define("rtgl-image",_t({}));customElements.define("rtgl-svg",kt({}));customElements.define("rtgl-input",At({}));customElements.define("rtgl-textarea",Et({}));})();