From e889c123158c96c6c9bff21d0521889b220cc866 Mon Sep 17 00:00:00 2001 From: Chris Lorenzo Date: Tue, 9 Apr 2024 09:28:02 -0400 Subject: [PATCH] Updates --- assets/index-C4u_Hbz8.js | 8 -------- assets/index-C4u_Hbz8.js.map | 1 - assets/index-DjQeU_QX.js | 2 ++ assets/index-DjQeU_QX.js.map | 1 + assets/index-legacy-Baty9aaB.js | 2 -- assets/index-legacy-Baty9aaB.js.map | 1 - assets/index-legacy-DMeX0taR.js | 2 ++ assets/index-legacy-DMeX0taR.js.map | 1 + assets/solidWord.png | Bin 0 -> 12524 bytes assets/stars-full.png | Bin 0 -> 2988 bytes assets/stars.png | Bin 0 -> 2751 bytes index.html | 4 ++-- 12 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 assets/index-C4u_Hbz8.js delete mode 100644 assets/index-C4u_Hbz8.js.map create mode 100644 assets/index-DjQeU_QX.js create mode 100644 assets/index-DjQeU_QX.js.map delete mode 100644 assets/index-legacy-Baty9aaB.js delete mode 100644 assets/index-legacy-Baty9aaB.js.map create mode 100644 assets/index-legacy-DMeX0taR.js create mode 100644 assets/index-legacy-DMeX0taR.js.map create mode 100644 assets/solidWord.png create mode 100644 assets/stars-full.png create mode 100644 assets/stars.png diff --git a/assets/index-C4u_Hbz8.js b/assets/index-C4u_Hbz8.js deleted file mode 100644 index 33c59f8..0000000 --- a/assets/index-C4u_Hbz8.js +++ /dev/null @@ -1,8 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = [] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -var ri=Object.defineProperty;var oi=(r,n,e)=>n in r?ri(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>(oi(r,typeof n!="symbol"?n+"":n,e),e);import{a as F,i as ro,g as _n,c as ht,W as yr,E as nt,b as ke,d as ii,e as nr,f as si,m as At,h as Lt,j as oo,T as io,k as ai,l as In,S as vr,B as li,n as ci,o as so,p as di,q as hi,C as ui,r as fi,s as wr,t as br,u as gi,v as pi,w as mi}from"./CoreExtension-BSpcUIDc.js";function Yc(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();class ao{constructor(n){h(this,"releaseCallback");this.releaseCallback=n}}class xi extends ao{constructor(e,t){var o,i;super(e);h(this,"textureMap",new Map);h(this,"zeroReferenceTextureSet",new Set);h(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),a=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>a&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(F(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),F(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);F(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class yi extends ao{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;F((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const yt={alpha:r=>r===1?null:{prop:"opacity",value:"".concat(r)},x:r=>({prop:"left",value:"".concat(r,"px")}),y:r=>({prop:"top",value:"".concat(r,"px")}),width:r=>r===0?null:{prop:"width",value:"".concat(r,"px")},height:r=>r===0?null:{prop:"height",value:"".concat(r,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:r=>r===!1?null:{prop:"overflow",value:r?"hidden":"visible"},rotation:r=>r===0?null:{prop:"transform",value:"rotate(".concat(r,"rad)")},scale:r=>r===1?null:{prop:"transform",value:"scale(".concat(r,")")},scaleX:r=>r===1?null:{prop:"transform",value:"scaleX(".concat(r,")")},scaleY:r=>r===1?null:{prop:"transform",value:"scaleY(".concat(r,")")},color:r=>r===0?null:{prop:"color",value:lo(r)}},lo=r=>{const n=(r&255)/255,e=r>>8&255,t=r>>16&255,o=r>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(n,")")},vi={id:"id"};class wi{constructor(n,e){h(this,"root",null);h(this,"canvas",null);h(this,"height",1080);h(this,"width",1920);h(this,"scaleX",1);h(this,"scaleY",1);var i,s,a,c,d,u;if(ro())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((a=e.deviceLogicalPixelRatio)!=null?a:1)),this.scaleX=(d=e.deviceLogicalPixelRatio)!=null?d:1,this.scaleY=(u=e.deviceLogicalPixelRatio)!=null?u:1,this.canvas=n,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(n,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(n),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const n=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+n.top,t=document.documentElement.scrollLeft+n.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(n,e){const t=document.createElement("div");t.style.position="absolute",t.id=n.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(n,e){const t=n.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(n,e){const t=n.createTextNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createProxy(n,e){return new Proxy(n,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,a)=>{const c=t.animate(s,a);return new Proxy(c,{get:(d,u,g)=>(u==="start"&&this.animateNode(e,n,s,a),Reflect.get(d,u,g))})}:Reflect.get(t,o,i))})}destroyNode(n){const e=document.getElementById(n.id.toString());e==null||e.remove()}updateNodeProperty(n,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(n);return}const s=document.getElementById(i.toString());s==null||s.appendChild(n);return}if(e==="text"){n.innerHTML=String(t),n.style.visibility="hidden";return}if(e==="src"&&t){n.setAttribute("data-src",String(t));return}if(yt[e]){const i=(o=yt[e])==null?void 0:o.call(yt,t);if(i===null)return;if(typeof i=="string"){n.style.setProperty(i,String(t));return}typeof i=="object"&&n.style.setProperty(i.prop,i.value);return}if(vi[e]){n.setAttribute(String(yt[e]),String(t));return}if(e==="data"){for(const i in t)n.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(n,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:a,y:c,width:d,height:u,alpha:g=1,rotation:y=0,scale:b=1,color:x}=t;function w(){setTimeout(()=>{n.style.top="".concat(c,"px"),n.style.left="".concat(a,"px"),n.style.width="".concat(d,"px"),n.style.height="".concat(u,"px"),n.style.opacity="".concat(g),n.style.rotate="".concat(y,"rad"),n.style.scale="".concat(b),n.style.color=lo(x)},i)}setTimeout(w,s)}}const bi="modulepreload",Si=function(r){return"/solid-demo-app/"+r},Sr={},Ai=function(n,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=Si(c),c in Sr)return;Sr[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let b=i.length-1;b>=0;b--){const x=i[b];if(x.href===c&&(!d||x.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":bi,d||(y.as="script",y.crossOrigin=""),y.href=c,a&&y.setAttribute("nonce",a),document.head.appendChild(y),d)return new Promise((b,x)=>{y.addEventListener("load",b),y.addEventListener("error",()=>x(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>n()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class ie{constructor(n){h(this,"priority",1);h(this,"name","");h(this,"ref");h(this,"target");h(this,"passParameters","");h(this,"declaredUniforms","");h(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=n;this.ref=e,this.target=t;const i={},s=[];let a="";const c=this.constructor.uniforms||{};for(const d in c){const u=c[d],g=u.type,y="".concat(e,"_").concat(d);let b="";u.size&&(b="[".concat(u.size(o),"]")),s.push(y),a+="uniform ".concat(g," ").concat(y).concat(b,";"),i[d]={name:y,uniform:c[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static getEffectKey(n){return""}static getMethodParameters(n,e){const t=[];for(const o in n){const i=n[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(n){return{}}static makeEffectKey(n){return!1}}h(ie,"uniforms",{}),h(ie,"methods"),h(ie,"onShaderMask"),h(ie,"onColorize"),h(ie,"onEffectMask");const Ci={x:(r,n)=>{r.props.x=n},y:(r,n)=>{r.props.y=n},width:(r,n)=>{r.props.width=n},height:(r,n)=>{r.props.height=n},color:(r,n)=>{r.props.color=n},zIndex:(r,n)=>{r.props.zIndex=n},fontFamily:(r,n)=>{r.props.fontFamily=n},fontWeight:(r,n)=>{r.props.fontWeight=n},fontStyle:(r,n)=>{r.props.fontStyle=n},fontStretch:(r,n)=>{r.props.fontStretch=n},fontSize:(r,n)=>{r.props.fontSize=n},text:(r,n)=>{r.props.text=n},textAlign:(r,n)=>{r.props.textAlign=n},contain:(r,n)=>{r.props.contain=n},offsetY:(r,n)=>{r.props.offsetY=n},scrollable:(r,n)=>{r.props.scrollable=n},scrollY:(r,n)=>{r.props.scrollY=n},letterSpacing:(r,n)=>{r.props.letterSpacing=n},lineHeight:(r,n)=>{r.props.lineHeight=n},maxLines:(r,n)=>{r.props.maxLines=n},textBaseline:(r,n)=>{r.props.textBaseline=n},verticalAlign:(r,n)=>{r.props.verticalAlign=n},overflowSuffix:(r,n)=>{r.props.overflowSuffix=n},debug:(r,n)=>{r.props.debug=n}};class co{constructor(n){h(this,"stage");h(this,"set");this.stage=n;const e={...Ci,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(n,e,t){n.status!==e&&(n.status=e,n.emitter.emit(e,t))}setIsRenderable(n,e){n.isRenderable=e}destroyState(n){["loading","loaded","failed"].forEach(t=>{n.emitter.off(t)})}scheduleUpdateState(n){n.updateScheduled||(n.updateScheduled=!0,queueMicrotask(()=>{n.updateScheduled=!1,this.updateState(n)}))}}const Ar=2048;function Cr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class Ti{constructor(n,e){h(this,"_canvas");h(this,"_context");h(this,"_settings");h(this,"renderInfo");this._canvas=n,this._context=e,this._settings=this.mergeDefaults({})}set settings(n){this._settings=this.mergeDefaults(n)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const n=[this._settings.fontFace],e=[];for(let t=0,o=n.length;t{console.warn("[Lightning] Font load error",e,n)}).then(()=>{document.fonts.check(n,this._settings.text)||console.warn("[Lightning] Font not found",n)})}catch(e){console.warn("[Lightning] Can't check font loading for "+n)}}}calculateRenderInfo(){const n={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,a=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,d=this._settings.h*e;let u=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,y=this._settings.cutEx*e,b=this._settings.cutSy*e,x=this._settings.cutEy*e,w=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),p=A-t;if(p<10&&(A+=10-p,p=10),u||(u=p),this._settings.textOverflow&&!this._settings.wordWrap){let C;switch(this._settings.textOverflow){case"clip":C="";break;case"ellipsis":C=this._settings.overflowSuffix;break;default:C=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,C)}let m;if(this._settings.wordWrap)m=this.wrapText(this._settings.text,u,w,S);else{m={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const C=m.l.length;for(let _=0;_this._settings.maxLines){const C=v.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(C[C.length-1],u-O,w,S);C[C.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=v.length;let k=0;const z=m.n.length;for(E=this._settings.maxLines;E=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(n.cutSx||n.cutSy)&&this._context.translate(-n.cutSx,-n.cutSy);let a,c;const d=[];for(let g=0,y=o.length;ge)for(;a>0&&(c=this._context.measureText(n.substring(0,a)).width+o,c>e);)a-=1;else for(;a=o?t:"")}wrapText(n,e,t,o=0){const i=n.split(/\r?\n/g);let s=[];const a=[];for(let c=0;cg?(b>0&&(d.push(u),u=""),u+=y[b],g=e-x-(b===0?o:0)):(g-=w,u+=" ".concat(y[b]))}d.push(u),u="",s=s.concat(d),ct+this._context.measureText(o).width+e,0):this._context.measureText(n).width}mergeDefaults(n){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...n}}}const Tr=typeof self>"u"?globalThis:self;var no;const _r=((no=Tr.document)==null?void 0:no.fonts)||Tr.fonts;function _i(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const Ii=ht(0,0,0,0);class Ri extends co{constructor(e){super(e);h(this,"canvas");h(this,"context");h(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),F(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof yr}addFontFace(e){F(e instanceof yr),_r.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,canvasPages:void 0,lightning2TextRenderer:new Ti(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var x,w;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=_i(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){_r.load(S).then(this.onFontLoaded.bind(this,e,S)).catch(this.onFontLoadError.bind(this,e,S));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const S=e.props.maxLines,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,p=A>0&&S>0?Math.min(A,S):Math.max(A,S);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:ke(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:p,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:a,contain:c}=e.props,{visibleWindow:d}=e;let{renderWindow:u,canvasPages:g}=e;if(!d.valid){const S=ht(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,Ii);ii(this.rendererBounds,S,d),d.valid=!0}const y=d.y2-d.y1,b=Math.ceil(y/e.renderInfo.lineHeight);if(y===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,A=o-a+u.y1,p=t+u.x2,m=o-a+u.y2;if(S<=d.x1&&p>=d.x2&&A<=d.y1&&m>=d.y2){this.setStatus(e,"loaded");return}md.y1&&(u.y1-=b*e.renderInfo.lineHeight,u.y2-=b*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-b,g[0].lineNumEnd=g[0].lineNumStart+b,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*b,A=Math.ceil(a/S),p=A*b,m=p-b,v=p+b;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:m,lineNumEnd:m+b,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:p,lineNumEnd:p+b,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:v,lineNumEnd:v+b,valid:!1}],e.canvasPages=g;const T=A*S;u={x1:0,y1:T-S,x2:i,y2:T+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(x=S.texture)==null||x.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),S.texture.setRenderableOwner(e,e.isRenderable),S.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(S.lineNumStart,S.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(S.lineNumStart,S.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((w=S.texture)==null||w.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),S.texture.setRenderableOwner(e,e.isRenderable)),S.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var C,_,E,P,k,z,O,D,W,j,se,te;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y,scrollY:b,contain:x,width:w,height:S}=e.props,A={x:g,y,width:x!=="none"?w:c,height:x==="both"?S:d};nr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),F(a,"canvasPages is not defined"),F(u,"renderWindow is not defined");const m=(u.y2-u.y1)/3,{zIndex:v,color:T}=e.props,R=i*si(T),I=At(4294967295,R);a[0].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((_=(C=a[0].texture)==null?void 0:C.dimensions)==null?void 0:_.width)||0,height:((P=(E=a[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((z=(k=a[1].texture)==null?void 0:k.dimensions)==null?void 0:z.width)||0,height:((D=(O=a[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:a[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((j=(W=a[2].texture)==null?void 0:W.dimensions)==null?void 0:j.width)||0,height:((te=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:te.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class ho extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}}h(ho,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class uo extends Lt{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});h(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,a)=>{o.activeTexture(a),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}h(uo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Rn=new Map,Bi=(r,n)=>{const e=JSON.stringify(r);if(Rn.has(e))return Rn.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Rn.set(e,t),t},Ne=class Ne extends Lt{constructor(e,t,o){const i=Ne.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});h(this,"effects",[]);this.effects=i.effects,this.calculateProps=oo(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const a=this.effects[s],c=t[a.name],d=(g=i.props)!=null?g:{},u=a.uniformInfo;Object.keys(d).forEach(y=>{const b=c.uniforms[y],x=u[y];let w=b.validator?b.validator(d[y],d):d[y];Array.isArray(w)&&(w=new Float32Array(w)),o.push({name:x.name,value:w})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;const o=e.effects.length;let i=0;for(;i{const w=t[x.type],S=w.getEffectKey(x.props||{});o[S]=o[S]?++o[S]:1;const A=o[S];A===1&&c.push({key:S,type:x.type,props:x.props});const p=new w({ref:"".concat(S).concat(A===1?"":A),target:S,props:x.props});return s+=p.declaredUniforms,a.push(...Object.values(p.uniformInfo)),p});let u="";c==null||c.forEach(x=>{var I;const w=t[x.type],S=w.resolveDefaults((I=x.props)!=null?I:{}),A=[];for(const C in w.methods){let _=C;const E=w.methods[C];i[C]&&i[C]!==E&&(_=Ne.resolveMethodDuplicate(C,E,i)),i[_]=E.replace("function",_),A.push({m:C,cm:_})}let p=w.onShaderMask instanceof Function?w.onShaderMask(S):w.onShaderMask,m=w.onColorize instanceof Function?w.onColorize(S):w.onColorize,v=w.onEffectMask instanceof Function?w.onEffectMask(S):w.onEffectMask;A.forEach(C=>{const{m:_,cm:E}=C,P=new RegExp("\\$".concat(_),"g");p&&(p=p.replace(P,E)),m&&(m=m.replace(P,E)),v&&(v=v.replace(P,E))});const T=w.getMethodParameters(w.uniforms,S),R=T.length>0?", ".concat(T):"";p&&(u+="\n float fx_".concat(x.key,"_onShaderMask(float shaderMask ").concat(R,") {\n ").concat(p,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(x.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(m,"\n }\n ")),v&&(u+="\n vec4 fx_".concat(x.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(v,"\n }\n "))});let g="";for(const x in i)g+=i[x];let y="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",b="\n\n ";for(let x=0;x0?", ".concat(w.passParameters):"",A=t[w.name];A.onShaderMask&&(b+="\n shaderMask = fx_".concat(w.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),A.onColorize&&(b+="\n maskColor = fx_".concat(w.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),A.onEffectMask&&(y="fx_".concat(w.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const p=d[x+1];(p===void 0||t[p.name].onEffectMask)&&(b+="\n shaderColor = ".concat(y,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,b),vertex:Ne.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:Bi(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};h(Ne,"z$__type__Props"),h(Ne,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),h(Ne,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let ut=Ne;class Mn extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(n){return{radius:n.radius||10,$dimensions:{width:0,height:0}}}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){this.setUniform("u_radius",n.radius)}canBatchShaderProps(n,e){return n.radius===e.radius&&n.$dimensions.width===e.$dimensions.width&&n.$dimensions.height===e.$dimensions.height}}h(Mn,"z$__type__Props"),h(Mn,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const ki=new Float32Array([1,0,0,0,1,0,0,0,1]),yn=class yn extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){const e=yn.resolveDefaults(n);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=ke(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(n={}){var e,t,o,i,s,a;return{transform:(e=n.transform)!=null?e:ki,scrollY:(t=n.scrollY)!=null?t:0,color:(o=n.color)!=null?o:4294967295,size:(i=n.size)!=null?i:16,distanceRange:(s=n.distanceRange)!=null?s:1,debug:(a=n.debug)!=null?a:!1}}};h(yn,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let zn=yn;class ot extends ie{constructor(){super(...arguments);h(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}h(ot,"z$__type__Props"),h(ot,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(ot,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(ot,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),h(ot,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Ct extends ie{constructor(){super(...arguments);h(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(Ct,"z$__type__Props"),h(Ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(Ct,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),h(Ct,"onColorize","\n return color;\n ");const Ye=class Ye extends ie{constructor(){super(...arguments);h(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const a=t.length;let c=0;const d=o;for(;ce.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(Ye,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),h(Ye,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat(Ye.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Pn=Ye;class Dn extends ie{constructor(){super(...arguments);h(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}h(Dn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h(Dn,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class it extends ie{constructor(){super(...arguments);h(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(it,"z$__type__Props"),h(it,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(it,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(it,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(it,"onColorize","\n return color;\n ");class st extends ie{constructor(){super(...arguments);h(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(st,"z$__type__Props"),h(st,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(st,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(st,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(st,"onColorize","\n return color;\n ");class at extends ie{constructor(){super(...arguments);h(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(at,"z$__type__Props"),h(at,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(at,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(at,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(at,"onColorize","\n return color;\n ");class lt extends ie{constructor(){super(...arguments);h(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(lt,"z$__type__Props"),h(lt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(lt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(lt,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(lt,"onColorize","\n return color;\n ");class Tt extends ie{constructor(){super(...arguments);h(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,a;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(a=e.time)!=null?a:Date.now()}}}h(Tt,"z$__type__Props"),h(Tt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),h(Tt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),h(Tt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class rn extends ie{constructor(){super(...arguments);h(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}h(rn,"z$__type__Props"),h(rn,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(rn,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const qe=class qe extends ie{constructor(){super(...arguments);h(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,a,c,d;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const u=t.length;let g=0;const y=o;for(;ge.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(qe,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(qe.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let On=qe;class ct extends ie{constructor(){super(...arguments);h(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,a,c,d;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(a=e.rounded)!=null?a:!1,radius:(c=e.radius)!=null?c:1,color:(d=e.color)!=null?d:4294967295}}}h(ct,"z$__type__Props"),h(ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ct,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),h(ct,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),h(ct,"onColorize","\n return color;\n ");class dt extends ie{constructor(){super(...arguments);h(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}h(dt,"z$__type__Props"),h(dt,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(dt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(dt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),h(dt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class Ei{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",ho),this.registerShaderType("DefaultShaderBatched",uo),this.registerShaderType("RoundedRectangle",Mn),this.registerShaderType("DynamicShader",ut),this.registerShaderType("SdfShader",zn),this.registerEffectType("border",Ct),this.registerEffectType("borderBottom",at),this.registerEffectType("borderLeft",lt),this.registerEffectType("borderRight",it),this.registerEffectType("borderTop",st),this.registerEffectType("fadeOut",rn),this.registerEffectType("linearGradient",Pn),this.registerEffectType("radialGradient",On),this.registerEffectType("grayscale",Dn),this.registerEffectType("glitch",Tt),this.registerEffectType("radius",ot),this.registerEffectType("radialProgress",ct),this.registerEffectType("holePunch",dt)}registerShaderType(n,e){this.shConstructors[n]=e}registerEffectType(n,e){this.effectConstructors[n]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(n,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[n];if(!t)throw new Error('Shader type "'.concat(n,'" is not registered'));if(n==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(n){if(!this.renderer)throw new Error("Renderer is not been defined");const e=ut.resolveDefaults(n,this.effectConstructors),t=ut.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new ut(this.renderer,n,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(n){this.attachedShader!==n&&(this.attachedShader&&this.attachedShader.detach(),n.attach(),this.attachedShader=n)}}class Fi{constructor(){h(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function Ni(r){return/\.(ktx|pvr)$/.test(r)}const Li=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?Mi(e):zi(e)},Mi=async r=>{const n=new DataView(r),e=n.getUint32(12)===16909060,t=[],o={glInternalFormat:n.getUint32(28,e),pixelWidth:n.getUint32(36,e),pixelHeight:n.getUint32(40,e),numberOfMipmapLevels:n.getUint32(56,e),bytesOfKeyValueData:n.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const a=r,c=new Int32Array(a,0,13),d=c[12]+52,u=new Uint8Array(a,d),g=[],y={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let b=0,x=y.pixelWidth||0,w=y.pixelHeight||0;for(let S=0;S>2)*(w+3>>2)*8,p=new Uint8Array(a,u.byteOffset+b,A);g.push(p),b+=A,x=x>>1,w=w>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:y.pixelWidth||0,height:y.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Et=class Et extends io{constructor(e,t){super(e);h(this,"props");this.props=Et.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(Ni(e))return Li(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=Et.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};h(Et,"z$__type__Props");let Un=Et;const Pi=24;function Di(r,n,e,t,o,i,s,a,c){const d=Math.min(Math.max(s.firstLineIdx,0),a.length),u=0;let g=0;t==="middle"?g=(n-r)/2:t==="bottom"&&(g=n-r);const b=o/i+d*n+g;if(!(c&&b>=c/i))return{sdfX:u,sdfY:b,lineIndex:d}}class _t{constructor(n,e=0){h(this,"iterator");h(this,"peekBuffer",[]);h(this,"_lastIndex");this.iterator=n,this.iterator=n,this._lastIndex=e-1,this.peekBuffer=[]}next(){const n=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return n.done?this._lastIndex=-1:this._lastIndex++,n}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const n=this.iterator.next();return this.peekBuffer.push(n),n}get lastIndex(){return this._lastIndex}}function*It(r,n=0){let e=n;for(;e=b.y1,De=O<=b.y2,pe=Pe&&De;for(;(de=te.next())&&!de.done;){const K=de.value;if(r===y.length)y.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(r>y.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?W.codepointIndex!==-1&&(W.codepointIndex=-1,re=z):W.codepointIndex===-1&&(W.codepointIndex=K.cluster,W.bufferOffset=D,W.xStart=re),K.mapped){const Ut=z+K.xOffset+K.width;if(g!=="none"&&Ut>=ge&&W.codepointIndex!==-1&&W.xStart>0)if(be){te=j.shapeText(se,new _t(It(t,W.codepointIndex),W.codepointIndex)),D=W.bufferOffset;break}else te=j.shapeText(se,new _t(It(A,0),0)),z=W.xStart,D=W.bufferOffset,g="none";else{const Oe=z+K.xOffset,Ue=O+K.yOffset;if(pe){Ce===-1&&(Ce=D);const Ke=x.getAtlasEntry(K.glyphId),Xe=Ke.x/x.data.common.scaleW,Ve=Ke.y/x.data.common.scaleH,xt=Ke.width/x.data.common.scaleW,xr=Ke.height/x.data.common.scaleH;u[D++]=Oe,u[D++]=Ue,u[D++]=Xe,u[D++]=Ve,u[D++]=Oe+K.width,u[D++]=Ue,u[D++]=Xe+xt,u[D++]=Ve,u[D++]=Oe,u[D++]=Ue+K.height,u[D++]=Xe,u[D++]=Ve+xr,u[D++]=Oe+K.width,u[D++]=Ue+K.height,u[D++]=Xe+xt,u[D++]=Ve+xr}k=Math.max(k,Ue+K.height),P=Math.max(P,Oe+K.width),z+=K.xAdvance}}else if(K.codepoint===10){if(be)break;te=j.shapeText(se,new _t(It(A,0),0)),g="none"}}Ce!==-1&&(ze.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),z=0,O+=v,r++,W.codepointIndex=-1,re=0,!w&&g==="both"&&O>b.y2||de&&de.done?Qe=!1:be||(Qe=!1)}if(o==="center"){const be=g==="none"?P:T;for(let ge=0;getypeof r=="number"?r:Hi[r]||400;function ji(r,n,e,t,o){let i=Ir(e);for(const s of r){const a=s[n];if(!a)continue;if(a.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(n,"' - will be used for all weights and styles")),a.values().next().value;const c=new Map;for(const u of a){const g=Ir(u.descriptors.weight);if(g===i&&u.descriptors.style===t&&u.descriptors.stretch===o)return u;c.set(g,u)}const d="TrFontManager: No exact match: '".concat(n," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(d),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const Qi=oo(ji);class fo{constructor(n){h(this,"textRenderers");this.textRenderers=n}addFontFace(n){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(n)&&t.addFontFace(n)}}static resolveFontFace(n,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return Qi(n,t,o,i,s)}}const Ki={x:0,y:0,width:0,height:0};class Xi extends co{constructor(e){super(e);h(this,"ssdfFontFamilies",{});h(this,"msdfFontFamilies",{});h(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);h(this,"sdfShader");h(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof vr}addFontFace(e){F(e instanceof vr);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:a}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}F(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:y,width:b,height:x,lineHeight:w,verticalAlign:S,scrollable:A,overflowSuffix:p,maxLines:m}=e.props,v=y==="both"&&A?e.props.scrollY:0,{renderWindow:T}=e,R=t.data.info.size,I=d/R,C=w/I;e.distanceRange=I*t.data.distanceField.distanceRange;const _=c.length*Pi;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!a&&T.valid){const j=T.screen;if(u+j.x1<=P.x1&&u+j.x2>=P.x2&&g-v+j.y1<=P.y1&&g-v+j.y2>=P.y2){this.setStatus(e,"loaded");return}T.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:z}=e.props;if(!T.valid){if(!In(P,this.rendererBounds))return;$i(T,u,g,v,w,y==="both"?P.y2-P.y1:0,P,I)}const O=Di(R,C,w,S,k,I,T,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,W=Ui(O.lineIndex,O.sdfX,O.sdfY,c,z,b,x,d,w,D,E,y,i,T.sdf,t,a,A,p,m);e.bufferUploaded=!1,e.bufferNumFloats=W.bufferNumFloats,e.bufferNumQuads=W.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=T,s.lastLayoutNumCharacters=W.layoutNumCharacters,s.bufferSize=E.byteLength,W.fullyProcessed&&(e.textW=W.maxX*I,e.textH=W.maxY*I),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:a,color:c,contain:d,scrollable:u,zIndex:g,debug:y}=e.props,b=d==="both"&&u?e.props.scrollY:0,{textW:x=0,textH:w=0,distanceRange:S,vertexBuffer:A,bufferUploaded:p,trFontFace:m,elementBounds:v}=e;let{webGlBuffers:T}=e;if(!T){const k=s.glw,z=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();F(O),e.webGlBuffers=new li([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,F(e.webGlBuffers),T=e.webGlBuffers}if(!p){const k=s.glw,z=(_=T==null?void 0:T.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(z,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(F(m),u&&d==="both"){F(v.valid);const k=ci(v,Ki);o.valid?(e.clippingRect.valid=!0,o=nr(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=so(k,e.clippingRect))}const R=new di(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:hi(c,i),size:a/(((E=m.data)==null?void 0:E.info.size)||0),scrollY:b,distanceRange:S,debug:y.sdfShaderDebug},i,o,{height:w,width:x},0,g),I=(P=e.trFontFace)==null?void 0:P.texture;F(I);const C=this.stage.txManager.getCtxTexture(I);R.addTexture(C),R.length=e.bufferNumFloats,R.numQuads=e.bufferNumQuads,s.addRenderOp(R)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return fo.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function Vi(r){return r.prototype instanceof ui}async function Gi(r,n){let e;try{console.log("Loading core extension",r),e=await Ai(()=>import(r),__vite__mapDeps([]))}catch(o){console.error("The core extension module at '".concat(r,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(r,"' does not have a default export."));return}const t=e.default;if(Vi(t)){const o=new t;try{await o.run(n)}catch(i){console.error("The core extension at '".concat(r,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(r,"' does not extend CoreExtension."))}function go(r){const n={boolean:!0,string:!0,number:!0},e=Object.keys(r);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),r[o]=i.substring(0,2048)),n[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete r[o])}return r}class qi extends nt{constructor(e,t,o){var A,p,m,v;super();h(this,"root",null);h(this,"driver");h(this,"canvas");h(this,"settings");h(this,"inspector",null);h(this,"nodes",new Map);h(this,"nextTextureId",1);h(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(p=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?p:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(m=e.enableContextSpy)!=null?m:!1,enableInspector:(v=e.enableInspector)!=null?v:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=T=>{this.driver.releaseTexture(T)},y=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=y?new yi(g):new xi(g,this.settings.textureCleanupOptions);const b=s*c,x=a*c;this.driver=o;const w=document.createElement("canvas");this.canvas=w,w.width=b*d,w.height=x*d,w.style.width="".concat(b,"px"),w.style.height="".concat(x,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=T=>{this.nodes.set(T.id,T)},o.onBeforeDestroyNode=T=>{this.nodes.delete(T.id)},o.onFpsUpdate=T=>{this.emit("fpsUpdate",T)},o.onFrameTick=T=>{this.emit("frameTick",T)},o.onIdle=()=>{this.emit("idle")},S.appendChild(w),u&&!ro()&&(this.inspector=new wi(w,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,a,c,d,u,g,y,b,x,w,S,A,p,m,v,T,R,I;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(a=e.textRendererOverride)!=null?a:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(d=e.fontStyle)!=null?d:"normal",fontWeight:(u=e.fontWeight)!=null?u:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(y=e.textAlign)!=null?y:"left",contain:(b=e.contain)!=null?b:"none",scrollable:(x=e.scrollable)!=null?x:!1,scrollY:(w=e.scrollY)!=null?w:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(p=e.lineHeight)!=null?p:t,maxLines:(m=e.maxLines)!=null?m:0,textBaseline:(v=e.textBaseline)!=null?v:"alphabetic",verticalAlign:(T=e.verticalAlign)!=null?T:"top",overflowSuffix:(R=e.overflowSuffix)!=null?R:"...",debug:(I=e.debug)!=null?I:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var d,u,g,y,b,x,w,S,A,p,m,v,T,R,I,C,_,E,P,k,z,O,D,W,j,se,te,de,Ce,ze,Dt,Ot,Qe,be,ge,re,Pe,De,pe,K,Ut,Oe,Ue,Ke,Xe,Ve,xt;const t=(d=e.color)!=null?d:4294967295,o=(y=(g=(u=e.colorTl)!=null?u:e.colorTop)!=null?g:e.colorLeft)!=null?y:t,i=(w=(x=(b=e.colorTr)!=null?b:e.colorTop)!=null?x:e.colorRight)!=null?w:t,s=(p=(A=(S=e.colorBl)!=null?S:e.colorBottom)!=null?A:e.colorLeft)!=null?p:t,a=(T=(v=(m=e.colorBr)!=null?m:e.colorBottom)!=null?v:e.colorRight)!=null?T:t,c=go((R=e.data)!=null?R:{});return{x:(I=e.x)!=null?I:0,y:(C=e.y)!=null?C:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,autosize:(k=e.autosize)!=null?k:!1,clipping:(z=e.clipping)!=null?z:!1,color:t,colorTop:(O=e.colorTop)!=null?O:t,colorBottom:(D=e.colorBottom)!=null?D:t,colorLeft:(W=e.colorLeft)!=null?W:t,colorRight:(j=e.colorRight)!=null?j:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(se=e.zIndex)!=null?se:0,zIndexLocked:(te=e.zIndexLocked)!=null?te:0,parent:(de=e.parent)!=null?de:null,texture:(Ce=e.texture)!=null?Ce:null,shader:(ze=e.shader)!=null?ze:null,src:(Dt=e.src)!=null?Dt:"",scale:(Ot=e.scale)!=null?Ot:null,scaleX:(be=(Qe=e.scaleX)!=null?Qe:e.scale)!=null?be:1,scaleY:(re=(ge=e.scaleY)!=null?ge:e.scale)!=null?re:1,mount:(Pe=e.mount)!=null?Pe:0,mountX:(pe=(De=e.mountX)!=null?De:e.mount)!=null?pe:0,mountY:(Ut=(K=e.mountY)!=null?K:e.mount)!=null?Ut:0,pivot:(Oe=e.pivot)!=null?Oe:.5,pivotX:(Ke=(Ue=e.pivotX)!=null?Ue:e.pivot)!=null?Ke:.5,pivotY:(Ve=(Xe=e.pivotY)!=null?Xe:e.pivot)!=null?Ve:.5,rotation:(xt=e.rotation)!=null?xt:0,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Zi extends nt{constructor(e,t,o){super();h(this,"node");h(this,"props");h(this,"settings");h(this,"propStartValues",{});h(this,"restoreValues",{});h(this,"progress",0);h(this,"delayFor",0);h(this,"timingFunction");h(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=fi(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let a=0;a{this.startedResolve=n}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(n=>{this.stoppedResolve=n}))}started(){F(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){F(this.stoppedResolve);const{loop:n,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!n&&this.manager.unregisterAnimation(this.animation)}}const q=0,Z=3,ce=6,X=1,J=4,he=7,me=2,xe=5,ye=8;class ve{constructor(n){h(this,"data");n?(this.data=new Float32Array(9),this.data[q]=n[0],this.data[Z]=n[3],this.data[ce]=n[6],this.data[X]=n[1],this.data[J]=n[4],this.data[he]=n[7],this.data[me]=n[2],this.data[xe]=n[5],this.data[ye]=n[8]):this.data=new Float32Array(9)}static get temp(){return es}static multiply(n,e,t){const o=n.data[q]*e.data[q]+n.data[Z]*e.data[X]+n.data[ce]*e.data[me],i=n.data[q]*e.data[Z]+n.data[Z]*e.data[J]+n.data[ce]*e.data[xe],s=n.data[q]*e.data[ce]+n.data[Z]*e.data[he]+n.data[ce]*e.data[ye],a=n.data[X]*e.data[q]+n.data[J]*e.data[X]+n.data[he]*e.data[me],c=n.data[X]*e.data[Z]+n.data[J]*e.data[J]+n.data[he]*e.data[xe],d=n.data[X]*e.data[ce]+n.data[J]*e.data[he]+n.data[he]*e.data[ye],u=n.data[me]*e.data[q]+n.data[xe]*e.data[X]+n.data[ye]*e.data[me],g=n.data[me]*e.data[Z]+n.data[xe]*e.data[J]+n.data[ye]*e.data[xe],y=n.data[me]*e.data[ce]+n.data[xe]*e.data[he]+n.data[ye]*e.data[ye];return t||(t=new ve),t.data[q]=o,t.data[Z]=i,t.data[ce]=s,t.data[X]=a,t.data[J]=c,t.data[he]=d,t.data[me]=u,t.data[xe]=g,t.data[ye]=y,t}static identity(n){return n||(n=new ve),n.data[q]=1,n.data[Z]=0,n.data[ce]=0,n.data[X]=0,n.data[J]=1,n.data[he]=0,n.data[me]=0,n.data[xe]=0,n.data[ye]=1,n}static translate(n,e,t){return t||(t=new ve),t.data[q]=1,t.data[Z]=0,t.data[ce]=n,t.data[X]=0,t.data[J]=1,t.data[he]=e,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static scale(n,e,t){return t||(t=new ve),t.data[q]=n,t.data[Z]=0,t.data[ce]=0,t.data[X]=0,t.data[J]=e,t.data[he]=0,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new ve),e.data[q]=t,e.data[Z]=-o,e.data[ce]=0,e.data[X]=o,e.data[J]=t,e.data[he]=0,e.data[me]=0,e.data[xe]=0,e.data[ye]=1,e}static copy(n,e,t){return e||(e=new ve),e.data[0]=n.data[0],e.data[1]=n.data[1],e.data[2]=n.data[2],e.data[3]=n.data[3],e.data[4]=n.data[4],e.data[5]=n.data[5],e.data[6]=n.data[6],e.data[7]=n.data[7],e.data[8]=n.data[8],e}translate(n,e){return this.data[ce]=this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[he]=this.data[X]*n+this.data[J]*e+this.data[he],this}scale(n,e){return this.data[q]=this.data[q]*n,this.data[Z]=this.data[Z]*e,this.data[X]=this.data[X]*n,this.data[J]=this.data[J]*e,this}rotate(n){if(n===0||!(n%Math.PI*2))return this;const e=Math.cos(n),t=Math.sin(n),o=this.data[q]*e+this.data[Z]*t,i=this.data[Z]*e-this.data[q]*t,s=this.data[X]*e+this.data[J]*t,a=this.data[J]*e-this.data[X]*t;return this.data[q]=o,this.data[Z]=i,this.data[X]=s,this.data[J]=a,this}multiply(n){return ve.multiply(this,n,this)}get tx(){return this.data[ce]}get ty(){return this.data[he]}get ta(){return this.data[q]}get tb(){return this.data[Z]}get tc(){return this.data[X]}get td(){return this.data[J]}transformPoint(n,e){return[this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[X]*n+this.data[J]*e+this.data[X]]}}const es=new ve,Wt=0,Yt=2,$t=4,Ht=6,jt=1,Qt=3,Kt=5,Xt=7;class sn{constructor(n){h(this,"data");this.data=new Float32Array(8),n&&(this.data[Wt]=n[Wt],this.data[Yt]=n[Yt],this.data[$t]=n[$t],this.data[Ht]=n[Ht],this.data[jt]=n[jt],this.data[Qt]=n[Qt],this.data[Kt]=n[Kt],this.data[Xt]=n[Xt])}static translate(n,e,t,o,i,s,a,c,d){return d||(d=new sn),d.data[Wt]=n,d.data[Yt]=t,d.data[$t]=i,d.data[Ht]=a,d.data[jt]=e,d.data[Qt]=o,d.data[Kt]=s,d.data[Xt]=c,d}get x1(){return this.data[Wt]}get x2(){return this.data[Yt]}get x3(){return this.data[$t]}get x4(){return this.data[Ht]}get y1(){return this.data[jt]}get y2(){return this.data[Qt]}get y3(){return this.data[Kt]}get y4(){return this.data[Xt]}}var V;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(V||(V={}));const Je=new Map;Je.set(V.Init,"init");Je.set(V.OutOfBounds,"outOfBounds");Je.set(V.InBounds,"inBounds");Je.set(V.InViewport,"inViewport");var B;(function(r){r[r.Children=1]="Children",r[r.ScaleRotate=2]="ScaleRotate",r[r.Local=4]="Local",r[r.Global=8]="Global",r[r.Clipping=16]="Clipping",r[r.CalculatedZIndex=32]="CalculatedZIndex",r[r.ZIndexSortedChildren=64]="ZIndexSortedChildren",r[r.PremultipliedColors=128]="PremultipliedColors",r[r.WorldAlpha=256]="WorldAlpha",r[r.RenderState=512]="RenderState",r[r.IsRenderable=1024]="IsRenderable",r[r.None=0]="None",r[r.All=2047]="All"})(B||(B={}));class rr extends nt{constructor(e,t){super();h(this,"stage");h(this,"children",[]);h(this,"props");h(this,"updateType",B.All);h(this,"globalTransform");h(this,"scaleRotateTransform");h(this,"localTransform");h(this,"renderCoords");h(this,"renderBound");h(this,"strictBound");h(this,"preloadBound");h(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});h(this,"isRenderable",!1);h(this,"renderState",V.Init);h(this,"worldAlpha",1);h(this,"premultipliedColorTl",0);h(this,"premultipliedColorTr",0);h(this,"premultipliedColorBl",0);h(this,"premultipliedColorBr",0);h(this,"calcZIndex",0);h(this,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});h(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null},this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();F(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ve.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){F(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=ve.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(F(this.localTransform),this.globalTransform=ve.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors|B.IsRenderable),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=At(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=At(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=At(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=At(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&this.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){F(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=ht(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=ht(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),br(this.renderBound,this.strictBound)?V.InViewport:br(this.renderBound,this.preloadBound)?V.InBounds:V.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===V.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oV.InBounds&&t===V.OutOfBounds&&(this.emit(Je.get(V.InBounds),{previous:o,current:t}),o=V.InBounds);const i=Je.get(t);F(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(V[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>V.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;F(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,y=i+e*a,b=s,x=s+t*u;this.renderCoords=sn.translate(g,b,y,b,y,x,g,x,this.renderCoords)}else this.renderCoords=sn.translate(i,s,i+e*a,s+e*d,i+e*a+t*c,s+e*d+t*u,i+t*c,s+t*u,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;F(t),F(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=ht(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:y,y4:b}=e;this.renderBound=ht(Math.min(s,u,c,g),Math.min(a,y,d,b),Math.max(s,u,c,g),Math.max(a,y,d,b),this.renderBound)}}calculateClippingRect(e){F(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,a=i.tb!==0||i.tc!==0;s&&!a?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?nr(e,t,t):e.valid&&(so(e,t),t.valid=!0)}calculateZIndex(){var s,a;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(a=e.parent)!=null&&a.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);F(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let ts=1;function or(){return ts++}class Wn extends nt{constructor(e,t,o,i){var s;super();h(this,"rendererMain");h(this,"stage");h(this,"id");h(this,"coreNode");h(this,"_children",[]);h(this,"_src","");h(this,"_parent",null);h(this,"_texture",null);h(this,"_shader",null);h(this,"_data",{});h(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});h(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});h(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});h(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});h(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});h(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:or(),this.coreNode=i||new rr(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);F(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=go(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new Zi(this.coreNode,e,t);return new Ji(this.stage.animationManager,o)}}const ns=r=>{let n=!1;const e=()=>{if(r.updateAnimations(),!r.hasSceneUpdates()){r.calculateFps(),setTimeout(e,16.666666666666668),n||(r.emit("idle"),n=!0);return}n=!1,r.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},rs=()=>performance?performance.now():Date.now();class os{constructor(){h(this,"activeAnimations",new Set)}registerAnimation(n){this.activeAnimations.add(n)}unregisterAnimation(n){this.activeAnimations.delete(n)}update(n){this.activeAnimations.forEach(e=>{e.update(n)})}}class is{constructor(n){h(this,"imageWorkersEnabled",!0);h(this,"messageManager",{});h(this,"workers",[]);h(this,"workerIndex",0);this.workers=this.createWorkers(n),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(n){const{src:e,data:t,error:o}=n.data,i=this.messageManager[e];if(i){const[s,a]=i;delete this.messageManager[e],o?a(new Error(o)):s(t)}}createWorkers(n=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(n);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const Ft=class Ft extends io{constructor(e,t){super(e);h(this,"props");this.props=Ft.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(n,e){if(this.textures.has(n)&&(this.memUsed-=this.textures.get(n)),e===0){this.textures.delete(n);return}else this.memUsed+=e,this.textures.set(n,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((n,e)=>{e.renderable||e.free()})}}const ls=2e6;class cs extends nt{constructor(e){super();h(this,"options");h(this,"animationManager");h(this,"txManager");h(this,"txMemManager");h(this,"fontManager");h(this,"textRenderers");h(this,"shManager");h(this,"renderer");h(this,"root");h(this,"boundsMargin");h(this,"deltaTime",0);h(this,"lastFrameTime",0);h(this,"currentFrameTime",0);h(this,"fpsNumFrames",0);h(this,"fpsElapsedTime",0);h(this,"renderRequested",!1);h(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:a,appHeight:c,boundsMargin:d,enableContextSpy:u,numImageWorkers:g,txMemByteThreshold:y}=e;this.txManager=new ss(g),this.txMemManager=new as(y),this.shManager=new Ei,this.animationManager=new os,this.contextSpy=u?new Fi:null;let b=[0,0,0,0];d&&(b=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=b,s!=null&&s.monitorTextureCache&&setInterval(()=>{F(this.txManager);const w=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",w.idCacheSize),console.log("Texture Key Cache Size: ",w.keyCacheSize)},1e3),this.renderer=new mi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:ls,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Ri(this),sdf:new Xi(this)},this.fontManager=new fo(this.textRenderers);const x=new rr(this,{id:i,x:0,y:0,width:a,height:c,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=x,ns(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=rs(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){F(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});h(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),F(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){F(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class hs extends Wn{constructor(n,e,t){super(n,e,t,new ds(t,{id:or(),x:n.x,y:n.y,width:n.width,height:n.height,alpha:n.alpha,autosize:n.autosize,clipping:n.clipping,color:n.color,colorTop:n.colorTop,colorBottom:n.colorBottom,colorLeft:n.colorLeft,colorRight:n.colorRight,colorTl:n.colorTl,colorTr:n.colorTr,colorBl:n.colorBl,colorBr:n.colorBr,zIndex:n.zIndex,zIndexLocked:n.zIndexLocked,scaleX:n.scaleX,scaleY:n.scaleY,mountX:n.mountX,mountY:n.mountY,mount:n.mount,pivot:n.pivot,pivotX:n.pivotX,pivotY:n.pivotY,rotation:n.rotation,text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStretch:n.fontStretch,fontStyle:n.fontStyle,contain:n.contain,scrollable:n.scrollable,letterSpacing:n.letterSpacing,textAlign:n.textAlign,scrollY:n.scrollY,offsetY:n.offsetY,textRendererOverride:n.textRendererOverride,lineHeight:n.lineHeight,maxLines:n.maxLines,textBaseline:n.textBaseline,verticalAlign:n.verticalAlign,overflowSuffix:n.overflowSuffix,debug:n.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(n){this.coreNode.text=n}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(n){this.coreNode.textRendererOverride=n}get fontSize(){return this.coreNode.fontSize}set fontSize(n){this.coreNode.fontSize=n}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(n){this.coreNode.fontFamily=n}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(n){this.coreNode.fontWeight=n}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(n){this.coreNode.fontStretch=n}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(n){this.coreNode.fontStyle=n}get textAlign(){return this.coreNode.textAlign}set textAlign(n){this.coreNode.textAlign=n}get contain(){return this.coreNode.contain}set contain(n){this.coreNode.contain=n}get scrollable(){return this.coreNode.scrollable}set scrollable(n){this.coreNode.scrollable=n}get scrollY(){return this.coreNode.scrollY}set scrollY(n){this.coreNode.scrollY=n}get offsetY(){return this.coreNode.offsetY}set offsetY(n){this.coreNode.offsetY=n}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(n){this.coreNode.letterSpacing=n}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(n){n&&(this.coreNode.lineHeight=n)}get maxLines(){return this.coreNode.maxLines}set maxLines(n){n&&(this.coreNode.maxLines=n)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(n){n&&(this.coreNode.textBaseline=n)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(n){n&&(this.coreNode.verticalAlign=n)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(n){n&&(this.coreNode.overflowSuffix=n)}get debug(){return this.coreNode.debug}set debug(n){this.coreNode.debug=n}}class us{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(n,e,t){this.stage=new cs({rootId:or(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=n,F(this.stage.root);const o=new Wn(n.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await Gi(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(n){F(this.rendererMain),F(this.stage);const e=new Wn(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){F(this.rendererMain),F(this.stage);const e=new hs(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(n){n.destroy()}releaseTexture(n){const{stage:e}=this;F(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return F(this.root),this.root}onCreateNode(n){throw new Error("Method not implemented.")}onBeforeDestroyNode(n){throw new Error("Method not implemented.")}onFpsUpdate(n){throw new Error("Method not implemented.")}onFrameTick(n){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}const po=(r,n)=>r===n,an=Symbol("solid-proxy"),fs=Symbol("solid-track"),ln={equals:po};let mo=Co;const Se=1,cn=2,xo={owned:null,cleanups:null,context:null,owner:null},Bn={};var $=null;let kn=null,gs=null,H=null,ae=null,Ie=null,vn=0;function ft(r,n){const e=H,t=$,o=r.length===0,i=n===void 0?t:n,s=o?xo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?r:()=>r(()=>le(()=>bn(s)));$=s,H=null;try{return Re(a,!0)}finally{H=e,$=t}}function U(r,n){n=n?Object.assign({},ln,n):ln;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),Ao(e,o));return[So.bind(e),t]}function $n(r,n,e){const t=zt(r,n,!0,Se);rt(t)}function _e(r,n,e){const t=zt(r,n,!1,Se);rt(t)}function $e(r,n,e){mo=bs;const t=zt(r,n,!1,Se);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):rt(t)}function ne(r,n,e){e=e?Object.assign({},ln,e):ln;const t=zt(r,n,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,rt(t),So.bind(t)}function ps(r){return r&&typeof r=="object"&&"then"in r}function et(r,n,e){let t,o,i;arguments.length===2&&typeof n=="object"||arguments.length===1?(t=!0,o=r,i=n||{}):(t=r,o=n,i=e||{});let s=null,a=Bn,c=!1,d="initialValue"in i,u=typeof t=="function"&&ne(t);const g=new Set,[y,b]=(i.storage||U)(i.initialValue),[x,w]=U(void 0),[S,A]=U(void 0,{equals:!1}),[p,m]=U(d?"ready":"unresolved");function v(C,_,E,P){return s===C&&(s=null,P!==void 0&&(d=!0),(C===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),a=Bn,T(_,E)),_}function T(C,_){Re(()=>{_===void 0&&b(()=>C),m(_!==void 0?"errored":d?"ready":"unresolved"),w(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function R(){const C=ys,_=y(),E=x();if(E!==void 0&&!s)throw E;return H&&!H.user&&C&&$n(()=>{S(),s&&(C.resolved||g.has(C)||(C.increment(),g.add(C)))}),_}function I(C=!0){if(C!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){v(s,le(y));return}const E=a!==Bn?a:le(()=>o(_,{value:y(),refetching:C}));return ps(E)?(s=E,"value"in E?(E.status==="success"?v(s,E.value,void 0,_):v(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Re(()=>{m(d?"refreshing":"pending"),A()},!1),E.then(P=>v(E,P,void 0,_),P=>v(E,void 0,_o(P),_)))):(v(s,E,void 0,_),E)}return Object.defineProperties(R,{state:{get:()=>p()},error:{get:()=>x()},loading:{get(){const C=p();return C==="pending"||C==="refreshing"}},latest:{get(){if(!d)return R();const C=x();if(C&&!s)throw C;return y()}}}),u?$n(()=>I(!1)):I(!1),[R,{refetch:I,mutate:b}]}function yo(r,n=po,e){const t=new Map,o=zt(i=>{const s=r();for(const[a,c]of t.entries())if(n(a,s)!==n(a,i))for(const d of c.values())d.state=Se,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Se);return rt(o),i=>{const s=H;if(s){let a;(a=t.get(i))?a.add(s):t.set(i,a=new Set([s])),Me(()=>{a.delete(s),!a.size&&t.delete(i)})}return n(i,o.value)}}function ms(r){return Re(r,!1)}function le(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function He(r,n,e){const t=Array.isArray(r);let o,i=e&&e.defer;return s=>{let a;if(t){a=Array(r.length);for(let d=0;dn(a,o,s));return o=a,c}}function je(r){$e(()=>le(r))}function Me(r){return $===null||($.cleanups===null?$.cleanups=[r]:$.cleanups.push(r)),r}function Mt(){return $}function vo(r,n){const e=$,t=H;$=r,H=null;try{return Re(n,!0)}catch(o){ir(o)}finally{$=e,H=t}}function xs(r){const n=H,e=$;return Promise.resolve().then(()=>{H=n,$=e;let t;return Re(r,!1),H=$=null,t?t.done:void 0})}function wo(r,n){const e=Symbol("context");return{id:e,Provider:Ss(e),defaultValue:r}}function bo(r){return $&&$.context&&$.context[r.id]!==void 0?$.context[r.id]:r.defaultValue}function wn(r){const n=ne(r),e=ne(()=>Hn(n()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let ys;function So(){if(this.sources&&this.state)if(this.state===Se)rt(this);else{const r=ae;ae=null,Re(()=>hn(this),!1),ae=r}if(H){const r=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(r)):(H.sources=[this],H.sourceSlots=[r]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function Ao(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Re(()=>{for(let o=0;o1e6)throw ae=[],new Error},!1)),n}function rt(r){if(!r.fn)return;bn(r);const n=vn;vs(r,r.value,n)}function vs(r,n,e){let t;const o=$,i=H;H=$=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Se,r.owned&&r.owned.forEach(bn),r.owned=null),r.updatedAt=e+1,ir(s)}finally{H=i,$=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?Ao(r,t):r.value=t,r.updatedAt=e)}function zt(r,n,e,t=Se,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:$,context:$?$.context:null,pure:e};return $===null||$!==xo&&($.owned?$.owned.push(i):$.owned=[i]),i}function dn(r){if(r.state===0)return;if(r.state===cn)return hn(r);if(r.suspense&&le(r.suspense.inFallback))return r.suspense.effects.push(r);const n=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt=0;e--)if(r=n[e],r.state===Se)rt(r);else if(r.state===cn){const t=ae;ae=null,Re(()=>hn(r,n[0]),!1),ae=t}}function Re(r,n){if(ae)return r();let e=!1;n||(ae=[]),Ie?e=!0:Ie=[],vn++;try{const t=r();return ws(e),t}catch(t){e||(Ie=null),ae=null,ir(t)}}function ws(r){if(ae&&(Co(ae),ae=null),r)return;const n=Ie;Ie=null,n.length&&Re(()=>mo(n),!1)}function Co(r){for(let n=0;n=0;n--)bn(r.owned[n]);r.owned=null}if(r.cleanups){for(n=r.cleanups.length-1;n>=0;n--)r.cleanups[n]();r.cleanups=null}r.state=0}function _o(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function ir(r,n=$){throw _o(r)}function Hn(r){if(typeof r=="function"&&!r.length)return Hn(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=le(()=>($.context={...$.context,[r]:t.value},wn(()=>t.children))),void 0),o}}const As=Symbol("fallback");function Rr(r){for(let n=0;n1?[]:null;return Me(()=>Rr(i)),()=>{let c=r()||[],d,u;return c[fs],le(()=>{let y=c.length,b,x,w,S,A,p,m,v,T;if(y===0)s!==0&&(Rr(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[As],o[0]=ft(R=>(i[0]=R,e.fallback())),s=1);else if(s===0){for(o=new Array(y),u=0;u=p&&v>=p&&t[m]===c[v];m--,v--)w[v]=o[m],S[v]=i[m],a&&(A[v]=a[m]);for(b=new Map,x=new Array(v+1),u=v;u>=p;u--)T=c[u],d=b.get(T),x[u]=d===void 0?-1:d,b.set(T,u);for(d=p;d<=m;d++)T=t[d],u=b.get(T),u!==void 0&&u!==-1?(w[u]=o[d],S[u]=i[d],a&&(A[u]=a[d]),u=x[u],b.set(T,u)):i[d]();for(u=p;ur(n||{}))}function Vt(){return!0}const jn={get(r,n,e){return n===an?e:r.get(n)},has(r,n){return n===an?!0:r.has(n)},set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor(r,n){return{configurable:!0,enumerable:!0,get(){return r.get(n)},set:Vt,deleteProperty:Vt}},ownKeys(r){return r.keys()}};function En(r){return(r=typeof r=="function"?r():r)?r:{}}function Ts(){for(let r=0,n=this.length;r=0;a--){const c=En(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in En(r[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=r[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let d=c.length-1;d>=0;d--){const u=c[d];if(u==="__proto__"||u==="constructor")continue;const g=Object.getOwnPropertyDescriptor(a,u);if(!t[u])t[u]=g.get?{enumerable:!0,configurable:!0,get:Ts.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const y=e[u];y&&(g.get?y.push(g.get.bind(a)):g.value!==void 0&&y.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const a=i[s],c=t[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function _s(r,...n){if(an in r){const o=new Set(n.length>1?n.flat():n[0]),i=n.map(s=>new Proxy({get(a){return s.includes(a)?r[a]:void 0},has(a){return s.includes(a)&&a in r},keys(){return s.filter(a=>a in r)}},jn));return i.push(new Proxy({get(s){return o.has(s)?void 0:r[s]},has(s){return o.has(s)?!1:s in r},keys(){return Object.keys(r).filter(s=>!o.has(s))}},jn)),i}const e={},t=n.map(()=>({}));for(const o of Object.getOwnPropertyNames(r)){const i=Object.getOwnPropertyDescriptor(r,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,c=0;for(const d of n)d.includes(o)&&(a=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;a||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const Is=r=>"Stale read from <".concat(r,">.");function Sn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return ne(Cs(()=>r.each,r.children,n||void 0))}function Be(r){const n=r.keyed,e=ne(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o});return ne(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?le(()=>o(n?t:()=>{if(!le(e))throw Is("Show");return r.when})):o}return r.fallback},void 0,void 0)}const Rs=void 0;let Le,ar;function Bs(r={},n="app"){const e=new us;return Le=new qi(r,n,e),ar=Le.createShader.bind(Le),Le}class ks extends Array{constructor(e){super();h(this,"_parent");this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){const o=this.indexOf(t);this.splice(o,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){const t=this.indexOf(e);t>=0&&this.splice(t,1)}}function Es(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Fs=Es()||!1,Ae={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Br(r){return Ns(r)&&r.debug}function Ze(r,n,...e){Fs&&(Ae.debug||Br(n)||Br(e[0]))&&console.log(r,n,...e)}function vt(r){return typeof r=="function"}function Ns(r){return typeof r=="object"}function un(r){return Array.isArray(r)}function Ls(r){return typeof r=="string"}function Ms(r){return typeof r=="number"}function zs(r){return Number.isInteger(r)}function Ps(r,n){for(const e of n)if(e in r)return!0;return!1}function Ro(r,n={}){if(un(r))r.forEach(e=>{Ro(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class kr extends Array{constructor(e,t={}){var n=(...ld)=>(super(...ld),h(this,"onChange"),this);return un(t)?n(...t):Ls(t)?n(t):n(...Object.entries(t).filter(([o,i])=>i).map(([o])=>o)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){const t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}function Ds(r){const n=[];for(let p=0;pp+(m[i]||0),0));const A=y&&w?p=>{w==="flexStart"?p[u]=0:w==="center"?p[u]=(y-(p[s]||0))/2:w==="flexEnd"&&(p[u]=y-(p[s]||0))}:p=>p;if(x==="flexStart"){let p=0;if(n.forEach(m=>{m[d]=p+(m[a]||0),p+=(m[i]||0)+b+(m[a]||0)+(m[c]||0),A(m)}),r._autosized){const m=p-b;if(m!==r[i])return r[i]=m,!0}}else if(x==="flexEnd"){let p=g;for(let m=e-1;m>=0;m--){const v=n[m];F(v),v[d]=p-(v[i]||0)-(v[c]||0),p-=(v[i]||0)+b+(v[a]||0)+(v[c]||0),A(v)}}else if(x==="center"){let p=(g-(S+b*(e-1)))/2;n.forEach(m=>{m[d]=p,p+=(m[i]||0)+b,A(m)})}else if(x==="spaceBetween"){const p=(g-S)/(e-1);let m=0;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}else if(x==="spaceEvenly"){const p=(g-S)/(e+1);let m=p;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}return!1}const[lr,Qn]=U(void 0),{animationSettings:Os}=Ae;function Er(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return ar("DynamicShader",{effects:n})}function wt(r=""){return{set(n){Ms(n)&&(n={width:n,color:255}),this.effects={...this.effects||{},["border".concat(r)]:n},this["_border".concat(r)]=n},get(){return this["_border".concat(r)]}}}const Us=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],Ws=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class we extends Object{constructor(e){super();h(this,"id");h(this,"debug");h(this,"name");h(this,"lng");h(this,"renderer");h(this,"selected");h(this,"rendered");h(this,"autofocus");h(this,"flexItem");h(this,"_queueDelete");h(this,"forwardFocus");h(this,"_undoStyles");h(this,"_renderProps");h(this,"_effects");h(this,"_parent");h(this,"_shader");h(this,"_style");h(this,"_states");h(this,"_events");h(this,"_animationSettings");h(this,"_width");h(this,"_height");h(this,"_color");h(this,"_borderRadius");h(this,"_border");h(this,"_borderLeft");h(this,"_borderRight");h(this,"_borderTop");h(this,"_borderBottom");h(this,"_autosized");h(this,"_isDirty");h(this,"_animationQueue",[]);h(this,"_animationQueueSettings");h(this,"_animationRunning",!1);h(this,"children");this.name=e,this.rendered=!1,this.autofocus=!1,this._renderProps={x:0,y:0},this.children=new ks(this)}get effects(){return this._effects}set effects(e){this._effects=e,this.rendered&&(this.shader=Er(e))}get parent(){return this._parent}set parent(e){var t;this._parent=e,this.rendered&&this.lng&&(this.lng.parent=(t=e==null?void 0:e.lng)!=null?t:null)}get shader(){return this._shader}set shader(e){un(e)?this._shader=ar(...e):this._shader=e,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(e,t){if(this.lng){if(Ae.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[e])){const o=this.transition===!0||this.transition[e]===!0?void 0:this.transition[e];return this.animate({[e]:t},o).start()}this.lng[e]=t}else this._renderProps[e]=t}_sendToLightning(e,t){this.rendered&&this.lng?this.lng[e]=t:this._renderProps[e]=t}animate(e,t){return F(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}chain(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}async start(){let e=this._animationQueue.shift();for(;e;)this._animationRunning=!0,await this.animate(e.props,e.animationSettings).start().waitUntilStopped(),e=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.rendered){if(this.forwardFocus!==void 0)if(vt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const e=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(e!==null&&eQn(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(e,t)=>{if(t.type==="text"){const{dimensions:o}=t;this.parent.updateLayout(this,o)}})}getText(){return this.children.map(e=>e.text).join("")}destroy(){var e;this._queueDelete&&((e=this.lng)==null||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){un(e)?this._style=Ro(e):this._style=e;for(const t in this._style)this[t]===void 0&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find(t=>t.id===e)}searchChildrenById(e){for(const t of this.children){if(t.id===e)return t;if(t instanceof we){const o=t.searchChildrenById(e);if(o)return o}}}set states(e){this._states=new kr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new kr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Os}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){var o;this.hasChildren&&(Ze("Layout: ",this),vt(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),this.display==="flex"&&Ds(this)&&((o=this.parent)==null||o.updateLayout()),vt(this.onLayout)&&this.onLayout.call(this,e,t))}_stateChanged(){if(Ze("State Changed: ",this,this.states),this.forwardStates){const t=this.states.slice();this.children.forEach(o=>o.states=t)}const e=this.states;if(this._undoStyles||this.style&&Ps(this.style,e)){this._undoStyles=this._undoStyles||[];const t={};this._undoStyles.forEach(i=>{t[i]=this.style[i]});const o=e.reduce((i,s)=>{const a=this.style[s];return a&&(i={...i,...a}),i},{});this._undoStyles=Object.keys(o),o.transition!==void 0&&(this.transition=o.transition),Object.assign(this,{...t,...o})}}render(){const e=this,t=this.parent;if(!t){console.warn("Parent not set - no node created for: ",this);return}if(!t.rendered){console.warn("Parent not rendered yet: ",this);return}if(this.rendered){console.warn("Node already rendered: ",this);return}t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();let o=e._renderProps;t.lng&&(o.parent=t.lng),e._effects&&(this.shader=Er(e._effects)),e.isTextNode()?(o={...Ae.fontSettings,...o,text:e.getText()},o.contain&&(o.width||(o.width=(t.width||0)-(o.x||0)-(o.marginRight||0),e._width=o.width,e._autosized=!0),o.contain==="both"&&!o.height&&!o.maxLines&&(o.height=(t.height||0)-(o.y||0)-(o.marginBottom||0),e._height=o.height,e._autosized=!0)),Ze("Rendering: ",this,o),e.lng=Le.createTextNode(o),vt(e.onLoad)&&e.lng.on("loaded",e.onLoad),(!e.width||!e.height)&&(e._autosized=!0,e._resizeOnTextLoad())):(o.texture||(isNaN(o.width)&&(o.width=(t.width||0)-(o.x||0),e._width=o.width,e._autosized=!0),isNaN(o.height)&&(o.height=(t.height||0)-(o.y||0),e._height=o.height,e._autosized=!0),!o.color&&!o.src&&(e._color=o.color=0)),Ze("Rendering: ",this,o),e.lng=Le.createNode(o),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,vt(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach(([i,s])=>{var a;(a=e.lng)==null||a.on(i,(c,d)=>s(e,d))}),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,e.name!=="text"&&e.children.forEach(i=>{i.render?i.render():i.text!==""&&console.warn("TextNode outside of : ",i)}),e.autofocus&&e.setFocus()}}for(const r of Us)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightningAnimatable(r,n)}});for(const r of Ws)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightning(r,n)}});Object.defineProperties(we.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:wt(),borderLeft:wt("Left"),borderRight:wt("Right"),borderTop:wt("Top"),borderBottom:wt("Bottom")});Object.defineProperties(we.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const N=r=>(()=>{var n=Pt("text");return An(n,r,!1),n})(),M=r=>(()=>{var n=Pt("node");return An(n,r,!1),n})();function Ys({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(p,m,v,T){if(v!==void 0&&!T&&(T=[]),typeof m!="function")return g(p,m,T,v);_e(R=>g(p,m(),R,v),T)}function g(p,m,v,T,R){for(;typeof v=="function";)v=v();if(m===v)return v;const I=typeof m,C=T!==void 0;if(I==="string"||I==="number")if(I==="number"&&(m=m.toString()),C){let _=v[0];_&&e(_)?t(_,m):_=n(m),v=x(p,v,T,_)}else v!==""&&typeof v=="string"?t(c(p),v=m):(x(p,v,T,n(m)),v=m);else if(m==null||I==="boolean")v=x(p,v,T);else{if(I==="function")return _e(()=>{let _=m();for(;typeof _=="function";)_=_();v=g(p,_,v,T)}),()=>v;if(Array.isArray(m)){const _=[];if(y(_,m,R))return _e(()=>v=g(p,_,v,T,!0)),()=>v;if(_.length===0){const E=x(p,v,T);if(C)return v=E}else Array.isArray(v)?v.length===0?w(p,_,T):b(p,v,_):v==null||v===""?w(p,_):b(p,C&&v||[c(p)],_);v=_}else{if(Array.isArray(v)){if(C)return v=x(p,v,T,m);x(p,v,null,m)}else v==null||v===""||!c(p)?o(p,m):S(p,m,c(p));v=m}}return v}function y(p,m,v){let T=!1;for(let R=0,I=m.length;Rk-_){const W=m[C];for(;_=0;C--){const _=m[C];if(R!==_){const E=a(_)===p;!I&&!C?E?S(p,R,_):o(p,R,v):E&&i(p,_)}else I=!0}}else o(p,R,v);return[R]}function w(p,m,v){for(let T=0,R=m.length;Tv.children=g(p,m.children,v.children)),_e(()=>m.ref&&m.ref(p)),_e(()=>{for(const R in m){if(R==="children"||R==="ref")continue;const I=m[R];I!==v[R]&&(s(p,R,I,v[R]),v[R]=I)}}),v}return{render(p,m){let v;return ft(T=>{v=T,u(m,p())}),v},insert:u,spread(p,m,v){typeof m=="function"?_e(T=>A(p,m(),T,v)):A(p,m,void 0,v)},createElement:r,createTextNode:n,insertNode:o,setProp(p,m,v,T){return s(p,m,v,T),v},mergeProps:sr,effect:_e,memo:ne,createComponent:Io,use(p,m,v){return le(()=>p(m,v))}}}function $s(r){const n=Ys(r);return n.mergeProps=sr,n}const Hs={createElement(r){return new we(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){Ze("Replace Text: ",r,n),r.text=n;const e=r.parent;F(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){Ze("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof we?r.rendered&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){Ze("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof we&&queueMicrotask(()=>n.destroy())},getParentNode(r){return r.parent},getFirstChild(r){return r.children[0]},getNextSibling(r){const n=r.parent.children||[],e=n.indexOf(r)+1;if(er.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of r)a.listener({...s,from:a.location,retry:c=>{c&&(e=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:n,confirm:t}}let Kn;function cr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Kn=window.history.state._depth}cr();function Gs(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function qs(r,n){let e=!1;return()=>{const t=Kn;cr();const o=t==null?null:Kn-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const Zs=/^(?:[a-z0-9]+:)?\/\//i,Js=/^\/+|(\/)\/+$/g,No="http://sr";function Rt(r,n=!1){const e=r.replace(Js,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function on(r,n,e){if(Zs.test(n))return;const t=Rt(r),o=e&&Rt(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Rt(n,!i)}function ea(r,n){if(r==null)throw new Error(n);return r}function ta(r,n){return Rt(r).replace(/\/*(\*.*)?$/g,"")+Rt(n)}function Lo(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function na(r,n,e){const[t,o]=r.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return a=>{const c=a.split("/").filter(Boolean),d=c.length-s;if(d<0||d>0&&o===void 0&&!n)return null;const u={path:s?"":"/",params:{}},g=y=>e===void 0?void 0:e[y];for(let y=0;yt.localeCompare(r,void 0,{sensitivity:"base"})===0;return n===void 0?!0:typeof n=="string"?e(n):typeof n=="function"?n(r):Array.isArray(n)?n.some(e):n instanceof RegExp?n.test(r):!1}function ra(r){const[n,e]=r.pattern.split("/*",2),t=n.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function Mo(r){const n=new Map,e=Mt();return new Proxy({},{get(t,o){return n.has(o)||vo(e,()=>n.set(o,ne(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function zo(r){let n=/(\/?\:[^\/]+)\?/.exec(r);if(!n)return[r];let e=r.slice(0,n.index),t=r.slice(n.index+n[0].length);const o=[e,e+=n[1]];for(;n=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=n[1]),t=t.slice(n[0].length);return zo(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const oa=100,Po=wo(),Do=wo(),Oo=()=>ea(bo(Po)," and 'use' router primitives can be only used inside a Route."),mt=()=>Oo().navigatorFactory(),dr=()=>Oo().params;function ia(r,n=""){const{component:e,load:t,children:o,info:i}=r,s=!o||Array.isArray(o)&&!o.length,a={key:r,component:e,load:t,info:i};return Uo(r.path).reduce((c,d)=>{for(const u of zo(d)){const g=ta(n,u);let y=s?g:g.split("/*",1)[0];y=y.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:u,pattern:y,matcher:na(y,!s,r.matchFilters)})}return c},[])}function sa(r,n=0){return{routes:r,score:ra(r[r.length-1])*1e4-n,matcher(e){const t=[];for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function Uo(r){return Array.isArray(r)?r:[r]}function Wo(r,n="",e=[],t=[]){const o=Uo(r);for(let i=0,s=o.length;is.score-i.score)}function Nr(r,n){for(let e=0,t=r.length;e{const d=r();try{return new URL(d,e)}catch(u){return console.error("Invalid path ".concat(d)),c}},e,{equals:(c,d)=>c.href===d.href}),o=ne(()=>t().pathname),i=ne(()=>t().search,!0),s=ne(()=>t().hash),a=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return n()},get key(){return a()},query:Mo(He(i,()=>Lo(t())))}}let We;function la(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(k=>k),c=s.renderPath||(k=>k),d=s.beforeLeave||Fo(),u=on("",t.base||"");if(u===void 0)throw new Error("".concat(u," is not a valid base path"));u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[g,y]=U(!1),b=async k=>{y(!0);try{await xs(k)}finally{y(!1)}},[x,w]=U(o().value),[S,A]=U(o().state),p=aa(x,S),m=[],v=U([]),T=ne(()=>Nr(n(),p.pathname)),R=Mo(()=>{const k=T(),z={};for(let O=0;Ou,outlet:()=>null,resolvePath(k){return on(u,k)}};return _e(()=>{const{value:k,state:z}=o();le(()=>{k!==x()&&b(()=>{We="native",w(k),A(z),v[1]([])}).then(()=>{We=void 0})})}),{base:I,location:p,params:R,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:T,beforeLeave:d,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:v};function C(k,z,O){le(()=>{if(typeof z=="number"){z&&(s.go?s.go(z):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:W,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},te=W?k.resolvePath(z):on("",z);if(te===void 0)throw new Error("Path '".concat(z,"' is not a routable path"));if(m.length>=oa)throw new Error("Too many redirects");const de=x();if((te!==de||se!==S())&&!Vs){if(d.confirm(te,O)){const Ce=m.push({value:de,replace:D,scroll:j,state:S()});b(()=>{We="navigate",w(te),A(se),v[1]([])}).then(()=>{m.length===Ce&&(We=void 0,E({value:te,state:se}))})}}})}function _(k){return k=k||bo(Do)||I,(z,O)=>C(k,z,O)}function E(k){const z=m[0];z&&((k.value!==z.value||k.state!==z.state)&&i({...k,replace:z.replace,scroll:z.scroll}),m.length=0)}function P(k,z){const O=Nr(n(),k.pathname),D=We;We="preload";for(let W in O){const{route:j,params:se}=O[W];j.component&&j.component.preload&&j.component.preload();const{load:te}=j;z&&te&&vo(e(),()=>te({params:se,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:Lo(k),state:null,key:""},intent:"preload"}))}We=D}}function ca(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:d}=t().route,u=ne(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:We||"initial"}):void 0;return{parent:n,pattern:a,path:u,outlet:()=>c?Io(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(b){return on(o.path(),b,u())}}}const da=r=>n=>{const{base:e}=n,t=wn(()=>n.children),o=ne(()=>Wo(t(),n.base||""));let i;const s=la(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(Po.Provider,{value:s,get children(){return l(ha,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[pt(()=>(i=Mt())&&null),l(ua,{routerState:s,get branches(){return o()}})]}})}})};function ha(r){const n=r.routerState.location,e=r.routerState.params,t=ne(()=>r.load&&le(()=>r.load({params:e,location:n,intent:"preload"})));return l(Be,{get when(){return r.root},keyed:!0,get fallback(){return r.children},children:o=>l(o,{params:e,location:n,get data(){return t()},get children(){return r.children}})})}function ua(r){const n=[];let e;const t=ne(He(r.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const c=[];for(let d=0,u=o.length;d{n[d]=b,c[d]=ca(r.routerState,c[d-1]||r.routerState.base,Lr(()=>t()[d+1]),()=>r.routerState.matches()[d])}))}return n.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Lr(()=>t()&&e)()}const Lr=r=>()=>l(Be,{get when(){return r()},keyed:!0,children:n=>l(Do.Provider,{value:n,get children(){return n.outlet()}})}),ue=r=>{const n=wn(()=>r.children);return sr(r,{get children(){return n()}})};function fa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function ga(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function pa(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=fa(U(e(r.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!n&&r.set(o),o));return r.init&&Me(r.init((o=r.get())=>{n=!0,t[1](e(o)),n=!1})),da({signal:t,create:r.create,utils:r.utils})}function ma(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function xa(r,n){const e=ga("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const ya=new Map;function va(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(x){return x.namespaceURI==="http://www.w3.org/2000/svg"}function c(x){if(x.defaultPrevented||x.button!==0||x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)return;const w=x.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!w||n&&!w.hasAttribute("link"))return;const S=a(w),A=S?w.href.baseVal:w.href;if((S?w.target.baseVal:w.target)||!A&&!w.hasAttribute("state"))return;const m=(w.getAttribute("rel")||"").split(/\s+/);if(w.hasAttribute("download")||m&&m.includes("external"))return;const v=S?new URL(A,document.baseURI):new URL(A);if(!(v.origin!==window.location.origin||o&&v.pathname&&!v.pathname.toLowerCase().startsWith(o.toLowerCase())))return[w,v]}function d(x){const w=c(x);if(!w)return;const[S,A]=w,p=t.parsePath(A.pathname+A.search+A.hash),m=S.getAttribute("state");x.preventDefault(),i(p,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:m&&JSON.parse(m)})}function u(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||t.preloadRoute(A,S.getAttribute("preload")!=="false")}function g(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,S.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function y(x){const w=c(x);if(!w)return;const[,S]=w;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function b(x){let w=x.submitter&&x.submitter.hasAttribute("formaction")?x.submitter.getAttribute("formaction"):x.target.getAttribute("action");if(!w)return;if(!w.startsWith("https://action/")){const A=new URL(w,No);if(w=t.parsePath(A.pathname+A.search),!w.startsWith(e))return}if(x.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=ya.get(w);if(S){x.preventDefault();const A=new FormData(x.target);x.submitter&&x.submitter.name&&A.append(x.submitter.name,x.submitter.value),S.call({r:t,f:x.target},A)}}Ks(["click","submit"]),document.addEventListener("click",d),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",y),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",b),Me(()=>{document.removeEventListener("click",d),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",y),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",b)})}}function wa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function ba(r){const n=()=>window.location.hash.slice(1),e=Fo();return pa({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Gs(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";xa(c,i),cr()},init:t=>ma(window,"hashchange",qs(t,o=>!e.confirm(o&&o<0?o:n()))),create:va(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:wa,beforeLeave:e}})(r)}var Sa=!!Rs,Aa=Sa?r=>Mt()?Me(r):r:Me;function Ca(r,n,e,t){return r.addEventListener(n,e,t),Aa(r.removeEventListener.bind(r,n,e,t))}function Ta(r,n=Mt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||ft(i=>t=r(o=i),n),t)}var _a=Ta(()=>{const[r,n]=U(null);return Ca(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function Gt(r){return typeof r=="function"}function Ia(r){return Array.isArray(r)}const qt={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[fn,Ra]=U([]),Ba=r=>{const n=_a();if(r)for(const[e,t]of Object.entries(r))Ia(t)?t.forEach(o=>{qt[o]=e}):qt[t]=e;return $e(He(lr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Gt(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(a=>{s.includes(a)||(a.states.remove("focus"),Gt(a.onBlur)&&a.onBlur.call(a,e,t))}),Ra(s),s},{defer:!0})),$e(()=>{const e=n();if(e){const t=qt[e.key]||qt[e.keyCode];le(()=>{const o=fn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Gt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Gt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),fn};function Yo(r,n){const e=n();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,r.onBeforeLayout=(a,c)=>{if(c){r.width=r.children.reduce((g,y)=>g+(y.width||0),0)+o+i;const d=r.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;r.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),r.height=u+t+s}}}function ka(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function Ea(r,n,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(r);s.lang=e,s.onend=()=>{o()},s.onerror=a=>{i(a)},n.push(s),t.speak(s)})}function Xn(r,n,e=!0){const t=window.speechSynthesis,o=ka(Array.isArray(r)?r:[r]),i=[],s=[];let a=!0;return{series:(async()=>{try{for(;a&&o.length;){const d=await Promise.resolve(o.shift());if(a){if(typeof d=="string"&&d.includes("PAUSE-")){let u=Number(d.split("PAUSE-")[1])*1e3;isNaN(u)&&(u=0),await Mr(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Ea(d,s,n),g=0}catch(y){if(y instanceof SpeechSynthesisErrorEvent)if(y.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Mr(500*(3-g));else if(y.error==="canceled"||y.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(y.error));else throw y}}else if(typeof d=="function"){const u=Xn(d(),n,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Xn(d,n,!1);i.push(u),await u.series}}else break}}finally{a=!1}})(),get active(){return a},append:d=>{o.push(d)},cancel:()=>{a&&(e&&t.cancel(),i.forEach(d=>{d.cancel()}),a=!1)}}}let Zt;function Fa(r,n="en-US"){return Zt&&Zt.cancel(),Zt=Xn(r,n),Zt}var hr=(r,n)=>{let e;const t=()=>clearTimeout(e);return Mt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let Vn,Bt=[],Te,Gn=!1;const Na=3e5;function zr(r,n){const e=hr(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function bt(r){return r.id||r.name}function La(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Bt.includes(i));if(Vn(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Bt=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([bt(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([bt(s),"Title",s.title]),t.push(s.title)):i.push([bt(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([bt(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([bt(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ma(r){if(!Gn)return Te=Fa(r)}const oe={debug:!1,enabled:!0,cancel:function(){Te&&Te.cancel()},clearPrevFocus:function(r=0){Bt=Bt.slice(0,r),Vn()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&Te&&Te.active?Te.append(r):(oe.cancel(),Ma(r)),e&&(Gn=!0,Te==null||Te.series.finally(()=>{Gn=!1,oe.refresh()}).catch(console.error))),Te},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(le(()=>fn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=Na}={}){oe.onFocusChange=zr(La,r),Vn=zr(()=>{Bt=[]},n)}},za=()=>(oe.setupTimers(),$e(He(fn,oe.onFocusChange,{defer:!0})),oe);function Pa(r,n){const e=Le.createTexture("ImageTexture",{src:r});return n.reduce((t,o)=>{const{x:i,y:s,width:a,height:c}=o;return t[o.name]=Le.createTexture("SubTexture",{texture:e,x:i,y:s,width:a,height:c}),t},{})}const[Da,Ee]=U(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGoh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L50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgCoBAu/CeBhzsJ/kORZTtuNN5Nk70bXAZ0Hy59G8qIawVoB6LMAnu8suE3tH0/y3077NAMg6esAuoaoC0la7M2d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RCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Oa(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(d){if(d.startsWith("#")){r.color=L(d),r.src="",r.alpha=1,t=1,n.alpha=0,e.alpha=0;return}else r.color=4294967295,e.alpha=1;if(t===0){r.src=d,t=1;return}if(t===1){n.src=d,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=d,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}const c=hr(a,400);return $e(He(Da,d=>{c(d)},{defer:!0})),l(M,{width:1920,height:1080,zIndex:-5,get children(){return[l(M,{ref(d){var u=r;typeof u=="function"?u(d):r=d},style:s}),l(M,{ref(d){var u=n;typeof u=="function"?u(d):n=d},style:s,alpha:0}),l(M,{ref(d){var u=e;typeof u=="function"?u(d):e=d},src:"./assets/hero-mask-inverted.png",get color(){return L(f.color.materialBrand)},width:1920,height:1080})]}})}var Pr,Dr,Or,Ur,Wr,Yr,$r,Hr,jr,Qr,Kr,Xr,Vr,Gr,qr,Zr;const Ua=["focus","disabled"],Wa=["brand","inverse","neutral"];function Y({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=Ua,toneKeys:s=Wa},a=!1){const c=(x,w,S)=>{const A=s.map(p=>{var T,R;const m={};return new Set([].concat.apply([],[(T=x==null?void 0:x[p])!=null?T:{},(R=w==null?void 0:w[p])!=null?R:{}].map(Object.keys))).forEach(I=>{var E;var C,_;i.includes(I)||(m[I]=(E=(C=w==null?void 0:w[p])==null?void 0:C[I])!=null?E:(_=x==null?void 0:x[p])==null?void 0:_[I])}),i.forEach(I=>{var C,_;m[I]={...S[I],...(C=x==null?void 0:x[p])==null?void 0:C[I],...(_=w==null?void 0:w[p])==null?void 0:_[I]}}),[p,m]});return Object.fromEntries(A)},d=(x,w)=>{const S=i.map(p=>[p,{...x==null?void 0:x[p],...w==null?void 0:w[p]}]);return Object.fromEntries(S)},u=(x,w)=>({...x,...w.base}),g=x=>Object.fromEntries(Object.entries(r).filter(([w,S])=>x[S]).map(([w,S])=>[w,x[S]])),y=x=>Object.fromEntries(Object.entries(x).map(([S,A])=>{const p=g(A);return Object.entries(A).filter(([m,v])=>i.includes(m)).forEach(([m,v])=>{p[m]=g(v)}),[S,p]}));return((x,w,S)=>{const A=y(o);a&&console.log(A);const p=u(x,A);a&&console.log(p);const m=d(w,A);a&&console.log(m);const v=c(S,A,m);return a&&console.log(v),{base:{...p,...m},tones:v}})(n,e,t)}function $o(r=0){return(n,e,t,o)=>{if(n.children.length===0)return;const i=n.gap||0,s=n.scroll||"auto",[a,c]=Ya(n),d=n.flexDirection==="row"?n.x:n.y,u=n.flexDirection==="row"?e.x:e.y,g=n.flexDirection==="row"?e.width:e.height,y=t>o?"positive":"negative";let b=d;s==="auto"?n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(y==="positive"?b=d-g-i:b=d+g+i):(Math.abs(d)+cu?b=-u+r:s==="edge"&&y==="positive"&&Math.abs(d)+c{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return function(...e){for(const t of n)if(t.apply(this,e)===!0)return!0}};function Ho(){if(!this||this.selected===void 0||this.children.length===0)return!1;let r=this.children[this.selected];for(;r!=null&&r.skipFocus;)this.selected++,r=this.children[this.selected];if(!(r instanceof we))return!1;r.setFocus()}function gn(r){return function(){var n,e;const t=this.children.length,o=this.wrap,i=this.selected||0;if(t===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%t+1,this.selected>=t){if(!o){this.selected=void 0;break}this.selected=0}while((n=this.children[this.selected])!=null&&n.skipFocus);else if(r==="left"||r==="up")do if(this.selected=(this.selected||0)%t-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=t-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;const s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&i!==void 0){const c=this.children[i].selected||0;s.selected=c{const n=gn("up"),e=gn("down");return l(M,Q(r,{get onUp(){return gt(r.onUp,n)},get onDown(){return gt(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.y):void 0)},get style(){var t;return[...[r.style].flat(),Nn.Container.tones[(t=r.tone)!=null?t:Nn.tone],Nn.Container.base]}}))},{Label:{defaultTone:Zc,...Qo}={styles:{}}}=($r=f)==null?void 0:$r.componentConfig,il={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:Qo},sl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:Qo};Y(il);Y(sl);const{Rating:{styles:gr,defaultTone:Jc}={styles:{},defaultTone:"neutral"}}=(Hr=f)==null?void 0:Hr.componentConfig,al={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:gr},ll={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:gr},cl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:gr};Y(al);Y(cl);Y(ll);const{Details:{defaultTone:ed,...Ko}={styles:{}}}=(jr=f)==null?void 0:jr.componentConfig,dl={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:Ko},hl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:Ko};Y(dl);Y(hl);const{Metadata:{defaultTone:td,...pr}={styles:{}}}=(Qr=f)==null?void 0:Qr.componentConfig,ul={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:pr},fl={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:pr},gl={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:pr};Y(ul);Y(gl);Y(fl);const{ProgressBar:{defaultTone:nd,...Xo}={styles:{}}}=(Kr=f)==null?void 0:Kr.componentConfig,pl={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:Xo},ml={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Xo};Y(pl);Y(ml);const{Row:{defaultTone:xl,...yl}={styles:{}}}=(Xr=f)==null?void 0:Xr.componentConfig,vl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:f.layout.gutterX,width:f.layout.screenW,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:yl},wl=Y(vl),St={tone:xl,Container:wl},G=r=>{const n=gn("left"),e=gn("right");return l(M,Q(r,{get selected(){return r.selected||0},get onLeft(){return gt(r.onLeft,n)},get onRight(){return gt(r.onRight,e)},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:St.tone},get style(){return[...[r.style].flat(),St.Container.tones[r.tone||St.tone],St.Container.base]},get states(){var t;return(t=r.tone)!=null?t:St.tone}}))},{Keyboard:{defaultTone:rd,...mr}={styles:{}}}=(Vr=f)==null?void 0:Vr.componentConfig,bl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:mr},Sl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:mr},Al={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:mr};Y(bl);Y(Sl);Y(Al);const{Key:{defaultTone:od,...Vo}={styles:{}}}=(Gr=f)==null?void 0:Gr.componentConfig,Cl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:Vo},Tl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:Vo};Y(Cl);Y(Tl);const{Tile:{defaultTone:id,...Cn}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,{Surface:{defaultSurfaceTone:sd,..._l}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,Il={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{..._l,...Cn}},Rl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cn},Bl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cn},kl={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Cn};Y(Il);Y(Rl);Y(Bl);Y(kl);const qn={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:L("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:L("#424242")},active:{width:328,height:70}}},El="/solid-demo-app/",Fl=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Nl(r){const n=Pa(El+"assets/icons_white.png",Fl);return l(M,Q(r,{get texture(){return n[r.name]},get width(){return n[r.name].props.width},get height(){return n[r.name].props.height},get x(){return(100-(n[r.name].props.width||0))/2},get y(){return(100-(n[r.name].props.height||0))/2}}))}function Jt(r){return l(M,Q(r,{forwardStates:!0,get style(){return qn.NavButton},get children(){return[l(M,{y:-16,get children(){return l(Nl,{scale:.5,get name(){return r.icon}})}}),l(N,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}}},get children(){return r.children}})]}}))}function Ll(r){let n;const e=mt();function t(){n.states.add("focus"),this.children.forEach(i=>i.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(i=>i.states.remove("active"))}return[l(ee,Q(r,{onFocus:t,onBlur:o,get style(){return qn.Column},scroll:"none",get children(){return[l(Jt,{onEnter:()=>e("/browse/all"),icon:"trending",children:"Trending"}),l(Jt,{icon:"movie",onEnter:()=>e("/browse/movie"),children:"Movies"}),l(Jt,{icon:"tv",onEnter:()=>e("/browse/tv"),children:"TV"}),l(Jt,{icon:"experiment",onEnter:()=>e("/examples"),children:"Examples"})]}})),l(M,{ref(i){var s=n;typeof s=="function"?s(i):n=i},get style(){return qn.Gradient}})]}const Ml={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},en={x:10,fontSize:36,textColor:L("#ffffff")},tn={fontSize:36,textColor:L("#ffffff")},[zl,Pl]=U(0),[Dl,Ol]=U(0),[Ul,Go]=U(99),[Wl,Yl]=U(0);let Zn=0,Jn=0;const $l=hr(()=>{Jn=0,Zn=0,Go(99)},1e4),Hl=r=>{r&&(Pl(r),Go(n=>Math.min(r,n)),Yl(n=>Math.max(r,n)),Jn+=r,Zn++,Ol(Math.round(Jn/Zn)),$l())};function jl(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&Hl(t)})}const Ql=r=>l(M,Q(r,{style:Ml,get children(){return[l(M,{get children(){return[l(N,{style:en,children:"FPS:"}),l(N,{style:tn,x:94,get children(){return zl().toString()}})]}}),l(M,{x:160,get children(){return[l(N,{style:en,children:"AVG:"}),l(N,{style:tn,x:104,get children(){return Dl().toString()}})]}}),l(M,{x:0,y:40,get children(){return[l(N,{style:en,children:"MIN:"}),l(N,{style:tn,x:94,get children(){return Ul().toString()}})]}}),l(M,{x:160,y:40,get children(){return[l(N,{style:en,children:"MAX:"}),l(N,{style:tn,x:104,get children(){return Wl().toString()}})]}})]}})),Kl=r=>{Ba({Announcer:"a",Menu:"m",Escape:"Escape"});const n=za();n.enabled=!1;const e=mt();let t,o;return je(()=>{jl({renderer:Le})}),l(M,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onLeft:()=>{if(t.states.has("focus"))return!1;o=lr(),t.setFocus()},onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(Oa,{}),l(Ql,{}),pt(()=>r.children),l(Ll,{ref(i){var s=t;typeof s=="function"?s(i):t=i}})]}})},fe={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:L("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:L("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:L("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:L("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:L("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:1500,height:400}},pn={width:120,height:40,color:L("#000000"),borderRadius:8,border:{width:2,color:L("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:L("#333333")}},transition:{scale:!0,color:!0}},Xl={color:L("#00A699"),height:8,y:2,x:-4,width:pn.width+8},Vl={fontSize:12,y:12,contain:"width",textAlign:"center",color:L("#F6F6F9"),height:pn.height,width:pn.width},mn={container:pn,topBar:Xl,text:Vl},Jr={width:386,height:136,color:L("#715cab"),focus:{color:L("#5a39a2")},disabled:{color:L("#291d43")}},Gl={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:L("#FFFFFF"),height:Jr.height,width:Jr.width,focus:{fontSize:40},disabled:{color:L("#909090")}};function ql(r){return l(M,Q(r,{get style(){return fe.Thumbnail}}))}function xn(r){const[n,e]=_s(r,["items"]);return l(G,Q(e,{get style(){return fe.Row},get children(){return l(Sn,{get each(){return n.items},children:t=>l(ql,t)})}}))}function Zl(r){return l(M,Q(r,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return r.children}})}}))}const Jl="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",ec="https://api.themoviedb.org/3";let qo,Zo;const tc="w185",nc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Jl}};function kt(r,n=tc){return Zo+n+r}function rc(r,n={}){return qo?er(r,n):Jo().then(()=>er(r,n))}function er(r,n={}){return fetch(ec+r,{...nc,...n}).then(e=>e.json())}function Jo(){return er("/configuration").then(r=>{var n;return qo=r,Zo=(n=r.images)==null?void 0:n.secure_base_url,r})}const tt={get:rc,loadConfig:Jo};function oc(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function ic(r,n=7){let e=[];for(let t=0,o=r.length;t({src:kt(n.poster_path||n.profile_path),tileSrc:kt(n.backdrop_path||n.profile_path,"w300"),backdrop:kt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:oc(n.title||n.name,30),title:n.title||n.name,data:n,entityInfo:{type:n.media_type||"people",id:n.id},heroContent:{title:n.title||n.name,description:n.overview}}))}let Ln=new Map;const nn=new Map;function sc(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Ln.has(e))return Ln.get(e);let t=tt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(nn.has(r)?nn.get(r):[]).concat(Nt(i)),a=ic(s);return a[a.length-1].length<7?nn.set(r,a.pop()):nn.delete(r),a});return Ln.set(e,t),t}}function ac(r){const[n,e]=U([]),[t,o]=U(1),[i,s]=U(!1),[a]=et(t,r);return $n(()=>{const c=a();c&&ms(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Tn=1100,lc={...f.typography.display2,width:Tn,height:58,contain:"both"},cc=r=>l(N,Q(r,{style:lc,get children(){return r.children}})),dc={...f.typography.body1,width:Tn,height:72,contain:"both"},hc={fontSize:20,lineHeight:20},uc=r=>l(N,Q(r,{style:dc,get children(){return r.children}}));function fc(r){return[l(Be,{get when(){return(r==null?void 0:r.rtCrit)&&(r==null?void 0:r.rtCrit)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtCrit+"%"}})]}}),l(Be,{get when(){return(r==null?void 0:r.rtFan)&&(r==null?void 0:r.rtFan)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtFan+"%"}})]}})]}const gc=r=>(()=>{var n=Pt("node");return Eo(Yo,n,()=>[8,15,13,15]),An(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),ko(n,l(N,{style:hc,get children(){return r.children}})),n})(),tr=f.typography.body2,pc=r=>l(M,{style:{display:"flex",flexDirection:"row",gap:12,width:Tn,height:48},get children(){return[l(N,{style:tr,get children(){return r.metaText}}),l(Sn,{get each(){return r.badges},children:n=>l(gc,{y:-5,children:n})}),pt(()=>fc(r.reviews))]}}),ei=r=>l(M,Q(r,{style:{display:"flex",flexDirection:"column",width:Tn,height:160,gap:16},get children(){return[l(cc,{get children(){return r.title}}),l(uc,{get children(){return r.description}}),l(pc,{get metaText(){return r.metaText},get badges(){return r.badges},get reviews(){return r.reviews}})]}}));function mc(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"m"}function eo(r){return r.split("-")[0]}function xc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?Nt(e.slice(0,7)):tt.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>Nt(t.slice(0,7))))}function yc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>Nt(e.slice(0,7)))}function ti({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return tt.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:kt(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:r==="movie"?mc(t.runtime)+" - "+t.release_date:"".concat(eo(t.first_air_date)," - ").concat(eo(t.last_air_date)),reviews:e},...t}))}const to=()=>{const r=dr(),[n,e]=U(0),[t,o]=U();et(t,ti);const[i,s]=U({}),a=mt(),c=yo(()=>0),d=ne(()=>ac(sc(r.filter||"all")));$e(He(lr,y=>{y.backdrop&&Ee(y.backdrop),y.heroContent&&s(y.heroContent)},{defer:!0}));function u(){var b;(b=this.children.selected)==null||b.setFocus(),e((this.y||0)*-1+24);let y=d().pages().length;(y===0||this.parent.selected&&this.parent.selected>=y-2)&&d().setPage(x=>x+1)}function g(){let y=this.children.selected;F(y&&y.href),a(y.href)}return l(Be,{get when(){return d().pages().length},get children(){return[l(ei,Q({y:360,x:150},i)),l(M,{clipping:!0,get style(){return fe.itemsContainer},get children(){return l(ee,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return fe.Column},get children(){return l(Sn,{get each(){return d().pages()},children:(y,b)=>l(xn,{get autofocus(){return c(b())},items:y,onFocus:u,onEnter:g})})}})}})]}})},vc=()=>{const r=mt(),n=yo(()=>0);function e(){let c=this.children.selected;F(c&&c.id),r("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(c){const d={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[u,g]=U(4294967295);return l(M,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(M,{x:30,get children(){return[l(N,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(N,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(N,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=U(140);function a(c){s(c.selected*-400+140)}return l(M,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(M,{x:120,get children(){return[l(M,{src:"/assets/solidjs.png",width:101,height:90,y:40}),l(N,{fontSize:90,x:110,y:40,children:"Examples"}),l(M,{y:140,height:1,width:1800,color:3906468351})]}}),l(G,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return fe.Row},justifyContent:"flexStart",gap:40,get children(){return l(Sn,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return n(d())},get index(){return d()}},c))})}})]}})},wc=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return je(()=>{Ee("#000000")}),l(M,{autofocus:!0,style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(N,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),l(M,{style:n,get children(){return[l(N,{style:o,children:"Subline Text"}),l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"}),l(N,{style:o,children:"More Text"})]}})]}})},bc=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={fontSize:26};let o,i;je(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=U(),[c,d]=U();setTimeout(()=>{var A;a("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:L("#0000ff")},g={color:L("#f54242"),focus:{color:L("#4287f5")}};function y(A){const p=wn(()=>A.children);return l(M,Q(A,{get style(){return[g,A.style,[u]]},get children(){return[l(M,{id:"child1",width:100,height:100,get color(){return L("#ff0000")},y:25,get children(){return[pt(()=>p()),l(M,{id:"subChild",x:150,width:100,height:100,get color(){return L("#00ff00")}}),l(N,{get children(){return A.title}})]}}),l(M,{width:100,height:100,get color(){return L("#ffff00")},y:175,get children(){return p()}})]}}))}const b={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},x={color:L("#cccccc"),focus:{color:L("#000000")}},w={color:L("#ffffff"),focus:{color:L("#f6f6cc")}};function S(A){return console.log("Ref is available: ",A),!0}return l(M,{style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(M,{style:n,get children(){return[l(N,{get children(){return c()}}),l(N,{style:t,get children(){return["Sub ",pt(()=>s())," Text"]}}),l(Be,{get when(){return s()},get children(){return l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),l(N,{style:t,children:"More Text"})]}}),l(y,{autofocus:!0,ref(A){var p=i;typeof p=="function"?p(A):i=A},style:[w,x],get children(){return l(N,{children:"Child Test"})}}),l(M,{ref(A){var p=o;typeof p=="function"?p(A):o=A},style:b,width:100,height:100,get color(){return L("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.5}})]}})},Sc=()=>{let r,n;const[e,t]=U([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:L("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},i={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(c,d)=>Math.floor(Math.random()*(d-c+1)+c);je(()=>{Ee("#000000"),r.x=1820/2,r.y=980/2,n=setInterval(()=>{r.rotation=s(-90,90),r.x=s(-300,2220),r.y=s(-300,1380)},2500)});function a(c,d){t(u=>[...u,c].slice(-4)),console.log(c)}return Me(()=>{clearInterval(n)}),l(M,{get children(){return[l(N,{style:i,get children(){return e().join("\n")}}),l(M,{autofocus:!0,style:o,ref(c){var d=r;typeof d=="function"?d(c):r=c},onEvents:[["inBounds",c=>a("inBounds")],["outOfBounds",c=>a("outOfBounds")],["inViewport",c=>a("inViewport")],["outOfViewport",c=>a("outOfViewport")]]})]}})},Ac=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400};function e(o){return l(M,Q(o,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Pt("node");return Eo(Yo,i,()=>[10,15]),An(i,Q(o,{get style(){return{color:L("#000000be"),borderRadius:8,border:{width:2,color:L("#ffffff")}}}}),!0),ko(i,l(N,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(G,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(N,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(G,{x:100,gap:40,style:n,get children(){return[l(e,{autofocus:!0,onEnter:r,children:"TV Shows"}),l(e,{states:{active:!0,disabled:!1},children:"Movies"}),l(e,{states:"active",children:"Sports"}),l(e,{states:"disabled",children:"News"})]}})]},Cc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(M,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=U(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const s=50;return l(ee,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex Start - Margin Left"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{marginRight:100}),l(e,{}),l(e,{}),l(e,{marginRight:100})]}}),l(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},Tc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(M,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return l(ee,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start - AlignItems: center"}),l(G,{alignItems:"center",gap:a,style:r,onFocus:s,get children(){return[l(e,{autofocus:!0,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(G,{gap:a,alignItems:"flexStart",style:r,onFocus:s,get children(){return[l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(G,{gap:a,justifyContent:"flexEnd",alignItems:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}})]}}),l(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:a,justifyContent:"center",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:a,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:a,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}})]}})},_c=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:L("#1769aa")};return l(M,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=U(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const c=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:c,style:r,onFocus:a,get children(){return[l(ee,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,style:n,onFocus:a,alignItems:"flexStart",get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(ee,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Ic=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:L("#1769aa")};return l(M,Q(c,{style:d}))}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:a,style:r,onFocus:s,get children(){return[l(ee,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(ee,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Rc=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return l(M,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(N,{style:Gl,get children(){return i.children}})}}))}return l(G,{style:n,get children(){return[l(o,{autofocus:!0,onEnter:r,children:"Focused"}),l(o,{states:{active:!0,disabled:!1},children:"Normal"}),l(o,{states:"disabled",children:"Disabled"})]}})},Bc="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function kc(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?Ec():console.error("Browser not supported!")}async function Ec(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",Fc);try{await n.load(Bc),console.log("The video has now been loaded!")}catch(e){ni(e)}}function Fc(r){ni(r.detail)}function ni(r){console.error("Error code",r.code,"object",r)}function Nc(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function Lc(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",kc);const Mc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),ti),[t]=et(()=>({...r}),yc),[o]=et(()=>({...r}),xc),[i,s]=U(0);$e(He(e,A=>{Ee(A.backgroundImage)},{defer:!0}));const a=600,c={color:L("#000000"),alpha:0,width:1900,height:890,x:10,y:a,borderRadius:30};function d(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=a,w.y=a,w.alpha=0}function u(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=200,w.y=160,w.alpha=.9}function g(){let A=this.children.selected;F(A&&A.href),n(A.href)}function y(){Lc(),document.getElementsByTagName("canvas")[0].focus(),Qn(S),s(0)}function b(){const A=Nc();Qn(A),s(.9)}let x,w,S;return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{onUp:()=>S.setFocus(),onEscape:y,get children(){return[l(ei,Q({y:360,x:150},()=>e().heroContent)),l(Zl,{autofocus:!0,ref(A){var p=S;typeof p=="function"?p(A):S=A},y:560,x:150,onDown:()=>x.setFocus(),onEnter:b,children:"Watch Trailer"}),l(ee,{ref(A){var p=x;typeof p=="function"?p(A):x=A},y:a,x:140,get style(){return fe.Column},zIndex:5,get children(){return l(Be,{get when(){return pt(()=>!!o())()&&t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Recommendations"}),l(xn,{onFocus:d,onEnter:g,get items(){return o()}}),l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Cast and Crew"}),l(xn,{onFocus:u,onEnter:g,get items(){return t()}})]}})}}),l(M,{ref(A){var p=w;typeof p=="function"?p(A):w=A},style:c,transition:{alpha:!0,y:!0}})]}}),l(M,{get alpha(){return i()},get color(){return L("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function zc({id:r}){return tt.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>Nt(n.slice(0,7)))}function Pc({id:r}){return tt.get("/person/".concat(r)).then(n=>({backgroundImage:kt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const Dc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),Pc),[t]=et(()=>({...r}),zc);$e(He(e,s=>{Ee(s.backgroundImage)},{defer:!0}));const o={color:L("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;F(s&&s.href),n(s.href)}return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{x:150,y:200,get style(){return fe.Column},zIndex:3,get children(){return[l(N,{get style(){return f.typography.display2},get children(){return e().name}}),l(N,{get style(){return fe.peopleBio},get children(){return e().biography}})]}}),l(M,{style:o}),l(ee,{y:670,x:140,get style(){return fe.Column},get children(){return l(Be,{get when(){return t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Credits"}),l(xn,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Oc=()=>(()=>{var r=Pt("node");return Qs(r,"style",{width:1920,height:1080,color:868483072}),r})(),Uc=new URL("AppCoreExtensions-tiD9qKNE.js",import.meta.url).href;Ae.debug=!1;Ae.animationsEnabled=!0;Ae.fontSettings.fontFamily="Ubuntu";Ae.fontSettings.color=L("#ffffff");Ae.fontSettings.fontSize=32;Ae.rendererOptions={coreExtensionModule:Uc,fpsUpdateInterval:1e3,enableInspector:!0};js(()=>l(ba,{root:r=>l(Kl,r),get children(){return[l(ue,{path:"",component:to}),l(ue,{path:"examples",component:vc}),l(ue,{path:"browse/:filter",component:to}),l(ue,{path:"text",component:wc}),l(ue,{path:"buttons",component:Ac}),l(ue,{path:"flex",component:Cc}),l(ue,{path:"create",component:bc}),l(ue,{path:"viewport",component:Sc}),l(ue,{path:"flexsize",component:Tc}),l(ue,{path:"flexcolumnsize",component:_c}),l(ue,{path:"flexcolumn",component:Ic}),l(ue,{path:"buttonsmaterial",component:Rc}),l(ue,{path:"entity/people/:id",component:Dc}),l(ue,{path:"entity/:type/:id",component:Mc}),l(ue,{path:"*all",component:Oc})]}}));export{Yc as __vite_legacy_guard}; -//# sourceMappingURL=index-C4u_Hbz8.js.map diff --git a/assets/index-C4u_Hbz8.js.map b/assets/index-C4u_Hbz8.js.map deleted file mode 100644 index f996a37..0000000 --- a/assets/index-C4u_Hbz8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"mappings":";;;;;;stCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,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AAW,CACT,SAAU,CACR,KAAM,EACN,MAAO,GACP,KAAM,IACN,OAAQ,GACR,KAAM,IACN,MAAO,EACR,EACD,MAAO,CACL,KAAM,EACN,MAAO,IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YA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CAAAwU,SACjCye,EAAK,CAACvE,UAAS,KAAAla,EACfye,EAAK,IAAAze,EACLye,EAAKze,MACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CAACvb,MAAU9d,MAAOwqC,EAActN,UAAgB,IAAAlmB,UAAA,CAAAwU,SACpDye,EAAK,CAACH,UAAW,IAAG,EAAAte,EACpBye,EAAKze,MACLye,EAAK,CAACH,UAAW,IAAG,EAAAte,EACpBye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,EAAKze,MACLye,EAAK,CAACF,aAAc,IAAGve,IACvBye,EAAKze,MACLye,EAAK,IAAAze,EACLye,EAAK,CAACF,aAAc,GAAG,KAAAve,IAGzB6N,GAAM,CACLvb,MACA2oB,eAAgB,SAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,eAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,cAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,YAKhB,ECzIMQ,GAAsBA,IAAM,CACvBlN,WAA2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c,IAC7CgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWqiB,GAAY5e,IAC7CgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW6kB,GAAkBphB,IACzDgB,GAAK,CAACtH,KAAI,aAAc6C,UAAWwiB,GAAc/e,IACjDgB,GAAK,CAACtH,KAAI,kBAAmB6C,UAAW8kB,GAAmBrhB,IAC3DgB,GAAK,CAACtH,KAAI,oBAAqB6C,UAAWmkB,GAAM1gB,IAChDgB,GAAK,CAACtH,KAAI,mBAAoB6C,UAAWojB,GAAM3f,IAC/CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWskB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","results","eff","index","fxClass","uniInfo","p","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_H","_G","_J","_I","_K","_M","_L","_O","_N","_P","_R","_Q","_T","_S","_U","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","delayedBackgrounds","r$","_ref$","_ref$2","_ref$3","materialBrand","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","lastItem","windowVal","updateLastIndex","currentVal","newVal","size2","direct","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","num","defaultTone$e","themeStyles$d","container$e","defaultTone$d","themeStyles$c","container$d","defaultTone$c","themeStyles$b","container$c","text$6","icon$2","defaultTone$b","themeStyles$a","container$b","content","text$5","defaultTone$a","themeStyles$9","strokeWidth","container$a","icon$1","defaultTone$9","themeStyles$8","container$9","Container$9","styles$9","Column","onUp","onDown","defaultTone$8","themeStyles$7","container$8","text$4","themeStyles$6","defaultTone$7","container$7","text$3","icon","defaultTone$6","themeStyles$5","container$6","text$2","defaultTone$5","themeStyles$4","container$5","titleText","descriptionText","defaultTone$4","themeStyles$3","container$4","progress","defaultTone$3","themeStyles$2","container$3","Container$3","styles$3","Row","onLeft","onRight","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","onEnter","Gradient","fpsStyle","fpsLabel","textColor","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","count","totalFps","resetCounter","calcFps","Math","min","max","round","setupFPS","FPSCounter","toString","App","Menu","Escape","announcer","enabled","focusRingRef","navDrawer","lastFocused","onAnnouncer","onLast","history","back","onMenu","has","Button","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","page","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","getReviews","reviews","rtCrit","title","marginRight","MetaTextStyle","rtFan","Badge","borderRadius","border","body2","Metadata","display","flexDirection","metaText","badges","ContentBlock","description","minutesToHMM","minutes","hours","remainingMinutes","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","trailerButton","onEnterTrailer","RowTitle","People","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,97],"sources":["../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number | string;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWI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uzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr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9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(img);\n },\n { defer: true },\n ),\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 20,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 1500,\n height: 400,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + data.release_date\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n },\n { defer: true },\n ),\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits,\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations,\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\n \n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-C4u_Hbz8.js"} \ No newline at end of file diff --git a/assets/index-DjQeU_QX.js b/assets/index-DjQeU_QX.js new file mode 100644 index 0000000..3efe67a --- /dev/null +++ b/assets/index-DjQeU_QX.js @@ -0,0 +1,2 @@ +var ki=Object.defineProperty;var Ei=(r,n,e)=>n in r?ki(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var d=(r,n,e)=>(Ei(r,typeof n!="symbol"?n+"":n,e),e);import{a as L,i as _o,g as Dn,c as yt,W as Fr,E as st,b as Fe,d as Fi,e as hr,f as Ni,m as Rt,h as Ot,j as Io,T as Ro,k as Li,l as On,S as Nr,B as Mi,n as zi,o as Bo,p as Pi,q as Di,C as Oi,r as Wi,s as Lr,t as Mr,u as Ui,v as $i,w as Yi}from"./CoreExtension-BSpcUIDc.js";function Du(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();class ko{constructor(n){d(this,"releaseCallback");this.releaseCallback=n}}class Hi extends ko{constructor(e,t){var o,i;super(e);d(this,"textureMap",new Map);d(this,"zeroReferenceTextureSet",new Set);d(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),a=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>a&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(L(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),L(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);L(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class ji extends ko{constructor(e){super(e);d(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;L((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const Ct={alpha:r=>r===1?null:{prop:"opacity",value:"".concat(r)},x:r=>({prop:"left",value:"".concat(r,"px")}),y:r=>({prop:"top",value:"".concat(r,"px")}),width:r=>r===0?null:{prop:"width",value:"".concat(r,"px")},height:r=>r===0?null:{prop:"height",value:"".concat(r,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:r=>r===!1?null:{prop:"overflow",value:r?"hidden":"visible"},rotation:r=>r===0?null:{prop:"transform",value:"rotate(".concat(r,"rad)")},scale:r=>r===1?null:{prop:"transform",value:"scale(".concat(r,")")},scaleX:r=>r===1?null:{prop:"transform",value:"scaleX(".concat(r,")")},scaleY:r=>r===1?null:{prop:"transform",value:"scaleY(".concat(r,")")},color:r=>r===0?null:{prop:"color",value:Eo(r)}},Eo=r=>{const n=(r&255)/255,e=r>>8&255,t=r>>16&255,o=r>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(n,")")},Qi={id:"id"};class Xi{constructor(n,e){d(this,"root",null);d(this,"canvas",null);d(this,"height",1080);d(this,"width",1920);d(this,"scaleX",1);d(this,"scaleY",1);var i,s,a,c,u,h;if(_o())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((a=e.deviceLogicalPixelRatio)!=null?a:1)),this.scaleX=(u=e.deviceLogicalPixelRatio)!=null?u:1,this.scaleY=(h=e.deviceLogicalPixelRatio)!=null?h:1,this.canvas=n,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(n,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(n),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const n=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+n.top,t=document.documentElement.scrollLeft+n.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(n,e){const t=document.createElement("div");t.style.position="absolute",t.id=n.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(n,e){const t=n.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(n,e){const t=n.createTextNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createProxy(n,e){return new Proxy(n,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,a)=>{const c=t.animate(s,a);return new Proxy(c,{get:(u,h,g)=>(h==="start"&&this.animateNode(e,n,s,a),Reflect.get(u,h,g))})}:Reflect.get(t,o,i))})}destroyNode(n){const e=document.getElementById(n.id.toString());e==null||e.remove()}updateNodeProperty(n,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(n);return}const s=document.getElementById(i.toString());s==null||s.appendChild(n);return}if(e==="text"){n.innerHTML=String(t),n.style.visibility="hidden";return}if(e==="src"&&t){n.setAttribute("data-src",String(t));return}if(Ct[e]){const i=(o=Ct[e])==null?void 0:o.call(Ct,t);if(i===null)return;if(typeof i=="string"){n.style.setProperty(i,String(t));return}typeof i=="object"&&n.style.setProperty(i.prop,i.value);return}if(Qi[e]){n.setAttribute(String(Ct[e]),String(t));return}if(e==="data"){for(const i in t)n.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(n,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:a,y:c,width:u,height:h,alpha:g=1,rotation:v=0,scale:S=1,color:p}=t;function x(){setTimeout(()=>{n.style.top="".concat(c,"px"),n.style.left="".concat(a,"px"),n.style.width="".concat(u,"px"),n.style.height="".concat(h,"px"),n.style.opacity="".concat(g),n.style.rotate="".concat(v,"rad"),n.style.scale="".concat(S),n.style.color=Eo(p)},i)}setTimeout(x,s)}}const Ki="modulepreload",Vi=function(r){return"/solid-demo-app/"+r},zr={},Gi=function(n,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=Vi(c),c in zr)return;zr[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(!!t)for(let S=i.length-1;S>=0;S--){const p=i[S];if(p.href===c&&(!u||p.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(h)))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":Ki,u||(v.as="script",v.crossOrigin=""),v.href=c,a&&v.setAttribute("nonce",a),document.head.appendChild(v),u)return new Promise((S,p)=>{v.addEventListener("load",S),v.addEventListener("error",()=>p(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>n()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class ie{constructor(n){d(this,"priority",1);d(this,"name","");d(this,"ref");d(this,"target");d(this,"passParameters","");d(this,"declaredUniforms","");d(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=n;this.ref=e,this.target=t;const i={},s=[];let a="";const c=this.constructor.uniforms||{};for(const u in c){const h=c[u],g=h.type,v="".concat(e,"_").concat(u);let S="";h.size&&(S="[".concat(h.size(o),"]")),s.push(v),a+="uniform ".concat(g," ").concat(v).concat(S,";"),i[u]={name:v,uniform:c[u].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static getEffectKey(n){return""}static getMethodParameters(n,e){const t=[];for(const o in n){const i=n[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(n){return{}}static makeEffectKey(n){return!1}}d(ie,"uniforms",{}),d(ie,"methods"),d(ie,"onShaderMask"),d(ie,"onColorize"),d(ie,"onEffectMask");const qi={x:(r,n)=>{r.props.x=n},y:(r,n)=>{r.props.y=n},width:(r,n)=>{r.props.width=n},height:(r,n)=>{r.props.height=n},color:(r,n)=>{r.props.color=n},zIndex:(r,n)=>{r.props.zIndex=n},fontFamily:(r,n)=>{r.props.fontFamily=n},fontWeight:(r,n)=>{r.props.fontWeight=n},fontStyle:(r,n)=>{r.props.fontStyle=n},fontStretch:(r,n)=>{r.props.fontStretch=n},fontSize:(r,n)=>{r.props.fontSize=n},text:(r,n)=>{r.props.text=n},textAlign:(r,n)=>{r.props.textAlign=n},contain:(r,n)=>{r.props.contain=n},offsetY:(r,n)=>{r.props.offsetY=n},scrollable:(r,n)=>{r.props.scrollable=n},scrollY:(r,n)=>{r.props.scrollY=n},letterSpacing:(r,n)=>{r.props.letterSpacing=n},lineHeight:(r,n)=>{r.props.lineHeight=n},maxLines:(r,n)=>{r.props.maxLines=n},textBaseline:(r,n)=>{r.props.textBaseline=n},verticalAlign:(r,n)=>{r.props.verticalAlign=n},overflowSuffix:(r,n)=>{r.props.overflowSuffix=n},debug:(r,n)=>{r.props.debug=n}};class Fo{constructor(n){d(this,"stage");d(this,"set");this.stage=n;const e={...qi,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(n,e,t){n.status!==e&&(n.status=e,n.emitter.emit(e,t))}setIsRenderable(n,e){n.isRenderable=e}destroyState(n){["loading","loaded","failed"].forEach(t=>{n.emitter.off(t)})}scheduleUpdateState(n){n.updateScheduled||(n.updateScheduled=!0,queueMicrotask(()=>{n.updateScheduled=!1,this.updateState(n)}))}}const Pr=2048;function Dr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class Zi{constructor(n,e){d(this,"_canvas");d(this,"_context");d(this,"_settings");d(this,"renderInfo");this._canvas=n,this._context=e,this._settings=this.mergeDefaults({})}set settings(n){this._settings=this.mergeDefaults(n)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const n=[this._settings.fontFace],e=[];for(let t=0,o=n.length;t{console.warn("[Lightning] Font load error",e,n)}).then(()=>{document.fonts.check(n,this._settings.text)||console.warn("[Lightning] Font not found",n)})}catch(e){console.warn("[Lightning] Can't check font loading for "+n)}}}calculateRenderInfo(){const n={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,a=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,u=this._settings.h*e;let h=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,v=this._settings.cutEx*e,S=this._settings.cutSy*e,p=this._settings.cutEy*e,x=(this._settings.letterSpacing||0)*e,b=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),w=A-t;if(w<10&&(A+=10-w,w=10),h||(h=w),this._settings.textOverflow&&!this._settings.wordWrap){let T;switch(this._settings.textOverflow){case"clip":T="";break;case"ellipsis":T=this._settings.overflowSuffix;break;default:T=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,h-b,T)}let y;if(this._settings.wordWrap)y=this.wrapText(this._settings.text,h,x,b);else{y={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const T=y.l.length;for(let _=0;_this._settings.maxLines){const T=m.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(T[T.length-1],h-O,x,b);T[T.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=m.length;let k=0;const z=y.n.length;for(E=this._settings.maxLines;E=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(n.cutSx||n.cutSy)&&this._context.translate(-n.cutSx,-n.cutSy);let a,c;const u=[];for(let g=0,v=o.length;ge)for(;a>0&&(c=this._context.measureText(n.substring(0,a)).width+o,c>e);)a-=1;else for(;a=o?t:"")}wrapText(n,e,t,o=0){const i=n.split(/\r?\n/g);let s=[];const a=[];for(let c=0;cg?(S>0&&(u.push(h),h=""),h+=v[S],g=e-p-(S===0?o:0)):(g-=x,h+=" ".concat(v[S]))}u.push(h),h="",s=s.concat(u),ct+this._context.measureText(o).width+e,0):this._context.measureText(n).width}mergeDefaults(n){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...n}}}const Or=typeof self>"u"?globalThis:self;var To;const Wr=((To=Or.document)==null?void 0:To.fonts)||Or.fonts;function Ji(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const es=yt(0,0,0,0);class ts extends Fo{constructor(e){super(e);d(this,"canvas");d(this,"context");d(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),L(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof Fr}addFontFace(e){L(e instanceof Fr),Wr.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new st,canvasPages:void 0,lightning2TextRenderer:new Zi(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var p,x;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const b=Ji(e.props);if(e.fontInfo={cssString:b,loaded:!1},!e.fontInfo.loaded){Wr.load(b).then(this.onFontLoaded.bind(this,e,b)).catch(this.onFontLoadError.bind(this,e,b));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const b=e.props.maxLines,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,w=A>0&&b>0?Math.min(A,b):Math.max(A,b);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:Fe(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:w,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:a,contain:c}=e.props,{visibleWindow:u}=e;let{renderWindow:h,canvasPages:g}=e;if(!u.valid){const b=yt(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,es);Fi(this.rendererBounds,b,u),u.valid=!0}const v=u.y2-u.y1,S=Math.ceil(v/e.renderInfo.lineHeight);if(v===0){g=void 0,h=void 0,this.setStatus(e,"loaded");return}else if(h&&g){const b=t+h.x1,A=o-a+h.y1,w=t+h.x2,y=o-a+h.y2;if(b<=u.x1&&w>=u.x2&&A<=u.y1&&y>=u.y2){this.setStatus(e,"loaded");return}yu.y1&&(h.y1-=S*e.renderInfo.lineHeight,h.y2-=S*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-S,g[0].lineNumEnd=g[0].lineNumStart+S,g[0].valid=!1)}else{const b=e.renderInfo.lineHeight*S,A=Math.ceil(a/b),w=A*S,y=w-S,m=w+S;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:y,lineNumEnd:y+S,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:w,lineNumEnd:w+S,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:m,lineNumEnd:m+S,valid:!1}],e.canvasPages=g;const C=A*b;h={x1:0,y1:C-b,x2:i,y2:C+b*2}}e.renderWindow=h,performance.now();for(const b of g)if(!b.valid){if(b.lineNumStart<0){(p=b.texture)==null||p.setRenderableOwner(e,!1),b.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),b.texture.setRenderableOwner(e,e.isRenderable),b.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(b.lineNumStart,b.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(b.lineNumStart,b.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((x=b.texture)==null||x.setRenderableOwner(e,!1),b.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),b.texture.setRenderableOwner(e,e.isRenderable)),b.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var T,_,E,P,k,z,O,D,U,j,se,ne;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:u=0,renderWindow:h}=e;if(!a||!h)return;const{x:g,y:v,scrollY:S,contain:p,width:x,height:b}=e.props,A={x:g,y:v,width:p!=="none"?x:c,height:p==="both"?b:u};hr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),L(a,"canvasPages is not defined"),L(h,"renderWindow is not defined");const y=(h.y2-h.y1)/3,{zIndex:m,color:C}=e.props,R=i*Ni(C),I=Rt(4294967295,R);a[0].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((_=(T=a[0].texture)==null?void 0:T.dimensions)==null?void 0:_.width)||0,height:((P=(E=a[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-S+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((z=(k=a[1].texture)==null?void 0:k.dimensions)==null?void 0:z.width)||0,height:((D=(O=a[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:a[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-S+h.y1+y,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((j=(U=a[2].texture)==null?void 0:U.dimensions)==null?void 0:j.width)||0,height:((ne=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:ne.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-S+h.y1+y+y,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class No extends Ot{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}}d(No,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Lo extends Ot{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});d(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,a)=>{o.activeTexture(a),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}d(Lo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Wn=new Map,ns=(r,n)=>{const e=JSON.stringify(r);if(Wn.has(e))return Wn.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Wn.set(e,t),t},Me=class Me extends Ot{constructor(e,t,o){const i=Me.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});d(this,"effects",[]);this.effects=i.effects,this.calculateProps=Io(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const a=this.effects[s],c=t[a.name],u=(g=i.props)!=null?g:{},h=a.uniformInfo;Object.keys(u).forEach(v=>{const S=c.uniforms[v],p=h[v];let x=S.validator?S.validator(u[v],u):u[v];Array.isArray(x)&&(x=new Float32Array(x)),o.push({name:p.name,value:x})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;const o=e.effects.length;let i=0;for(;i{const x=t[p.type],b=x.getEffectKey(p.props||{});o[b]=o[b]?++o[b]:1;const A=o[b];A===1&&c.push({key:b,type:p.type,props:p.props});const w=new x({ref:"".concat(b).concat(A===1?"":A),target:b,props:p.props});return s+=w.declaredUniforms,a.push(...Object.values(w.uniformInfo)),w});let h="";c==null||c.forEach(p=>{var I;const x=t[p.type],b=x.resolveDefaults((I=p.props)!=null?I:{}),A=[];for(const T in x.methods){let _=T;const E=x.methods[T];i[T]&&i[T]!==E&&(_=Me.resolveMethodDuplicate(T,E,i)),i[_]=E.replace("function",_),A.push({m:T,cm:_})}let w=x.onShaderMask instanceof Function?x.onShaderMask(b):x.onShaderMask,y=x.onColorize instanceof Function?x.onColorize(b):x.onColorize,m=x.onEffectMask instanceof Function?x.onEffectMask(b):x.onEffectMask;A.forEach(T=>{const{m:_,cm:E}=T,P=new RegExp("\\$".concat(_),"g");w&&(w=w.replace(P,E)),y&&(y=y.replace(P,E)),m&&(m=m.replace(P,E))});const C=x.getMethodParameters(x.uniforms,b),R=C.length>0?", ".concat(C):"";w&&(h+="\n float fx_".concat(p.key,"_onShaderMask(float shaderMask ").concat(R,") {\n ").concat(w,"\n }\n ")),y&&(h+="\n vec4 fx_".concat(p.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(y,"\n }\n ")),m&&(h+="\n vec4 fx_".concat(p.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(m,"\n }\n "))});let g="";for(const p in i)g+=i[p];let v="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",S="\n\n ";for(let p=0;p0?", ".concat(x.passParameters):"",A=t[x.name];A.onShaderMask&&(S+="\n shaderMask = fx_".concat(x.target,"_onShaderMask(shaderMask ").concat(b,");\n ")),A.onColorize&&(S+="\n maskColor = fx_".concat(x.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(b,");\n ")),A.onEffectMask&&(v="fx_".concat(x.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(b,")"));const w=u[p+1];(w===void 0||t[w.name].onEffectMask)&&(S+="\n shaderColor = ".concat(v,";\n "))}return{effects:u,uniforms:a,fragment:Me.fragment(s,g,h,S),vertex:Me.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:ns(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};d(Me,"z$__type__Props"),d(Me,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),d(Me,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let vt=Me;class Kn extends Ot{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(n){return{radius:n.radius||10,$dimensions:{width:0,height:0}}}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){this.setUniform("u_radius",n.radius)}canBatchShaderProps(n,e){return n.radius===e.radius&&n.$dimensions.width===e.$dimensions.width&&n.$dimensions.height===e.$dimensions.height}}d(Kn,"z$__type__Props"),d(Kn,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const rs=new Float32Array([1,0,0,0,1,0,0,0,1]),Rn=class Rn extends Ot{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){const e=Rn.resolveDefaults(n);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=Fe(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(n={}){var e,t,o,i,s,a;return{transform:(e=n.transform)!=null?e:rs,scrollY:(t=n.scrollY)!=null?t:0,color:(o=n.color)!=null?o:4294967295,size:(i=n.size)!=null?i:16,distanceRange:(s=n.distanceRange)!=null?s:1,debug:(a=n.debug)!=null?a:!1}}};d(Rn,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let Vn=Rn;class dt extends ie{constructor(){super(...arguments);d(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}d(dt,"z$__type__Props"),d(dt,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),d(dt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),d(dt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),d(dt,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Bt extends ie{constructor(){super(...arguments);d(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}d(Bt,"z$__type__Props"),d(Bt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(Bt,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),d(Bt,"onColorize","\n return color;\n ");const Qe=class Qe extends ie{constructor(){super(...arguments);d(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const a=t.length;let c=0;const u=o;for(;ce.map(o=>Fe(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),d(Qe,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),d(Qe,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat(Qe.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Gn=Qe;class qn extends ie{constructor(){super(...arguments);d(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}d(qn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),d(qn,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class ht extends ie{constructor(){super(...arguments);d(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}d(ht,"z$__type__Props"),d(ht,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(ht,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),d(ht,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),d(ht,"onColorize","\n return color;\n ");class ft extends ie{constructor(){super(...arguments);d(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}d(ft,"z$__type__Props"),d(ft,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(ft,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),d(ft,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),d(ft,"onColorize","\n return color;\n ");class gt extends ie{constructor(){super(...arguments);d(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}d(gt,"z$__type__Props"),d(gt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(gt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),d(gt,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),d(gt,"onColorize","\n return color;\n ");class pt extends ie{constructor(){super(...arguments);d(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}d(pt,"z$__type__Props"),d(pt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(pt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),d(pt,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),d(pt,"onColorize","\n return color;\n ");class kt extends ie{constructor(){super(...arguments);d(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,a;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(a=e.time)!=null?a:Date.now()}}}d(kt,"z$__type__Props"),d(kt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),d(kt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),d(kt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class dn extends ie{constructor(){super(...arguments);d(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}d(dn,"z$__type__Props"),d(dn,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),d(dn,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const et=class et extends ie{constructor(){super(...arguments);d(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,a,c,u;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const h=t.length;let g=0;const v=o;for(;ge.map(o=>Fe(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),d(et,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(et.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Zn=et;class mt extends ie{constructor(){super(...arguments);d(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,a,c,u;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(a=e.rounded)!=null?a:!1,radius:(c=e.radius)!=null?c:1,color:(u=e.color)!=null?u:4294967295}}}d(mt,"z$__type__Props"),d(mt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Fe(e),method:"uniform4fv",type:"vec4"}}),d(mt,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),d(mt,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),d(mt,"onColorize","\n return color;\n ");class xt extends ie{constructor(){super(...arguments);d(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}d(xt,"z$__type__Props"),d(xt,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),d(xt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),d(xt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),d(xt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class os{constructor(){d(this,"shCache",new Map);d(this,"shConstructors",{});d(this,"attachedShader",null);d(this,"effectConstructors",{});d(this,"renderer");this.registerShaderType("DefaultShader",No),this.registerShaderType("DefaultShaderBatched",Lo),this.registerShaderType("RoundedRectangle",Kn),this.registerShaderType("DynamicShader",vt),this.registerShaderType("SdfShader",Vn),this.registerEffectType("border",Bt),this.registerEffectType("borderBottom",gt),this.registerEffectType("borderLeft",pt),this.registerEffectType("borderRight",ht),this.registerEffectType("borderTop",ft),this.registerEffectType("fadeOut",dn),this.registerEffectType("linearGradient",Gn),this.registerEffectType("radialGradient",Zn),this.registerEffectType("grayscale",qn),this.registerEffectType("glitch",kt),this.registerEffectType("radius",dt),this.registerEffectType("radialProgress",mt),this.registerEffectType("holePunch",xt)}registerShaderType(n,e){this.shConstructors[n]=e}registerEffectType(n,e){this.effectConstructors[n]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(n,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[n];if(!t)throw new Error('Shader type "'.concat(n,'" is not registered'));if(n==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(n){if(!this.renderer)throw new Error("Renderer is not been defined");const e=vt.resolveDefaults(n,this.effectConstructors),t=vt.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new vt(this.renderer,n,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(n){this.attachedShader!==n&&(this.attachedShader&&this.attachedShader.detach(),n.attach(),this.attachedShader=n)}}class is{constructor(){d(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function ss(r){return/\.(ktx|pvr)$/.test(r)}const as=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?ls(e):cs(e)},ls=async r=>{const n=new DataView(r),e=n.getUint32(12)===16909060,t=[],o={glInternalFormat:n.getUint32(28,e),pixelWidth:n.getUint32(36,e),pixelHeight:n.getUint32(40,e),numberOfMipmapLevels:n.getUint32(56,e),bytesOfKeyValueData:n.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const a=r,c=new Int32Array(a,0,13),u=c[12]+52,h=new Uint8Array(a,u),g=[],v={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let S=0,p=v.pixelWidth||0,x=v.pixelHeight||0;for(let b=0;b>2)*(x+3>>2)*8,w=new Uint8Array(a,h.byteOffset+S,A);g.push(w),S+=A,p=p>>1,x=x>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:v.pixelWidth||0,height:v.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},zt=class zt extends Ro{constructor(e,t){super(e);d(this,"props");this.props=zt.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(ss(e))return as(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=zt.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};d(zt,"z$__type__Props");let Jn=zt;const us=24;function ds(r,n,e,t,o,i,s,a,c){const u=Math.min(Math.max(s.firstLineIdx,0),a.length),h=0;let g=0;t==="middle"?g=(n-r)/2:t==="bottom"&&(g=n-r);const S=o/i+u*n+g;if(!(c&&S>=c/i))return{sdfX:h,sdfY:S,lineIndex:u}}class Et{constructor(n,e=0){d(this,"iterator");d(this,"peekBuffer",[]);d(this,"_lastIndex");this.iterator=n,this.iterator=n,this._lastIndex=e-1,this.peekBuffer=[]}next(){const n=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return n.done?this._lastIndex=-1:this._lastIndex++,n}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const n=this.iterator.next();return this.peekBuffer.push(n),n}get lastIndex(){return this._lastIndex}}function*Ft(r,n=0){let e=n;for(;e=S.y1,$e=O<=S.y2,ye=Ue&&$e;for(;(he=ne.next())&&!he.done;){const K=he.value;if(r===v.length)v.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(r>v.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?U.codepointIndex!==-1&&(U.codepointIndex=-1,re=z):U.codepointIndex===-1&&(U.codepointIndex=K.cluster,U.bufferOffset=D,U.xStart=re),K.mapped){const Qt=z+K.xOffset+K.width;if(g!=="none"&&Qt>=xe&&U.codepointIndex!==-1&&U.xStart>0)if(Ce){ne=j.shapeText(se,new Et(Ft(t,U.codepointIndex),U.codepointIndex)),D=U.bufferOffset;break}else ne=j.shapeText(se,new Et(Ft(A,0),0)),z=U.xStart,D=U.bufferOffset,g="none";else{const Ye=z+K.xOffset,He=O+K.yOffset;if(ye){_e===-1&&(_e=D);const Ge=p.getAtlasEntry(K.glyphId),qe=Ge.x/p.data.common.scaleW,Ze=Ge.y/p.data.common.scaleH,At=Ge.width/p.data.common.scaleW,Er=Ge.height/p.data.common.scaleH;h[D++]=Ye,h[D++]=He,h[D++]=qe,h[D++]=Ze,h[D++]=Ye+K.width,h[D++]=He,h[D++]=qe+At,h[D++]=Ze,h[D++]=Ye,h[D++]=He+K.height,h[D++]=qe,h[D++]=Ze+Er,h[D++]=Ye+K.width,h[D++]=He+K.height,h[D++]=qe+At,h[D++]=Ze+Er}k=Math.max(k,He+K.height),P=Math.max(P,Ye+K.width),z+=K.xAdvance}}else if(K.codepoint===10){if(Ce)break;ne=j.shapeText(se,new Et(Ft(A,0),0)),g="none"}}_e!==-1&&(We.push({bufferStart:_e,bufferEnd:D}),_e=-1),z=0,O+=m,r++,U.codepointIndex=-1,re=0,!x&&g==="both"&&O>S.y2||he&&he.done?Ve=!1:Ce||(Ve=!1)}if(o==="center"){const Ce=g==="none"?P:C;for(let xe=0;xetypeof r=="number"?r:xs[r]||400;function ys(r,n,e,t,o){let i=Ur(e);for(const s of r){const a=s[n];if(!a)continue;if(a.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(n,"' - will be used for all weights and styles")),a.values().next().value;const c=new Map;for(const h of a){const g=Ur(h.descriptors.weight);if(g===i&&h.descriptors.style===t&&h.descriptors.stretch===o)return h;c.set(g,h)}const u="TrFontManager: No exact match: '".concat(n," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(u),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const vs=Io(ys);class Mo{constructor(n){d(this,"textRenderers");this.textRenderers=n}addFontFace(n){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(n)&&t.addFontFace(n)}}static resolveFontFace(n,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return vs(n,t,o,i,s)}}const ws={x:0,y:0,width:0,height:0};class bs extends Fo{constructor(e){super(e);d(this,"ssdfFontFamilies",{});d(this,"msdfFontFamilies",{});d(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);d(this,"sdfShader");d(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&On(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&On(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof Nr}addFontFace(e){L(e instanceof Nr);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new st,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:a}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}L(t.data,"Font face data should be loaded");const{text:c,fontSize:u,x:h,y:g,contain:v,width:S,height:p,lineHeight:x,verticalAlign:b,scrollable:A,overflowSuffix:w,maxLines:y}=e.props,m=v==="both"&&A?e.props.scrollY:0,{renderWindow:C}=e,R=t.data.info.size,I=u/R,T=x/I;e.distanceRange=I*t.data.distanceField.distanceRange;const _=c.length*us;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!a&&C.valid){const j=C.screen;if(h+j.x1<=P.x1&&h+j.x2>=P.x2&&g-m+j.y1<=P.y1&&g-m+j.y2>=P.y2){this.setStatus(e,"loaded");return}C.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:z}=e.props;if(!C.valid){if(!On(P,this.rendererBounds))return;ms(C,h,g,m,x,v==="both"?P.y2-P.y1:0,P,I)}const O=ds(R,T,x,b,k,I,C,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,U=fs(O.lineIndex,O.sdfX,O.sdfY,c,z,S,p,u,x,D,E,v,i,C.sdf,t,a,A,w,y);e.bufferUploaded=!1,e.bufferNumFloats=U.bufferNumFloats,e.bufferNumQuads=U.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=C,s.lastLayoutNumCharacters=U.layoutNumCharacters,s.bufferSize=E.byteLength,U.fullyProcessed&&(e.textW=U.maxX*I,e.textH=U.maxY*I),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:a,color:c,contain:u,scrollable:h,zIndex:g,debug:v}=e.props,S=u==="both"&&h?e.props.scrollY:0,{textW:p=0,textH:x=0,distanceRange:b,vertexBuffer:A,bufferUploaded:w,trFontFace:y,elementBounds:m}=e;let{webGlBuffers:C}=e;if(!C){const k=s.glw,z=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();L(O),e.webGlBuffers=new Mi([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,L(e.webGlBuffers),C=e.webGlBuffers}if(!w){const k=s.glw,z=(_=C==null?void 0:C.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(z,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(L(y),h&&u==="both"){L(m.valid);const k=zi(m,ws);o.valid?(e.clippingRect.valid=!0,o=hr(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=Bo(k,e.clippingRect))}const R=new Pi(s.glw,s.options,C,this.sdfShader,{transform:t.data,color:Di(c,i),size:a/(((E=y.data)==null?void 0:E.info.size)||0),scrollY:S,distanceRange:b,debug:v.sdfShaderDebug},i,o,{height:x,width:p},0,g),I=(P=e.trFontFace)==null?void 0:P.texture;L(I);const T=this.stage.txManager.getCtxTexture(I);R.addTexture(T),R.length=e.bufferNumFloats,R.numQuads=e.bufferNumQuads,s.addRenderOp(R)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return Mo.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function Ss(r){return r.prototype instanceof Oi}async function As(r,n){let e;try{console.log("Loading core extension",r),e=await Gi(()=>import(r),[])}catch(o){console.error("The core extension module at '".concat(r,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(r,"' does not have a default export."));return}const t=e.default;if(Ss(t)){const o=new t;try{await o.run(n)}catch(i){console.error("The core extension at '".concat(r,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(r,"' does not extend CoreExtension."))}function zo(r){const n={boolean:!0,string:!0,number:!0},e=Object.keys(r);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),r[o]=i.substring(0,2048)),n[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete r[o])}return r}class Cs extends st{constructor(e,t,o){var A,w,y,m;super();d(this,"root",null);d(this,"driver");d(this,"canvas");d(this,"settings");d(this,"inspector",null);d(this,"nodes",new Map);d(this,"nextTextureId",1);d(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(w=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?w:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(y=e.enableContextSpy)!=null?y:!1,enableInspector:(m=e.enableInspector)!=null?m:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:u,enableInspector:h}=i,g=C=>{this.driver.releaseTexture(C)},v=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=v?new ji(g):new Hi(g,this.settings.textureCleanupOptions);const S=s*c,p=a*c;this.driver=o;const x=document.createElement("canvas");this.canvas=x,x.width=S*u,x.height=p*u,x.style.width="".concat(S,"px"),x.style.height="".concat(p,"px");let b;if(typeof t=="string"?b=document.getElementById(t):b=t,!b)throw new Error("Could not find target element");o.onCreateNode=C=>{this.nodes.set(C.id,C)},o.onBeforeDestroyNode=C=>{this.nodes.delete(C.id)},o.onFpsUpdate=C=>{this.emit("fpsUpdate",C)},o.onFrameTick=C=>{this.emit("frameTick",C)},o.onIdle=()=>{this.emit("idle")},b.appendChild(x),h&&!_o()&&(this.inspector=new Xi(x,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,a,c,u,h,g,v,S,p,x,b,A,w,y,m,C,R,I;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(a=e.textRendererOverride)!=null?a:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(u=e.fontStyle)!=null?u:"normal",fontWeight:(h=e.fontWeight)!=null?h:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(v=e.textAlign)!=null?v:"left",contain:(S=e.contain)!=null?S:"none",scrollable:(p=e.scrollable)!=null?p:!1,scrollY:(x=e.scrollY)!=null?x:0,offsetY:(b=e.offsetY)!=null?b:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(w=e.lineHeight)!=null?w:t,maxLines:(y=e.maxLines)!=null?y:0,textBaseline:(m=e.textBaseline)!=null?m:"alphabetic",verticalAlign:(C=e.verticalAlign)!=null?C:"top",overflowSuffix:(R=e.overflowSuffix)!=null?R:"...",debug:(I=e.debug)!=null?I:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var u,h,g,v,S,p,x,b,A,w,y,m,C,R,I,T,_,E,P,k,z,O,D,U,j,se,ne,he,_e,We,Ht,jt,Ve,Ce,xe,re,Ue,$e,ye,K,Qt,Ye,He,Ge,qe,Ze,At;const t=(u=e.color)!=null?u:4294967295,o=(v=(g=(h=e.colorTl)!=null?h:e.colorTop)!=null?g:e.colorLeft)!=null?v:t,i=(x=(p=(S=e.colorTr)!=null?S:e.colorTop)!=null?p:e.colorRight)!=null?x:t,s=(w=(A=(b=e.colorBl)!=null?b:e.colorBottom)!=null?A:e.colorLeft)!=null?w:t,a=(C=(m=(y=e.colorBr)!=null?y:e.colorBottom)!=null?m:e.colorRight)!=null?C:t,c=zo((R=e.data)!=null?R:{});return{x:(I=e.x)!=null?I:0,y:(T=e.y)!=null?T:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,autosize:(k=e.autosize)!=null?k:!1,clipping:(z=e.clipping)!=null?z:!1,color:t,colorTop:(O=e.colorTop)!=null?O:t,colorBottom:(D=e.colorBottom)!=null?D:t,colorLeft:(U=e.colorLeft)!=null?U:t,colorRight:(j=e.colorRight)!=null?j:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(se=e.zIndex)!=null?se:0,zIndexLocked:(ne=e.zIndexLocked)!=null?ne:0,parent:(he=e.parent)!=null?he:null,texture:(_e=e.texture)!=null?_e:null,shader:(We=e.shader)!=null?We:null,src:(Ht=e.src)!=null?Ht:"",scale:(jt=e.scale)!=null?jt:null,scaleX:(Ce=(Ve=e.scaleX)!=null?Ve:e.scale)!=null?Ce:1,scaleY:(re=(xe=e.scaleY)!=null?xe:e.scale)!=null?re:1,mount:(Ue=e.mount)!=null?Ue:0,mountX:(ye=($e=e.mountX)!=null?$e:e.mount)!=null?ye:0,mountY:(Qt=(K=e.mountY)!=null?K:e.mount)!=null?Qt:0,pivot:(Ye=e.pivot)!=null?Ye:.5,pivotX:(Ge=(He=e.pivotX)!=null?He:e.pivot)!=null?Ge:.5,pivotY:(Ze=(qe=e.pivotY)!=null?qe:e.pivot)!=null?Ze:.5,rotation:(At=e.rotation)!=null?At:0,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Ts extends st{constructor(e,t,o){super();d(this,"node");d(this,"props");d(this,"settings");d(this,"propStartValues",{});d(this,"restoreValues",{});d(this,"progress",0);d(this,"delayFor",0);d(this,"timingFunction");d(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=Wi(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let a=0;a{this.startedResolve=n}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(n=>{this.stoppedResolve=n}))}started(){L(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){L(this.stoppedResolve);const{loop:n,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!n&&this.manager.unregisterAnimation(this.animation)}}const Z=0,J=3,ue=6,V=1,ee=4,fe=7,ve=2,we=5,be=8;class Se{constructor(n){d(this,"data");n?(this.data=new Float32Array(9),this.data[Z]=n[0],this.data[J]=n[3],this.data[ue]=n[6],this.data[V]=n[1],this.data[ee]=n[4],this.data[fe]=n[7],this.data[ve]=n[2],this.data[we]=n[5],this.data[be]=n[8]):this.data=new Float32Array(9)}static get temp(){return Is}static multiply(n,e,t){const o=n.data[Z]*e.data[Z]+n.data[J]*e.data[V]+n.data[ue]*e.data[ve],i=n.data[Z]*e.data[J]+n.data[J]*e.data[ee]+n.data[ue]*e.data[we],s=n.data[Z]*e.data[ue]+n.data[J]*e.data[fe]+n.data[ue]*e.data[be],a=n.data[V]*e.data[Z]+n.data[ee]*e.data[V]+n.data[fe]*e.data[ve],c=n.data[V]*e.data[J]+n.data[ee]*e.data[ee]+n.data[fe]*e.data[we],u=n.data[V]*e.data[ue]+n.data[ee]*e.data[fe]+n.data[fe]*e.data[be],h=n.data[ve]*e.data[Z]+n.data[we]*e.data[V]+n.data[be]*e.data[ve],g=n.data[ve]*e.data[J]+n.data[we]*e.data[ee]+n.data[be]*e.data[we],v=n.data[ve]*e.data[ue]+n.data[we]*e.data[fe]+n.data[be]*e.data[be];return t||(t=new Se),t.data[Z]=o,t.data[J]=i,t.data[ue]=s,t.data[V]=a,t.data[ee]=c,t.data[fe]=u,t.data[ve]=h,t.data[we]=g,t.data[be]=v,t}static identity(n){return n||(n=new Se),n.data[Z]=1,n.data[J]=0,n.data[ue]=0,n.data[V]=0,n.data[ee]=1,n.data[fe]=0,n.data[ve]=0,n.data[we]=0,n.data[be]=1,n}static translate(n,e,t){return t||(t=new Se),t.data[Z]=1,t.data[J]=0,t.data[ue]=n,t.data[V]=0,t.data[ee]=1,t.data[fe]=e,t.data[ve]=0,t.data[we]=0,t.data[be]=1,t}static scale(n,e,t){return t||(t=new Se),t.data[Z]=n,t.data[J]=0,t.data[ue]=0,t.data[V]=0,t.data[ee]=e,t.data[fe]=0,t.data[ve]=0,t.data[we]=0,t.data[be]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new Se),e.data[Z]=t,e.data[J]=-o,e.data[ue]=0,e.data[V]=o,e.data[ee]=t,e.data[fe]=0,e.data[ve]=0,e.data[we]=0,e.data[be]=1,e}static copy(n,e,t){return e||(e=new Se),e.data[0]=n.data[0],e.data[1]=n.data[1],e.data[2]=n.data[2],e.data[3]=n.data[3],e.data[4]=n.data[4],e.data[5]=n.data[5],e.data[6]=n.data[6],e.data[7]=n.data[7],e.data[8]=n.data[8],e}translate(n,e){return this.data[ue]=this.data[Z]*n+this.data[J]*e+this.data[ue],this.data[fe]=this.data[V]*n+this.data[ee]*e+this.data[fe],this}scale(n,e){return this.data[Z]=this.data[Z]*n,this.data[J]=this.data[J]*e,this.data[V]=this.data[V]*n,this.data[ee]=this.data[ee]*e,this}rotate(n){if(n===0||!(n%Math.PI*2))return this;const e=Math.cos(n),t=Math.sin(n),o=this.data[Z]*e+this.data[J]*t,i=this.data[J]*e-this.data[Z]*t,s=this.data[V]*e+this.data[ee]*t,a=this.data[ee]*e-this.data[V]*t;return this.data[Z]=o,this.data[J]=i,this.data[V]=s,this.data[ee]=a,this}multiply(n){return Se.multiply(this,n,this)}get tx(){return this.data[ue]}get ty(){return this.data[fe]}get ta(){return this.data[Z]}get tb(){return this.data[J]}get tc(){return this.data[V]}get td(){return this.data[ee]}transformPoint(n,e){return[this.data[Z]*n+this.data[J]*e+this.data[ue],this.data[V]*n+this.data[ee]*e+this.data[V]]}}const Is=new Se,Xt=0,Kt=2,Vt=4,Gt=6,qt=1,Zt=3,Jt=5,en=7;class gn{constructor(n){d(this,"data");this.data=new Float32Array(8),n&&(this.data[Xt]=n[Xt],this.data[Kt]=n[Kt],this.data[Vt]=n[Vt],this.data[Gt]=n[Gt],this.data[qt]=n[qt],this.data[Zt]=n[Zt],this.data[Jt]=n[Jt],this.data[en]=n[en])}static translate(n,e,t,o,i,s,a,c,u){return u||(u=new gn),u.data[Xt]=n,u.data[Kt]=t,u.data[Vt]=i,u.data[Gt]=a,u.data[qt]=e,u.data[Zt]=o,u.data[Jt]=s,u.data[en]=c,u}get x1(){return this.data[Xt]}get x2(){return this.data[Kt]}get x3(){return this.data[Vt]}get x4(){return this.data[Gt]}get y1(){return this.data[qt]}get y2(){return this.data[Zt]}get y3(){return this.data[Jt]}get y4(){return this.data[en]}}var G;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(G||(G={}));const nt=new Map;nt.set(G.Init,"init");nt.set(G.OutOfBounds,"outOfBounds");nt.set(G.InBounds,"inBounds");nt.set(G.InViewport,"inViewport");var B;(function(r){r[r.Children=1]="Children",r[r.ScaleRotate=2]="ScaleRotate",r[r.Local=4]="Local",r[r.Global=8]="Global",r[r.Clipping=16]="Clipping",r[r.CalculatedZIndex=32]="CalculatedZIndex",r[r.ZIndexSortedChildren=64]="ZIndexSortedChildren",r[r.PremultipliedColors=128]="PremultipliedColors",r[r.WorldAlpha=256]="WorldAlpha",r[r.RenderState=512]="RenderState",r[r.IsRenderable=1024]="IsRenderable",r[r.None=0]="None",r[r.All=2047]="All"})(B||(B={}));class fr extends st{constructor(e,t){super();d(this,"stage");d(this,"children",[]);d(this,"props");d(this,"updateType",B.All);d(this,"globalTransform");d(this,"scaleRotateTransform");d(this,"localTransform");d(this,"renderCoords");d(this,"renderBound");d(this,"strictBound");d(this,"preloadBound");d(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});d(this,"isRenderable",!1);d(this,"renderState",G.Init);d(this,"worldAlpha",1);d(this,"premultipliedColorTl",0);d(this,"premultipliedColorTr",0);d(this,"premultipliedColorBl",0);d(this,"premultipliedColorBr",0);d(this,"calcZIndex",0);d(this,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});d(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});d(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null},this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();L(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=Se.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){L(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=Se.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(L(this.localTransform),this.globalTransform=Se.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors|B.IsRenderable),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=Rt(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=Rt(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=Rt(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=Rt(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&this.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){L(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=yt(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=yt(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),Mr(this.renderBound,this.strictBound)?G.InViewport:Mr(this.renderBound,this.preloadBound)?G.InBounds:G.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===G.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oG.InBounds&&t===G.OutOfBounds&&(this.emit(nt.get(G.InBounds),{previous:o,current:t}),o=G.InBounds);const i=nt.get(t);L(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(G[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>G.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;L(o);const{tx:i,ty:s,ta:a,tb:c,tc:u,td:h}=o;if(c===0&&u===0){const g=i,v=i+e*a,S=s,p=s+t*h;this.renderCoords=gn.translate(g,S,v,S,v,p,g,p,this.renderCoords)}else this.renderCoords=gn.translate(i,s,i+e*a,s+e*u,i+e*a+t*c,s+e*u+t*h,i+t*c,s+t*h,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;L(t),L(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:u}=e;if(o===0||i===0)this.renderBound=yt(s,a,c,u,this.renderBound);else{const{x2:h,x4:g,y2:v,y4:S}=e;this.renderBound=yt(Math.min(s,h,c,g),Math.min(a,v,u,S),Math.max(s,h,c,g),Math.max(a,v,u,S),this.renderBound)}}calculateClippingRect(e){L(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,a=i.tb!==0||i.tc!==0;s&&!a?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?hr(e,t,t):e.valid&&(Bo(e,t),t.valid=!0)}calculateZIndex(){var s,a;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(a=e.parent)!=null&&a.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);L(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let Rs=1;function gr(){return Rs++}class er extends st{constructor(e,t,o,i){var s;super();d(this,"rendererMain");d(this,"stage");d(this,"id");d(this,"coreNode");d(this,"_children",[]);d(this,"_src","");d(this,"_parent",null);d(this,"_texture",null);d(this,"_shader",null);d(this,"_data",{});d(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});d(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});d(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});d(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});d(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});d(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});d(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:gr(),this.coreNode=i||new fr(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);L(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=zo(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new Ts(this.coreNode,e,t);return new _s(this.stage.animationManager,o)}}const Bs=r=>{let n=!1;const e=()=>{if(r.updateAnimations(),!r.hasSceneUpdates()){r.calculateFps(),setTimeout(e,16.666666666666668),n||(r.emit("idle"),n=!0);return}n=!1,r.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},ks=()=>performance?performance.now():Date.now();class Es{constructor(){d(this,"activeAnimations",new Set)}registerAnimation(n){this.activeAnimations.add(n)}unregisterAnimation(n){this.activeAnimations.delete(n)}update(n){this.activeAnimations.forEach(e=>{e.update(n)})}}class Fs{constructor(n){d(this,"imageWorkersEnabled",!0);d(this,"messageManager",{});d(this,"workers",[]);d(this,"workerIndex",0);this.workers=this.createWorkers(n),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(n){const{src:e,data:t,error:o}=n.data,i=this.messageManager[e];if(i){const[s,a]=i;delete this.messageManager[e],o?a(new Error(o)):s(t)}}createWorkers(n=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(n);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const Pt=class Pt extends Ro{constructor(e,t){super(e);d(this,"props");this.props=Pt.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(n,e){if(this.textures.has(n)&&(this.memUsed-=this.textures.get(n)),e===0){this.textures.delete(n);return}else this.memUsed+=e,this.textures.set(n,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((n,e)=>{e.renderable||e.free()})}}const Ms=2e6;class zs extends st{constructor(e){super();d(this,"options");d(this,"animationManager");d(this,"txManager");d(this,"txMemManager");d(this,"fontManager");d(this,"textRenderers");d(this,"shManager");d(this,"renderer");d(this,"root");d(this,"boundsMargin");d(this,"deltaTime",0);d(this,"lastFrameTime",0);d(this,"currentFrameTime",0);d(this,"fpsNumFrames",0);d(this,"fpsElapsedTime",0);d(this,"renderRequested",!1);d(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:a,appHeight:c,boundsMargin:u,enableContextSpy:h,numImageWorkers:g,txMemByteThreshold:v}=e;this.txManager=new Ns(g),this.txMemManager=new Ls(v),this.shManager=new os,this.animationManager=new Es,this.contextSpy=h?new is:null;let S=[0,0,0,0];u&&(S=Array.isArray(u)?u:[u,u,u,u]),this.boundsMargin=S,s!=null&&s.monitorTextureCache&&setInterval(()=>{L(this.txManager);const x=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",x.idCacheSize),console.log("Texture Key Cache Size: ",x.keyCacheSize)},1e3),this.renderer=new Yi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:Ms,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new ts(this),sdf:new bs(this)},this.fontManager=new Mo(this.textRenderers);const p=new fr(this,{id:i,x:0,y:0,width:a,height:c,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=p,Bs(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=ks(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){L(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});d(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),L(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){L(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class Ds extends er{constructor(n,e,t){super(n,e,t,new Ps(t,{id:gr(),x:n.x,y:n.y,width:n.width,height:n.height,alpha:n.alpha,autosize:n.autosize,clipping:n.clipping,color:n.color,colorTop:n.colorTop,colorBottom:n.colorBottom,colorLeft:n.colorLeft,colorRight:n.colorRight,colorTl:n.colorTl,colorTr:n.colorTr,colorBl:n.colorBl,colorBr:n.colorBr,zIndex:n.zIndex,zIndexLocked:n.zIndexLocked,scaleX:n.scaleX,scaleY:n.scaleY,mountX:n.mountX,mountY:n.mountY,mount:n.mount,pivot:n.pivot,pivotX:n.pivotX,pivotY:n.pivotY,rotation:n.rotation,text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStretch:n.fontStretch,fontStyle:n.fontStyle,contain:n.contain,scrollable:n.scrollable,letterSpacing:n.letterSpacing,textAlign:n.textAlign,scrollY:n.scrollY,offsetY:n.offsetY,textRendererOverride:n.textRendererOverride,lineHeight:n.lineHeight,maxLines:n.maxLines,textBaseline:n.textBaseline,verticalAlign:n.verticalAlign,overflowSuffix:n.overflowSuffix,debug:n.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(n){this.coreNode.text=n}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(n){this.coreNode.textRendererOverride=n}get fontSize(){return this.coreNode.fontSize}set fontSize(n){this.coreNode.fontSize=n}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(n){this.coreNode.fontFamily=n}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(n){this.coreNode.fontWeight=n}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(n){this.coreNode.fontStretch=n}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(n){this.coreNode.fontStyle=n}get textAlign(){return this.coreNode.textAlign}set textAlign(n){this.coreNode.textAlign=n}get contain(){return this.coreNode.contain}set contain(n){this.coreNode.contain=n}get scrollable(){return this.coreNode.scrollable}set scrollable(n){this.coreNode.scrollable=n}get scrollY(){return this.coreNode.scrollY}set scrollY(n){this.coreNode.scrollY=n}get offsetY(){return this.coreNode.offsetY}set offsetY(n){this.coreNode.offsetY=n}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(n){this.coreNode.letterSpacing=n}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(n){n&&(this.coreNode.lineHeight=n)}get maxLines(){return this.coreNode.maxLines}set maxLines(n){n&&(this.coreNode.maxLines=n)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(n){n&&(this.coreNode.textBaseline=n)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(n){n&&(this.coreNode.verticalAlign=n)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(n){n&&(this.coreNode.overflowSuffix=n)}get debug(){return this.coreNode.debug}set debug(n){this.coreNode.debug=n}}class Os{constructor(){d(this,"root",null);d(this,"stage",null);d(this,"rendererMain",null)}async init(n,e,t){this.stage=new zs({rootId:gr(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=n,L(this.stage.root);const o=new er(n.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await As(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(n){L(this.rendererMain),L(this.stage);const e=new er(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){L(this.rendererMain),L(this.stage);const e=new Ds(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(n){n.destroy()}releaseTexture(n){const{stage:e}=this;L(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return L(this.root),this.root}onCreateNode(n){throw new Error("Method not implemented.")}onBeforeDestroyNode(n){throw new Error("Method not implemented.")}onFpsUpdate(n){throw new Error("Method not implemented.")}onFrameTick(n){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}const Po=(r,n)=>r===n,pn=Symbol("solid-proxy"),Ws=Symbol("solid-track"),mn={equals:Po};let Do=Qo;const Te=1,xn=2,Oo={owned:null,cleanups:null,context:null,owner:null},Un={};var $=null;let $n=null,Us=null,H=null,le=null,ke=null,Bn=0;function wt(r,n){const e=H,t=$,o=r.length===0,i=n===void 0?t:n,s=o?Oo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?r:()=>r(()=>ce(()=>En(s)));$=s,H=null;try{return Ee(a,!0)}finally{H=e,$=t}}function Y(r,n){n=n?Object.assign({},mn,n):mn;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),jo(e,o));return[Ho.bind(e),t]}function nr(r,n,e){const t=Ut(r,n,!0,Te);lt(t)}function Be(r,n,e){const t=Ut(r,n,!1,Te);lt(t)}function Ke(r,n,e){Do=Ks;const t=Ut(r,n,!1,Te);(!e||!e.render)&&(t.user=!0),ke?ke.push(t):lt(t)}function q(r,n,e){e=e?Object.assign({},mn,e):mn;const t=Ut(r,n,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,lt(t),Ho.bind(t)}function $s(r){return r&&typeof r=="object"&&"then"in r}function rt(r,n,e){let t,o,i;arguments.length===2&&typeof n=="object"||arguments.length===1?(t=!0,o=r,i=n||{}):(t=r,o=n,i=e||{});let s=null,a=Un,c=!1,u="initialValue"in i,h=typeof t=="function"&&q(t);const g=new Set,[v,S]=(i.storage||Y)(i.initialValue),[p,x]=Y(void 0),[b,A]=Y(void 0,{equals:!1}),[w,y]=Y(u?"ready":"unresolved");function m(T,_,E,P){return s===T&&(s=null,P!==void 0&&(u=!0),(T===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),a=Un,C(_,E)),_}function C(T,_){Ee(()=>{_===void 0&&S(()=>T),y(_!==void 0?"errored":u?"ready":"unresolved"),x(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function R(){const T=js,_=v(),E=p();if(E!==void 0&&!s)throw E;return H&&!H.user&&T&&nr(()=>{b(),s&&(T.resolved||g.has(T)||(T.increment(),g.add(T)))}),_}function I(T=!0){if(T!==!1&&c)return;c=!1;const _=h?h():t;if(_==null||_===!1){m(s,ce(v));return}const E=a!==Un?a:ce(()=>o(_,{value:v(),refetching:T}));return $s(E)?(s=E,"value"in E?(E.status==="success"?m(s,E.value,void 0,_):m(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Ee(()=>{y(u?"refreshing":"pending"),A()},!1),E.then(P=>m(E,P,void 0,_),P=>m(E,void 0,Ko(P),_)))):(m(s,E,void 0,_),E)}return Object.defineProperties(R,{state:{get:()=>w()},error:{get:()=>p()},loading:{get(){const T=w();return T==="pending"||T==="refreshing"}},latest:{get(){if(!u)return R();const T=p();if(T&&!s)throw T;return v()}}}),h?nr(()=>I(!1)):I(!1),[R,{refetch:I,mutate:S}]}function Wo(r,n=Po,e){const t=new Map,o=Ut(i=>{const s=r();for(const[a,c]of t.entries())if(n(a,s)!==n(a,i))for(const u of c.values())u.state=Te,u.pure?le.push(u):ke.push(u);return s},void 0,!0,Te);return lt(o),i=>{const s=H;if(s){let a;(a=t.get(i))?a.add(s):t.set(i,a=new Set([s])),Pe(()=>{a.delete(s),!a.size&&t.delete(i)})}return n(i,o.value)}}function Ys(r){return Ee(r,!1)}function ce(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function at(r,n,e){const t=Array.isArray(r);let o,i=e&&e.defer;return s=>{let a;if(t){a=Array(r.length);for(let u=0;un(a,o,s));return o=a,c}}function Oe(r){Ke(()=>ce(r))}function Pe(r){return $===null||($.cleanups===null?$.cleanups=[r]:$.cleanups.push(r)),r}function Wt(){return $}function Uo(r,n){const e=$,t=H;$=r,H=null;try{return Ee(n,!0)}catch(o){pr(o)}finally{$=e,H=t}}function Hs(r){const n=H,e=$;return Promise.resolve().then(()=>{H=n,$=e;let t;return Ee(r,!1),H=$=null,t?t.done:void 0})}function $o(r,n){const e=Symbol("context");return{id:e,Provider:Vs(e),defaultValue:r}}function Yo(r){return $&&$.context&&$.context[r.id]!==void 0?$.context[r.id]:r.defaultValue}function kn(r){const n=q(r),e=q(()=>rr(n()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let js;function Ho(){if(this.sources&&this.state)if(this.state===Te)lt(this);else{const r=le;le=null,Ee(()=>vn(this),!1),le=r}if(H){const r=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(r)):(H.sources=[this],H.sourceSlots=[r]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function jo(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Ee(()=>{for(let o=0;o1e6)throw le=[],new Error},!1)),n}function lt(r){if(!r.fn)return;En(r);const n=Bn;Qs(r,r.value,n)}function Qs(r,n,e){let t;const o=$,i=H;H=$=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Te,r.owned&&r.owned.forEach(En),r.owned=null),r.updatedAt=e+1,pr(s)}finally{H=i,$=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?jo(r,t):r.value=t,r.updatedAt=e)}function Ut(r,n,e,t=Te,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:$,context:$?$.context:null,pure:e};return $===null||$!==Oo&&($.owned?$.owned.push(i):$.owned=[i]),i}function yn(r){if(r.state===0)return;if(r.state===xn)return vn(r);if(r.suspense&&ce(r.suspense.inFallback))return r.suspense.effects.push(r);const n=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt=0;e--)if(r=n[e],r.state===Te)lt(r);else if(r.state===xn){const t=le;le=null,Ee(()=>vn(r,n[0]),!1),le=t}}function Ee(r,n){if(le)return r();let e=!1;n||(le=[]),ke?e=!0:ke=[],Bn++;try{const t=r();return Xs(e),t}catch(t){e||(ke=null),le=null,pr(t)}}function Xs(r){if(le&&(Qo(le),le=null),r)return;const n=ke;ke=null,n.length&&Ee(()=>Do(n),!1)}function Qo(r){for(let n=0;n=0;n--)En(r.owned[n]);r.owned=null}if(r.cleanups){for(n=r.cleanups.length-1;n>=0;n--)r.cleanups[n]();r.cleanups=null}r.state=0}function Ko(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function pr(r,n=$){throw Ko(r)}function rr(r){if(typeof r=="function"&&!r.length)return rr(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=ce(()=>($.context={...$.context,[r]:t.value},kn(()=>t.children))),void 0),o}}const Gs=Symbol("fallback");function $r(r){for(let n=0;n1?[]:null;return Pe(()=>$r(i)),()=>{let c=r()||[],u,h;return c[Ws],ce(()=>{let v=c.length,S,p,x,b,A,w,y,m,C;if(v===0)s!==0&&($r(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[Gs],o[0]=wt(R=>(i[0]=R,e.fallback())),s=1);else if(s===0){for(o=new Array(v),h=0;h=w&&m>=w&&t[y]===c[m];y--,m--)x[m]=o[y],b[m]=i[y],a&&(A[m]=a[y]);for(S=new Map,p=new Array(m+1),h=m;h>=w;h--)C=c[h],u=S.get(C),p[h]=u===void 0?-1:u,S.set(C,h);for(u=w;u<=y;u++)C=t[u],h=S.get(C),h!==void 0&&h!==-1?(x[h]=o[u],b[h]=i[u],a&&(A[h]=a[u]),h=p[h],S.set(C,h)):i[u]();for(h=w;hr(n||{}))}function tn(){return!0}const or={get(r,n,e){return n===pn?e:r.get(n)},has(r,n){return n===pn?!0:r.has(n)},set:tn,deleteProperty:tn,getOwnPropertyDescriptor(r,n){return{configurable:!0,enumerable:!0,get(){return r.get(n)},set:tn,deleteProperty:tn}},ownKeys(r){return r.keys()}};function Yn(r){return(r=typeof r=="function"?r():r)?r:{}}function Zs(){for(let r=0,n=this.length;r=0;a--){const c=Yn(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in Yn(r[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=r[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let u=c.length-1;u>=0;u--){const h=c[u];if(h==="__proto__"||h==="constructor")continue;const g=Object.getOwnPropertyDescriptor(a,h);if(!t[h])t[h]=g.get?{enumerable:!0,configurable:!0,get:Zs.bind(e[h]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const v=e[h];v&&(g.get?v.push(g.get.bind(a)):g.value!==void 0&&v.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const a=i[s],c=t[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function Js(r,...n){if(pn in r){const o=new Set(n.length>1?n.flat():n[0]),i=n.map(s=>new Proxy({get(a){return s.includes(a)?r[a]:void 0},has(a){return s.includes(a)&&a in r},keys(){return s.filter(a=>a in r)}},or));return i.push(new Proxy({get(s){return o.has(s)?void 0:r[s]},has(s){return o.has(s)?!1:s in r},keys(){return Object.keys(r).filter(s=>!o.has(s))}},or)),i}const e={},t=n.map(()=>({}));for(const o of Object.getOwnPropertyNames(r)){const i=Object.getOwnPropertyDescriptor(r,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,c=0;for(const u of n)u.includes(o)&&(a=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;a||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const ea=r=>"Stale read from <".concat(r,">.");function Fn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return q(qs(()=>r.each,r.children,n||void 0))}function De(r){const n=r.keyed,e=q(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o});return q(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?ce(()=>o(n?t:()=>{if(!ce(e))throw ea("Show");return r.when})):o}return r.fallback},void 0,void 0)}const ta=void 0;let ze,xr;function na(r={},n="app"){const e=new Os;return ze=new Cs(r,n,e),xr=ze.createShader.bind(ze),ze}class ra extends Array{constructor(e){super();d(this,"_parent");this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){const o=this.indexOf(t);this.splice(o,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){const t=this.indexOf(e);t>=0&&this.splice(t,1)}}function oa(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const ia=oa()||!1,me={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Yr(r){return sa(r)&&r.debug}function tt(r,n,...e){ia&&(me.debug||Yr(n)||Yr(e[0]))&&console.log(r,n,...e)}function nn(r){return typeof r=="function"}function sa(r){return typeof r=="object"}function wn(r){return Array.isArray(r)}function aa(r){return typeof r=="string"}function la(r){return typeof r=="number"}function ca(r){return Number.isInteger(r)}function ua(r,n){for(const e of n)if(e in r)return!0;return!1}function Go(r,n={}){if(wn(r))r.forEach(e=>{Go(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class Hr extends Array{constructor(e,t={}){var n=(...od)=>(super(...od),d(this,"onChange"),this);return wn(t)?n(...t):aa(t)?n(t):n(...Object.entries(t).filter(([o,i])=>i).map(([o])=>o)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){const t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}function da(r){const n=[];let e=!1;for(let y=0;y(y.flexOrder||0)-(m.flexOrder||0));const t=n.length,i=(r.flexDirection||"row")==="row",s=i?"width":"height",a=i?"height":"width",c=i?"marginLeft":"marginTop",u=i?"marginRight":"marginBottom",h=i?"x":"y",g=i?"y":"x",v=r[s]||0,S=r[a]||0,p=r.gap||0,x=r.justifyContent||"flexStart",b=r.alignItems;let A=0;["center","spaceBetween","spaceEvenly"].includes(x)&&(A=n.reduce((y,m)=>y+(m[s]||0),0));const w=S&&b?y=>{b==="flexStart"?y[g]=0:b==="center"?y[g]=(S-(y[a]||0))/2:b==="flexEnd"&&(y[g]=S-(y[a]||0))}:y=>y;if(x==="flexStart"){let y=0;if(n.forEach(m=>{m[h]=y+(m[c]||0),y+=(m[s]||0)+p+(m[c]||0)+(m[u]||0),w(m)}),r.flexBoundary!=="fixed"){const m=y-p;if(m!==r[s])return r[s]=m,!0}}else if(x==="flexEnd"){let y=v;for(let m=t-1;m>=0;m--){const C=n[m];L(C),C[h]=y-(C[s]||0)-(C[u]||0),y-=(C[s]||0)+p+(C[c]||0)+(C[u]||0),w(C)}}else if(x==="center"){let y=(v-(A+p*(t-1)))/2;n.forEach(m=>{m[h]=y,y+=(m[s]||0)+p,w(m)})}else if(x==="spaceBetween"){const y=(v-A)/(t-1);let m=0;n.forEach(C=>{C[h]=m,m+=(C[s]||0)+y,w(C)})}else if(x==="spaceEvenly"){const y=(v-A)/(t+1);let m=y;n.forEach(C=>{C[h]=m,m+=(C[s]||0)+y,w(C)})}return!1}const[yr,qo]=Y(void 0),{animationSettings:ha}=me;function jr(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return xr("DynamicShader",{effects:n})}function Tt(r=""){return{set(n){la(n)&&(n={width:n,color:255}),this.effects={...this.effects||{},["border".concat(r)]:n},this["_border".concat(r)]=n},get(){return this["_border".concat(r)]}}}const fa=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],ga=["autosize","clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class Ae extends Object{constructor(e){super();d(this,"id");d(this,"debug");d(this,"name");d(this,"lng");d(this,"renderer");d(this,"selected");d(this,"autofocus");d(this,"flexItem");d(this,"flexOrder");d(this,"flexBoundary");d(this,"_queueDelete");d(this,"forwardFocus");d(this,"_undoStyles");d(this,"_renderProps");d(this,"_effects");d(this,"_parent");d(this,"_shader");d(this,"_style");d(this,"_states");d(this,"_events");d(this,"_animationSettings");d(this,"_borderRadius");d(this,"_border");d(this,"_borderLeft");d(this,"_borderRight");d(this,"_borderTop");d(this,"_borderBottom");d(this,"_autosized");d(this,"_isDirty");d(this,"_animationQueue",[]);d(this,"_animationQueueSettings");d(this,"_animationRunning",!1);d(this,"children");this.name=e,this._renderProps={},this.children=new ra(this)}get effects(){return this._effects}set effects(e){this._effects=e,this.lng&&(this.shader=jr(e))}get parent(){return this._parent}set parent(e){var t;this._parent=e,this.lng&&(this.lng.parent=(t=e==null?void 0:e.lng)!=null?t:null)}get shader(){return this._shader}set shader(e){wn(e)?this._shader=xr(...e):this._shader=e,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(e,t){if(this.lng){if(me.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[e])){const o=this.transition===!0||this.transition[e]===!0?void 0:this.transition[e];return this.animate({[e]:t},o).start()}this.lng[e]=t}else this._renderProps[e]=t}_sendToLightning(e,t){this.lng?this.lng[e]=t:this._renderProps[e]=t}animate(e,t){return L(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}chain(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}async start(){let e=this._animationQueue.shift();for(;e;)this._animationRunning=!0,await this.animate(e.props,e.animationSettings).start().waitUntilStopped(),e=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.lng){if(this.forwardFocus!==void 0)if(nn(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const e=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(e!==null&&eqo(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(e,t)=>{if(t.type==="text"){const{dimensions:o}=t;this.parent.updateLayout(this,o)}})}getText(){return this.children.map(e=>e.text).join("")}destroy(){var e;this._queueDelete&&((e=this.lng)==null||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){wn(e)?this._style=Go(e):this._style=e;for(const t in this._style)this[t]===void 0&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find(t=>t.id===e)}searchChildrenById(e){for(const t of this.children){if(t.id===e)return t;if(t instanceof Ae){const o=t.searchChildrenById(e);if(o)return o}}}set states(e){this._states=new Hr(this._stateChanged.bind(this),e),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new Hr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||ha}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){var o;this.hasChildren&&(tt("Layout: ",this),nn(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),this.display==="flex"&&da(this)&&((o=this.parent)==null||o.updateLayout()),nn(this.onLayout)&&this.onLayout.call(this,e,t))}_stateChanged(){if(tt("State Changed: ",this,this.states),this.forwardStates){const t=this.states.slice();this.children.forEach(o=>o.states=t)}const e=this.states;if(this._undoStyles||this.style&&ua(this.style,e)){this._undoStyles=this._undoStyles||[];const t={};this._undoStyles.forEach(i=>{t[i]=this.style[i]});const o=e.reduce((i,s)=>{const a=this.style[s];return a&&(i={...i,...a}),i},{});this._undoStyles=Object.keys(o),o.transition!==void 0&&(this.transition=o.transition),Object.assign(this,t,o)}}render(){const e=this,t=this.parent;if(!t){console.warn("Parent not set - no node created for: ",this);return}if(!t.lng){console.warn("Parent not rendered yet: ",this);return}if(this.lng){console.warn("Node already rendered: ",this);return}t._isDirty&&(t.updateLayout(),t._isDirty=!1),this.states.length&&this._stateChanged();const o=e._renderProps;if(o.x=o.x||0,o.y=o.y||0,t.lng&&(o.parent=t.lng),e._effects&&(this.shader=jr(e._effects)),e.isTextNode()){if(me.fontSettings)for(const i in me.fontSettings)o[i]===void 0&&(o[i]=me.fontSettings[i]);o.text=e.getText(),o.contain&&(o.width||(o.width=(t.width||0)-o.x-(o.marginRight||0),e._autosized=!0),o.contain==="both"&&!o.height&&!o.maxLines&&(o.height=(t.height||0)-o.y-(o.marginBottom||0),e._autosized=!0)),tt("Rendering: ",this,o),e.lng=ze.createTextNode(o),(!o.width||!o.height)&&(e._autosized=!0,e._resizeOnTextLoad())}else o.texture||(isNaN(o.width)&&(o.width=(t.width||0)-o.x,e._autosized=!0),isNaN(o.height)&&(o.height=(t.height||0)-o.y,e._autosized=!0),!o.color&&!o.src&&(o.color=0)),tt("Rendering: ",this,o),e.lng=ze.createNode(o);e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad),nn(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach(([i,s])=>{var a;(a=e.lng)==null||a.on(i,(c,u)=>s(e,u))}),e.lng.div&&(e.lng.div.solid=e),e.name!=="text"&&e.children.forEach(i=>{i.render?i.render():i.text!==""&&console.warn("TextNode outside of : ",i)}),e.autofocus&&e.setFocus(),delete this._renderProps}}for(const r of fa)Object.defineProperty(Ae.prototype,r,{get(){return this.lng?this.lng[r]:this._renderProps[r]},set(n){this._sendToLightningAnimatable(r,n)}});for(const r of ga)Object.defineProperty(Ae.prototype,r,{get(){return this.lng?this.lng[r]:this._renderProps[r]},set(n){this._sendToLightning(r,n)}});Object.defineProperties(Ae.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:Tt(),borderLeft:Tt("Left"),borderRight:Tt("Right"),borderTop:Tt("Top"),borderBottom:Tt("Bottom")});Object.defineProperties(Ae.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const F=r=>(()=>{var n=$t("text");return Nn(n,r,!1),n})(),N=r=>(()=>{var n=$t("node");return Nn(n,r,!1),n})();function pa({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:u}){function h(w,y,m,C){if(m!==void 0&&!C&&(C=[]),typeof y!="function")return g(w,y,C,m);Be(R=>g(w,y(),R,m),C)}function g(w,y,m,C,R){for(;typeof m=="function";)m=m();if(y===m)return m;const I=typeof y,T=C!==void 0;if(I==="string"||I==="number")if(I==="number"&&(y=y.toString()),T){let _=m[0];_&&e(_)?t(_,y):_=n(y),m=p(w,m,C,_)}else m!==""&&typeof m=="string"?t(c(w),m=y):(p(w,m,C,n(y)),m=y);else if(y==null||I==="boolean")m=p(w,m,C);else{if(I==="function")return Be(()=>{let _=y();for(;typeof _=="function";)_=_();m=g(w,_,m,C)}),()=>m;if(Array.isArray(y)){const _=[];if(v(_,y,R))return Be(()=>m=g(w,_,m,C,!0)),()=>m;if(_.length===0){const E=p(w,m,C);if(T)return m=E}else Array.isArray(m)?m.length===0?x(w,_,C):S(w,m,_):m==null||m===""?x(w,_):S(w,T&&m||[c(w)],_);m=_}else{if(Array.isArray(m)){if(T)return m=p(w,m,C,y);p(w,m,null,y)}else m==null||m===""||!c(w)?o(w,y):b(w,y,c(w));m=y}}return m}function v(w,y,m){let C=!1;for(let R=0,I=y.length;Rk-_){const U=y[T];for(;_=0;T--){const _=y[T];if(R!==_){const E=a(_)===w;!I&&!T?E?b(w,R,_):o(w,R,m):E&&i(w,_)}else I=!0}}else o(w,R,m);return[R]}function x(w,y,m){for(let C=0,R=y.length;Cm.children=g(w,y.children,m.children)),Be(()=>y.ref&&y.ref(w)),Be(()=>{for(const R in y){if(R==="children"||R==="ref")continue;const I=y[R];I!==m[R]&&(s(w,R,I,m[R]),m[R]=I)}}),m}return{render(w,y){let m;return wt(C=>{m=C,h(y,w())}),m},insert:h,spread(w,y,m){typeof y=="function"?Be(C=>A(w,y(),C,m)):A(w,y,void 0,m)},createElement:r,createTextNode:n,insertNode:o,setProp(w,y,m,C){return s(w,y,m,C),m},mergeProps:mr,effect:Be,memo:q,createComponent:Vo,use(w,y,m){return ce(()=>w(y,m))}}}function ma(r){const n=pa(r);return n.mergeProps=mr,n}const xa={createElement(r){return new Ae(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){tt("Replace Text: ",r,n),r.text=n;const e=r.parent;L(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){tt("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof Ae?r.lng&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){tt("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof Ae&&queueMicrotask(()=>n.destroy())},getParentNode(r){return r.parent},getFirstChild(r){return r.children[0]},getNextSibling(r){const n=r.parent.children||[],e=n.indexOf(r)+1;if(er.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of r)a.listener({...s,from:a.location,retry:c=>{c&&(e=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:n,confirm:t}}let ir;function vr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),ir=window.history.state._depth}vr();function Aa(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function Ca(r,n){let e=!1;return()=>{const t=ir;vr();const o=t==null?null:ir-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const Ta=/^(?:[a-z0-9]+:)?\/\//i,_a=/^\/+|(\/)\/+$/g,ni="http://sr";function Nt(r,n=!1){const e=r.replace(_a,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function hn(r,n,e){if(Ta.test(n))return;const t=Nt(r),o=e&&Nt(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Nt(n,!i)}function Ia(r,n){if(r==null)throw new Error(n);return r}function Ra(r,n){return Nt(r).replace(/\/*(\*.*)?$/g,"")+Nt(n)}function ri(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function oi(r,n,e){const[t,o]=r.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return a=>{const c=a.split("/").filter(Boolean),u=c.length-s;if(u<0||u>0&&o===void 0&&!n)return null;const h={path:s?"":"/",params:{}},g=v=>e===void 0?void 0:e[v];for(let v=0;vt.localeCompare(r,void 0,{sensitivity:"base"})===0;return n===void 0?!0:typeof n=="string"?e(n):typeof n=="function"?n(r):Array.isArray(n)?n.some(e):n instanceof RegExp?n.test(r):!1}function Ba(r){const[n,e]=r.pattern.split("/*",2),t=n.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function ii(r){const n=new Map,e=Wt();return new Proxy({},{get(t,o){return n.has(o)||Uo(e,()=>n.set(o,q(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function wr(r){let n=/(\/?\:[^\/]+)\?/.exec(r);if(!n)return[r];let e=r.slice(0,n.index),t=r.slice(n.index+n[0].length);const o=[e,e+=n[1]];for(;n=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=n[1]),t=t.slice(n[0].length);return wr(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const ka=100,si=$o(),ai=$o(),br=()=>Ia(Yo(si)," and 'use' router primitives can be only used inside a Route."),St=()=>br().navigatorFactory(),li=()=>br().location,Ea=(r,n)=>{const e=li(),t=q(()=>wr(r()).map(o=>oi(o,void 0,n)));return q(()=>{for(const o of t()){const i=o(e.pathname);if(i)return i}})},Sr=()=>br().params;function Fa(r,n=""){const{component:e,load:t,children:o,info:i}=r,s=!o||Array.isArray(o)&&!o.length,a={key:r,component:e,load:t,info:i};return ci(r.path).reduce((c,u)=>{for(const h of wr(u)){const g=Ra(n,h);let v=s?g:g.split("/*",1)[0];v=v.split("/").map(S=>S.startsWith(":")||S.startsWith("*")?S:encodeURIComponent(S)).join("/"),c.push({...a,originalPath:h,pattern:v,matcher:oi(v,!s,r.matchFilters)})}return c},[])}function Na(r,n=0){return{routes:r,score:Ba(r[r.length-1])*1e4-n,matcher(e){const t=[];for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function ci(r){return Array.isArray(r)?r:[r]}function ui(r,n="",e=[],t=[]){const o=ci(r);for(let i=0,s=o.length;is.score-i.score)}function Xr(r,n){for(let e=0,t=r.length;e{const u=r();try{return new URL(u,e)}catch(h){return console.error("Invalid path ".concat(u)),c}},e,{equals:(c,u)=>c.href===u.href}),o=q(()=>t().pathname),i=q(()=>t().search,!0),s=q(()=>t().hash),a=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return n()},get key(){return a()},query:ii(at(i,()=>ri(t())))}}let je;function Ma(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(k=>k),c=s.renderPath||(k=>k),u=s.beforeLeave||ti(),h=hn("",t.base||"");if(h===void 0)throw new Error("".concat(h," is not a valid base path"));h&&!o().value&&i({value:h,replace:!0,scroll:!1});const[g,v]=Y(!1),S=async k=>{v(!0);try{await Hs(k)}finally{v(!1)}},[p,x]=Y(o().value),[b,A]=Y(o().state),w=La(p,b),y=[],m=Y([]),C=q(()=>Xr(n(),w.pathname)),R=ii(()=>{const k=C(),z={};for(let O=0;Oh,outlet:()=>null,resolvePath(k){return hn(h,k)}};return Be(()=>{const{value:k,state:z}=o();ce(()=>{k!==p()&&S(()=>{je="native",x(k),A(z),m[1]([])}).then(()=>{je=void 0})})}),{base:I,location:w,params:R,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:C,beforeLeave:u,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:m};function T(k,z,O){ce(()=>{if(typeof z=="number"){z&&(s.go?s.go(z):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:U,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},ne=U?k.resolvePath(z):hn("",z);if(ne===void 0)throw new Error("Path '".concat(z,"' is not a routable path"));if(y.length>=ka)throw new Error("Too many redirects");const he=p();if((ne!==he||se!==b())&&!Sa){if(u.confirm(ne,O)){const _e=y.push({value:he,replace:D,scroll:j,state:b()});S(()=>{je="navigate",x(ne),A(se),m[1]([])}).then(()=>{y.length===_e&&(je=void 0,E({value:ne,state:se}))})}}})}function _(k){return k=k||Yo(ai)||I,(z,O)=>T(k,z,O)}function E(k){const z=y[0];z&&((k.value!==z.value||k.state!==z.state)&&i({...k,replace:z.replace,scroll:z.scroll}),y.length=0)}function P(k,z){const O=Xr(n(),k.pathname),D=je;je="preload";for(let U in O){const{route:j,params:se}=O[U];j.component&&j.component.preload&&j.component.preload();const{load:ne}=j;z&&ne&&Uo(e(),()=>ne({params:se,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:ri(k),state:null,key:""},intent:"preload"}))}je=D}}function za(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:u}=t().route,h=q(()=>t().path);c&&c.preload&&c.preload();const g=u?u({params:s,location:i,intent:je||"initial"}):void 0;return{parent:n,pattern:a,path:h,outlet:()=>c?Vo(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(S){return hn(o.path(),S,h())}}}const Pa=r=>n=>{const{base:e}=n,t=kn(()=>n.children),o=q(()=>ui(t(),n.base||""));let i;const s=Ma(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(si.Provider,{value:s,get children(){return l(Da,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[bt(()=>(i=Wt())&&null),l(Oa,{routerState:s,get branches(){return o()}})]}})}})};function Da(r){const n=r.routerState.location,e=r.routerState.params,t=q(()=>r.load&&ce(()=>r.load({params:e,location:n,intent:"preload"})));return l(De,{get when(){return r.root},keyed:!0,get fallback(){return r.children},children:o=>l(o,{params:e,location:n,get data(){return t()},get children(){return r.children}})})}function Oa(r){const n=[];let e;const t=q(at(r.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const c=[];for(let u=0,h=o.length;u{n[u]=S,c[u]=za(r.routerState,c[u-1]||r.routerState.base,Kr(()=>t()[u+1]),()=>r.routerState.matches()[u])}))}return n.splice(o.length).forEach(u=>u()),s&&a?s:(e=c[0],c)}));return Kr(()=>t()&&e)()}const Kr=r=>()=>l(De,{get when(){return r()},keyed:!0,children:n=>l(ai.Provider,{value:n,get children(){return n.outlet()}})}),ge=r=>{const n=kn(()=>r.children);return mr(r,{get children(){return n()}})};function Wa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function Ua(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function $a(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=Wa(Y(e(r.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!n&&r.set(o),o));return r.init&&Pe(r.init((o=r.get())=>{n=!0,t[1](e(o)),n=!1})),Pa({signal:t,create:r.create,utils:r.utils})}function Ya(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function Ha(r,n){const e=Ua("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const ja=new Map;function Qa(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const x=p.composedPath().find(C=>C instanceof Node&&C.nodeName.toUpperCase()==="A");if(!x||n&&!x.hasAttribute("link"))return;const b=a(x),A=b?x.href.baseVal:x.href;if((b?x.target.baseVal:x.target)||!A&&!x.hasAttribute("state"))return;const y=(x.getAttribute("rel")||"").split(/\s+/);if(x.hasAttribute("download")||y&&y.includes("external"))return;const m=b?new URL(A,document.baseURI):new URL(A);if(!(m.origin!==window.location.origin||o&&m.pathname&&!m.pathname.toLowerCase().startsWith(o.toLowerCase())))return[x,m]}function u(p){const x=c(p);if(!x)return;const[b,A]=x,w=t.parsePath(A.pathname+A.search+A.hash),y=b.getAttribute("state");p.preventDefault(),i(w,{resolve:!1,replace:b.hasAttribute("replace"),scroll:!b.hasAttribute("noscroll"),state:y&&JSON.parse(y)})}function h(p){const x=c(p);if(!x)return;const[b,A]=x;s[A.pathname]||t.preloadRoute(A,b.getAttribute("preload")!=="false")}function g(p){const x=c(p);if(!x)return;const[b,A]=x;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,b.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function v(p){const x=c(p);if(!x)return;const[,b]=x;s[b.pathname]&&(clearTimeout(s[b.pathname]),delete s[b.pathname])}function S(p){let x=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!x)return;if(!x.startsWith("https://action/")){const A=new URL(x,ni);if(x=t.parsePath(A.pathname+A.search),!x.startsWith(e))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const b=ja.get(x);if(b){p.preventDefault();const A=new FormData(p.target);p.submitter&&p.submitter.name&&A.append(p.submitter.name,p.submitter.value),b.call({r:t,f:p.target},A)}}wa(["click","submit"]),document.addEventListener("click",u),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",v),document.addEventListener("focusin",h),document.addEventListener("touchstart",h)),document.addEventListener("submit",S),Pe(()=>{document.removeEventListener("click",u),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",v),document.removeEventListener("focusin",h),document.removeEventListener("touchstart",h)),document.removeEventListener("submit",S)})}}function Xa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function Ka(r){const n=()=>window.location.hash.slice(1),e=ti();return $a({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Aa(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";Ha(c,i),vr()},init:t=>Ya(window,"hashchange",Ca(t,o=>!e.confirm(o&&o<0?o:n()))),create:Qa(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:Xa,beforeLeave:e}})(r)}var Va=!!ta,Ga=Va?r=>Wt()?Pe(r):r:Pe;function qa(r,n,e,t){return r.addEventListener(n,e,t),Ga(r.removeEventListener.bind(r,n,e,t))}function Za(r,n=Wt()){let e=0,t,o;return()=>(e++,Pe(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||wt(i=>t=r(o=i),n),t)}var Ja=Za(()=>{const[r,n]=Y(null);return qa(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function rn(r){return typeof r=="function"}function el(r){return Array.isArray(r)}const on={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[bn,tl]=Y([]),nl=r=>{const n=Ja();if(r)for(const[e,t]of Object.entries(r))el(t)?t.forEach(o=>{on[o]=e}):on[t]=e;return Ke(at(yr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),rn(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(a=>{s.includes(a)||(a.states.remove("focus"),rn(a.onBlur)&&a.onBlur.call(a,e,t))}),tl(s),s},{defer:!0})),Ke(()=>{const e=n();if(e){const t=on[e.key]||on[e.keyCode];ce(()=>{const o=bn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(rn(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(rn(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),bn};function di(r,n){const e=n();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,r.onBeforeLayout=(a,c)=>{if(c){r.width=r.children.reduce((g,v)=>g+(v.width||0),0)+o+i;const u=r.children[0];u&&(u.x=o,u.marginLeft=o);let h=0;r.children.forEach(g=>{g.y=t,g.marginTop=t,h=Math.max(h,g.height||0)}),r.height=h+t+s}}}function rl(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function ol(r,n,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(r);s.lang=e,s.onend=()=>{o()},s.onerror=a=>{i(a)},n.push(s),t.speak(s)})}function sr(r,n,e=!0){const t=window.speechSynthesis,o=rl(Array.isArray(r)?r:[r]),i=[],s=[];let a=!0;return{series:(async()=>{try{for(;a&&o.length;){const u=await Promise.resolve(o.shift());if(a){if(typeof u=="string"&&u.includes("PAUSE-")){let h=Number(u.split("PAUSE-")[1])*1e3;isNaN(h)&&(h=0),await Vr(h)}else if(typeof u=="string"&&u.length){let g=3;for(;a&&g>0;)try{await ol(u,s,n),g=0}catch(v){if(v instanceof SpeechSynthesisErrorEvent)if(v.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Vr(500*(3-g));else if(v.error==="canceled"||v.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(v.error));else throw v}}else if(typeof u=="function"){const h=sr(u(),n,!1);i.push(h),await h.series}else if(Array.isArray(u)){const h=sr(u,n,!1);i.push(h),await h.series}}else break}}finally{a=!1}})(),get active(){return a},append:u=>{o.push(u)},cancel:()=>{a&&(e&&t.cancel(),i.forEach(u=>{u.cancel()}),a=!1)}}}let sn;function il(r,n="en-US"){return sn&&sn.cancel(),sn=sr(r,n),sn}var ar=(r,n)=>{let e;const t=()=>clearTimeout(e);return Wt()&&Pe(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let lr,Lt=[],Re,cr=!1;const sl=3e5;function Gr(r,n){const e=ar(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function _t(r){return r.id||r.name}function al(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Lt.includes(i));if(lr(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Lt=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([_t(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([_t(s),"Title",s.title]),t.push(s.title)):i.push([_t(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([_t(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([_t(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function ll(r){if(!cr)return Re=il(r)}const oe={debug:!1,enabled:!0,cancel:function(){Re&&Re.cancel()},clearPrevFocus:function(r=0){Lt=Lt.slice(0,r),lr()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&Re&&Re.active?Re.append(r):(oe.cancel(),ll(r)),e&&(cr=!0,Re==null||Re.series.finally(()=>{cr=!1,oe.refresh()}).catch(console.error))),Re},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(ce(()=>bn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=sl}={}){oe.onFocusChange=Gr(al,r),lr=Gr(()=>{Lt=[]},n)}},cl=()=>(oe.setupTimers(),Ke(at(bn,oe.onFocusChange,{defer:!0})),oe);function ul(r,n){const e=ze.createTexture("ImageTexture",{src:r});return n.reduce((t,o)=>{const{x:i,y:s,width:a,height:c}=o;return t[o.name]=ze.createTexture("SubTexture",{texture:e,x:i,y:s,width:a,height:c}),t},{})}const[dl,Ne]=Y(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkO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zLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQU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AIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function hl(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(c){if(c.startsWith("#")){r.color=M(c),r.src="",r.alpha=1,t=1,n.alpha=0,e.alpha=0;return}else r.color=4294967295,e.alpha=1;if(t===0){r.src=c,t=1;return}if(t===1){n.src=c,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=c,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}return Ke(at(dl,c=>{a(c)},{defer:!0})),l(N,{width:1920,height:1080,zIndex:-5,get children(){return[l(N,{ref(c){var u=r;typeof u=="function"?u(c):r=c},style:s}),l(N,{ref(c){var u=n;typeof u=="function"?u(c):n=c},style:s,alpha:0}),l(N,{ref(c){var u=e;typeof u=="function"?u(c):e=c},src:"./assets/hero-mask-inverted.png",get color(){return M(f.color.materialBrand)},width:1920,height:1080})]}})}var qr,Zr,Jr,eo,to,no,ro,oo,io,so,ao,lo,co,uo,ho,fo,go,po;const fl=(r,n)=>r===n,mo={equals:fl};let gl=pi;const Yt=1,Sn=2;var fn=null;let jn=null,pl=null,ae=null,de=null,ot=null,Ln=0;function ct(r,n){n=n?Object.assign({},mo,n):mo;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),hi(e,o));return[xl.bind(e),t]}function ml(r){if(ae===null)return r();const n=ae;ae=null;try{return r()}finally{ae=n}}function xl(){if(this.sources&&this.state)if(this.state===Yt)fi(this);else{const r=de;de=null,Mn(()=>An(this),!1),de=r}if(ae){const r=this.observers?this.observers.length:0;ae.sources?(ae.sources.push(this),ae.sourceSlots.push(r)):(ae.sources=[this],ae.sourceSlots=[r]),this.observers?(this.observers.push(ae),this.observerSlots.push(ae.sources.length-1)):(this.observers=[ae],this.observerSlots=[ae.sources.length-1])}return this.value}function hi(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Mn(()=>{for(let o=0;o1e6)throw de=[],new Error},!1)),n}function fi(r){if(!r.fn)return;Ar(r);const n=Ln;yl(r,r.value,n)}function yl(r,n,e){let t;const o=fn,i=ae;ae=fn=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Yt,r.owned&&r.owned.forEach(Ar),r.owned=null),r.updatedAt=e+1,xi(s)}finally{ae=i,fn=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?hi(r,t):r.value=t,r.updatedAt=e)}function gi(r){if(r.state===0)return;if(r.state===Sn)return An(r);if(r.suspense&&ml(r.suspense.inFallback))return r.suspense.effects.push(r);const n=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt=0;e--)if(r=n[e],r.state===Yt)fi(r);else if(r.state===Sn){const t=de;de=null,Mn(()=>An(r,n[0]),!1),de=t}}function Mn(r,n){if(de)return r();let e=!1;n||(de=[]),ot?e=!0:ot=[],Ln++;try{const t=r();return vl(e),t}catch(t){e||(ot=null),de=null,xi(t)}}function vl(r){if(de&&(pi(de),de=null),r)return;const n=ot;ot=null,n.length&&Mn(()=>gl(n),!1)}function pi(r){for(let n=0;n=0;n--)Ar(r.owned[n]);r.owned=null}if(r.cleanups){for(n=r.cleanups.length-1;n>=0;n--)r.cleanups[n]();r.cleanups=null}r.state=0}function wl(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function xi(r,n=fn){throw wl(r)}function an(r){if(!r||!r[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");const n={};for(const[e,t]of r)n[e]=t;return n}const bl=["focus","disabled"],Sl=["brand","inverse","neutral"];function W({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=bl,toneKeys:s=Sl},a=!1){const c=(p,x,b)=>{const A=s.map(w=>{var C,R;const y={};return new Set([].concat.apply([],[(C=p==null?void 0:p[w])!=null?C:{},(R=x==null?void 0:x[w])!=null?R:{}].map(Object.keys))).forEach(I=>{var E;var T,_;i.includes(I)||(y[I]=(E=(T=x==null?void 0:x[w])==null?void 0:T[I])!=null?E:(_=p==null?void 0:p[w])==null?void 0:_[I])}),i.forEach(I=>{var T,_;y[I]={...b[I],...(T=p==null?void 0:p[w])==null?void 0:T[I],...(_=x==null?void 0:x[w])==null?void 0:_[I]}}),[w,y]});return an(A)},u=(p,x)=>{const b=i.map(w=>[w,{...p==null?void 0:p[w],...x==null?void 0:x[w]}]);return an(b)},h=(p,x)=>({...p,...x.base}),g=p=>an(Object.entries(r).filter(([x,b])=>p[b]).map(([x,b])=>[x,p[b]])),v=p=>an(Object.entries(p).map(([b,A])=>{const w=g(A);return Object.entries(A).filter(([y,m])=>i.includes(y)).forEach(([y,m])=>{w[y]=g(m)}),[b,w]}));return((p,x,b)=>{const A=v(o);a&&console.log(A);const w=h(p,A);a&&console.log(w);const y=u(x,A);a&&console.log(y);const m=c(b,A,y);return a&&console.log(m),{base:{...w,...y},tones:m}})(n,e,t)}function Cn(r=0){return(n,e,t=0,o)=>{var b,A,w,y;if(n.children.length===0)return;const i=n.flexDirection==="row"?"width":"height",s=n.flexDirection==="row"?"x":"y",a=n.gap||0,c=n.scroll||"auto",[u,h]=Al(n);let g=(b=n[s])!=null?b:0;const v=(A=e==null?void 0:e[s])!=null?A:0,S=(w=e==null?void 0:e[i])!=null?w:0,p=o===void 0?"none":t>o?"positive":"negative";let x=g;if(c==="auto")n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(p==="positive"?x=g-S-a:x=g+S+a):(Math.abs(g)+hv)x=-v+r;else if(c==="edge"&&p==="positive"&&Math.abs(g)+h{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return n.length===1?n[0]:function(...e){let t;for(const o of n)if(t=o.apply(this,e),t===!0)return t;return t}};function yi(){if(!this||this.selected===void 0||this.children.length===0)return!1;let r=this.children[this.selected];for(;r!=null&&r.skipFocus;)this.selected++,r=this.children[this.selected];return r instanceof Ae?(r.setFocus(),!0):!1}function Tn(r){return function(){var n,e,t;const o=this.children.length,i=this.wrap,s=this.selected||0;if(o===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}while((n=this.children[this.selected])!=null&&n.skipFocus);else if(r==="left"||r==="up")do if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=s,(t=this.children[this.selected])!=null&&t.states.has("focus")))return!1;const a=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,a,this.selected,s),this.plinko&&s!==void 0){const u=this.children[s].selected||0;a.selected=ut){console.error("Column expects a number between 1 & ".concat(t,". Received ").concat(n));return}const s=e-o*2,a=(n-1)*i;return(s-a)/n}const{Artwork:{defaultTone:Yu,...Tl}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,_l={themeKeys:{fillColor:"fillColor",scale:"imageScale",pivotX:"imageScalePivotX",pivotY:"imageScalePivotY"},base:{fallbackSrc:void 0,fillColor:f.color.overlay,gradientColor:f.color.material,pivotX:.5,pivotY:.5,scale:void 0},themeStyles:Tl};W(_l);const{Badge:{defaultTone:Hu,...Cr}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,Il={themeKeys:{color:"backgroundColor"},base:{color:f.color.fillInverseSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverse,width:f.stroke.sm},display:"flex",justifyContent:"spaceEvenly",padding:[f.spacer.md-f.stroke.sm,f.spacer.xs+f.stroke.sm,f.spacer.md+f.stroke.sm,f.spacer.md+f.stroke.sm]},tones:{inverse:{color:f.color.fillNeutralSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}},brand:{color:f.color.fillBrand,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}}},themeStyles:Cr},Rl={themeKeys:{color:"textColor"},base:{...f.typography.tag1,color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:Cr},Bl={themeKeys:{color:"iconColor"},base:{color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:Cr};W(Il);W(Bl);W(Rl);const{Button:{defaultTone:kl,...Tr}={styles:{}}}=(Jr=f)==null?void 0:Jr.componentConfig,{Surface:{surfaceDefaultTone:El,..._r}={styles:{}}}=(eo=f)==null?void 0:eo.componentConfig,Fl={themeKeys:{textAlign:"textAlign",borderRadius:"radius",color:"backgroundColor",justifyContent:"justifyContent"},base:{height:f.typography.button1.lineHeight+f.spacer.xl*2,display:"flex",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm,contentColor:f.color.fillNeutral},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:{..._r,...Tr}},Nl={themeKeys:{color:"contentColor"},base:{color:f.color.textNeutral},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{..._r,...Tr}},Ll={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{..._r,...Tr}},Ml=W(Fl),zl=W(Nl),Pl=W(Ll),ut={tone:kl||El||"neutral",Container:Ml,Content:zl,Text:Pl},xo=r=>l(N,Q(r,{get style(){var e;var n;return[...[r.style].flat(),(n=ut.Container.tones)==null?void 0:n[(e=r.tone)!=null?e:ut.tone],ut.Container.base]},forwardStates:!0,get children(){return l(F,{get style(){var e;var n;return[...[(n=r.style)==null?void 0:n.Text].flat(),ut.Text.tones[(e=r.tone)!=null?e:ut.tone],ut.Text.base]},get children(){return r.children}})}})),{Checkbox:{defaultTone:ju,...vi}={styles:{}}}=(to=f)==null?void 0:to.componentConfig,Je=f.stroke.sm,Le=f.spacer.xxl,Dl={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:Le,height:Le,display:"flex",justifyContent:"center",color:f.color.fillNeutral,alignItems:"center",borderRadius:Le/4,border:{color:f.color.strokeInverse,width:Je}},modes:{disabled:{alpha:f.alpha.inactive}},tones:{brand:{borderRadius:Le/4,border:{color:f.color.strokeNeutralSecondary,width:Je},color:f.color.fillNeutralSecondary,checked:{borderRadius:Le/4,border:{color:f.color.strokeNeutralSecondary,width:Je},color:f.color.fillBrand}},neutral:{borderRadius:Le/4,border:{color:f.color.strokeNeutralSecondary,width:Je},color:f.color.fillInverseSecondary,checked:{borderRadius:Le/4,border:{color:f.color.strokeNeutralSecondary,width:Je},color:f.color.fillNeutral}},inverse:{borderRadius:Le/4,border:{color:f.color.strokeInverseSecondary,width:Je},color:f.color.fillNeutralSecondary,checked:{borderRadius:Le/4,border:{color:f.color.strokeInverseSecondary,width:Je},color:f.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:vi},Ol={themeKeys:{color:"color"},base:{width:f.spacer.lg,height:f.spacer.lg,src:f.asset.check},tones:{neutral:{color:f.color.fillInverse},inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillInverse}},themeStyles:vi};W(Dl);W(Ol);const{Icon:{defaultTone:Qu,...Wl}={styles:{}}}=(no=f)==null?void 0:no.componentConfig,Ul={themeKeys:{color:"color"},base:{width:100,height:100,color:f.color.fillInverse},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Wl};W(Ul);const{Column:{defaultTone:$l,...Yl}={styles:{}}}=(ro=f)==null?void 0:ro.componentConfig,Hl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:f.layout.gutterY,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:Yl},jl=W(Hl),Qn={tone:$l||"neutral",Container:jl},te=r=>{const n=Tn("up"),e=Tn("down");return l(N,Q(r,{get onUp(){return Xe(r.onUp,n)},get onDown(){return Xe(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:yi,get onCreate(){return Xe(t=>{var o,i;return Cn(r.y).call(t,t,t.children[(o=r.selected)!=null?o:0],(i=r.selected)!=null?i:0,void 0)},r.onCreate)},get onSelectedChanged(){return Xe(r.onSelectedChanged,r.scroll!=="none"?Cn(r.y):void 0)},get style(){var t;return[...[r.style].flat(),Qn.Container.tones[(t=r.tone)!=null?t:Qn.tone],Qn.Container.base]}}))},{Label:{defaultTone:Xu,...wi}={styles:{}}}=(oo=f)==null?void 0:oo.componentConfig,Ql={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:wi},Xl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:wi};W(Ql);W(Xl);const{Rating:{styles:Ir,defaultTone:Ku}={styles:{},defaultTone:"neutral"}}=(io=f)==null?void 0:io.componentConfig,Kl={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:Ir},Vl={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:Ir},Gl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:Ir};W(Kl);W(Gl);W(Vl);const{Details:{defaultTone:Vu,...bi}={styles:{}}}=(so=f)==null?void 0:so.componentConfig,ql={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:bi},Zl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:bi};W(ql);W(Zl);const{Metadata:{defaultTone:Gu,...Rr}={styles:{}}}=(ao=f)==null?void 0:ao.componentConfig,Jl={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:Rr},ec={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:Rr},tc={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:Rr};W(Jl);W(tc);W(ec);const{ProgressBar:{defaultTone:qu,...Si}={styles:{}}}=(lo=f)==null?void 0:lo.componentConfig,nc={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:Si},rc={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Si};W(nc);W(rc);const{Row:{defaultTone:oc,...ic}={styles:{}}}=(co=f)==null?void 0:co.componentConfig,sc={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:f.layout.gutterX,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:ic},ac=W(sc),It={tone:oc,Container:ac},X=r=>{const n=Tn("left"),e=Tn("right");return l(N,Q(r,{get selected(){return r.selected||0},get onLeft(){return Xe(r.onLeft,n)},get onRight(){return Xe(r.onRight,e)},forwardFocus:yi,get onCreate(){return Xe(t=>{var o,i;return Cn(r.x).call(t,t,t.children[(o=r.selected)!=null?o:0],(i=r.selected)!=null?i:0,void 0)},r.onCreate)},get onSelectedChanged(){return Xe(r.onSelectedChanged,r.scroll!=="none"?Cn(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:It.tone},get style(){return[...[r.style].flat(),It.Container.tones[r.tone||It.tone],It.Container.base]},get states(){var t;return(t=r.tone)!=null?t:It.tone}}))},{Keyboard:{defaultTone:Zu,...Br}={styles:{}}}=(uo=f)==null?void 0:uo.componentConfig,lc={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:Br},cc={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:Br},uc={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:Br};W(lc);W(cc);W(uc);const{Key:{defaultTone:Ju,...Ai}={styles:{}}}=(ho=f)==null?void 0:ho.componentConfig,dc={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.md],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:Ai},hc={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:Ai};W(dc);W(hc);const{Input:{defaultTone:ed,...kr}={styles:{}}}=(fo=f)==null?void 0:fo.componentConfig,fc={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:kr},gc={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:Cl(f,4),height:100,display:"flex",flexDirection:"column",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,contentColor:f.color.fillInverse,borderRadius:f.radius.sm,marginX:f.spacer.xxxl},modes:{focus:{color:f.color.interactiveNeutralFocus},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:kr},pc={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},themeStyles:kr};W(fc);W(gc);W(pc);const{Tile:{defaultTone:td,...zn}={styles:{}}}=(go=f)==null?void 0:go.componentConfig,{Surface:{defaultSurfaceTone:nd,...mc}={styles:{}}}=(po=f)==null?void 0:po.componentConfig,xc={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{...mc,...zn}},yc={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:zn},vc={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:zn},wc={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:zn};W(xc);W(yc);W(vc);W(wc);const bc={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},Ie={x:10,fontSize:22,textColor:M("#f6f6f6")},ln={fontSize:22,textColor:M("#f6f6f6")},[Sc,Ac]=ct(0),[Cc,Tc]=ct(0),[_c,Ic]=ct(99),[Rc,Bc]=ct(0),[kc,Ec]=ct(0),[Fc,Nc]=ct(0),[Lc,Mc]=ct(0);let yo=0,vo=0;const zc=r=>{r&&(Ac(r),Ic(n=>Math.min(r,n)),Bc(n=>Math.max(r,n)),vo+=r,yo++,Tc(Math.round(vo/yo)))},Pc=r=>{let n=0,e=0,t=0;r.txManager.textureIdCache.forEach((o,i,s)=>{o.state==="loaded"&&n++,o.state==="loading"&&e++,o.state==="failed"&&t++}),Ec(n),Nc(e),Mc(t)};function Dc(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&(zc(t),Pc(n.root.stage))})}const Oc=r=>l(N,Q(r,{style:bc,get children(){return[l(N,{get children(){return[l(F,{style:Ie,children:"FPS:"}),l(F,{style:ln,x:90,get children(){return Sc()}})]}}),l(N,{x:160,get children(){return[l(F,{style:Ie,children:"AVG:"}),l(F,{style:ln,x:100,get children(){return Cc()}})]}}),l(N,{x:0,y:20,get children(){return[l(F,{style:Ie,children:"MIN:"}),l(F,{style:ln,x:90,get children(){return _c()}})]}}),l(N,{x:160,y:20,get children(){return[l(F,{style:Ie,children:"MAX:"}),l(F,{style:ln,x:100,get children(){return Rc()}})]}}),l(N,{x:0,y:50,get children(){return[l(F,{style:Ie,children:"Loaded Textures Cnt:"}),l(F,{style:Ie,x:270,get children(){return kc()}})]}}),l(N,{x:0,y:80,get children(){return[l(F,{style:Ie,children:"Loading Textures Cnt:"}),l(F,{style:Ie,x:270,get children(){return Fc()}})]}}),l(N,{x:0,y:110,get children(){return[l(F,{style:Ie,children:"Failed Textures Cnt:"}),l(F,{style:Ie,x:270,get children(){return Lc()}})]}})]}})),ur={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:M("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:M("#424242")},active:{width:328,height:70}}},Wc="/solid-demo-app/",Uc=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function $c(r){const n=ul(Wc+"assets/icons_white.png",Uc);return l(N,Q(r,{get texture(){return n[r.name]},get width(){return n[r.name].props.width},get height(){return n[r.name].props.height},get x(){return(100-(n[r.name].props.width||0))/2},get y(){return(100-(n[r.name].props.height||0))/2}}))}function cn(r){return l(N,Q(r,{forwardStates:!0,get style(){return ur.NavButton},get children(){return[l(N,{y:-16,get children(){return l($c,{scale:.5,get name(){return r.icon}})}}),l(F,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}}},get children(){return r.children}})]}}))}function Yc(r){let n;const e=St();function t(){n.states.add("focus"),this.children.forEach(s=>s.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(s=>s.states.remove("active"))}function i(s){if(Ea(()=>s)())return r.focusPage();e(s)}return[l(N,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return r.showWidgets?1:0},get children(){return[l(F,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),l(N,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),l(te,Q(r,{onFocus:t,onBlur:o,get style(){return ur.Column},scroll:"none",get children(){return[l(cn,{onEnter:()=>i("/browse/all"),icon:"trending",children:"Trending"}),l(cn,{icon:"movie",onEnter:()=>i("/browse/movie"),children:"Movies"}),l(cn,{icon:"tv",onEnter:()=>i("/browse/tv"),children:"TV"}),l(cn,{icon:"experiment",onEnter:()=>i("/examples"),children:"Examples"})]}})),l(N,{ref(s){var a=n;typeof a=="function"?a(s):n=s},get style(){return ur.Gradient}})]}const Hc=r=>{nl({Announcer:"a",Menu:"m",Escape:"Escape",Backspace:"Backspace"});const n=cl();n.enabled=!1;const e=St();let t,o;Oe(()=>{Dc({renderer:ze})});function i(){return t.states.has("focus")?!1:(o=yr(),t.setFocus())}const[s,a]=Y(!0),c=li(),u=["/browse","/entity"];return Ke(()=>{const h=c.pathname;let g=u.some(v=>h.startsWith(v));h==="/"&&(g=!0),a(g)}),l(N,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(hl,{}),l(Oc,{mountX:1,x:1910,y:10,get alpha(){return s()?1:0}}),bt(()=>r.children),l(Yc,{ref(h){var g=t;typeof g=="function"?g(h):t=h},focusPage:()=>o.setFocus(),get showWidgets(){return s()}})]}})},pe={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:M("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:M("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:M("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:M("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:M("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:780,height:340}},_n={width:120,height:40,color:M("#000000"),borderRadius:8,border:{width:2,color:M("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:M("#333333")}},transition:{scale:!0,color:!0}},jc={color:M("#00A699"),height:8,y:2,x:-4,width:_n.width+8},Qc={fontSize:12,y:12,contain:"width",textAlign:"center",color:M("#F6F6F9"),height:_n.height,width:_n.width},wo={container:_n,topBar:jc,text:Qc},bo={width:386,height:136,color:M("#715cab"),focus:{color:M("#5a39a2")},disabled:{color:M("#291d43")}},Xc={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:M("#FFFFFF"),height:bo.height,width:bo.width,focus:{fontSize:40},disabled:{color:M("#909090")}};function Kc(r){return l(N,Q(r,{get style(){return pe.Thumbnail}}))}function In(r){const[n,e]=Js(r,["items"]);return l(X,Q(e,{get style(){return pe.Row},get children(){return l(Fn,{get each(){return n.items},children:t=>l(Kc,t)})}}))}const Vc="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",Gc="https://api.themoviedb.org/3";let Ci,Ti;const qc="w185",Zc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Vc}};function Mt(r,n=qc){return Ti+n+r}function Jc(r,n={}){return Ci?dr(r,n):_i().then(()=>dr(r,n))}function dr(r,n={}){return fetch(Gc+r,{...Zc,...n}).then(e=>e.json())}function _i(){return dr("/configuration").then(r=>{var n;return Ci=r,Ti=(n=r.images)==null?void 0:n.secure_base_url,r})}const it={get:Jc,loadConfig:_i};function eu(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function tu(r,n=7){let e=[];for(let t=0,o=r.length;t({src:Mt(n.poster_path||n.profile_path),tileSrc:Mt(n.backdrop_path||n.profile_path,"w300"),backdrop:Mt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:eu(n.title||n.name,30),title:n.title||n.name,data:n,entityInfo:{type:n.media_type||"people",id:n.id},heroContent:{title:n.title||n.name,description:n.overview}}))}let Xn=new Map;const un=new Map;function nu(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Xn.has(e))return Xn.get(e);let t=it.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(un.has(r)?un.get(r):[]).concat(Dt(i)),a=tu(s);return a[a.length-1].length<7?un.set(r,a.pop()):un.delete(r),a});return Xn.set(e,t),t}}function ru(r){const[n,e]=Y([]),[t,o]=Y(1),[i,s]=Y(!1),[a]=rt(t,r);return nr(()=>{const c=a();c&&Ys(()=>{c.length===0&&s(!0),e(u=>[...u,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Pn=900,ou={...f.typography.display2,maxLines:1,width:Pn,contain:"width"},iu=r=>l(F,Q(r,{style:ou})),su={...f.typography.body1,lineHeight:32,width:Pn,maxLines:3,contain:"width"},au={fontSize:16,lineHeight:20},lu=r=>l(F,Q(r,{style:su,get children(){return r.children}})),cu=r=>(()=>{var n=$t("node");return ei(di,n,()=>[8,13,11,13]),Nn(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),Jo(n,l(F,{style:au,get children(){return r.children}})),n})(),So=f.typography.body2,uu=r=>l(N,{style:{display:"flex",flexDirection:"row",gap:18,width:Pn,height:48},get children(){return[l(N,{y:-4,src:"./assets/stars.png",width:188,height:31}),l(N,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*r.voteAverage/10},height:31,get children(){return l(N,{src:"./assets/stars-full.png",width:188,height:31})}}),l(F,{style:So,get children(){return[bt(()=>r.voteCount)," reviews"]}}),l(F,{style:So,get children(){return r.metaText}}),l(Fn,{get each(){return r.badges},children:n=>l(cu,{y:-5,children:n})})]}}),Ii=r=>l(N,Q(r,{style:{display:"flex",flexDirection:"column",width:Pn,height:220,gap:16},get children(){return[l(iu,{get children(){return r.title}}),l(lu,{get children(){return r.description}}),l(De,{get when(){return r.voteCount},get children(){return l(uu,{get metaText(){return r.metaText},get badges(){return r.badges},get voteCount(){return r.voteCount},get voteAverage(){return r.voteAverage}})}})]}}));function du(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"min"}function hu(r){const n=r.split("-");return n[1]+"/"+n[2]+"/"+n[0]}function Ao(r){return r.split("-")[0]}function fu({type:r,id:n}){return it.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?Dt(e.slice(0,7)):it.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>Dt(t.slice(0,7))))}function gu({type:r,id:n}){return it.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>Dt(e.slice(0,7)))}function Ri({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return it.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:Mt(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:r==="movie"?du(t.runtime)+" "+hu(t.release_date):"".concat(Ao(t.first_air_date)," - ").concat(Ao(t.last_air_date)),reviews:e},...t}))}const Co=()=>{const r=Sr(),[n,e]=Y(0),[t,o]=Y();rt(t,Ri);const[i,s]=Y({}),a=St(),c=Wo(()=>0),u=q(()=>ru(nu(r.filter||"all"))),h=ar(p=>Ne(p),400),g=ar(p=>s(p),200);Ke(at(yr,p=>{p.backdrop&&h(p.backdrop),p.heroContent&&g(p.heroContent)},{defer:!0}));function v(){var x;(x=this.children.selected)==null||x.setFocus(),e((this.y||0)*-1+24);let p=u().pages().length;(p===0||this.parent.selected&&this.parent.selected>=p-2)&&u().setPage(b=>b+1)}function S(){let p=this.children.selected;return L(p&&p.href),a(p.href),!0}return l(De,{get when(){return u().pages().length},get children(){return[l(Ii,Q({y:360,x:162},i)),l(N,{clipping:!0,get style(){return pe.itemsContainer},get children(){return l(te,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return pe.Column},get children(){return l(Fn,{get each(){return u().pages()},children:(p,x)=>l(In,{get autofocus(){return c(x())},items:p,width:1620,onFocus:v,onEnter:S})})}})}})]}})},pu=()=>{const r=St(),n=Wo(()=>0);function e(){let c=this.children.selected;L(c&&c.id),r("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(c){const u={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[h,g]=Y(4294967295);return l(N,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:u,get children(){return l(N,{x:30,get children(){return[l(F,{y:30,fontSize:84,get color(){return h()},get children(){return c.index}}),l(F,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return h()},get children(){return c.title}}),l(F,{y:200,fontSize:28,width:330,contain:"width",get color(){return h()},get children(){return c.description}})]}})}}))}const[i,s]=Y(140);function a(c){s(c.selected*-400+140)}return l(N,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(N,{x:120,get children(){return[l(N,{src:"/assets/solidjs.png",width:101,height:90,y:40}),l(F,{fontSize:90,x:110,y:40,children:"Examples"}),l(N,{y:140,height:1,width:1800,color:3906468351})]}}),l(X,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return pe.Row},justifyContent:"flexStart",gap:40,get children(){return l(Fn,{each:t,children:(c,u)=>l(o,Q({get autofocus(){return n(u())},get index(){return u()}},c))})}})]}})},mu=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return Oe(()=>{Ne("#000000")}),l(N,{autofocus:!0,style:r,get children(){return[l(F,{style:e,children:"Title of the Page"}),l(F,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),l(N,{style:n,get children(){return[l(F,{style:o,children:"Subline Text"}),l(N,{width:28,height:28,src:"/assets/rt-popcorn.png"}),l(F,{style:o,children:"More Text"})]}})]}})},xu=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={fontSize:26};let o,i;Oe(()=>{Ne("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=Y(),[c,u]=Y();setTimeout(()=>{var A;a("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const h={width:400,height:300,color:M("#0000ff")},g={color:M("#f54242"),focus:{color:M("#4287f5")}};function v(A){const w=kn(()=>A.children);return l(N,Q(A,{get style(){return[g,A.style,[h]]},get children(){return[l(N,{id:"child1",width:100,height:100,get color(){return M("#ff0000")},y:25,get children(){return[bt(()=>w()),l(N,{id:"subChild",x:150,width:100,height:100,get color(){return M("#00ff00")}}),l(F,{get children(){return A.title}})]}}),l(N,{width:100,height:100,get color(){return M("#ffff00")},y:175,get children(){return w()}})]}}))}const S={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},p={color:M("#cccccc"),focus:{color:M("#000000")}},x={color:M("#ffffff"),focus:{color:M("#f6f6cc")}};function b(A){return A.states.has("focus")}return l(N,{style:r,get children(){return[l(F,{style:e,children:"Title of the Page"}),l(N,{style:n,get children(){return[l(F,{get children(){return c()}}),l(F,{style:t,get children(){return["Sub ",bt(()=>s())," Text"]}}),l(De,{get when(){return s()},get children(){return l(N,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),l(F,{style:t,children:"More Text"})]}}),l(v,{autofocus:!0,ref(A){var w=i;typeof w=="function"?w(A):i=A},style:[x,p],get children(){return l(F,{children:"Child Test"})}}),l(N,{ref(A){var w=o;typeof w=="function"?w(A):o=A},style:S,width:100,height:100,get color(){return M("#00ff00")},x:900,y:400,get alpha(){return b(o)?1:.2}})]}})},yu=()=>{let r,n;const[e,t]=Y([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:M("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},i={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(c,u)=>Math.floor(Math.random()*(u-c+1)+c);Oe(()=>{Ne("#000000"),r.x=1820/2,r.y=980/2,n=setInterval(()=>{r.rotation=s(-90,90),r.x=s(-300,2220),r.y=s(-300,1380)},2500)});function a(c,u){t(h=>[...h,c].slice(-4)),console.log(c)}return Pe(()=>{clearInterval(n)}),l(N,{get children(){return[l(F,{style:i,get children(){return e().join("\n")}}),l(N,{autofocus:!0,style:o,ref(c){var u=r;typeof u=="function"?u(c):r=c},onEvents:[["inBounds",c=>a("inBounds")],["outOfBounds",c=>a("outOfBounds")],["inViewport",c=>a("inViewport")],["outOfViewport",c=>a("outOfViewport")]]})]}})},vu=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400};function e(o){return l(N,Q(o,{forwardStates:!0,get style(){return wo.container},get children(){return l(F,{get style(){return wo.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=$t("node");return ei(di,i,()=>[10,15]),Nn(i,Q(o,{get style(){return{color:M("#000000be"),borderRadius:8,border:{width:2,color:M("#ffffff")}}}}),!0),Jo(i,l(F,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(X,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(F,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(X,{x:100,gap:40,style:n,get children(){return[l(e,{autofocus:!0,onEnter:r,children:"TV Shows"}),l(e,{states:{active:!0,disabled:!1},children:"Movies"}),l(e,{states:"active",children:"Sports"}),l(e,{states:"disabled",children:"News"})]}})]},wu=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(N,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=Y(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}Oe(()=>{Ne("#333333")});const s=50;return l(te,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return pe.Column},get children(){return[l(F,{style:n,children:"Flex Start"}),l(X,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(F,{style:n,children:"Flex Start - Margin Left"}),l(X,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(F,{style:n,children:"Flex End"}),l(X,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(F,{style:n,children:"Flex End - Margin Right"}),l(X,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{marginRight:100}),l(e,{}),l(e,{}),l(e,{marginRight:100})]}}),l(F,{style:n,children:"Center - No Margin Support"}),l(X,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(F,{style:n,children:"Space Between - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(F,{style:n,children:"Space Evenly - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},bu=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(N,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=Y(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Oe(()=>{Ne("#333333")});const a=50;return l(te,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return pe.Column},get children(){return[l(F,{style:n,children:"Flex Start - AlignItems: center"}),l(X,{alignItems:"center",gap:a,style:r,onFocus:s,get children(){return[l(e,{autofocus:!0,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(F,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(X,{gap:a,alignItems:"flexStart",style:r,onFocus:s,get children(){return[l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(F,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(X,{gap:a,justifyContent:"flexEnd",alignItems:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(F,{style:n,children:"Flex End - Margin Right"}),l(X,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}})]}}),l(F,{style:n,children:"Center - No Margin Support"}),l(X,{gap:a,justifyContent:"center",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(F,{style:n,children:"Space Between - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(F,{style:n,children:"Space Evenly - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}})]}})},Su=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(u){const h={width:o(),height:80,x:5,color:M("#1769aa")};return l(N,Q(u,{style:h}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=Y(50);function a(){var u;(u=this.children.selected)==null||u.setFocus(),s(150+(this.y||0)*-1)}Oe(()=>{Ne("#333333")});const c=50;return[l(F,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:c,style:r,onFocus:a,get children(){return[l(te,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,style:n,onFocus:a,alignItems:"flexStart",get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Au=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const u={width:50,height:80,x:5,color:M("#1769aa")};return l(N,Q(c,{style:u}))}const[o,i]=Y(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Oe(()=>{Ne("#333333")});const a=50;return[l(F,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:a,style:r,onFocus:s,get children(){return[l(te,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Cu=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return l(N,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(F,{style:Xc,get children(){return i.children}})}}))}return l(X,{style:n,get children(){return[l(o,{autofocus:!0,onEnter:r,children:"Focused"}),l(o,{states:{active:!0,disabled:!1},children:"Normal"}),l(o,{states:"disabled",children:"Disabled"})]}})},Tu="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function _u(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?Iu():console.error("Browser not supported!")}async function Iu(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",Ru);try{await n.load(Tu),console.log("The video has now been loaded!")}catch(e){Bi(e)}}function Ru(r){Bi(r.detail)}function Bi(r){console.error("Error code",r.code,"object",r)}function Bu(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function ku(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",_u);const Eu=()=>{const r=Sr(),n=St(),[e]=rt(()=>({...r}),Ri),[t]=rt(()=>({...r}),gu),[o]=rt(()=>({...r}),fu),[i,s]=Y(0);Ke(at(e,A=>{Ne(A.backgroundImage)},{defer:!0}));const a=640,c={color:M("#000000"),alpha:0,width:1900,height:890,x:-160,y:a,borderRadius:30};function u(){var A;(A=this.children.selected)==null||A.setFocus(),p.y=a,x.y=a,x.alpha=0}function h(){var A;(A=this.children.selected)==null||A.setFocus(),p.y=200,x.y=160,x.alpha=.9}function g(){let A=this.children.selected;L(A&&A.href),n(A.href)}function v(){ku(),document.getElementsByTagName("canvas")[0].focus(),b.setFocus(),s(0)}function S(){const A=Bu();qo(A),s(.9)}let p,x,b;return l(De,{get when(){return e()},keyed:!0,get children(){return[l(N,{x:170,onUp:()=>b.setFocus(),onEscape:v,get children(){return[l(Ii,Q({y:260},()=>e().heroContent)),l(X,{ref(A){var w=b;typeof w=="function"?w(A):b=A},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>p.setFocus(),onEnter:S,get children(){return[l(xo,{width:300,autofocus:!0,children:"Play"}),l(xo,{width:300,children:"Resume"})]}}),l(te,{ref(A){var w=p;typeof w=="function"?w(A):p=A},x:0,y:a,get style(){return pe.Column},zIndex:5,get children(){return l(De,{get when(){return bt(()=>!!o())()&&t()},get children(){return[l(F,{skipFocus:!0,get style(){return pe.RowTitle},children:"Recommendations"}),l(In,{onFocus:u,onEnter:g,get items(){return o()},width:1620}),l(F,{skipFocus:!0,get style(){return pe.RowTitle},children:"Cast and Crew"}),l(In,{onFocus:h,onEnter:g,get items(){return t()},width:1620})]}})}}),l(N,{ref(A){var w=x;typeof w=="function"?w(A):x=A},style:c,transition:{alpha:!0,y:!0}})]}}),l(N,{get alpha(){return i()},get color(){return M("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function Fu({id:r}){return it.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>Dt(n.slice(0,7)))}function Nu({id:r}){return it.get("/person/".concat(r)).then(n=>({backgroundImage:Mt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const Lu=()=>{const r=Sr(),n=St(),[e]=rt(()=>({...r}),Nu),[t]=rt(()=>({...r}),Fu),o={color:M("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;L(s&&s.href),n(s.href)}return Oe(()=>{Ne("#333333")}),l(De,{get when(){return e()},keyed:!0,get children(){return[l(N,{get src(){return e().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),l(N,{x:150,y:200,width:800,gap:24,get style(){return pe.Column},zIndex:3,get children(){return[l(F,{contain:"width",get style(){return f.typography.display2},get children(){return e().name}}),l(F,{contain:"both",get style(){return pe.peopleBio},get children(){return e().biography}})]}}),l(N,{style:o}),l(te,{y:670,x:140,get style(){return pe.Column},get children(){return l(De,{get when(){return t()},get children(){return[l(F,{skipFocus:!0,get style(){return pe.RowTitle},children:"Credits"}),l(In,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Mu=()=>(()=>{var r=$t("node");return va(r,"style",{width:1920,height:1080,color:868483072}),r})(),zu=new URL("AppCoreExtensions-tiD9qKNE.js",import.meta.url).href;me.debug=!1;me.animationsEnabled=!0;me.fontSettings.fontFamily="Ubuntu";me.fontSettings.color=M("#f6f6f6");me.fontSettings.fontSize=32;me.rendererOptions={coreExtensionModule:zu,fpsUpdateInterval:200,enableInspector:!0};ya(()=>l(Ka,{root:r=>l(Hc,r),get children(){return[l(ge,{path:"",component:Co}),l(ge,{path:"examples",component:pu}),l(ge,{path:"browse/:filter",component:Co}),l(ge,{path:"text",component:mu}),l(ge,{path:"buttons",component:vu}),l(ge,{path:"flex",component:wu}),l(ge,{path:"create",component:xu}),l(ge,{path:"viewport",component:yu}),l(ge,{path:"flexsize",component:bu}),l(ge,{path:"flexcolumnsize",component:Su}),l(ge,{path:"flexcolumn",component:Au}),l(ge,{path:"buttonsmaterial",component:Cu}),l(ge,{path:"entity/people/:id",component:Lu}),l(ge,{path:"entity/:type/:id",component:Eu}),l(ge,{path:"*all",component:Mu})]}}));export{Du as __vite_legacy_guard}; +//# sourceMappingURL=index-DjQeU_QX.js.map diff --git a/assets/index-DjQeU_QX.js.map b/assets/index-DjQeU_QX.js.map new file mode 100644 index 0000000..d8b67d4 --- /dev/null +++ b/assets/index-DjQeU_QX.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"stCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,EAAiB,CAD7BC,EAAA,wBAEI,KAAK,gBAAkBD,CAC1B,CACL,CCHO,MAAME,WAAuCH,EAAoB,CAIpE,YA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ACP,KAAM,IACN,OAAQ,GACR,KAAM,IACN,MAAO,EACR,EACD,MAAO,CACL,KAAM,EACN,MAAO,IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,o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CgB,GAAK,CAAC1H,KAAI,SAAUiD,UAAW6hB,GAAUpe,IACzCgB,GAAK,CAAC1H,KAAI,WAAYiD,UAAWijB,GAAYxf,IAC7CgB,GAAK,CAAC1H,KAAI,WAAYiD,UAAWklB,GAAYzhB,IAC7CgB,GAAK,CAAC1H,KAAI,iBAAkBiD,UAAW2nB,GAAkBlkB,IACzDgB,GAAK,CAAC1H,KAAI,aAAciD,UAAWqlB,GAAc5hB,IACjDgB,GAAK,CAAC1H,KAAI,kBAAmBiD,UAAW4nB,GAAmBnkB,IAC3DgB,GAAK,CAAC1H,KAAI,oBAAqBiD,UAAWgnB,GAAMvjB,IAChDgB,GAAK,CAAC1H,KAAI,mBAAoBiD,UAAWimB,GAAMxiB,IAC/CgB,GAAK,CAAC1H,KAAI,OAAQiD,UAAWonB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","unif","uniType","uniformName","define","res","u","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","results","eff","index","fxClass","uniInfo","p","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_H","_G","_J","_I","_K","_M","_L","_O","_N","_P","_R","_Q","_T","_S","_U","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","hasOrder","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useLocation","useMatch","matchers","matcher","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","r$","_ref$","_ref$2","_ref$3","materialBrand","value2","objectFromEntries","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","axis","lastItem","updateLastIndex","rootPosition","selectedPosition","selectedSize","direct","currentChildIndex","currentChild","currentChildSize","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","_c2","num","getWidthByUpCount$1","theme2","upCount","screenW","columnCount","marginX","gutterX","columnWidth","columnGapTotal","defaultTone$f","themeStyles$e","container$f","defaultTone$e","themeStyles$d","container$e","text$7","icon$2","defaultTone$d","themeStyles$c","surfaceDefaultTone","surfaceThemeStyles$1","container$d","content","text$6","Container$c","Content","Text$5","styles$c","Button","Text$7","defaultTone$c","themeStyles$b","strokeWidth","container$c","icon$1","defaultTone$b","themeStyles$a","container$b","defaultTone$a","themeStyles$9","container$a","Container$9","styles$9","Column","onUp","onDown","defaultTone$9","themeStyles$8","container$9","text$5","themeStyles$7","defaultTone$8","container$8","text$4","icon","defaultTone$7","themeStyles$6","container$7","text$3","defaultTone$6","themeStyles$5","container$6","titleText","descriptionText","defaultTone$5","themeStyles$4","container$5","progress","defaultTone$4","themeStyles$3","container$4","Container$3","styles$3","Row","onLeft","onRight","defaultTone$3","themeStyles$2","container$3","text$2","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","isLoadedCount","setIsLoadedCount","isLoadingCount","setIsLoadingCount","isFailedCount","setIsFailedCount","count","totalFps","calcFps","fps2","calcPerformanceMetrics","isLoadedCount2","isLoadingCount2","isFailedCount2","setupFPS","FPSCounter","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","handleNavigate","page","focusPage","flexItem","showWidgets","onEnter","Gradient","App","Menu","Escape","Backspace","announcer","enabled","navDrawer","lastFocused","focusNavDrawer","has","setShowWidgets","showOnPaths","currentPath","matchesPartial","some","onAnnouncer","onLast","history","back","onMenu","onBackspace","mountX","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","Badge","borderRadius","border","MetaTextStyle","body2","Metadata","display","flexDirection","voteAverage","voteCount","metaText","badges","ContentBlock","title","description","minutesToHMM","minutes","hours","remainingMinutes","formatDate","dateString","parts","justYear","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","delayedBackgrounds","delayedHero","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","Math","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","marginRight","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","entityActions","onEnterTrailer","RowTitle","People","autosize","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,97],"sources":["../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.0_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_6vkiwwm6gksv7h5ofy2pmddjzm/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGoh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L50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQM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koGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For as For$1, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, Row, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal, onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n Backspace: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n Backspace: \"Backspace\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { createEffect } from \"solid-js/types/server/reactive.js\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-DjQeU_QX.js"} \ No newline at end of file diff --git a/assets/index-legacy-Baty9aaB.js b/assets/index-legacy-Baty9aaB.js deleted file mode 100644 index 21ad686..0000000 --- a/assets/index-legacy-Baty9aaB.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["defaultTone"],o=["defaultTone"],i=["defaultTone"],s=["defaultTone"],a=["defaultTone"],l=["defaultTone"],d=["defaultTone"],h=["defaultTone"],u=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultSurfaceTone"];function v(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw o}}return a}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i=t&&t.prototype instanceof x?t:x,s=Object.create(i.prototype),a=new E(n||[]);return o(s,"_invoke",{value:k(e,r,a)}),s}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function x(){}function y(){}function b(){}var w={};d(w,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,s)&&(w=A);var C=b.prototype=x.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,s,a){var l=u(e[o],e,i);if("throw"!==l.type){var d=l.arg,h=d.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(h).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=c;return function(i,s){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw s;return{value:e,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var l=I(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===c)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=u(t,r,n);if("normal"===d.type){if(o=n.done?v:f,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=v,n.method="throw",n.arg=d.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=u(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),d=n.call(s,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function x(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(d){return void r(d)}a.done?t(l):Promise.resolve(l).then(n,o)}function y(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){x(i,n,o,s,a,"next",e)}function a(e){x(i,n,o,s,a,"throw",e)}s(void 0)}))}}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function C(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{C=e.a,T=e.i,_=e.g,k=e.c,I=e.W,B=e.E,R=e.b,E=e.d,N=e.e,F=e.f,L=e.m,z=e.h,M=e.j,P=e.T,D=e.k,O=e.l,U=e.S,W=e.B,Y=e.n,j=e.o,H=e.p,Q=e.q,K=e.C,$=e.r,X=e.s,G=e.t,V=e.u,Z=e.v,q=e.w}],execute:function(){var x,J,ee,te=m().mark(Xe),re=document.createElement("style");re.textContent="html,body,*{padding:0;margin:0}video{position:absolute;top:0;left:0;z-index:2;outline:none}.center-element{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n",document.head.appendChild(re);class ne{constructor(e){S(this,"releaseCallback",void 0),this.releaseCallback=e}}class oe extends ne{constructor(e,t){var r,n;super(e),S(this,"textureMap",new Map),S(this,"zeroReferenceTextureSet",new Set),S(this,"options",void 0),this.options={textureCleanupIntervalMs:null!==(r=t.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(n=t.textureCleanupAgeThreadholdMs)&&void 0!==n?n:6e4},setInterval((()=>{var e,t=Date.now(),r=this.options.textureCleanupAgeThreadholdMs,n=A(this.zeroReferenceTextureSet);try{for(n.s();!(e=n.n()).done;){var o=e.value;t-o.lastUpdate>r&&(this.releaseCallback(o.id),this.textureMap.delete(o.id),this.zeroReferenceTextureSet.delete(o))}}catch(i){n.e(i)}finally{n.f()}}),this.options.textureCleanupIntervalMs)}registerTexture(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;if(C(r,"Texture must have an id to be registered"),!this.textureMap.has(r)){var n={id:r,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(r,n),this.zeroReferenceTextureSet.add(n)}}incrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),C(n,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),n.nodeRefCount++,n.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(n)&&this.zeroReferenceTextureSet.delete(n)}decrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);C(n,"Texture must have been registered"),n.nodeRefCount--,n.lastUpdate=Date.now(),0===n.nodeRefCount&&this.zeroReferenceTextureSet.add(n),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}class ie extends ne{constructor(e){super(e),S(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;C(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(r=e.options)||void 0===r?void 0:r.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}var se={alpha:e=>1===e?null:{prop:"opacity",value:`${e}`},x:e=>({prop:"left",value:`${e}px`}),y:e=>({prop:"top",value:`${e}px`}),width:e=>0===e?null:{prop:"width",value:`${e}px`},height:e=>0===e?null:{prop:"height",value:`${e}px`},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:e=>!1===e?null:{prop:"overflow",value:e?"hidden":"visible"},rotation:e=>0===e?null:{prop:"transform",value:`rotate(${e}rad)`},scale:e=>1===e?null:{prop:"transform",value:`scale(${e})`},scaleX:e=>1===e?null:{prop:"transform",value:`scaleX(${e})`},scaleY:e=>1===e?null:{prop:"transform",value:`scaleY(${e})`},color:e=>0===e?null:{prop:"color",value:ae(e)}},ae=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,le={id:"id"};class de{constructor(e,t){var r,n,o,i,s,a;if(S(this,"root",null),S(this,"canvas",null),S(this,"height",1080),S(this,"width",1920),S(this,"scaleX",1),S(this,"scaleY",1),!T()){if(!t)throw new Error("settings is required");this.height=Math.ceil(null!==(r=t.appHeight)&&void 0!==r?r:1080/(null!==(n=t.deviceLogicalPixelRatio)&&void 0!==n?n:1)),this.width=Math.ceil(null!==(o=t.appWidth)&&void 0!==o?o:1900/(null!==(i=t.deviceLogicalPixelRatio)&&void 0!==i?i:1)),this.scaleX=null!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a:1,this.canvas=e,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(e,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(e),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}setRootPosition(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,r=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left=`${r}px`,this.root.style.top=`${t}px`,this.root.style.width=`${this.width}px`,this.root.style.height=`${this.height}px`,this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform=`scale(${this.scaleX}, ${this.scaleY})`,this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}createDiv(e,t){var r=document.createElement("div");for(var n in r.style.position="absolute",r.id=e.id.toString(),t)this.updateNodeProperty(r,n,t[n]);return r}createNode(e,t){var r=e.createNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createTextNode(e,t){var r=e.createTextNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createProxy(e,t){return new Proxy(e,{set:(e,r,n)=>(this.updateNodeProperty(t,r,n),Reflect.set(e,r,n)),get:(r,n,o)=>("destroy"===n&&this.destroyNode(r),"animate"===n?(n,o)=>{var i=r.animate(n,o);return new Proxy(i,{get:(r,i,s)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,s))})}:Reflect.get(r,n,o))})}destroyNode(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}updateNodeProperty(e,t,r){if(null!==this.root&&null!=r)if("parent"!==t){if("text"===t)return e.innerHTML=String(r),void(e.style.visibility="hidden");if("src"===t&&r)e.setAttribute("data-src",String(r));else{if(se[t]){var n,o=null===(n=se[t])||void 0===n?void 0:n.call(se,r);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(r)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(le[t])e.setAttribute(String(se[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var s=r.id;if(1===s)return void this.root.appendChild(e);var a=document.getElementById(s.toString());null==a||a.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,s=n.delay,a=void 0===s?0:s,l=r.x,d=r.y,h=r.width,u=r.height,c=r.alpha,f=void 0===c?1:c,p=r.rotation,v=void 0===p?0:p,g=r.scale,m=void 0===g?1:g,x=r.color;setTimeout((function(){setTimeout((()=>{e.style.top=`${d}px`,e.style.left=`${l}px`,e.style.width=`${h}px`,e.style.height=`${u}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=ae(x)}),i)}),a)}}var he=function(e,t,r){var n=Promise.resolve();return n.then((()=>e())).catch((e=>{var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};class ue{static getEffectKey(e){return""}static getMethodParameters(e,t){var r=[];for(var n in e){var o=e[n],i="";o.size&&(i=`[${o.size(t)}]`),r.push(`${o.type} ${n}${i}`)}return r.join(",")}constructor(e){S(this,"priority",1),S(this,"name",""),S(this,"ref",void 0),S(this,"target",void 0),S(this,"passParameters",""),S(this,"declaredUniforms",""),S(this,"uniformInfo",{});var t=e.ref,r=e.target,n=e.props,o=void 0===n?{}:n;this.ref=t,this.target=r;var i={},s=[],a="",l=this.constructor.uniforms||{};for(var d in l){var h=l[d],u=h.type,c=`${t}_${d}`,f="";h.size&&(f=`[${h.size(o)}]`),s.push(c),a+=`uniform ${u} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}S(ue,"uniforms",{}),S(ue,"methods",void 0),S(ue,"onShaderMask",void 0),S(ue,"onColorize",void 0),S(ue,"onEffectMask",void 0);var ce={x:(e,t)=>{e.props.x=t},y:(e,t)=>{e.props.y=t},width:(e,t)=>{e.props.width=t},height:(e,t)=>{e.props.height=t},color:(e,t)=>{e.props.color=t},zIndex:(e,t)=>{e.props.zIndex=t},fontFamily:(e,t)=>{e.props.fontFamily=t},fontWeight:(e,t)=>{e.props.fontWeight=t},fontStyle:(e,t)=>{e.props.fontStyle=t},fontStretch:(e,t)=>{e.props.fontStretch=t},fontSize:(e,t)=>{e.props.fontSize=t},text:(e,t)=>{e.props.text=t},textAlign:(e,t)=>{e.props.textAlign=t},contain:(e,t)=>{e.props.contain=t},offsetY:(e,t)=>{e.props.offsetY=t},scrollable:(e,t)=>{e.props.scrollable=t},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t},lineHeight:(e,t)=>{e.props.lineHeight=t},maxLines:(e,t)=>{e.props.maxLines=t},textBaseline:(e,t)=>{e.props.textBaseline=t},verticalAlign:(e,t)=>{e.props.verticalAlign=t},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t},debug:(e,t)=>{e.props.debug=t}};class fe{constructor(e){S(this,"stage",void 0),S(this,"set",void 0),this.stage=e;var t=w(w({},ce),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(r,n)=>{r.props[e]!==n&&(t(r,n),this.stage.requestRender())}]))))}setStatus(e,t,r){e.status!==t&&(e.status=t,e.emitter.emit(t,r))}setIsRenderable(e,t){e.isRenderable=t}destroyState(e){["loading","loaded","failed"].forEach((t=>{e.emitter.off(t)}))}scheduleUpdateState(e){e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((()=>{e.updateScheduled=!1,this.updateState(e)})))}}function pe(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class ve{constructor(e,t){S(this,"_canvas",void 0),S(this,"_context",void 0),S(this,"_settings",void 0),S(this,"renderInfo",void 0),this._canvas=e,this._context=t,this._settings=this.mergeDefaults({})}set settings(e){this._settings=this.mergeDefaults(e)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){for(var e=[this._settings.fontFace],t=[],r=0,n=e.length;r{console.warn("[Lightning] Font load error",t,e)})).then((()=>{document.fonts.check(e,this._settings.text)||console.warn("[Lightning] Font not found",e)}))}catch(t){console.warn("[Lightning] Can't check font loading for "+e)}}}calculateRenderInfo(){var e={},t=this.getPrecision(),r=this._settings.paddingLeft*t,n=this._settings.paddingRight*t,o=this._settings.fontSize*t,i=null===this._settings.offsetY?null:this._settings.offsetY*t,s=(this._settings.lineHeight||o)*t,a=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,h=this._settings.cutSx*t,u=this._settings.cutEx*t,c=this._settings.cutSy*t,f=this._settings.cutEy*t,p=(this._settings.letterSpacing||0)*t,v=this._settings.textIndent*t;this.setFontProperties();var g,m=a||2048/this.getPrecision(),x=m-r;if(x<10&&(m+=10-x,x=10),d||(d=x),this._settings.textOverflow&&!this._settings.wordWrap){var y;switch(this._settings.textOverflow){case"clip":y="";break;case"ellipsis":y=this._settings.overflowSuffix;break;default:y=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,d-v,y)}if(this._settings.wordWrap)g=this.wrapText(this._settings.text,d,p,v);else for(var b=(g={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]}).l.length,w=0;wthis._settings.maxLines){var A,C=S.slice(0,this._settings.maxLines),T=null;if(this._settings.overflowSuffix){var _=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,k=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${k.l[0]}${this._settings.overflowSuffix}`,T=[k.l.length>1?k.l[1]:""]}else T=[""];var I=S.length,B=0,R=g.n.length;for(A=this._settings.maxLines;A=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],d=0,h=i.length;dt)for(;s>0&&(a=this._context.measureText(e.substring(0,s)).width+n)>t;)s-=1;else for(;s=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],s=[],a=0;ah?(c>0&&(l.push(d),d=""),d+=u[c],h=t-f-(0===c?n:0)):(h-=p,d+=` ${u[c]}`)}l.push(d),d="",i=i.concat(l),ae+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return w({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}var ge="undefined"==typeof self?globalThis:self,me=(null===(x=ge.document)||void 0===x?void 0:x.fonts)||ge.fonts;var xe=k(0,0,0,0);class ye extends fe{constructor(e){super(e),S(this,"canvas",void 0),S(this,"context",void 0),S(this,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");var t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),C(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof I}addFontFace(e){C(e instanceof I),me.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,canvasPages:void 0,lightning2TextRenderer:new ve(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(r=e.props,n=r.fontFamily,[r.fontStyle,r.fontWeight,r.fontStretch,`${r.fontSize}px`,n].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void me.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var r,n;if(e.fontInfo.loaded){if(!e.renderInfo){var o=e.props.maxLines,i="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,s=i>0&&o>0?Math.min(i,o):Math.max(i,o);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:R(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:s,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var a=e.props,l=a.x,d=a.y,h=a.width,u=a.height,c=a.scrollY,f=a.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=k(l,d,"none"!==f?l+h:1/0,"both"===f?d+u:1/0,xe);E(this.rendererBounds,m,p),p.valid=!0}var x=p.y2-p.y1,y=Math.ceil(x/e.renderInfo.lineHeight);if(0===x)return g=void 0,v=void 0,void this.setStatus(e,"loaded");if(v&&g){var b=l+v.x1,w=d-c+v.y1,S=l+v.x2,C=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&C>=p.y2)return void this.setStatus(e,"loaded");Cp.y1&&(v.y1-=y*e.renderInfo.lineHeight,v.y2-=y*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-y,g[0].lineNumEnd=g[0].lineNumStart+y,g[0].valid=!1)}else{var T,_,I,B=e.renderInfo.lineHeight*y,N=Math.ceil(c/B),F=N*y,L=F-y,z=F+y;g=[{texture:null===(T=g)||void 0===T?void 0:T[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:F,lineNumEnd:F+y,valid:!1},{texture:null===(I=g)||void 0===I?void 0:I[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=N*B;v={x1:0,y1:M-B,x2:h,y2:M+2*B}}e.renderWindow=v,performance.now();var P,D=A(g);try{for(D.s();!(P=D.n()).done;){var O=P.value;if(!O.valid)if(O.lineNumStart<0){var U;null===(U=O.texture)||void 0===U||U.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),O.texture.setRenderableOwner(e,e.isRenderable),O.valid=!0}else{var W;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(O.lineNumStart,O.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(O.lineNumStart,O.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(W=O.texture)||void 0===W||W.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),O.texture.setRenderableOwner(e,e.isRenderable);O.valid=!0}}}catch(Y){D.e(Y)}finally{D.f()}this.setStatus(e,"loaded")}}renderQuads(e,t,r,n){var o=this.stage,i=e.canvasPages,s=e.textW,a=void 0===s?0:s,l=e.textH,d=void 0===l?0:l,h=e.renderWindow;if(i&&h){var u=e.props,c=u.x,f=u.y,p=u.scrollY,v=u.contain,g=u.width,m=u.height,x={x:c,y:f,width:"none"!==v?g:a,height:"both"===v?m:d};N({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),C(i,"canvasPages is not defined"),C(h,"renderWindow is not defined");var y,b,w,S,A,T,_=(h.y2-h.y1)/3,k=e.props,I=k.zIndex,B=k.color,R=n*F(B),E=L(4294967295,R);if(i[0].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(y=i[0].texture)||void 0===y||null===(y=y.dimensions)||void 0===y?void 0:y.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(S=i[1].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.width)||0,height:(null===(T=i[2].texture)||void 0===T||null===(T=T.dimensions)||void 0===T?void 0:T.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.canvasPages)||void 0===r||r.forEach((r=>{var n;null===(n=r.texture)||void 0===n||n.setRenderableOwner(e,t)}))}destroyState(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((t=>{var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,!1)}))}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,r){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,r),this.scheduleUpdateState(e))}}class be extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}S(be,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class we extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}),S(this,"supportsIndexedTextures",!0)}bindTextures(e){var t=this.renderer,r=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach(((e,t)=>{r.activeTexture(t),r.bindTexture(e.ctxTexture)}));var n=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",n)}}S(we,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>`\n #define txUnits ${e}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) {\n ${Array.from(Array(e).keys()).map((e=>`\n ${0!==e?"else ":""}if (idx == ${e}) {\n return texture2D(textures[${e}], uv);\n }\n `)).join("")}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `});var Se=new Map,Ae=(e,t)=>{var r=JSON.stringify(e);if(Se.has(r))return Se.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Se.set(r,n),n};class Ce extends z{constructor(e,t,r){var n=Ce.createShader(t,r);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...n.uniforms],shaderSources:{vertex:n.vertex,fragment:n.fragment}}),S(this,"effects",[]),this.effects=n.effects,this.calculateProps=M(this.calculateProps.bind(this))}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){var t=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach(((e,n)=>{var o,i=this.effects[n],s=t[i.name],a=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(a).forEach((e=>{var t=s.uniforms[e],n=l[e],o=t.validator?t.validator(a[e],a):a[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}bindProps(e){this.calculateProps(e.effects).forEach((e=>{this.setUniform(e.name,e.value)}))}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;for(var r=e.effects.length,n=0;n{var n=t[e.type],a=n.getEffectKey(e.props||{});r[a]=r[a]?++r[a]:1;var l=r[a];1===l&&s.push({key:a,type:e.type,props:e.props});var d=new n({ref:`${a}${1===l?"":l}`,target:a,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==s||s.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var a in o.methods){var d=a,h=o.methods[a];n[a]&&n[a]!==h&&(d=Ce.resolveMethodDuplicate(a,h,n)),n[d]=h.replace("function",d),s.push({m:a,cm:d})}var u=o.onShaderMask instanceof Function?o.onShaderMask(i):o.onShaderMask,c=o.onColorize instanceof Function?o.onColorize(i):o.onColorize,f=o.onEffectMask instanceof Function?o.onEffectMask(i):o.onEffectMask;s.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");u&&(u=u.replace(n,r)),c&&(c=c.replace(n,r)),f&&(f=f.replace(n,r))}));var p=o.getMethodParameters(o.uniforms,i),v=p.length>0?`, ${p}`:"";u&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${u}\n }\n `),c&&(l+=`\n vec4 fx_${e.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${c}\n }\n `),f&&(l+=`\n vec4 fx_${e.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${f}\n }\n `)}));var d="";for(var h in n)d+=n[h];for(var u="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",c="\n\n ",f=0;f0?`, ${p.passParameters}`:"",g=t[p.name];g.onShaderMask&&(c+=`\n shaderMask = fx_${p.target}_onShaderMask(shaderMask ${v});\n `),g.onColorize&&(c+=`\n maskColor = fx_${p.target}_onColorize(shaderMask, maskColor, shaderColor${v});\n `),g.onEffectMask&&(u=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=a[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${u};\n `)}return{effects:a,uniforms:i,fragment:Ce.fragment(o,d,l,c),vertex:Ce.vertex()}}static resolveMethodDuplicate(e,t,r,n=0){var o=e+(n>0?n:"");return r[o]&&r[o]!==t?this.resolveMethodDuplicate(e,t,r,++n):o}static resolveDefaults(e,t){return{effects:Ae(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var r,n="";return null===(r=e.effects)||void 0===r||r.forEach((e=>{var r=t[e.type].getEffectKey(e.props||{});n+=`,${r}`})),`DynamicShader${n}`}}S(Ce,"z$__type__Props",void 0),S(Ce,"vertex",(()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ")),S(Ce,"fragment",((e,t,r,n)=>`\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${e}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${t}\n\n ${r}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${n}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `));class Te extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){this.setUniform("u_radius",e.radius)}canBatchShaderProps(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}S(Te,"z$__type__Props",void 0),S(Te,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var _e=new Float32Array([1,0,0,0,1,0,0,0,1]);class ke extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){var t=ke.resolveDefaults(e);for(var r in t)if("transform"===r)this.setUniform("u_transform",!1,t[r]);else if("scrollY"===r)this.setUniform("u_scrollY",t[r]);else if("color"===r){var n=R(t.color);this.setUniform("u_color",n)}else"size"===r?this.setUniform("u_size",t[r]):"distanceRange"===r?this.setUniform("u_distanceRange",t[r]):"debug"===r&&this.setUniform("u_debug",t[r]?1:0)}static resolveDefaults(e={}){var t,r,n,o,i,s;return{transform:null!==(t=e.transform)&&void 0!==t?t:_e,scrollY:null!==(r=e.scrollY)&&void 0!==r?r:0,color:null!==(n=e.color)&&void 0!==n?n:4294967295,size:null!==(o=e.size)&&void 0!==o?o:16,distanceRange:null!==(i=e.distanceRange)&&void 0!==i?i:1,debug:null!==(s=e.debug)&&void 0!==s&&s}}}S(ke,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});class Ie extends ue{constructor(...e){super(...e),S(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}S(Ie,"z$__type__Props",void 0),S(Ie,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Ie,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),S(Ie,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),S(Ie,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Be extends ue{constructor(...e){super(...e),S(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Be,"z$__type__Props",void 0),S(Be,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Be,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),S(Be,"onColorize","\n return color;\n ");class Re extends ue{constructor(...e){super(...e),S(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],o=e.stops||[];if(0===o.length||o.length!==n.length){for(var i=n.length,s=0,a=o;se.map((e=>R(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),S(Re,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),S(Re,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${J.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Ee extends ue{constructor(...e){super(...e),S(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}S(Ee,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),S(Ee,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class Ne extends ue{constructor(...e){super(...e),S(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Ne,"z$__type__Props",void 0),S(Ne,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Ne,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Ne,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Ne,"onColorize","\n return color;\n ");class Fe extends ue{constructor(...e){super(...e),S(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Fe,"z$__type__Props",void 0),S(Fe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Fe,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Fe,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Fe,"onColorize","\n return color;\n ");class Le extends ue{constructor(...e){super(...e),S(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Le,"z$__type__Props",void 0),S(Le,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Le,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Le,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Le,"onColorize","\n return color;\n ");class ze extends ue{constructor(...e){super(...e),S(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(ze,"z$__type__Props",void 0),S(ze,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(ze,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(ze,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(ze,"onColorize","\n return color;\n ");class Me extends ue{constructor(...e){super(...e),S(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,r,n,o,i;return{amplitude:null!==(t=e.amplitude)&&void 0!==t?t:.2,narrowness:null!==(r=e.narrowness)&&void 0!==r?r:4,blockiness:null!==(n=e.blockiness)&&void 0!==n?n:2,minimizer:null!==(o=e.minimizer)&&void 0!==o?o:8,time:null!==(i=e.time)&&void 0!==i?i:Date.now()}}}S(Me,"z$__type__Props",void 0),S(Me,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),S(Me,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),S(Me,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class Pe extends ue{constructor(...e){super(...e),S(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}S(Pe,"z$__type__Props",void 0),S(Pe,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Pe,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");class De extends ue{constructor(...e){super(...e),S(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,s=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],a=e.stops||[];if(0===a.length||a.length!==s.length){for(var l=s.length,d=0,h=a;de.map((e=>R(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),S(De,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${ee.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Oe extends ue{constructor(...e){super(...e),S(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,s,a;return{width:null!==(t=e.width)&&void 0!==t?t:10,progress:null!==(r=e.progress)&&void 0!==r?r:.5,offset:null!==(n=e.offset)&&void 0!==n?n:0,range:null!==(o=e.range)&&void 0!==o?o:2*Math.PI,rounded:null!==(i=e.rounded)&&void 0!==i&&i,radius:null!==(s=e.radius)&&void 0!==s?s:1,color:null!==(a=e.color)&&void 0!==a?a:4294967295}}}S(Oe,"z$__type__Props",void 0),S(Oe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Oe,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),S(Oe,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),S(Oe,"onColorize","\n return color;\n ");class Ue extends ue{constructor(...e){super(...e),S(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:null!==(t=e.radius)&&void 0!==t?t:0}}}S(Ue,"z$__type__Props",void 0),S(Ue,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Ue,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),S(Ue,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),S(Ue,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class We{constructor(){S(this,"shCache",new Map),S(this,"shConstructors",{}),S(this,"attachedShader",null),S(this,"effectConstructors",{}),S(this,"renderer",void 0),this.registerShaderType("DefaultShader",be),this.registerShaderType("DefaultShaderBatched",we),this.registerShaderType("RoundedRectangle",Te),this.registerShaderType("DynamicShader",Ce),this.registerShaderType("SdfShader",ke),this.registerEffectType("border",Be),this.registerEffectType("borderBottom",Le),this.registerEffectType("borderLeft",ze),this.registerEffectType("borderRight",Ne),this.registerEffectType("borderTop",Fe),this.registerEffectType("fadeOut",Pe),this.registerEffectType("linearGradient",Re),this.registerEffectType("radialGradient",De),this.registerEffectType("grayscale",Ee),this.registerEffectType("glitch",Me),this.registerEffectType("radius",Ie),this.registerEffectType("radialProgress",Oe),this.registerEffectType("holePunch",Ue)}registerShaderType(e,t){this.shConstructors[e]=t}registerEffectType(e,t){this.effectConstructors[e]=t}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(e,t){if(!this.renderer)throw new Error("Renderer is not been defined");var r=this.shConstructors[e];if(!r)throw new Error(`Shader type "${e}" is not registered`);if("DynamicShader"===e)return this.loadDynamicShader(t);var n=r.resolveDefaults(t),o=r.makeCacheKey(n)||r.name;if(o&&this.shCache.has(o))return{shader:this.shCache.get(o),props:n};var i=new r(this.renderer,t);return o&&this.shCache.set(o,i),{shader:i,props:n}}loadDynamicShader(e){if(!this.renderer)throw new Error("Renderer is not been defined");var t=Ce.resolveDefaults(e,this.effectConstructors),r=Ce.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Ce(this.renderer,e,this.effectConstructors);return r&&this.shCache.set(r,n),{shader:n,props:t}}useShader(e){this.attachedShader!==e&&(this.attachedShader&&this.attachedShader.detach(),e.attach(),this.attachedShader=e)}}class Ye{constructor(){S(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return w({},this.data)}}var je=function(){var e=y(m().mark((function e(t){var r,n;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:if(n=e.sent,-1===t.indexOf(".ktx")){e.next=8;break}return e.abrupt("return",He(n));case 8:return e.abrupt("return",Qe(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=y(m().mark((function e(t){var r,n,o,i,s,a,l;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=new DataView(t),n=16909060===r.getUint32(12),o=[],i={glInternalFormat:r.getUint32(28,n),pixelWidth:r.getUint32(36,n),pixelHeight:r.getUint32(40,n),numberOfMipmapLevels:r.getUint32(56,n),bytesOfKeyValueData:r.getUint32(60,n)},s=64,s+=i.bytesOfKeyValueData,a=0;a>2)*(h+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),s.push(f),l+=c,d>>=1,h>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:s,width:a.pixelWidth||0,height:a.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class Ke extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=Ke.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.src,o=r.premultiplyAlpha,n){t.next=3;break}return t.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){t.next=5;break}return t.abrupt("return",{data:n,premultiplyAlpha:o});case 5:if(!/\.(ktx|pvr)$/.test(n)){t.next=7;break}return t.abrupt("return",je(n));case 7:if(!e.txManager.imageWorkerManager){t.next=13;break}return t.next=10,e.txManager.imageWorkerManager.getImage(n,o);case 10:return t.abrupt("return",t.sent);case 13:if(!e.txManager.hasCreateImageBitmap){t.next=28;break}return t.next=16,fetch(n);case 16:return i=t.sent,t.next=19,i.blob();case 19:return s=t.sent,a=null!=o?o:e.hasAlphaChannel(s.type),t.next=23,createImageBitmap(s,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=a,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return(l=new Image).src=n,t.next=32,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 32:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 33:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=Ke.resolveDefaults(e);return!(t.src instanceof ImageData)&&`ImageTexture,${t.src},${t.premultiplyAlpha}`}static resolveDefaults(e){var t,r;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(r=e.premultiplyAlpha)||void 0===r||r}}}S(Ke,"z$__type__Props",void 0);class $e{constructor(e,t=0){S(this,"iterator",void 0),S(this,"peekBuffer",[]),S(this,"_lastIndex",void 0),this.iterator=e,this.iterator=e,this._lastIndex=t-1,this.peekBuffer=[]}next(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}get lastIndex(){return this._lastIndex}}function Xe(e,t=0){var r,n;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:r=t;case 1:if(!(r=f.y1,K=E<=f.y2,$=Q&&K;(y=M.next())&&!y.done;){var X=y.value;if(e===c.length)c.push({codepointIndex:X.cluster,maxY:B,maxX:I});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,H=R):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=H),X.mapped){var G=R+X.xOffset+X.width;if("none"!==u&&G>=j&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new $e(Xe(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new $e(Xe(m,0),0)),R=F.xStart,N=F.bufferOffset,u="none"}else{var V=R+X.xOffset,Z=E+X.yOffset;if($){-1===P&&(P=N);var q=p.getAtlasEntry(X.glyphId),J=q.x/p.data.common.scaleW,ee=q.y/p.data.common.scaleH,te=q.width/p.data.common.scaleW,re=q.height/p.data.common.scaleH;h[N++]=V,h[N++]=Z,h[N++]=J,h[N++]=ee,h[N++]=V+X.width,h[N++]=Z,h[N++]=J+te,h[N++]=ee,h[N++]=V,h[N++]=Z+X.height,h[N++]=J,h[N++]=ee+re,h[N++]=V+X.width,h[N++]=Z+X.height,h[N++]=J+te,h[N++]=ee+re}B=Math.max(B,Z+X.height),I=Math.max(I,V+X.width),R+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new $e(Xe(m,0),0)),u="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),R=0,E+=w,e++,F.codepointIndex=-1,H=0,!v&&"both"===u&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===u?I:S,oe=0;oe"number"==typeof e?e:Ze[e]||400;var Je=M((function(e,t,r,n,o){var i,s=qe(r),a=A(e);try{for(a.s();!(i=a.n()).done;){var l=i.value[t];if(l){if(1===l.size)return console.warn(`TrFontManager: Only one font face found for family: '${t}' - will be used for all weights and styles`),l.values().next().value;var d,h=new Map,u=A(l);try{for(u.s();!(d=u.n()).done;){var c=d.value,f=qe(c.descriptors.weight);if(f===s&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;h.set(f,c)}}catch(v){u.e(v)}finally{u.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${s} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===s&&h.has(500))return h.get(500);if(500===s&&h.has(400))return h.get(400);if(s<400){for(;s>0;){if(h.has(s))return h.get(s);s-=100}s=600}for(;s<1e3;){if(h.has(s))return h.get(s);s+=100}for(s=500;s>0;){if(h.has(s))return h.get(s);s-=100}}}}catch(v){a.e(v)}finally{a.f()}}));class et{constructor(e){S(this,"textRenderers",void 0),this.textRenderers=e}addFontFace(e){for(var t in this.textRenderers){var r=this.textRenderers[t];r&&r.isFontFaceSupported(e)&&r.addFontFace(e)}}static resolveFontFace(e,t){var r=t.fontFamily,n=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return Je(e,r,n,o,i)}}var tt={x:0,y:0,width:0,height:0};class rt extends fe{constructor(e){super(e),S(this,"ssdfFontFamilies",{}),S(this,"msdfFontFamilies",{}),S(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),S(this,"sdfShader",void 0),S(this,"rendererBounds",void 0),this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}isFontFaceSupported(e){return e instanceof U}addFontFace(e){C(e instanceof U);var t=e.fontFamily,r="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(r){var n=r[t];n||(n=new Set,r[t]=n),n.add(e)}else console.warn(`Invalid font face type: ${e.type}`)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){var t=e.trFontFace,r=e.textH,n=e.lineCache,o=e.debugData,i=e.forceFullLayoutCalc;if(o.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){var s=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(s),void this.setStatus(e,"failed",new Error(s))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){C(t.data,"Font face data should be loaded");var a=e.props,l=a.text,d=a.fontSize,h=a.x,u=a.y,c=a.contain,f=a.width,p=a.height,v=a.lineHeight,g=a.verticalAlign,m=a.scrollable,x=a.overflowSuffix,y=a.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,T=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var _=24*l.length,k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(2*_));var I=e.elementBounds;if(I.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),I.valid=!0),!i&&w.valid){var B=w.screen;if(h+B.x1<=I.x1&&h+B.x2>=I.x2&&u-b+B.y1<=I.y1&&u-b+B.y2>=I.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var R=e.props,E=R.offsetY,N=R.textAlign;if(!w.valid){if(!O(I,this.rendererBounds))return;Ve(w,h,u,b,v,"both"===c?I.y2-I.y1:0,I,A)}var F=function(e,t,r,n,o,i,s,a,l){var d=Math.min(Math.max(s.firstLineIdx,0),a.length),h=0;"middle"===n?h=(t-e)/2:"bottom"===n&&(h=t-e);var u=o/i+d*t+h;if(!(l&&u>=l/i))return{sdfX:0,sdfY:u,lineIndex:d}}(S,T,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=Ge(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,k,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=k.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else t.once("loaded",(()=>{this.scheduleUpdateState(e)}))}renderQuads(e,t,r,n){var o,i;if(e.vertexBuffer){var s=this.stage.renderer,a=e.props,l=a.fontSize,d=a.color,h=a.contain,u=a.scrollable,c=a.zIndex,f=a.debug,p="both"===h&&u?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,m=e.textH,x=void 0===m?0:m,y=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,S=e.trFontFace,A=e.elementBounds,T=e.webGlBuffers;if(!T){var _=s.glw,k=4*Float32Array.BYTES_PER_ELEMENT,I=_.createBuffer();C(I),e.webGlBuffers=new W([{buffer:I,attributes:{a_position:{name:"a_position",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,C(e.webGlBuffers),T=e.webGlBuffers}if(!w){var B,R,E=s.glw,F=null!==(B=null===(R=T)||void 0===R?void 0:R.getBuffer("a_textureCoordinate"))&&void 0!==B?B:null;E.arrayBufferData(F,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(C(S),u&&"both"===h){C(A.valid);var L=Y(A,tt);r.valid?(e.clippingRect.valid=!0,r=N(r,L,e.clippingRect)):(e.clippingRect.valid=!0,r=j(L,e.clippingRect))}var z=new H(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:Q(d,n),size:l/((null===(o=S.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:y,debug:f.sdfShaderDebug},n,r,{height:x,width:g},0,c),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;C(M);var P=this.stage.txManager.getCtxTexture(M);z.addTexture(P),z.length=e.bufferNumFloats,z.numQuads=e.bufferNumQuads,s.addRenderOp(z)}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),null===(t=e.trFontFace)||void 0===t||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return et.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){var t=e.props,r=t.x,n=t.contain,o=t.width,i=e.elementBounds;i.x1=r,i.x2="none"!==n?r+o:1/0}setElementBoundsY(e){var t=e.props,r=t.y,n=t.contain,o=t.height,i=e.elementBounds;i.y1=r,i.y2="both"===n?r+o:1/0}}function nt(e,t){return ot.apply(this,arguments)}function ot(){return(ot=y(m().mark((function e(t,r){var n,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,he((()=>b.import(t)),void 0);case 4:n=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error(`The core extension module at '${t}' could not be loaded.`),console.error(e.t0),e.abrupt("return");case 12:if(n.default){e.next=15;break}return console.error(`The core extension module at '${t}' does not have a default export.`),e.abrupt("return");case 15:if(o=n.default,!(o.prototype instanceof K)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(r);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error(`The core extension at '${t}' threw an error.`),console.error(e.t1);case 27:e.next=30;break;case 29:console.error(`The core extension at '${t}' does not extend CoreExtension.`);case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function it(e){for(var t={boolean:!0,string:!0,number:!0},r=Object.keys(e),n=0;n2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),e[o]=i.substring(0,2048)),t[s]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class st extends B{constructor(e,t,r){var n,o,i,s;super(),S(this,"root",null),S(this,"driver",void 0),S(this,"canvas",void 0),S(this,"settings",void 0),S(this,"inspector",null),S(this,"nodes",new Map),S(this,"nextTextureId",1),S(this,"textureTracker",void 0);var a={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(n=e.clearColor)&&void 0!==n?n:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(o=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==o&&o,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(i=e.enableContextSpy)&&void 0!==i&&i,enableInspector:null!==(s=e.enableInspector)&&void 0!==s&&s};this.settings=a;var l=a.appWidth,d=a.appHeight,h=a.deviceLogicalPixelRatio,u=a.devicePhysicalPixelRatio,c=a.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=a.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new ie(f):new oe(f,this.settings.textureCleanupOptions);var v=l*h,g=d*h;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*u,x.height=g*u,x.style.width=`${v}px`,x.style.height=`${g}px`,!(m="string"==typeof t?document.getElementById(t):t))throw new Error("Could not find target element");r.onCreateNode=e=>{this.nodes.set(e.id,e)},r.onBeforeDestroyNode=e=>{this.nodes.delete(e.id)},r.onFpsUpdate=e=>{this.emit("fpsUpdate",e)},r.onFrameTick=e=>{this.emit("frameTick",e)},r.onIdle=()=>{this.emit("idle")},m.appendChild(x),c&&!T()&&(this.inspector=new de(x,a))}init(){var e=this;return y(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.driver.init(e,e.settings,e.canvas);case 2:e.root=e.driver.getRootNode();case 3:case"end":return t.stop()}}),t)})))()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,S=w(w({},this.resolveNodeDefaults(e)),{},{text:null!==(r=e.text)&&void 0!==r?r:"",textRendererOverride:null!==(n=e.textRendererOverride)&&void 0!==n?n:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(s=e.fontWeight)&&void 0!==s?s:"normal",fontStretch:null!==(a=e.fontStretch)&&void 0!==a?a:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(h=e.scrollable)&&void 0!==h&&h,scrollY:null!==(u=e.scrollY)&&void 0!==u?u:0,offsetY:null!==(c=e.offsetY)&&void 0!==c?c:0,letterSpacing:null!==(f=e.letterSpacing)&&void 0!==f?f:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(m=e.verticalAlign)&&void 0!==m?m:"top",overflowSuffix:null!==(x=e.overflowSuffix)&&void 0!==x?x:"...",debug:null!==(y=e.debug)&&void 0!==y?y:{}});return this.inspector?this.inspector.createTextNode(this.driver,S):this.driver.createTextNode(S)}resolveNodeDefaults(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,k,I,B,R,E,N,F,L,z,M,P,D,O,U,W,Y,j,H,Q,K,$,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:X,V=null!==(i=null!==(s=null!==(a=e.colorTr)&&void 0!==a?a:e.colorTop)&&void 0!==s?s:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(d=null!==(h=e.colorBl)&&void 0!==h?h:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:X,q=null!==(u=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==u?u:X,J=it(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(m=e.width)&&void 0!==m?m:0,height:null!==(x=e.height)&&void 0!==x?x:0,alpha:null!==(y=e.alpha)&&void 0!==y?y:1,autosize:null!==(b=e.autosize)&&void 0!==b&&b,clipping:null!==(w=e.clipping)&&void 0!==w&&w,color:X,colorTop:null!==(S=e.colorTop)&&void 0!==S?S:X,colorBottom:null!==(A=e.colorBottom)&&void 0!==A?A:X,colorLeft:null!==(C=e.colorLeft)&&void 0!==C?C:X,colorRight:null!==(T=e.colorRight)&&void 0!==T?T:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(_=e.zIndex)&&void 0!==_?_:0,zIndexLocked:null!==(k=e.zIndexLocked)&&void 0!==k?k:0,parent:null!==(I=e.parent)&&void 0!==I?I:null,texture:null!==(B=e.texture)&&void 0!==B?B:null,shader:null!==(R=e.shader)&&void 0!==R?R:null,src:null!==(E=e.src)&&void 0!==E?E:"",scale:null!==(N=e.scale)&&void 0!==N?N:null,scaleX:null!==(F=null!==(L=e.scaleX)&&void 0!==L?L:e.scale)&&void 0!==F?F:1,scaleY:null!==(z=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==z?z:1,mount:null!==(P=e.mount)&&void 0!==P?P:0,mountX:null!==(D=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==D?D:0,mountY:null!==(U=null!==(W=e.mountY)&&void 0!==W?W:e.mount)&&void 0!==U?U:0,pivot:null!==(Y=e.pivot)&&void 0!==Y?Y:.5,pivotX:null!==(j=null!==(H=e.pivotX)&&void 0!==H?H:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(Q=null!==(K=e.pivotY)&&void 0!==K?K:e.pivot)&&void 0!==Q?Q:.5,rotation:null!==($=e.rotation)&&void 0!==$?$:0,data:J}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,r){var n=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:w(w({},r),{},{id:n})};return this.textureTracker.registerTexture(o),o}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class at extends B{constructor(e,t,r){super(),S(this,"node",void 0),S(this,"props",void 0),S(this,"settings",void 0),S(this,"propStartValues",{}),S(this,"restoreValues",{}),S(this,"progress",0),S(this,"delayFor",0),S(this,"timingFunction",void 0),S(this,"propsList",void 0),this.node=e,this.props=t,this.settings=r,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach((t=>{this.propStartValues[t]=e[t]})),this.timingFunction=e=>e,r.easing&&"string"==typeof r.easing&&(this.timingFunction=$(r.easing)),this.delayFor=r.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach((e=>{this.node[e]=this.propStartValues[e]}))}reverse(){this.progress=0,Object.keys(this.props).forEach((e=>{var t=this.props[e],r=this.propStartValues[e];this.props[e]=r,this.propStartValues[e]=t})),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,r){return(this.timingFunction(e)||e)*(r-t)+t}update(e){var t=this.settings,r=t.duration,n=t.loop,o=t.easing,i=t.stopMethod;if(r)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/r,this.progress>1&&(this.progress=n?0:1,i))this.emit("finished",{});else{for(var s=0;s{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){C(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){C(this.stoppedResolve);var e=this.animation.settings,t=e.loop;if("reverse"===e.stopMethod)return this.animation.reverse(),void this.start();this.stoppedResolve(),this.stoppedResolve=null,t||this.manager.unregisterAnimation(this.animation)}}class dt{constructor(e){S(this,"data",void 0),e?(this.data=new Float32Array(9),this.data[0]=e[0],this.data[3]=e[3],this.data[6]=e[6],this.data[1]=e[1],this.data[4]=e[4],this.data[7]=e[7],this.data[2]=e[2],this.data[5]=e[5],this.data[8]=e[8]):this.data=new Float32Array(9)}static get temp(){return ut}static multiply(e,t,r){var n=e.data[0]*t.data[0]+e.data[3]*t.data[1]+e.data[6]*t.data[2],o=e.data[0]*t.data[3]+e.data[3]*t.data[4]+e.data[6]*t.data[5],i=e.data[0]*t.data[6]+e.data[3]*t.data[7]+e.data[6]*t.data[8],s=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],a=e.data[1]*t.data[3]+e.data[4]*t.data[4]+e.data[7]*t.data[5],l=e.data[1]*t.data[6]+e.data[4]*t.data[7]+e.data[7]*t.data[8],d=e.data[2]*t.data[0]+e.data[5]*t.data[1]+e.data[8]*t.data[2],h=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],u=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new dt),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=s,r.data[4]=a,r.data[7]=l,r.data[2]=d,r.data[5]=h,r.data[8]=u,r}static identity(e){return e||(e=new dt),e.data[0]=1,e.data[3]=0,e.data[6]=0,e.data[1]=0,e.data[4]=1,e.data[7]=0,e.data[2]=0,e.data[5]=0,e.data[8]=1,e}static translate(e,t,r){return r||(r=new dt),r.data[0]=1,r.data[3]=0,r.data[6]=e,r.data[1]=0,r.data[4]=1,r.data[7]=t,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static scale(e,t,r){return r||(r=new dt),r.data[0]=e,r.data[3]=0,r.data[6]=0,r.data[1]=0,r.data[4]=t,r.data[7]=0,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static rotate(e,t){var r=Math.cos(e),n=Math.sin(e);return t||(t=new dt),t.data[0]=r,t.data[3]=-n,t.data[6]=0,t.data[1]=n,t.data[4]=r,t.data[7]=0,t.data[2]=0,t.data[5]=0,t.data[8]=1,t}static copy(e,t,r){return t||(t=new dt),t.data[0]=e.data[0],t.data[1]=e.data[1],t.data[2]=e.data[2],t.data[3]=e.data[3],t.data[4]=e.data[4],t.data[5]=e.data[5],t.data[6]=e.data[6],t.data[7]=e.data[7],t.data[8]=e.data[8],t}translate(e,t){return this.data[6]=this.data[0]*e+this.data[3]*t+this.data[6],this.data[7]=this.data[1]*e+this.data[4]*t+this.data[7],this}scale(e,t){return this.data[0]=this.data[0]*e,this.data[3]=this.data[3]*t,this.data[1]=this.data[1]*e,this.data[4]=this.data[4]*t,this}rotate(e){if(0===e||!(e%Math.PI*2))return this;var t=Math.cos(e),r=Math.sin(e),n=this.data[0]*t+this.data[3]*r,o=this.data[3]*t-this.data[0]*r,i=this.data[1]*t+this.data[4]*r,s=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=s,this}multiply(e){return dt.multiply(this,e,this)}get tx(){return this.data[6]}get ty(){return this.data[7]}get ta(){return this.data[0]}get tb(){return this.data[3]}get tc(){return this.data[1]}get td(){return this.data[4]}transformPoint(e,t){return[this.data[0]*e+this.data[3]*t+this.data[6],this.data[1]*e+this.data[4]*t+this.data[1]]}}var ht,ut=new dt;class ct{constructor(e){S(this,"data",void 0),this.data=new Float32Array(8),e&&(this.data[0]=e[0],this.data[2]=e[2],this.data[4]=e[4],this.data[6]=e[6],this.data[1]=e[1],this.data[3]=e[3],this.data[5]=e[5],this.data[7]=e[7])}static translate(e,t,r,n,o,i,s,a,l){return l||(l=new ct),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=s,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=a,l}get x1(){return this.data[0]}get x2(){return this.data[2]}get x3(){return this.data[4]}get x4(){return this.data[6]}get y1(){return this.data[1]}get y2(){return this.data[3]}get y3(){return this.data[5]}get y4(){return this.data[7]}}!function(e){e[e.Init=0]="Init",e[e.OutOfBounds=2]="OutOfBounds",e[e.InBounds=4]="InBounds",e[e.InViewport=8]="InViewport"}(ht||(ht={}));var ft,pt=new Map;pt.set(ht.Init,"init"),pt.set(ht.OutOfBounds,"outOfBounds"),pt.set(ht.InBounds,"inBounds"),pt.set(ht.InViewport,"inViewport"),function(e){e[e.Children=1]="Children",e[e.ScaleRotate=2]="ScaleRotate",e[e.Local=4]="Local",e[e.Global=8]="Global",e[e.Clipping=16]="Clipping",e[e.CalculatedZIndex=32]="CalculatedZIndex",e[e.ZIndexSortedChildren=64]="ZIndexSortedChildren",e[e.PremultipliedColors=128]="PremultipliedColors",e[e.WorldAlpha=256]="WorldAlpha",e[e.RenderState=512]="RenderState",e[e.IsRenderable=1024]="IsRenderable",e[e.None=0]="None",e[e.All=2047]="All"}(ft||(ft={}));class vt extends B{constructor(e,t){super(),S(this,"stage",void 0),S(this,"children",[]),S(this,"props",void 0),S(this,"updateType",ft.All),S(this,"globalTransform",void 0),S(this,"scaleRotateTransform",void 0),S(this,"localTransform",void 0),S(this,"renderCoords",void 0),S(this,"renderBound",void 0),S(this,"strictBound",void 0),S(this,"preloadBound",void 0),S(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),S(this,"isRenderable",!1),S(this,"renderState",ht.Init),S(this,"worldAlpha",1),S(this,"premultipliedColorTl",0),S(this,"premultipliedColorTr",0),S(this,"premultipliedColorBl",0),S(this,"premultipliedColorBr",0),S(this,"calcZIndex",0),S(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),S(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=w(w({},t),{},{parent:null}),this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,r=null){this.props.texture&&this.unloadTexture();var n=this.stage.txManager.loadTexture(e,t,r);this.props.texture=n,this.props.textureOptions=r,this.setUpdateType(ft.IsRenderable),queueMicrotask((()=>{"loaded"===n.state?this.onTextureLoaded(n,n.dimensions):"failed"===n.state?this.onTextureFailed(n,n.error):"freed"===n.state&&this.onTextureFreed(n),n.on("loaded",this.onTextureLoaded),n.on("failed",this.onTextureFailed),n.on("freed",this.onTextureFreed)}))}unloadTexture(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(ft.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();C(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(ft.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&ft.Children||t.setUpdateType(ft.Children)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=dt.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){C(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,r=this.props.mountX*this.props.width,n=this.props.mountY*this.props.height;this.localTransform=dt.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(ft.Global)}update(e,t){this.updateType&ft.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(ft.Local)),this.updateType&ft.Local&&(this.updateLocalTransform(),this.setUpdateType(ft.Global));var r=this.props.parent,n=ft.None;this.updateType&ft.Global&&(C(this.localTransform),this.globalTransform=dt.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(ft.Clipping|ft.RenderState|ft.Children),n|=ft.Global),this.updateType&ft.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(ft.Children),n|=ft.Clipping),this.updateType&ft.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(ft.Children|ft.PremultipliedColors|ft.IsRenderable),n|=ft.WorldAlpha),this.updateType&ft.PremultipliedColors&&(this.premultipliedColorTl=L(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=L(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=L(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=L(this.props.colorBr,this.worldAlpha,!0))),this.updateType&ft.RenderState&&(this.updateRenderState(t),this.setUpdateType(ft.IsRenderable)),this.updateType&ft.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&ft.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(ft.ZIndexSortedChildren)),this.updateType&ft.Children&&this.children.length&&this.children.forEach((t=>{t.setUpdateType(n),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&ft.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}checkRenderBounds(e){C(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=k(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=k(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),G(this.renderBound,this.strictBound)?ht.InViewport:G(this.renderBound,this.preloadBound)?ht.InBounds:ht.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===ht.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rht.InBounds&&t===ht.OutOfBounds)&&(this.emit(pt.get(ht.InBounds),{previous:r,current:t}),r=ht.InBounds);var n=pt.get(t);C(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ht[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>ht.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}calculateRenderCoords(){var e=this.width,t=this.height,r=this.globalTransform;C(r);var n=r.tx,o=r.ty,i=r.ta,s=r.tb,a=r.tc,l=r.td;if(0===s&&0===a){var d=n,h=n+e*i,u=o,c=o+t*l;this.renderCoords=ct.translate(d,u,h,u,h,c,d,c,this.renderCoords)}else this.renderCoords=ct.translate(n,o,n+e*i,o+e*a,n+e*i+t*s,o+e*a+t*l,n+t*s,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;C(t),C(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,s=e.x3,a=e.y3;if(0===r||0===n)this.renderBound=k(o,i,s,a,this.renderBound);else{var l=e.x2,d=e.x4,h=e.y2,u=e.y4;this.renderBound=k(Math.min(o,l,s,d),Math.min(i,h,a,u),Math.max(o,l,s,d),Math.max(i,h,a,u),this.renderBound)}}calculateClippingRect(e){C(this.globalTransform);var t=this.clippingRect,r=this.props,n=this.globalTransform,o=r.clipping,i=0!==n.tb||0!==n.tc;o&&!i?(t.x=n.tx,t.y=n.ty,t.width=this.width*n.ta,t.height=this.height*n.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?N(e,t,t):e.valid&&(j(e,t),t.valid=!0)}calculateZIndex(){var e,t,r=this.props,n=r.zIndex||0,o=(null===(e=r.parent)||void 0===e?void 0:e.zIndex)||0,i=n;null!==(t=r.parent)&&void 0!==t&&t.zIndexLocked&&(i=n{e.setUpdateType(ft.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(ft.CalculatedZIndex|ft.Children),this.children.forEach((e=>{e.setUpdateType(ft.CalculatedZIndex)}))}get parent(){return this.props.parent}set parent(e){var t=this.props.parent;if(t!==e){if(this.props.parent=e,t){var r=t.children.indexOf(this);C(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(ft.Children|ft.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(ft.All),e.setUpdateType(ft.Children|ft.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}var gt=1;function mt(){return gt++}class xt extends B{constructor(e,t,r,n){var o;super(),S(this,"rendererMain",void 0),S(this,"stage",void 0),S(this,"id",void 0),S(this,"coreNode",void 0),S(this,"_children",[]),S(this,"_src",""),S(this,"_parent",null),S(this,"_texture",null),S(this,"_shader",null),S(this,"_data",{}),S(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),S(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),S(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),S(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),S(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),S(this,"onInViewport",((e,t)=>{this.emit("inViewport",t)})),this.rendererMain=t,this.stage=r,this.id=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:mt(),this.coreNode=n||new vt(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){null!==e&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var t,r=this._parent;if(this._parent=e,this.coreNode.parent=null!==(t=null==e?void 0:e.coreNode)&&void 0!==t?t:null,r){var n=r.children.indexOf(this);C(-1!==n,"MainOnlyNode.parent: Node not found in old parent's children!"),r.children.splice(n,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.texture=e?this.rendererMain.createTexture("ImageTexture",{src:e}):null)}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=it(e)}destroy(){this.emit("beforeDestroy",{});for(var e=this.children[0];e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){var r=new at(this.coreNode,e,t);return new lt(this.stage.animationManager,r)}}class yt{constructor(){S(this,"activeAnimations",new Set)}registerAnimation(e){this.activeAnimations.add(e)}unregisterAnimation(e){this.activeAnimations.delete(e)}update(e){this.activeAnimations.forEach((t=>{t.update(e)}))}}class bt{constructor(e){S(this,"imageWorkersEnabled",!0),S(this,"messageManager",{}),S(this,"workers",[]),S(this,"workerIndex",0),this.workers=this.createWorkers(e),this.workers.forEach((e=>{e.onmessage=this.handleMessage.bind(this)}))}handleMessage(e){var t=e.data,r=t.src,n=t.data,o=t.error,i=this.messageManager[r];if(i){var s=g(i,2),a=s[0],l=s[1];delete this.messageManager[r],o?l(new Error(o)):a(n)}}createWorkers(e=1){for(var t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),r=(self.URL?URL:webkitURL).createObjectURL(t),n=[],o=0;o{try{if(this.workers){var o=this.convertUrlToAbsolute(e);this.messageManager[o]=[r,n],this.getNextWorker().postMessage({src:o,premultiplyAlpha:t})}}catch(i){n(i)}}))}}class wt extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=wt.resolveDefaults(t)}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=e.props,n=r.width,o=r.height,i=n*o*4,s=new Uint8ClampedArray(i),a=0;a{})}setTextureMemUse(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}gc(){this.textures.forEach(((e,t)=>{t.renderable||t.free()}))}}class Ct extends B{constructor(e){super(),S(this,"options",void 0),S(this,"animationManager",void 0),S(this,"txManager",void 0),S(this,"txMemManager",void 0),S(this,"fontManager",void 0),S(this,"textRenderers",void 0),S(this,"shManager",void 0),S(this,"renderer",void 0),S(this,"root",void 0),S(this,"boundsMargin",void 0),S(this,"deltaTime",0),S(this,"lastFrameTime",0),S(this,"currentFrameTime",0),S(this,"fpsNumFrames",0),S(this,"fpsElapsedTime",0),S(this,"renderRequested",!1),S(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,s=e.appHeight,a=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,h=e.txMemByteThreshold;this.txManager=new St(d),this.txMemManager=new At(h),this.shManager=new We,this.animationManager=new yt,this.contextSpy=l?new Ye:null;var u=[0,0,0,0];a&&(u=Array.isArray(a)?a:[a,a,a,a]),this.boundsMargin=u,null!=o&&o.monitorTextureCache&&setInterval((()=>{C(this.txManager);var e=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),this.renderer=new q({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=r?r:4278190080,bufferMemory:2e6,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new ye(this),sdf:new rt(this)},this.fontManager=new et(this.textRenderers);var c,f,p,v=new vt(this,{id:n,x:0,y:0,width:i,height:s,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=v,c=this,f=!1,p=()=>{if(c.updateAnimations(),!c.hasSceneUpdates())return c.calculateFps(),setTimeout(p,16.666666666666668),void(f||(c.emit("idle"),f=!0));f=!1,c.drawFrame(),requestAnimationFrame(p)},requestAnimationFrame(p)}updateAnimations(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,r,n,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(r=this.contextSpy)||void 0===r?void 0:r.getData())&&void 0!==t?t:null}),null===(n=this.contextSpy)||void 0===n||n.reset()}}addQuads(e){C(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t{var e=this.contain,t=this.trState.props.width,r=this.trState.props.height,n=this.trState.textW||0,o=this.trState.textH||0;"both"===e?(this.props.width=t,this.props.height=r):"width"===e?(this.props.width=t,this.props.height=o):"none"===e&&(this.props.width=n,this.props.height=o),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})})),S(this,"onTextFailed",((e,t)=>{this.emit("failed",{type:"text",error:t})})),this._textRendererOverride=t.textRendererOverride;var r=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix}),n=r.resolvedTextRenderer,o=r.textRendererState;this.textRenderer=n,this.trState=o}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),"none"===this.contain&&this.setUpdateType(ft.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),"both"!==this.contain&&this.setUpdateType(ft.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);var t=this.resolveTextRendererAndState(this.trState.props),r=t.resolvedTextRenderer,n=t.textRendererState;this.textRenderer=r,this.trState=n}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),C(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return""!==this.trState.props.text||super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){C(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){var t=this.stage.resolveTextRenderer(e,this._textRendererOverride),r=t.createState(e);return r.emitter.on("loaded",this.onTextLoaded),r.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(r),{resolvedTextRenderer:t,textRendererState:r}}}class _t extends xt{constructor(e,t,r){super(e,t,r,new Tt(r,{id:mt(),x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStretch:e.fontStretch,fontStyle:e.fontStyle,contain:e.contain,scrollable:e.scrollable,letterSpacing:e.letterSpacing,textAlign:e.textAlign,scrollY:e.scrollY,offsetY:e.offsetY,textRendererOverride:e.textRendererOverride,lineHeight:e.lineHeight,maxLines:e.maxLines,textBaseline:e.textBaseline,verticalAlign:e.verticalAlign,overflowSuffix:e.overflowSuffix,debug:e.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(e){this.coreNode.text=e}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(e){this.coreNode.textRendererOverride=e}get fontSize(){return this.coreNode.fontSize}set fontSize(e){this.coreNode.fontSize=e}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(e){this.coreNode.fontFamily=e}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(e){this.coreNode.fontWeight=e}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(e){this.coreNode.fontStretch=e}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(e){this.coreNode.fontStyle=e}get textAlign(){return this.coreNode.textAlign}set textAlign(e){this.coreNode.textAlign=e}get contain(){return this.coreNode.contain}set contain(e){this.coreNode.contain=e}get scrollable(){return this.coreNode.scrollable}set scrollable(e){this.coreNode.scrollable=e}get scrollY(){return this.coreNode.scrollY}set scrollY(e){this.coreNode.scrollY=e}get offsetY(){return this.coreNode.offsetY}set offsetY(e){this.coreNode.offsetY=e}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(e){this.coreNode.letterSpacing=e}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(e){e&&(this.coreNode.lineHeight=e)}get maxLines(){return this.coreNode.maxLines}set maxLines(e){e&&(this.coreNode.maxLines=e)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(e){e&&(this.coreNode.textBaseline=e)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(e){e&&(this.coreNode.verticalAlign=e)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(e){e&&(this.coreNode.overflowSuffix=e)}get debug(){return this.coreNode.debug}set debug(e){this.coreNode.debug=e}}class kt{constructor(){S(this,"root",null),S(this,"stage",null),S(this,"rendererMain",null)}init(e,t,r){var n=this;return y(m().mark((function o(){var i;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Ct({rootId:mt(),appWidth:t.appWidth,appHeight:t.appHeight,txMemByteThreshold:t.txMemByteThreshold,boundsMargin:t.boundsMargin,deviceLogicalPixelRatio:t.deviceLogicalPixelRatio,devicePhysicalPixelRatio:t.devicePhysicalPixelRatio,clearColor:t.clearColor,canvas:r,fpsUpdateInterval:t.fpsUpdateInterval,enableContextSpy:t.enableContextSpy,numImageWorkers:t.numImageWorkers,debug:{monitorTextureCache:!1}}),n.rendererMain=e,C(n.stage.root),i=new xt(e.resolveNodeDefaults({}),n.rendererMain,n.stage,n.stage.root),n.root=i,i.once("beforeDestroy",n.onBeforeDestroyNode.bind(n,i)),n.onCreateNode(i),!t.coreExtensionModule){o.next=10;break}return o.next=10,nt(t.coreExtensionModule,n.stage);case 10:n.stage.on("fpsUpdate",((e,t)=>{n.onFpsUpdate(t)})),n.stage.on("frameTick",((e,t)=>{n.onFrameTick(t)})),n.stage.on("idle",(()=>{n.onIdle()}));case 13:case"end":return o.stop()}}),o)})))()}createNode(e){C(this.rendererMain),C(this.stage);var t=new xt(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){C(this.rendererMain),C(this.stage);var t=new _t(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}destroyNode(e){e.destroy()}releaseTexture(e){var t=this.stage;C(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return C(this.root),this.root}onCreateNode(e){throw new Error("Method not implemented.")}onBeforeDestroyNode(e){throw new Error("Method not implemented.")}onFpsUpdate(e){throw new Error("Method not implemented.")}onFrameTick(e){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}var It,Bt=(e,t)=>e===t,Rt=Symbol("solid-proxy"),Et=Symbol("solid-track"),Nt={equals:Bt},Ft=pr,Lt=1,zt=2,Mt={owned:null,cleanups:null,context:null,owner:null},Pt={},Dt=null,Ot=null,Ut=null,Wt=null,Yt=null,jt=0;function Ht(e,t){var r=Ut,n=Dt,o=0===e.length,i=void 0===t?n:t,s=o?Mt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>qt((()=>xr(s)))));Dt=s,Ut=null;try{return fr(a,!0)}finally{Ut=r,Dt=n}}function Qt(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Nt,t):Nt).equals||void 0};return[lr.bind(r),e=>("function"==typeof e&&(e=e(r.value)),dr(r,e))]}function Kt(e,t,r){hr(ur(e,t,!0,Lt))}function $t(e,t,r){hr(ur(e,t,!1,Lt))}function Xt(e,t,r){Ft=vr;var n=ur(e,t,!1,Lt);r&&r.render||(n.user=!0),Yt?Yt.push(n):hr(n)}function Gt(e,t,r){r=r?Object.assign({},Nt,r):Nt;var n=ur(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,hr(n),lr.bind(n)}function Vt(e,t,r){var n,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});var s=null,a=Pt,l=!1,d="initialValue"in i,h="function"==typeof n&&Gt(n),u=new Set,c=g((i.storage||Qt)(i.initialValue),2),f=c[0],p=c[1],v=g(Qt(void 0),2),m=v[0],x=v[1],y=g(Qt(void 0,{equals:!1}),2),b=y[0],w=y[1],S=g(Qt(d?"ready":"unresolved"),2),C=S[0],T=S[1];function _(e,t,r,n){return s===e&&(s=null,void 0!==n&&(d=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),a=Pt,function(e,t){fr((()=>{void 0===t&&p((()=>e)),T(void 0!==t?"errored":d?"ready":"unresolved"),x(t);var r,n=A(u.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}u.clear()}),!1)}(t,r)),t}function k(){var e=It,t=f(),r=m();if(void 0!==r&&!s)throw r;return Ut&&!Ut.user&&e&&Kt((()=>{b(),s&&(e.resolved||u.has(e)||(e.increment(),u.add(e)))})),t}function I(e=!0){if(!1===e||!l){l=!1;var t=h?h():n;if(null!=t&&!1!==t){var r,i=a!==Pt?a:qt((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(s=i,"value"in i?("success"===i.status?_(s,i.value,void 0,t):_(s,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),fr((()=>{T(d?"refreshing":"pending"),w()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,yr(e),t))))):(_(s,i,void 0,t),i)}_(s,qt(f))}}return Object.defineProperties(k,{state:{get:()=>C()},error:{get:()=>m()},loading:{get(){var e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return k();var e=m();if(e&&!s)throw e;return f()}}}),h?Kt((()=>I(!1))):I(!1),[k,{refetch:I,mutate:p}]}function Zt(e,t=Bt,r){var n=new Map,o=ur((r=>{var o,i=e(),s=A(n.entries());try{for(s.s();!(o=s.n()).done;){var a=g(o.value,2),l=a[0],d=a[1];if(t(l,i)!==t(l,r)){var h,u=A(d.values());try{for(u.s();!(h=u.n()).done;){var c=h.value;c.state=Lt,c.pure?Wt.push(c):Yt.push(c)}}catch(f){u.e(f)}finally{u.f()}}}}catch(f){s.e(f)}finally{s.f()}return i}),void 0,!0,Lt);return hr(o),e=>{var r,i=Ut;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),tr((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function qt(e){if(null===Ut)return e();var t=Ut;Ut=null;try{return e()}finally{Ut=t}}function Jt(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var s;if(o){s=Array(e.length);for(var a=0;at(s,n,r)));return n=s,l}}function er(e){Xt((()=>qt(e)))}function tr(e){return null===Dt||(null===Dt.cleanups?Dt.cleanups=[e]:Dt.cleanups.push(e)),e}function rr(){return Dt}function nr(e,t){var r=Dt,n=Ut;Dt=e,Ut=null;try{return fr(t,!0)}catch(o){br(o)}finally{Dt=r,Ut=n}}function or(e){var t=Ut,r=Dt;return Promise.resolve().then((()=>{Ut=t,Dt=r,fr(e,!1),Ut=Dt=null}))}function ir(e,t){var r=Symbol("context");return{id:r,Provider:Sr(r),defaultValue:e}}function sr(e){return Dt&&Dt.context&&void 0!==Dt.context[e.id]?Dt.context[e.id]:e.defaultValue}function ar(e){var t=Gt(e),r=Gt((()=>wr(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function lr(){if(this.sources&&this.state)if(this.state===Lt)hr(this);else{var e=Wt;Wt=null,fr((()=>gr(this)),!1),Wt=e}if(Ut){var t=this.observers?this.observers.length:0;Ut.sources?(Ut.sources.push(this),Ut.sourceSlots.push(t)):(Ut.sources=[this],Ut.sourceSlots=[t]),this.observers?(this.observers.push(Ut),this.observerSlots.push(Ut.sources.length-1)):(this.observers=[Ut],this.observerSlots=[Ut.sources.length-1])}return this.value}function dr(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&fr((()=>{for(var t=0;t1e6)throw Wt=[],new Error}),!1)),t}function hr(e){if(e.fn){xr(e);var t=jt;!function(e,t,r){var n,o=Dt,i=Ut;Ut=Dt=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=Lt,e.owned&&e.owned.forEach(xr),e.owned=null),e.updatedAt=r+1,br(s)}finally{Ut=i,Dt=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?dr(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function ur(e,t,r,n=Lt,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Dt,context:Dt?Dt.context:null,pure:r};return null===Dt||Dt!==Mt&&(Dt.owned?Dt.owned.push(i):Dt.owned=[i]),i}function cr(e){if(0!==e.state){if(e.state===zt)return gr(e);if(e.suspense&&qt(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===Lt)hr(e);else if(e.state===zt){var n=Wt;Wt=null,fr((()=>gr(e,t[0])),!1),Wt=n}}}function fr(e,t){if(Wt)return e();var r=!1;t||(Wt=[]),Yt?r=!0:Yt=[],jt++;try{var n=e();return function(e){Wt&&(pr(Wt),Wt=null);if(e)return;var t=Yt;Yt=null,t.length&&fr((()=>Ft(t)),!1)}(r),n}catch(o){r||(Yt=null),Wt=null,br(o)}}function pr(e){for(var t=0;t=0;t--)xr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function yr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function br(e,t=Dt){throw yr(e)}function wr(e){if("function"==typeof e&&!e.length)return wr(e());if(Array.isArray(e)){for(var t=[],r=0;rr=qt((()=>(Dt.context=w(w({},Dt.context),{},{[e]:t.value}),ar((()=>t.children)))))),void 0),r}}var Ar=Symbol("fallback");function Cr(e){for(var t=0;te(t||{})))}function _r(){return!0}var kr={get:(e,t,r)=>t===Rt?r:e.get(t),has:(e,t)=>t===Rt||e.has(t),set:_r,deleteProperty:_r,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:_r,deleteProperty:_r}),ownKeys:e=>e.keys()};function Ir(e){return(e="function"==typeof e?e():e)?e:{}}function Br(){for(var e=0,t=this.length;e=0;r--){var n=Ir(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in Ir(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;s--){var a=e[s];if(a)for(var l=Object.getOwnPropertyNames(a),d=function(){var e=l[h];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(a,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(a)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:Br.bind(o[e]=[t.get.bind(a)])}:void 0!==t.value?t:void 0},h=l.length-1;h>=0;h--)d()}for(var u={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(u,p,v):u[p]=v?v.value:void 0}return u}var Er=e=>`Stale read from <${e}>.`;function Nr(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Gt(function(e,t,r={}){var n=[],o=[],i=[],s=0,a=t.length>1?[]:null;return tr((()=>Cr(i))),()=>{var l,d,h=e()||[];return h[Et],qt((()=>{var e,t,c,f,p,v,g,m,x,y=h.length;if(0===y)0!==s&&(Cr(i),i=[],n=[],o=[],s=0,a&&(a=[])),r.fallback&&(n=[Ar],o[0]=Ht((e=>(i[0]=e,r.fallback()))),s=1);else if(0===s){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===h[m];g--,m--)c[m]=o[g],f[m]=i[g],a&&(p[m]=a[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=h[d],l=e.get(x),t[d]=void 0===l?-1:l,e.set(x,d);for(l=v;l<=g;l++)x=n[l],void 0!==(d=e.get(x))&&-1!==d?(c[d]=o[l],f[d]=i[l],a&&(p[d]=a[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function Fr(e){var t=e.keyed,r=Gt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Gt((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?qt((()=>o(t?n:()=>{if(!qt(r))throw Er("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var Lr,zr;function Mr(e={},t="app"){var r=new kt;return Lr=new st(e,t,r),zr=Lr.createShader.bind(Lr),Lr}class Pr extends Array{constructor(e){super(),S(this,"_parent",void 0),this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){var r=this.indexOf(t);this.splice(r,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}var Dr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Or(e,t,...r){false}function Ur(e){return"function"==typeof e}function Wr(e){return Array.isArray(e)}function Yr(e,t={}){if(Wr(e))e.forEach((e=>{Yr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class jr extends Array{constructor(e,t={}){return Wr(t)?(super(...t),S(this,"onChange",void 0)):"string"==typeof t?(super(t),S(this,"onChange",void 0)):(super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),S(this,"onChange",void 0)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}var Hr=g(Qt(void 0),2),Qr=Hr[0],Kr=Hr[1],$r=Dr.animationSettings;function Xr(e){for(var t=[],r=0,n=Object.entries(e);rKr(this)))}else this.autofocus=!0}isTextNode(){return"text"===this.name}_resizeOnTextLoad(){this.lng.on("loaded",((e,t)=>{if("text"===t.type){var r=t.dimensions;this.parent.updateLayout(this,r)}}))}getText(){return this.children.map((e=>e.text)).join("")}destroy(){var e;this._queueDelete&&(null===(e=this.lng)||void 0===e||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){for(var t in Wr(e)?this._style=Yr(e):this._style=e,this._style)void 0===this[t]&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find((t=>t.id===e))}searchChildrenById(e){var t,r=A(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof Vr){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new jr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new jr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||$r}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){var r;if(Or(),Ur(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],r=0;re+(t[s]||0)),0));var x=f&&g?e=>{"flexStart"===g?e[u]=0:"center"===g?e[u]=(f-(e[a]||0))/2:"flexEnd"===g&&(e[u]=f-(e[a]||0))}:e=>e;if("flexStart"===v){var y=0;if(t.forEach((e=>{e[h]=y+(e[l]||0),y+=(e[s]||0)+p+(e[l]||0)+(e[d]||0),x(e)})),e._autosized){var b=y-p;if(b!==e[s])return e[s]=b,!0}}else if("flexEnd"===v)for(var w=c,S=o-1;S>=0;S--){var A=t[S];C(A),A[h]=w-(A[s]||0)-(A[d]||0),w-=(A[s]||0)+p+(A[l]||0)+(A[d]||0),x(A)}else if("center"===v){var T=(c-(m+p*(o-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+p,x(e)}))}else if("spaceBetween"===v){var _=(c-m)/(o-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+_,x(e)}))}else if("spaceEvenly"===v){var I=(c-m)/(o+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,x(e)}))}return!1}(this))null===(r=this.parent)||void 0===r||r.updateLayout();Ur(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Or(0,0,this.states),this.forwardStates){var e=this.states.slice();this.children.forEach((t=>t.states=e))}var t=this.states;if(this._undoStyles||this.style&&function(e,t){var r,n=A(t);try{for(n.s();!(r=n.n()).done;)if(r.value in e)return!0}catch(o){n.e(o)}finally{n.f()}return!1}(this.style,t)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((e=>{r[e]=this.style[e]}));var n=t.reduce(((e,t)=>{var r=this.style[t];return r&&(e=w(w({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,w(w({},r),n))}}render(){var e=this,t=this.parent;if(t)if(t.rendered)if(this.rendered)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();var r=e._renderProps;t.lng&&(r.parent=t.lng),e._effects&&(this.shader=Xr(e._effects)),e.isTextNode()?((r=w(w(w({},Dr.fontSettings),r),{},{text:e.getText()})).contain&&(r.width||(r.width=(t.width||0)-(r.x||0)-(r.marginRight||0),e._width=r.width,e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-(r.y||0)-(r.marginBottom||0),e._height=r.height,e._autosized=!0)),Or(0,0),e.lng=Lr.createTextNode(r),Ur(e.onLoad)&&e.lng.on("loaded",e.onLoad),e.width&&e.height||(e._autosized=!0,e._resizeOnTextLoad())):(r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-(r.x||0),e._width=r.width,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-(r.y||0),e._height=r.height,e._autosized=!0),r.color||r.src||(e._color=r.color=0)),Or(0,0),e.lng=Lr.createNode(r),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,Ur(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach((([t,r])=>{var n;null===(n=e.lng)||void 0===n||n.on(t,((t,n)=>r(e,n)))})),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus()}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var Zr=function(){var e=Jr[qr];Object.defineProperty(Vr.prototype,e,{get(){var t;return null!==(t=this.lng&&this.lng[e])&&void 0!==t?t:this[`_${e}`]},set(t){this[`_${e}`]=t,this._sendToLightningAnimatable(e,t)}})},qr=0,Jr=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"];qr{return t=cn("text"),pn(t,e,!1),t;var t},on=e=>{return t=cn("node"),pn(t,e,!1),t;var t};function sn({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:l,getNextSibling:d}){function h(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return u(e,t,n,r);$t((n=>u(e,t(),n,r)),n)}function u(e,i,s,a,d){for(;"function"==typeof s;)s=s();if(i===s)return s;var h=typeof i,m=void 0!==a;if("string"===h||"number"===h)if("number"===h&&(i=i.toString()),m){var x=s[0];x&&r(x)?n(x,i):x=t(i),s=p(e,s,a,x)}else""!==s&&"string"==typeof s?n(l(e),s=i):(p(e,s,a,t(i)),s=i);else if(null==i||"boolean"===h)s=p(e,s,a);else{if("function"===h)return $t((()=>{for(var t=i();"function"==typeof t;)t=t();s=u(e,t,s,a)})),()=>s;if(Array.isArray(i)){var y=[];if(c(y,i,d))return $t((()=>s=u(e,y,s,a,!0))),()=>s;if(0===y.length){var b=p(e,s,a);if(m)return s=b}else Array.isArray(s)?0===s.length?v(e,y,a):f(e,s,y):null==s||""===s?v(e,y):f(e,m&&s||[l(e)],y);s=y}else{if(Array.isArray(s)){if(m)return s=p(e,s,a,i);p(e,s,null,i)}else null!=s&&""!==s&&l(e)?g(e,i,l(e)):o(e,i);s=i}}return s}function c(e,r,n){for(var o=!1,i=0,s=r.length;im-h)for(var w=t[l];h=0;c--){var f=r[c];if(h!==f){var p=a(f)===e;u||c?p&&i(e,f):p?g(e,h,f):o(e,h,n)}else u=!0}else o(e,h,n);return[h]}function v(e,t,r){for(var n=0,i=t.length;nr.children=u(e,t.children,r.children))),$t((()=>t.ref&&t.ref(e))),$t((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(s(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Ht((n=>{r=n,h(t,e())})),r},insert:h,spread(e,t,r){"function"==typeof t?$t((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(s(e,t,r,n),r),mergeProps:Rr,effect:$t,memo:Gt,createComponent:Tr,use:(e,t,r)=>qt((()=>e(t,r)))}}var an={createElement:e=>new Vr(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Or(0,0),e.text=t;var r=e.parent;C(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Or(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof Vr?e.rendered&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Or(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof Vr&&queueMicrotask((()=>t.destroy()))},getParentNode:e=>e.parent,getFirstChild:e=>e.children[0],getNextSibling(e){var t=e.parent.children||[],r=t.indexOf(e)+1;if(rr||document});r;){var n=r[t];if(n&&!r.disabled){var o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}var wn;function Sn(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),()=>e.delete(t)},confirm:function(r,n){if(t)return!(t=!1);var o,i={to:r,options:n,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0},s=A(e);try{var a=function(){var e=o.value;e.listener(w(w({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,w(w({},n),{},{resolve:!1}))}}))};for(s.s();!(o=s.n()).done;)a()}catch(l){s.e(l)}finally{s.f()}return!i.defaultPrevented}}}function An(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(w(w({},window.history.state),{},{_depth:window.history.length-1}),""),wn=window.history.state._depth}An();var Cn=/^(?:[a-z0-9]+:)?\/\//i,Tn=/^\/+|(\/)\/+$/g,_n="http://sr";function kn(e,t=!1){var r=e.replace(Tn,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function In(e,t,r){if(!Cn.test(t)){var n=kn(e),o=r&&kn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+kn(t,!i)}}function Bn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Rn(e,t,r){var n=g(e.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),a=s.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-a;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:a?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],h=0;h0===t.localeCompare(e,void 0,{sensitivity:"base"});return void 0===t||("string"==typeof t?r(t):"function"==typeof t?t(e):Array.isArray(t)?t.some(r):t instanceof RegExp&&t.test(e))}function Nn(e){var t=new Map,r=rr();return new Proxy({},{get:(n,o)=>(t.has(o)||nr(r,(()=>t.set(o,Gt((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Fn(e){var t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];for(var r=e.slice(0,t.index),n=e.slice(t.index+t[0].length),o=[r,r+=t[1]];t=/^(\/\:[^\/]+)\?/.exec(n);)o.push(r+=t[1]),n=n.slice(t[0].length);return Fn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Ln,zn=ir(),Mn=ir(),Pn=()=>function(e,t){if(null==e)throw new Error(t);return e}(sr(zn)," and 'use' router primitives can be only used inside a Route."),Dn=()=>Pn().navigatorFactory(),On=()=>Pn().params;function Un(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,s=!o||Array.isArray(o)&&!o.length,a={key:e,component:r,load:n,info:i};return Yn(e.path).reduce(((r,n)=>{var o,i,l=A(Fn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,h=(i=d,kn(t).replace(/\/*(\*.*)?$/g,"")+kn(i)),u=s?h:h.split("/*",1)[0];u=u.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(w(w({},a),{},{originalPath:d,pattern:u,matcher:Rn(u,!s,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Wn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=g(r.pattern.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),s.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),s.length-(void 0===i?0:1)))-t,matcher(t){for(var r=[],n=e.length-1;n>=0;n--){var o=e[n],i=o.matcher(t);if(!i)return null;r.unshift(w(w({},i),{},{route:o}))}return r}};var r,n,o,i,s}function Yn(e){return Array.isArray(e)?e:[e]}function jn(e,t="",r=[],n=[]){for(var o=Yn(e),i=0,s=o.length;it.score-e.score))}function Hn(e,t){for(var r=0,n=e.length;re),h=l.renderPath||(e=>e),u=l.beforeLeave||Sn(),c=In("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&s({value:c,replace:!0,scroll:!1});var f=g(Qt(!1),2),p=f[0],v=f[1],x=function(){var e=y(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,or(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),b=g(Qt(i().value),2),S=b[0],A=b[1],C=g(Qt(i().state),2),T=C[0],_=C[1],k=function(e,t){var r=new URL(_n),n=Gt((t=>{var n=e();try{return new URL(n,r)}catch(o){return console.error(`Invalid path ${n}`),t}}),r,{equals:(e,t)=>e.href===t.href}),o=Gt((()=>n().pathname)),i=Gt((()=>n().search),!0),s=Gt((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return t()},get key(){return""},query:Nn(Jt(i,(()=>Bn(n()))))}}(S,T),I=[],B=Qt([]),R=Gt((()=>Hn(t(),k.pathname))),E=Nn((()=>{for(var e=R(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>In(c,e)};return $t((()=>{var e=i(),t=e.value,r=e.state;qt((()=>{t!==S()&&x((()=>{Ln="native",A(t),_(r),B[1]([])})).then((()=>{Ln=void 0}))}))})),{base:N,location:k,params:E,isRouting:p,renderPath:h,parsePath:d,navigatorFactory:function(e){return e=e||sr(Mn)||N,(t,r)=>function(e,t,r){qt((()=>{if("number"!=typeof t){var n=w({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,a=n.scroll,d=n.state,h=i?e.resolvePath(t):In("",t);if(void 0===h)throw new Error(`Path '${t}' is not a routable path`);if(I.length>=100)throw new Error("Too many redirects");var c=S();if((h!==c||d!==T())&&u.confirm(h,r)){var f=I.push({value:c,replace:o,scroll:a,state:T()});x((()=>{Ln="navigate",A(h),_(d),B[1]([])})).then((()=>{var e,t;I.length===f&&(Ln=void 0,e={value:h,state:d},(t=I[0])&&(e.value===t.value&&e.state===t.state||s(w(w({},e),{},{replace:t.replace,scroll:t.scroll})),I.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:R,beforeLeave:u,preloadRoute:function(e,n){var o=Hn(t(),e.pathname),i=Ln;Ln="preload";var s=function(){var t=o[a],i=t.route,s=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&nr(r(),(()=>l({params:s,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Bn(e),state:null,key:""},intent:"preload"})))};for(var a in o)s();Ln=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:B}}var Kn=e=>t=>{var r,n=t.base,o=ar((()=>t.children)),i=Gt((()=>jn(o(),t.base||""))),s=Qn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(s),un(zn.Provider,{value:s,get children(){return un($n,{routerState:s,get root(){return t.root},get load(){return t.rootLoad},get children(){return[hn((()=>(r=rr())&&null)),un(Xn,{routerState:s,get branches(){return i()}})]}})}})};function $n(e){var t=e.routerState.location,r=e.routerState.params,n=Gt((()=>e.load&&qt((()=>e.load({params:r,location:t,intent:"preload"})))));return un(Fr,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>un(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Xn(e){var t,r=[],n=Gt(Jt(e.routerState.matches,((o,i,s)=>{for(var a=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],h=o[t];s&&d&&h.route.key===d.route.key?l[t]=s[t]:(a=!1,r[t]&&r[t](),Ht((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,s=e.params,a=n().route,l=a.pattern,d=a.component,h=a.load,u=Gt((()=>n().path));d&&d.preload&&d.preload();var c=h?h({params:s,location:i,intent:Ln||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>d?Tr(d,{params:s,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>In(o.path(),e,u())}}(e.routerState,l[t-1]||e.routerState.base,Gn((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},h=0,u=o.length;he())),s&&a?s:(t=l[0],l)})));return Gn((()=>n()&&t))()}var Gn=e=>()=>un(Fr,{get when(){return e()},keyed:!0,children:e=>un(Mn.Provider,{value:e,get children(){return e.outlet()}})}),Vn=e=>{var t=ar((()=>e.children));return Rr(e,{get children(){return t()}})};function Zn(e,t){var r=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}(`#${e}`);r?r.scrollIntoView():t&&window.scrollTo(0,0)}var qn=new Map;function Jn(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),s={};function a(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var r=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(r&&(!t||r.hasAttribute("link"))){var n="http://www.w3.org/2000/svg"===r.namespaceURI,i=n?r.href.baseVal:r.href;if(!(n?r.target.baseVal:r.target)&&(i||r.hasAttribute("state"))){var s=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||s&&s.includes("external"))){var a=n?new URL(i,document.baseURI):new URL(i);if(!(a.origin!==window.location.origin||o&&a.pathname&&!a.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,a]}}}}}function l(e){var t=a(e);if(t){var r=g(t,2),o=r[0],s=r[1],l=n.parsePath(s.pathname+s.search+s.hash),d=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:d&&JSON.parse(d)})}}function d(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function h(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||(s[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete s[i.pathname]}),200))}}function u(e){var t=a(e);if(t){var r=g(t,2)[1];s[r.pathname]&&(clearTimeout(s[r.pathname]),delete s[r.pathname])}}function c(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,_n);if(!(t=n.parsePath(o.pathname+o.search)).startsWith(r))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=qn.get(t);if(i){e.preventDefault();var s=new FormData(e.target);e.submitter&&e.submitter.name&&s.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},s)}}}!function(e,t=window.document){for(var r=t[yn]||(t[yn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",h),document.removeEventListener("mouseout",u),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function eo(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=g(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function to(e){var t=()=>window.location.hash.slice(1),r=Sn();return function(e){var t=!1,r=e=>"string"==typeof e?{value:e}:e,n=function([e,t],r,n){return[r?()=>r(e()):e,n?e=>t(n(e)):t]}(Qt(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&tr(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Kn({signal:n,create:e.create,utils:e.utils})}({get:t,set({value:e,replace:t,scroll:r,state:n}){t?window.history.replaceState(function(e){return w(w({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");Zn(o>=0?e.slice(o+1):"",r),An()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=wn;An();var o=null==n?null:wn-n;r?r=!1:o&&t(o)?(r=!0,window.history.go(-o)):e()}}(e,(e=>!r.confirm(e&&e<0?e:t()))),n.addEventListener(o,i),()=>n.removeEventListener(o,i);var n,o,i},create:Jn(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:eo,beforeLeave:r}})(e)}var ro=tr;function no(e,t=rr()){var r,n,o=0;return()=>(o++,tr((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Ht((t=>r=e(n=t)),t),r)}var oo=no((()=>{var e,t,r,n,o=g(Qt(null),2),i=o[0],s=o[1];return e=window,t="keydown",r=e=>{s(e),setTimeout((()=>s(null)))},e.addEventListener(t,r,n),ro(e.removeEventListener.bind(e,t,r,n)),i}));function io(e){return"function"==typeof e}var so,ao={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},lo=g(Qt([]),2),ho=lo[0],uo=lo[1],co=e=>{var t=oo();if(e)for(var r=function(){var e,t=g(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{ao[e]=r})):ao[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),io(n.onFocus)&&n.onFocus.call(n,e,t)),o.push(n),n=n.parent;return r.forEach((r=>{o.includes(r)||(r.states.remove("focus"),io(r.onBlur)&&r.onBlur.call(r,e,t))})),uo(o),o}),{defer:!0})),Xt((()=>{var e=t();if(e){var r=ao[e.key]||ao[e.keyCode];qt((()=>{var t,n=void 0,o=A(ho());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var s=i[`on${r}`];if(io(s)&&!0===s.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(io(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(a){o.e(a)}finally{o.f()}return!1}))}})),ho};function fo(e,t){var r,n,o,i,s=t();if(Array.isArray(s))if(2===s.length)r=i=s[0],n=o=s[1];else if(3===s.length)r=s[0],n=o=s[1],i=s[2];else{var a=g(s,4);r=a[0],o=a[1],i=a[2],n=a[3]}else r=o=i=n=s;e.onBeforeLayout=(t,s)=>{if(s){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var a=e.children[0];a&&(a.x=n,a.marginLeft=n);var l=0;e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i}}}function po(e){return new Promise((t=>{setTimeout(t,e)}))}function vo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var s=new SpeechSynthesisUtterance(e);s.lang=r,s.onend=()=>{o()},s.onerror=e=>{i(e)},t.push(s),n.speak(s)}))}function go(e,t,r=!0){var n=window.speechSynthesis,o=function(e=[]){var t,r=[];for(t=0;t0)){e.next=46;break}return e.prev=20,e.next=23,vo(r,s,t);case 23:d=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return d--,console.warn(`Speech synthesis network error. Retries left: ${d}`),e.next=34,po(500*(l-d));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}d=0,e.next=41;break;case 40:throw new Error(`SpeechSynthesisErrorEvent: ${e.t0.error}`);case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof r){e.next=55;break}return h=go(r(),t,!1),i.push(h),e.next=53,h.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return u=go(r,t,!1),i.push(u),e.next=60,u.series;case 60:e.next=1;break;case 62:return e.prev=62,a=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return a},append:e=>{o.push(e)},cancel:()=>{a&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),a=!1)}}}function mo(e,t="en-US"){return so&&so.cancel(),so=go(e,t)}var xo,yo,bo=(e,t)=>{var r,n=()=>clearTimeout(r);rr()&&tr(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},wo=[],So=!1;function Ao(e,t){var r,n=bo(e,t),o=e=>{r=e,n(e)};return o.flush=()=>{n.clear(),e(r)},o.clear=n.clear,o}function Co(e){return e.id||e.name}function To(e=[]){if(_o.onFocusChange&&_o.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!wo.includes(e)));if(xo(),t||!_o.onFocusChange){wo=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Co(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Co(t),"Title",t.title]),n.push(t.title)):e.push([Co(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Co(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Co(t),"No Context",""]),e)),o),_o.debug&&console.table(o),n.length?_o.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}_o.onFocusChange([])}}var _o={debug:!1,enabled:!0,cancel:function(){yo&&yo.cancel()},clearPrevFocus:function(e=0){wo=wo.slice(0,e),xo()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;_o.onFocusChange&&_o.enabled&&(_o.onFocusChange.flush(),t&&yo&&yo.active?yo.append(e):(_o.cancel(),function(e){if(!So)yo=mo(e)}(e)),r&&(So=!0,null===(n=yo)||void 0===n||n.series.finally((()=>{So=!1,_o.refresh()})).catch(console.error)));return yo},refresh:function(e=0){_o.clearPrevFocus(e),_o.onFocusChange&&_o.onFocusChange(qt((()=>ho())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){_o.onFocusChange=Ao(To,e),xo=Ao((()=>{wo=[]}),t)}};var ko,Io,Bo,Ro,Eo,No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,jo=g(Qt(""),2),Ho=jo[0],Qo=jo[1],Ko={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA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xmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQ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AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function $o(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};var s=bo((function(i){return i.startsWith("#")?(e.color=xn(i),e.src="",e.alpha=1,n=1,t.alpha=0,void(r.alpha=0)):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,void(n=1)):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),void e.animate({alpha:0},o).start()):void(2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start())))}),400);return Xt(Jt(Ho,(e=>{s(e)}),{defer:!0})),un(on,{width:1920,height:1080,zIndex:-5,get children(){return[un(on,{ref(t){"function"==typeof e?e(t):e=t},style:i}),un(on,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),un(on,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return xn(Ko.color.materialBrand)},width:1920,height:1080})]}})}var Xo=["focus","disabled"],Go=["brand","inverse","neutral"];function Vo({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=Xo,toneKeys:s=Go},a=!1){var l=t=>Object.fromEntries(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,Object.fromEntries(Object.entries(n).map((([e,t])=>{var r=l(t);return Object.entries(t).filter((([e,t])=>i.includes(e))).forEach((([e,t])=>{r[e]=l(t)})),[e,r]}))));a&&console.log(d);var h=((e,t)=>w(w({},e),t.base))(e,d);a&&console.log(h);var u=((e,t)=>{var r=i.map((r=>[r,w(w({},null==e?void 0:e[r]),null==t?void 0:t[r])]));return Object.fromEntries(r)})(t,d);a&&console.log(u);var c=((e,t,r)=>{var n=s.map((n=>{var o,s,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(s=null==t?void 0:t[n])&&void 0!==s?s:{}].map(Object.keys))).forEach((r=>{var o,s,l;i.includes(r)||(a[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(s=null==e?void 0:e[n])?void 0:s[r])})),i.forEach((o=>{var i,s;a[o]=w(w(w({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(s=null==t?void 0:t[n])?void 0:s[o])})),[n,a]}));return Object.fromEntries(n)})(r,d,u);return a&&console.log(c),{base:w(w({},h),u),tones:c}})(t,r,n)}function Zo(e=0){return(t,r,n,o)=>{if(0!==t.children.length){var i=t.gap||0,s=t.scroll||"auto",a=function(e){var t,r;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},r=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},r=e.height);return[t,r]}(t),l=g(a,2),d=l[0],h=l[1],u="row"===t.flexDirection?t.x:t.y,c="row"===t.flexDirection?r.x:r.y,f="row"===t.flexDirection?r.width:r.height,p=n>o?"positive":"negative",v=u;"auto"===s?null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(v="positive"===p?u-f-i:u+f+i):(Math.abs(u)+hc?v=-c+e:"edge"===s&&"positive"===p&&Math.abs(u)+h{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return function(...e){var r,n=A(t);try{for(n.s();!(r=n.n()).done;){if(!0===r.value.apply(this,e))return!0}}catch(o){n.e(o)}finally{n.f()}}};function Jo(){if(!this||void 0===this.selected||0===this.children.length)return!1;for(var e=this.children[this.selected];null==e?void 0:e.skipFocus;)this.selected++,e=this.children[this.selected];if(!(e instanceof Vr))return!1;e.setFocus()}function ei(e){return function(){var t,r,n=this.children.length,o=this.wrap,i=this.selected||0;if(0===n)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%n+1,this.selected>=n){if(!o){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%n-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=n-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&void 0!==i){var a=this.children[i].selected||0;s.selected=a{var t=ei("up"),r=ei("down");return un(on,gn(e,{get onUp(){return qo(e.onUp,t)},get onDown(){return qo(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Ri.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Ri.tone],Ri.Container.base]}}))},Ni=(null==(Fo=Ko)?void 0:Fo.componentConfig).Label,Fi=void 0===Ni?{styles:{}}:Ni,Li=(Fi.defaultTone,v(Fi,s)),zi={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Ko.color.textNeutral,padding:[Ko.spacer.md,Ko.spacer.lg],borderRadius:[Ko.radius.md,Ko.radius.md,Ko.radius.md,Ko.radius.none],height:Ko.typography.caption1.lineHeight+Ko.spacer.md,neutral:{backgroundColor:Ko.color.fillNeutral}},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand,focus:{color:Ko.color.orange}}},themeStyles:Li},Mi={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.caption1),{},{color:Ko.color.textInverse}),tones:{inverse:{color:Ko.color.textNeutral},brand:{color:Ko.color.textNeutral}},themeStyles:Li};Vo(zi),Vo(Mi);var Pi=(null==(Lo=Ko)?void 0:Lo.componentConfig).Rating,Di=void 0===Pi?{styles:{},defaultTone:"neutral"}:Pi,Oi=Di.styles,Ui=(Di.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Ko.spacer.sm},toneModes:{},themeStyles:Oi}),Wi={themeKeys:{color:"textColor"},base:w({color:Ko.color.textNeutral},Ko.typography.body2),toneModes:{},themeStyles:Oi},Yi={themeKeys:{color:"color"},base:{height:Ko.typography.body2.lineHeight,width:Ko.typography.body2.lineHeight,color:Ko.color.fillNeutral,marginRight:Ko.spacer.sm},toneModes:{},themeStyles:Oi};Vo(Ui),Vo(Yi),Vo(Wi);var ji=(null==(zo=Ko)?void 0:zo.componentConfig).Details,Hi=void 0===ji?{styles:{}}:ji,Qi=(Hi.defaultTone,v(Hi,a)),Ki={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Ko.spacer.lg,badgeContentSpacing:Ko.spacer.sm,ratingContentSpacing:Ko.spacer.lg},themeStyles:Qi},$i={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.body2),{},{marginRight:Ko.spacer.lg,color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Qi};Vo(Ki),Vo($i);var Xi=(null==(Mo=Ko)?void 0:Mo.componentConfig).Metadata,Gi=void 0===Xi?{styles:{}}:Xi,Vi=(Gi.defaultTone,v(Gi,l)),Zi={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:Vi},qi={themeKeys:{color:"textColor"},base:w(w({maxLines:1,contain:"width"},Ko.typography.headline3),{},{color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi},Ji={themeKeys:{color:"textColor"},base:w(w({contain:"width",maxLines:2},Ko.typography.body2),{},{color:Ko.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverseSecondary,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutralSecondary,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi};Vo(Zi),Vo(Ji),Vo(qi);var es=(null==(Po=Ko)?void 0:Po.componentConfig).ProgressBar,ts=void 0===es?{styles:{}}:es,rs=(ts.defaultTone,v(ts,d)),ns={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Ko.spacer.md,color:Ko.color.fillNeutralTertiary,borderRadius:Ko.radius.xs},tones:{inverse:{color:Ko.color.fillInverseTertiary}},themeStyles:rs},os={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Ko.radius.xs,color:Ko.color.fillNeutral},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand}},themeStyles:rs};Vo(ns),Vo(os);var is=(null==(Do=Ko)?void 0:Do.componentConfig).Row,ss=void 0===is?{styles:{}}:is,as=ss.defaultTone,ls=v(ss,h),ds={tone:as,Container:Vo({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:Ko.layout.gutterX,width:Ko.layout.screenW,itemTransition:w(w({},Ko.animation.standardEntrance),{},{duration:Ko.animation.duration.fast})},themeStyles:ls})},hs=e=>{var t=ei("left"),r=ei("right");return un(on,gn(e,{get selected(){return e.selected||0},get onLeft(){return qo(e.onLeft,t)},get onRight(){return qo(e.onRight,r)},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone},get style(){return[...[e.style].flat(),ds.Container.tones[e.tone||ds.tone],ds.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone}}))},us=(null==(Oo=Ko)?void 0:Oo.componentConfig).Keyboard,cs=void 0===us?{styles:{}}:us,fs=(cs.defaultTone,v(cs,u)),ps={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Ko.spacer.md,screenW:Ko.layout.screenW,marginX:Ko.layout.marginX,height:100},themeStyles:fs},vs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Ko.color.fillNeutral,padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:fs},gs={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:fs};Vo(ps),Vo(vs),Vo(gs);var ms=(null==(Uo=Ko)?void 0:Uo.componentConfig).Key,xs=void 0===ms?{styles:{}}:ms,ys=(xs.defaultTone,v(xs,c)),bs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,contentColor:Ko.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:ys},ws={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:ys};Vo(bs),Vo(ws);var Ss=(null==(Wo=Ko)?void 0:Wo.componentConfig).Tile,As=void 0===Ss?{styles:{}}:Ss,Cs=(As.defaultTone,v(As,f)),Ts=(null==(Yo=Ko)?void 0:Yo.componentConfig).Surface,_s=void 0===Ts?{styles:{}}:Ts,ks=(_s.defaultSurfaceTone,v(_s,p)),Is={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Ko.spacer.xl,paddingYBetweenContent:Ko.spacer.md,borderRadius:Ko.radius.md,alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:w(w({},ks),Cs)},Bs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cs},Rs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cs},Es={themeKeys:{},base:{width:5*Ko.spacer.lg,height:Ko.spacer.xxl+Ko.spacer.md},themeStyles:Cs};Vo(Is),Vo(Bs),Vo(Rs),Vo(Es);var Ns={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:Ko.layout.marginX}},Gradient:{zIndex:99,color:xn("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:xn("#424242")},active:{width:328,height:70}}},Fs="/solid-demo-app/",Ls=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function zs(e){var t,r,n,o=(t=Fs+"assets/icons_white.png",r=Ls,n=Lr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,s=t.height;return e[t.name]=Lr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:s}),e}),{}));return un(on,gn(e,{get texture(){return o[e.name]},get width(){return o[e.name].props.width},get height(){return o[e.name].props.height},get x(){return(100-(o[e.name].props.width||0))/2},get y(){return(100-(o[e.name].props.height||0))/2}}))}function Ms(e){return un(on,gn(e,{forwardStates:!0,get style(){return Ns.NavButton},get children(){return[un(on,{y:-16,get children(){return un(zs,{scale:.5,get name(){return e.icon}})}}),un(nn,{get style(){return w(w({},Ko.typography.button1),{},{fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}})},get children(){return e.children}})]}}))}function Ps(e){var t,r=Dn();return[un(Ei,gn(e,{onFocus:function(){t.states.add("focus"),this.children.forEach((e=>e.states.add("active"))),this.children.selected.setFocus()},onBlur:function(){t.states.remove("focus"),this.selected=0,this.children.forEach((e=>e.states.remove("active")))},get style(){return Ns.Column},scroll:"none",get children(){return[un(Ms,{onEnter:()=>r("/browse/all"),icon:"trending",children:"Trending"}),un(Ms,{icon:"movie",onEnter:()=>r("/browse/movie"),children:"Movies"}),un(Ms,{icon:"tv",onEnter:()=>r("/browse/tv"),children:"TV"}),un(Ms,{icon:"experiment",onEnter:()=>r("/examples"),children:"Examples"})]}})),un(on,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ns.Gradient}})]}var Ds={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},Os={x:10,fontSize:36,textColor:xn("#ffffff")},Us={fontSize:36,textColor:xn("#ffffff")},Ws=g(Qt(0),2),Ys=Ws[0],js=Ws[1],Hs=g(Qt(0),2),Qs=Hs[0],Ks=Hs[1],$s=g(Qt(99),2),Xs=$s[0],Gs=$s[1],Vs=g(Qt(0),2),Zs=Vs[0],qs=Vs[1],Js=0,ea=0,ta=bo((()=>{ea=0,Js=0,Gs(99)}),1e4);function ra(e){e.renderer.on("fpsUpdate",((e,t)=>{var r="number"==typeof t?t:t.fps;r>5&&(e=>{e&&(js(e),Gs((t=>Math.min(e,t))),qs((t=>Math.max(e,t))),ea+=e,Js++,Ks(Math.round(ea/Js)),ta())})(r)}))}var na=e=>un(on,gn(e,{style:Ds,get children(){return[un(on,{get children(){return[un(nn,{style:Os,children:"FPS:"}),un(nn,{style:Us,x:94,get children(){return Ys().toString()}})]}}),un(on,{x:160,get children(){return[un(nn,{style:Os,children:"AVG:"}),un(nn,{style:Us,x:104,get children(){return Qs().toString()}})]}}),un(on,{x:0,y:40,get children(){return[un(nn,{style:Os,children:"MIN:"}),un(nn,{style:Us,x:94,get children(){return Xs().toString()}})]}}),un(on,{x:160,y:40,get children(){return[un(nn,{style:Os,children:"MAX:"}),un(nn,{style:Us,x:104,get children(){return Zs().toString()}})]}})]}})),oa=e=>{co({Announcer:"a",Menu:"m",Escape:"Escape"});var t=(_o.setupTimers(),Xt(Jt(ho,_o.onFocusChange,{defer:!0})),_o);t.enabled=!1;var r,n,o=Dn();return er((()=>{ra({renderer:Lr})})),un(on,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onLeft:()=>{if(r.states.has("focus"))return!1;n=Qr(),r.setFocus()},onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[un($o,{}),un(na,{}),hn((()=>e.children)),un(Ps,{ref(e){"function"==typeof r?r(e):r=e}})]}})},ia={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:Ko.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:xn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:xn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:xn("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:xn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:Ko.layout.screenW-2*Ko.layout.marginX,x:Ko.layout.marginX+Ko.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:xn("#0000ff")},peopleBio:w(w({},Ko.typography.body1),{},{contain:"both",width:1500,height:400})},sa={width:120,height:40,color:xn("#000000"),borderRadius:8,border:{width:2,color:xn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:xn("#333333")}},transition:{scale:!0,color:!0}},aa={container:sa,topBar:{color:xn("#00A699"),height:8,y:2,x:-4,width:sa.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:xn("#F6F6F9"),height:sa.height,width:sa.width}},la=386,da=136,ha=(xn("#715cab"),xn("#5a39a2"),xn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:xn("#FFFFFF"),height:da,width:la,focus:{fontSize:40},disabled:{color:xn("#909090")}});function ua(e){return un(on,gn(e,{get style(){return ia.Thumbnail}}))}function ca(e){var t=function(e,...t){if(Rt in e){var r=new Set(t.length>1?t.flat():t[0]),n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},kr)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},kr)),n}var o,i={},s=t.map((()=>({}))),a=A(Object.getOwnPropertyNames(e));try{for(a.s();!(o=a.n()).done;){var l,d=o.value,h=Object.getOwnPropertyDescriptor(e,d),u=!h.get&&!h.set&&h.enumerable&&h.writable&&h.configurable,c=!1,f=0,p=A(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,u?s[f][d]=h.value:Object.defineProperty(s[f],d,h)),++f}catch(v){p.e(v)}finally{p.f()}c||(u?i[d]=h.value:Object.defineProperty(i,d,h))}}catch(v){a.e(v)}finally{a.f()}return[...s,i]}(e,["items"]),r=g(t,2),n=r[0],o=r[1];return un(hs,gn(o,{get style(){return ia.Row},get children(){return un(Nr,{get each(){return n.items},children:e=>un(ua,e)})}}))}function fa(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var pa,va,ga="https://api.themoviedb.org/3",ma="w185",xa={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function ya(e,t=ma){return va+t+e}function ba(e,t={}){return fetch(ga+e,w(w({},xa),t)).then((e=>e.json()))}function wa(){return ba("/configuration").then((e=>{var t;return pa=e,va=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var Sa={get:function(e,t={}){return pa?ba(e,t):wa().then((()=>ba(e,t)))},loadConfig:wa};function Aa(e=[]){return e.map((e=>{return{src:ya(e.poster_path||e.profile_path),tileSrc:ya(e.backdrop_path||e.profile_path,"w300"),backdrop:ya(e.backdrop_path,"w1280"),href:`/entity/${e.media_type||"people"}/${e.id}`,shortTitle:(t=e.title||e.name,r=30,t.length>r?t.substring(0,r-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,r}))}var Ca=new Map,Ta=new Map;function _a(e){var t=g(Qt([]),2),r=t[0],n=t[1],o=g(Qt(1),2),i=o[0],s=o[1],a=g(Qt(!1),2),l=a[0],d=a[1],h=g(Vt(i,e),1)[0];return Kt((()=>{var e=h();e&&fr((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:s,setPages:n,end:l,setEnd:d}}var ka=1100,Ia=w(w({},Ko.typography.display2),{},{width:ka,height:58,contain:"both"}),Ba=e=>un(nn,gn(e,{style:Ia,get children(){return e.children}})),Ra=w(w({},Ko.typography.body1),{},{width:ka,height:72,contain:"both"}),Ea={fontSize:20,lineHeight:20},Na=e=>un(nn,gn(e,{style:Ra,get children(){return e.children}}));var Fa=e=>{return t=cn("node"),mn(fo,t,(()=>[8,15,13,15])),pn(t,gn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),fn(t,un(nn,{style:Ea,get children(){return e.children}})),t;var t},La=Ko.typography.body2,za=e=>un(on,{style:{display:"flex",flexDirection:"row",gap:12,width:ka,height:48},get children(){return[un(nn,{style:La,get children(){return e.metaText}}),un(Nr,{get each(){return e.badges},children:e=>un(Fa,{y:-5,children:e})}),hn((()=>{return t=e.reviews,[un(Fr,{get when(){return(null==t?void 0:t.rtCrit)&&"0"!==(null==t?void 0:t.rtCrit)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtCrit+"%"}})]}}),un(Fr,{get when(){return(null==t?void 0:t.rtFan)&&"0"!==(null==t?void 0:t.rtFan)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtFan+"%"}})]}})];var t}))]}}),Ma=e=>un(on,gn(e,{style:{display:"flex",flexDirection:"column",width:ka,height:160,gap:16},get children(){return[un(Ba,{get children(){return e.title}}),un(Na,{get children(){return e.description}}),un(za,{get metaText(){return e.metaText},get badges(){return e.badges},get reviews(){return e.reviews}})]}}));function Pa(e){return e.split("-")[0]}function Da({type:e,id:t}){return Sa.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?Aa(t.slice(0,7)):Sa.get(`/trending/${e}/week?page=1`).then((({results:e})=>Aa(e.slice(0,7))))))}function Oa({type:e,id:t}){return Sa.get(`/${e}/${t}/credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function Ua({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return Sa.get(`/${e}/${t}`).then((t=>{return w({backgroundImage:ya(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:"movie"===e?(n=t.runtime,o=n%60,Math.floor(n/60)+"h "+(o<10?"0":"")+o+"m - "+t.release_date):`${Pa(t.first_air_date)} - ${Pa(t.last_air_date)}`,reviews:r}},t);var n,o}))}var Wa=()=>{var e=On(),t=g(Qt(0),2),r=t[0],n=t[1],o=g(Qt(),2),i=o[0];o[1];Vt(i,Ua);var s=g(Qt({}),2),a=s[0],l=s[1],d=Dn(),h=Zt((()=>0)),u=Gt((()=>{return _a((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(Ca.has(r))return Ca.get(r);var n=Sa.get(r).then((e=>{var r=e.results.filter((e=>!e.adult)),n=function(e,t=7){for(var r=[],n=0,o=e.length;n=t-2)&&u().setPage((e=>e+1))}function f(){var e=this.children.selected;C(e&&e.href),d(e.href)}return Xt(Jt(Qr,(e=>{e.backdrop&&Qo(e.backdrop),e.heroContent&&l(e.heroContent)}),{defer:!0})),un(Fr,{get when(){return u().pages().length},get children(){return[un(Ma,gn({y:360,x:150},a)),un(on,{clipping:!0,get style(){return ia.itemsContainer},get children(){return un(Ei,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ia.Column},get children(){return un(Nr,{get each(){return u().pages()},children:(e,t)=>un(ca,{get autofocus(){return h(t())},items:e,onFocus:c,onEnter:f})})}})}})]}})},Ya=()=>{var e=Dn(),t=Zt((()=>0));function r(){var t=this.children.selected;C(t&&t.id),e("/"+t.id)}var n=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(e){var t=g(Qt(4294967295),2),r=t[0],n=t[1];return un(on,gn(e,{onFocus:()=>n(255),onBlur:()=>n(4294967295),style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return un(on,{x:30,get children(){return[un(nn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),un(nn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),un(nn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=g(Qt(140),2),s=i[0],a=i[1];function l(e){a(-400*e.selected+140)}return un(on,{colorTop:1147903743,colorBottom:743406847,get children(){return[un(on,{x:120,get children(){return[un(on,{src:"/assets/solidjs.png",width:101,height:90,y:40}),un(nn,{fontSize:90,x:110,y:40,children:"Examples"}),un(on,{y:140,height:1,width:1800,color:3906468351})]}}),un(hs,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return s()},y:300,width:4400,get style(){return ia.Row},justifyContent:"flexStart",gap:40,get children(){return un(Nr,{each:n,children:(e,r)=>un(o,gn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},ja=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return er((()=>{Qo("#000000")})),un(on,{autofocus:!0,style:e,get children(){return[un(nn,{style:r,children:"Title of the Page"}),un(nn,{style:n,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),un(on,{style:t,get children(){return[un(nn,{style:o,children:"Subline Text"}),un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"}),un(nn,{style:o,children:"More Text"})]}})]}})},Ha=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},o={fontSize:42},i={fontSize:26};er((()=>{Qo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var s=g(Qt(),2),a=s[0],l=s[1],d=g(Qt(),2),h=d[0];d[1];setTimeout((()=>{var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var u={width:400,height:300,color:xn("#0000ff")},c={color:xn("#f54242"),focus:{color:xn("#4287f5")}};function f(e){var t=ar((()=>e.children));return un(on,gn(e,{get style(){return[c,e.style,[u]]},get children(){return[un(on,{id:"child1",width:100,height:100,get color(){return xn("#ff0000")},y:25,get children(){return[hn((()=>t())),un(on,{id:"subChild",x:150,width:100,height:100,get color(){return xn("#00ff00")}}),un(nn,{get children(){return e.title}})]}}),un(on,{width:100,height:100,get color(){return xn("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:xn("#cccccc"),focus:{color:xn("#000000")}},m={color:xn("#ffffff"),focus:{color:xn("#f6f6cc")}};return un(on,{style:r,get children(){return[un(nn,{style:o,children:"Title of the Page"}),un(on,{style:n,get children(){return[un(nn,{get children(){return h()}}),un(nn,{style:i,get children(){return["Sub ",hn((()=>a()))," Text"]}}),un(Fr,{get when(){return a()},get children(){return un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),un(nn,{style:i,children:"More Text"})]}}),un(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[m,v],get children(){return un(nn,{children:"Child Test"})}}),un(on,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return xn("#00ff00")},x:900,y:400,get alpha(){return t=e,console.log("Ref is available: ",t),1;var t}})]}})},Qa=()=>{var e,t,r=g(Qt([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:xn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},s={fontSize:32,x:960,y:540,mount:.5,lineheight:52},a=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return er((()=>{Qo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=a(-90,90),e.x=a(-300,2220),e.y=a(-300,1380)}),2500)})),tr((()=>{clearInterval(t)})),un(on,{get children(){return[un(nn,{style:s,get children(){return n().join("\n")}}),un(on,{autofocus:!0,style:i,ref(t){"function"==typeof e?e(t):e=t},onEvents:[["inBounds",e=>l("inBounds")],["outOfBounds",e=>l("outOfBounds")],["inViewport",e=>l("inViewport")],["outOfViewport",e=>l("outOfViewport")]]})]}})},Ka=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400};function r(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var n=e=>{return t=cn("node"),mn(fo,t,(()=>[10,15])),pn(t,gn(e,{get style(){return{color:xn("#000000be"),borderRadius:8,border:{width:2,color:xn("#ffffff")}}}}),!0),fn(t,un(nn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[un(hs,{x:100,y:200,gap:5,style:t,get children(){return[un(n,{children:"HD"}),un(n,{children:"PG13"}),un(n,{children:"NC17"}),un(nn,{fontSize:30,children:"I like bananas"}),un(n,{children:"DOLBY"})]}}),un(hs,{x:100,gap:40,style:t,get children(){return[un(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),un(r,{states:{active:!0,disabled:!1},children:"Movies"}),un(r,{states:"active",children:"Sports"}),un(r,{states:"disabled",children:"News"})]}})]},$a=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=g(Qt(50),2),o=n[0],i=n[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var a=50;return un(Ei,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex Start - Margin Left"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{marginLeft:100}),un(r,{}),un(r,{marginLeft:100}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{marginRight:100}),un(r,{}),un(r,{}),un(r,{marginRight:100})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:a,justifyContent:"center",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})},Xa=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=g(Qt(50),2),i=o[0],s=o[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),s(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var l=50;return un(Ei,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start - AlignItems: center"}),un(hs,{alignItems:"center",gap:l,style:e,onFocus:a,get children(){return[un(r,{autofocus:!0,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),un(hs,{gap:l,alignItems:"flexStart",style:e,onFocus:a,get children(){return[un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - AlignItems: flexEnd"}),un(hs,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:l,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:l,justifyContent:"center",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}})]}})},Ga=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,alignItems:"center",get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,alignItems:"flexStart",get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Va=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Za=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400,x:100},r={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},n=["RoundedRectangle",{radius:65}];function o(e){return un(on,gn(e,{forwardStates:!0,style:r,shader:n,get children(){return un(nn,{style:ha,get children(){return e.children}})}}))}return un(hs,{style:t,get children(){return[un(o,{autofocus:!0,onEnter:e,children:"Focused"}),un(o,{states:{active:!0,disabled:!1},children:"Normal"}),un(o,{states:"disabled",children:"Disabled"})]}})},qa="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Ja(){return(Ja=y(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),r=new shaka.Player,e.next=4,r.attach(t);case 4:return window.player=r,r.addEventListener("error",el),e.prev=6,e.next=9,r.load(qa);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),tl(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function el(e){tl(e.detail)}function tl(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Ja.apply(this,arguments)}():console.error("Browser not supported!")}));var rl=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),Ua),1)[0],n=g(Vt((()=>w({},e)),Oa),1)[0],o=g(Vt((()=>w({},e)),Da),1)[0],i=g(Qt(0),2),s=i[0],a=i[1];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var l,d,h,u=600,c={color:xn("#000000"),alpha:0,width:1900,height:890,x:10,y:u,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=u,d.y=u,d.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,d.y=160,d.alpha=.9}function v(){var e=this.children.selected;C(e&&e.href),t(e.href)}function m(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),Kr(h),a(0)}function x(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();Kr(e),a(.9)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{onUp:()=>h.setFocus(),onEscape:m,get children(){return[un(Ma,gn({y:360,x:150},(()=>r().heroContent))),un(fa,{autofocus:!0,ref(e){"function"==typeof h?h(e):h=e},y:560,x:150,onDown:()=>l.setFocus(),onEnter:x,children:"Watch Trailer"}),un(Ei,{ref(e){"function"==typeof l?l(e):l=e},y:u,x:140,get style(){return ia.Column},zIndex:5,get children(){return un(Fr,{get when(){return hn((()=>!!o()))()&&n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Recommendations"}),un(ca,{onFocus:f,onEnter:v,get items(){return o()}}),un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Cast and Crew"}),un(ca,{onFocus:p,onEnter:v,get items(){return n()}})]}})}}),un(on,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),un(on,{get alpha(){return s()},get color(){return xn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function nl({id:e}){return Sa.get(`/person/${e}/combined_credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function ol({id:e}){return Sa.get(`/person/${e}`).then((e=>w({backgroundImage:ya(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var il=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),ol),1)[0],n=g(Vt((()=>w({},e)),nl),1)[0];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var o={color:xn("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;C(e&&e.href),t(e.href)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{x:150,y:200,get style(){return ia.Column},zIndex:3,get children(){return[un(nn,{get style(){return Ko.typography.display2},get children(){return r().name}}),un(nn,{get style(){return ia.peopleBio},get children(){return r().biography}})]}}),un(on,{style:o}),un(Ei,{y:670,x:140,get style(){return ia.Column},get children(){return un(Fr,{get when(){return n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Credits"}),un(ca,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},sl=()=>{return e=cn("node"),vn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},al=new URL("AppCoreExtensions-legacy-CjL-s2b8.js",b.meta.url).href;Dr.debug=!1,Dr.animationsEnabled=!0,Dr.fontSettings.fontFamily="Ubuntu",Dr.fontSettings.color=xn("#ffffff"),Dr.fontSettings.fontSize=32,Dr.rendererOptions={coreExtensionModule:al,fpsUpdateInterval:1e3,enableInspector:!0},dn((()=>un(to,{root:e=>un(oa,e),get children(){return[un(Vn,{path:"",component:Wa}),un(Vn,{path:"examples",component:Ya}),un(Vn,{path:"browse/:filter",component:Wa}),un(Vn,{path:"text",component:ja}),un(Vn,{path:"buttons",component:Ka}),un(Vn,{path:"flex",component:$a}),un(Vn,{path:"create",component:Ha}),un(Vn,{path:"viewport",component:Qa}),un(Vn,{path:"flexsize",component:Xa}),un(Vn,{path:"flexcolumnsize",component:Ga}),un(Vn,{path:"flexcolumn",component:Va}),un(Vn,{path:"buttonsmaterial",component:Za}),un(Vn,{path:"entity/people/:id",component:il}),un(Vn,{path:"entity/:type/:id",component:rl}),un(Vn,{path:"*all",component:sl})]}})))}}}))}(); -//# sourceMappingURL=index-legacy-Baty9aaB.js.map diff --git a/assets/index-legacy-Baty9aaB.js.map b/assets/index-legacy-Baty9aaB.js.map deleted file mode 100644 index cbc4b67..0000000 --- a/assets/index-legacy-Baty9aaB.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-legacy-Baty9aaB.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number | string;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUV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SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/fe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GAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(img);\n },\n { defer: true },\n ),\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 20,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 1500,\n height: 400,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + data.release_date\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n },\n { defer: true },\n ),\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits,\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations,\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\n \n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","fontFace","ffs","i","length","_load","fonts","fontSetting","check","load","catch","then","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","WebTrFontFace","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","val","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step6","_iterator6","glyph","mapped","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","descriptors","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","d","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","init","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref13","_props$scaleX","_ref14","_props$scaleY","_props$mount","_ref15","_props$mountX","_ref16","_props$mountY","_props$pivot2","_ref17","_props$pivotX","_ref18","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","temp","tempMatrix","multiply","a","b","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","destroy","removeAllListeners","_this$props2","absX","_this$props$parent","_this$props$parent2","absY","_this$props$parent$ab","_this$props$parent3","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref20","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","rendered","autofocus","_renderProps","_effects","_p$lng","lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_context9","setFocus","forwardFocus","focusedIndex","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_iterator15","_step15","found","states","_states","_stateChanged","_animationSettings","_this$parent","onBeforeLayout","display","flexItem","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","_autosized","calculatedSize","toPad","calculateFlex","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_width","marginBottom","_height","onLoad","isNaN","_color","onFail","onCreate","handler","_node$lng","inode","solid","_loop2","_ref21","_i17","_LightningRendererNum","_loop3","_ref22","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref23","_callee9","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step16","defaultPrevented","preventDefault","_iterator16","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref24","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step19","finalFocusElm","_iterator19","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","delayedBackgrounds","r$","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref26","_ref27","_a2","_b2","_ref28","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_updateLastIndex","lastItem","windowVal","updateLastIndex","_updateLastIndex2","currentVal","newVal","size2","direct","scrollIndex","abs","chainFunctions","onlyFunctions","func","innerArgs","_step20","_iterator20","onGridFocus","skipFocus","handleNavigation","onSelectedChanged","plinko","num","_ref29$Artwork","Artwork","_ref29$Artwork2","themeStyles$d","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref30$Icon","Icon","_ref30$Icon2","themeStyles$c","_excluded2","inverse","brand","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$b","_excluded3","container$c","text$6","icon$2","_ref32$Button","Button","_ref32$Button2","themeStyles$a","_excluded4","container$b","contentColor","focus","content","text$5","_ref33$Checkbox","Checkbox","_ref33$Checkbox2","themeStyles$9","_excluded5","strokeWidth","container$a","checked","neutral","icon$1","_ref34$Column","Column","_ref34$Column2","defaultTone$9","themeStyles$8","_excluded6","styles$9","Container","itemTransition","onUp","onDown","_props$tone","flat","_ref35$Label","Label","_ref35$Label2","themeStyles$7","_excluded7","container$8","backgroundColor","text$4","_ref36$Rating","Rating","_ref36$Rating2","themeStyles$6","container$7","itemSpacing","toneModes","text$3","_ref37$Details","Details","_ref37$Details2","themeStyles$5","_excluded8","container$6","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$2","_ref38$Metadata","Metadata","_ref38$Metadata2","themeStyles$4","_excluded9","container$5","titleText","descriptionText","_ref39$ProgressBar","ProgressBar","_ref39$ProgressBar2","themeStyles$3","_excluded10","container$4","_ref40$Row","Row","_ref40$Row2","defaultTone$3","themeStyles$2","_excluded11","styles$3","onLeft","onRight","_props$tone2","_props$tone3","_ref41$Keyboard","_ref41$Keyboard2","themeStyles$1","_excluded12","container$2","keySpacing","baseWidth","sizes","paddingX","text$1","_ref42$Key","Key","_ref42$Key2","_excluded13","container$1","_ref43$Tile","Tile","_ref43$Tile2","tileThemeStyles","_excluded14","_ref44$Surface","Surface","_ref44$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded15","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","onEnter","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","totalFps","resetCounter","setupFPS","calcFps","FPSCounter","App","Menu","announcer","navDrawer","lastFocused","onAnnouncer","onLast","back","onMenu","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal32","pages","setPages","_createSignal34","page","setPage","_createSignal36","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","metaText","badges","getReviews","reviews","rtCrit","rtFan","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","backgroundImage","minutes","runtime","remainingMinutes","minutesToHMM","release_date","first_air_date","last_air_date","Browse","_createSignal38","columnY","setcolumnY","_createSignal40","entityProvider","_createSignal42","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal44","setColor","_createSignal46","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal48","insertTest","setInsertTest","_createSignal50","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal52","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal54","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal56","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal58","_this$children$select4","_createSignal60","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal62","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","trailerButton","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"y9UAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,CAC1B,ECFE,MAAMG,WAAuCL,GAIhDC,WAAAA,CAAYC,EAAiBI,GAAS,IAAAC,EAAAC,EAClCC,MAAMP,GAAiBC,oBAJd,IAAIO,KAAKP,EACIC,KAAA,0BAAA,IAAIO,KAAKR,EAAAC,KAAA,eAAA,GAI/BA,KAAKE,QAAU,CACXM,iCAAwBL,EAAED,EAAQM,gCAAwB,IAAAL,EAAAA,EAAI,IAC9DM,8BAAoE,QAAvCL,EAAEF,EAAQO,qCAA6BL,IAAAA,EAAAA,EAAI,KAI5EM,aAAY,KACR,IAEyDC,EAFnDC,EAAMC,KAAKD,MACXE,EAAcd,KAAKE,QAAQO,8BAA8BM,EAAAC,EAClChB,KAAKiB,yBAAuB,IAAzD,IAAAF,EAAAG,MAAAP,EAAAI,EAAAI,KAAAC,MAA2D,CAAA,IAAhDC,EAAcV,EAAAW,MACjBV,EAAMS,EAAeE,WAAaT,IAClCd,KAAKF,gBAAgBuB,EAAeG,IACpCxB,KAAKyB,WAAWC,OAAOL,EAAeG,IACtCxB,KAAKiB,wBAAwBS,OAAOL,GAE3C,CAAA,CAAAM,MAAAA,GAAAZ,EAAAa,EAAAD,EAAAZ,CAAAA,QAAAA,EAAAc,GACb,IAAW7B,KAAKE,QAAQM,yBACnB,CACDsB,eAAAA,CAAgBC,GAAS,IAAAC,EACfC,EAA2B,QAAlBD,EAAGD,EAAQ7B,eAAO,IAAA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AswB,MAAAA,CAAAA,GAC5Ce,GAAK,CAAC1I,KAAI,GAAI+C,UAAWoxB,KAAMxsB,GAC/Be,GAAK,CAAC1I,KAAI,WAAY+C,UAAWuyB,KAAM3tB,GACvCe,GAAK,CAAC1I,KAAI,iBAAkB+C,UAAWoxB,KAAMxsB,GAC7Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAWkzB,KAAQtuB,GACrCe,GAAK,CAAC1I,KAAI,UAAW+C,UAAWm1B,KAAWvwB,GAC3Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAWs1B,KAAQ1wB,GACrCe,GAAK,CAAC1I,KAAI,SAAU+C,UAAWwzB,KAAU5uB,GACzCe,GAAK,CAAC1I,KAAI,WAAY+C,UAAWw0B,KAAY5vB,GAC7Ce,GAAK,CAAC1I,KAAI,WAAY+C,UAAW41B,KAAYhxB,GAC7Ce,GAAK,CAAC1I,KAAI,iBAAkB+C,UAAWi5B,KAAkBr0B,GACzDe,GAAK,CAAC1I,KAAI,aAAc+C,UAAWg2B,KAAcpxB,GACjDe,GAAK,CAAC1I,KAAI,kBAAmB+C,UAAWk5B,KAAmBt0B,GAC3De,GAAK,CAAC1I,KAAI,oBAAqB+C,UAAW24B,KAAM/zB,GAChDe,GAAK,CAAC1I,KAAI,mBAAoB+C,UAAWu3B,KAAM3yB,GAC/Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAW44B,KAAQ","x_google_ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,98,102]} \ No newline at end of file diff --git a/assets/index-legacy-DMeX0taR.js b/assets/index-legacy-DMeX0taR.js new file mode 100644 index 0000000..4f2a181 --- /dev/null +++ b/assets/index-legacy-DMeX0taR.js @@ -0,0 +1,2 @@ +!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["surfaceDefaultTone"],o=["defaultTone"],i=["defaultTone"],s=["defaultTone"],a=["defaultTone"],l=["defaultTone"],d=["defaultTone"],u=["defaultTone"],h=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultTone"],v=["defaultTone"],g=["defaultSurfaceTone"];function m(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw o}}return a}}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,s=Object.create(i.prototype),a=new E(n||[]);return o(s,"_invoke",{value:k(e,r,a)}),s}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function m(){}function x(){}function b(){}var w={};d(w,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,s)&&(w=A);var C=b.prototype=m.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,s,a){var l=h(e[o],e,i);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=c;return function(i,s){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw s;return{value:e,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var l=I(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===c)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=h(t,r,n);if("normal"===d.type){if(o=n.done?v:f,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=v,n.method="throw",n.arg=d.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),d=n.call(s,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function b(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(d){return void r(d)}a.done?t(l):Promise.resolve(l).then(n,o)}function w(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){b(i,n,o,s,a,"next",e)}function a(e){b(i,n,o,s,a,"throw",e)}s(void 0)}))}}function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function _(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{_=e.a,k=e.i,I=e.g,B=e.c,R=e.W,E=e.E,N=e.b,F=e.d,L=e.e,z=e.f,M=e.m,P=e.h,D=e.j,O=e.T,U=e.k,W=e.l,Y=e.S,j=e.B,H=e.n,Q=e.o,K=e.p,$=e.q,X=e.C,G=e.r,V=e.s,Z=e.t,q=e.u,J=e.v,ee=e.w}],execute:function(){var b,te,re,ne=y().mark(Ve),oe=document.createElement("style");oe.textContent="html,body,*{padding:0;margin:0}video{position:absolute;top:0;left:0;z-index:2;outline:none}.center-element{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n",document.head.appendChild(oe);class ie{constructor(e){C(this,"releaseCallback",void 0),this.releaseCallback=e}}class se extends ie{constructor(e,t){var r,n;super(e),C(this,"textureMap",new Map),C(this,"zeroReferenceTextureSet",new Set),C(this,"options",void 0),this.options={textureCleanupIntervalMs:null!==(r=t.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(n=t.textureCleanupAgeThreadholdMs)&&void 0!==n?n:6e4},setInterval((()=>{var e,t=Date.now(),r=this.options.textureCleanupAgeThreadholdMs,n=T(this.zeroReferenceTextureSet);try{for(n.s();!(e=n.n()).done;){var o=e.value;t-o.lastUpdate>r&&(this.releaseCallback(o.id),this.textureMap.delete(o.id),this.zeroReferenceTextureSet.delete(o))}}catch(i){n.e(i)}finally{n.f()}}),this.options.textureCleanupIntervalMs)}registerTexture(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;if(_(r,"Texture must have an id to be registered"),!this.textureMap.has(r)){var n={id:r,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(r,n),this.zeroReferenceTextureSet.add(n)}}incrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),_(n,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),n.nodeRefCount++,n.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(n)&&this.zeroReferenceTextureSet.delete(n)}decrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);_(n,"Texture must have been registered"),n.nodeRefCount--,n.lastUpdate=Date.now(),0===n.nodeRefCount&&this.zeroReferenceTextureSet.add(n),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}class ae extends ie{constructor(e){super(e),C(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;_(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(r=e.options)||void 0===r?void 0:r.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}var le={alpha:e=>1===e?null:{prop:"opacity",value:`${e}`},x:e=>({prop:"left",value:`${e}px`}),y:e=>({prop:"top",value:`${e}px`}),width:e=>0===e?null:{prop:"width",value:`${e}px`},height:e=>0===e?null:{prop:"height",value:`${e}px`},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:e=>!1===e?null:{prop:"overflow",value:e?"hidden":"visible"},rotation:e=>0===e?null:{prop:"transform",value:`rotate(${e}rad)`},scale:e=>1===e?null:{prop:"transform",value:`scale(${e})`},scaleX:e=>1===e?null:{prop:"transform",value:`scaleX(${e})`},scaleY:e=>1===e?null:{prop:"transform",value:`scaleY(${e})`},color:e=>0===e?null:{prop:"color",value:de(e)}},de=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,ue={id:"id"};class he{constructor(e,t){var r,n,o,i,s,a;if(C(this,"root",null),C(this,"canvas",null),C(this,"height",1080),C(this,"width",1920),C(this,"scaleX",1),C(this,"scaleY",1),!k()){if(!t)throw new Error("settings is required");this.height=Math.ceil(null!==(r=t.appHeight)&&void 0!==r?r:1080/(null!==(n=t.deviceLogicalPixelRatio)&&void 0!==n?n:1)),this.width=Math.ceil(null!==(o=t.appWidth)&&void 0!==o?o:1900/(null!==(i=t.deviceLogicalPixelRatio)&&void 0!==i?i:1)),this.scaleX=null!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a:1,this.canvas=e,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(e,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(e),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}setRootPosition(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,r=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left=`${r}px`,this.root.style.top=`${t}px`,this.root.style.width=`${this.width}px`,this.root.style.height=`${this.height}px`,this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform=`scale(${this.scaleX}, ${this.scaleY})`,this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}createDiv(e,t){var r=document.createElement("div");for(var n in r.style.position="absolute",r.id=e.id.toString(),t)this.updateNodeProperty(r,n,t[n]);return r}createNode(e,t){var r=e.createNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createTextNode(e,t){var r=e.createTextNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createProxy(e,t){return new Proxy(e,{set:(e,r,n)=>(this.updateNodeProperty(t,r,n),Reflect.set(e,r,n)),get:(r,n,o)=>("destroy"===n&&this.destroyNode(r),"animate"===n?(n,o)=>{var i=r.animate(n,o);return new Proxy(i,{get:(r,i,s)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,s))})}:Reflect.get(r,n,o))})}destroyNode(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}updateNodeProperty(e,t,r){if(null!==this.root&&null!=r)if("parent"!==t){if("text"===t)return e.innerHTML=String(r),void(e.style.visibility="hidden");if("src"===t&&r)e.setAttribute("data-src",String(r));else{if(le[t]){var n,o=null===(n=le[t])||void 0===n?void 0:n.call(le,r);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(r)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(ue[t])e.setAttribute(String(le[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var s=r.id;if(1===s)return void this.root.appendChild(e);var a=document.getElementById(s.toString());null==a||a.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,s=n.delay,a=void 0===s?0:s,l=r.x,d=r.y,u=r.width,h=r.height,c=r.alpha,f=void 0===c?1:c,p=r.rotation,v=void 0===p?0:p,g=r.scale,m=void 0===g?1:g,x=r.color;setTimeout((function(){setTimeout((()=>{e.style.top=`${d}px`,e.style.left=`${l}px`,e.style.width=`${u}px`,e.style.height=`${h}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=de(x)}),i)}),a)}}var ce=function(e,t,r){var n=Promise.resolve();return n.then((()=>e())).catch((e=>{var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};class fe{static getEffectKey(e){return""}static getMethodParameters(e,t){var r=[];for(var n in e){var o=e[n],i="";o.size&&(i=`[${o.size(t)}]`),r.push(`${o.type} ${n}${i}`)}return r.join(",")}constructor(e){C(this,"priority",1),C(this,"name",""),C(this,"ref",void 0),C(this,"target",void 0),C(this,"passParameters",""),C(this,"declaredUniforms",""),C(this,"uniformInfo",{});var t=e.ref,r=e.target,n=e.props,o=void 0===n?{}:n;this.ref=t,this.target=r;var i={},s=[],a="",l=this.constructor.uniforms||{};for(var d in l){var u=l[d],h=u.type,c=`${t}_${d}`,f="";u.size&&(f=`[${u.size(o)}]`),s.push(c),a+=`uniform ${h} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}C(fe,"uniforms",{}),C(fe,"methods",void 0),C(fe,"onShaderMask",void 0),C(fe,"onColorize",void 0),C(fe,"onEffectMask",void 0);var pe={x:(e,t)=>{e.props.x=t},y:(e,t)=>{e.props.y=t},width:(e,t)=>{e.props.width=t},height:(e,t)=>{e.props.height=t},color:(e,t)=>{e.props.color=t},zIndex:(e,t)=>{e.props.zIndex=t},fontFamily:(e,t)=>{e.props.fontFamily=t},fontWeight:(e,t)=>{e.props.fontWeight=t},fontStyle:(e,t)=>{e.props.fontStyle=t},fontStretch:(e,t)=>{e.props.fontStretch=t},fontSize:(e,t)=>{e.props.fontSize=t},text:(e,t)=>{e.props.text=t},textAlign:(e,t)=>{e.props.textAlign=t},contain:(e,t)=>{e.props.contain=t},offsetY:(e,t)=>{e.props.offsetY=t},scrollable:(e,t)=>{e.props.scrollable=t},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t},lineHeight:(e,t)=>{e.props.lineHeight=t},maxLines:(e,t)=>{e.props.maxLines=t},textBaseline:(e,t)=>{e.props.textBaseline=t},verticalAlign:(e,t)=>{e.props.verticalAlign=t},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t},debug:(e,t)=>{e.props.debug=t}};class ve{constructor(e){C(this,"stage",void 0),C(this,"set",void 0),this.stage=e;var t=A(A({},pe),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(r,n)=>{r.props[e]!==n&&(t(r,n),this.stage.requestRender())}]))))}setStatus(e,t,r){e.status!==t&&(e.status=t,e.emitter.emit(t,r))}setIsRenderable(e,t){e.isRenderable=t}destroyState(e){["loading","loaded","failed"].forEach((t=>{e.emitter.off(t)}))}scheduleUpdateState(e){e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((()=>{e.updateScheduled=!1,this.updateState(e)})))}}function ge(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class me{constructor(e,t){C(this,"_canvas",void 0),C(this,"_context",void 0),C(this,"_settings",void 0),C(this,"renderInfo",void 0),this._canvas=e,this._context=t,this._settings=this.mergeDefaults({})}set settings(e){this._settings=this.mergeDefaults(e)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){for(var e=[this._settings.fontFace],t=[],r=0,n=e.length;r{console.warn("[Lightning] Font load error",t,e)})).then((()=>{document.fonts.check(e,this._settings.text)||console.warn("[Lightning] Font not found",e)}))}catch(t){console.warn("[Lightning] Can't check font loading for "+e)}}}calculateRenderInfo(){var e={},t=this.getPrecision(),r=this._settings.paddingLeft*t,n=this._settings.paddingRight*t,o=this._settings.fontSize*t,i=null===this._settings.offsetY?null:this._settings.offsetY*t,s=(this._settings.lineHeight||o)*t,a=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,u=this._settings.cutSx*t,h=this._settings.cutEx*t,c=this._settings.cutSy*t,f=this._settings.cutEy*t,p=(this._settings.letterSpacing||0)*t,v=this._settings.textIndent*t;this.setFontProperties();var g,m=a||2048/this.getPrecision(),x=m-r;if(x<10&&(m+=10-x,x=10),d||(d=x),this._settings.textOverflow&&!this._settings.wordWrap){var y;switch(this._settings.textOverflow){case"clip":y="";break;case"ellipsis":y=this._settings.overflowSuffix;break;default:y=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,d-v,y)}if(this._settings.wordWrap)g=this.wrapText(this._settings.text,d,p,v);else for(var b=(g={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]}).l.length,w=0;wthis._settings.maxLines){var A,C=S.slice(0,this._settings.maxLines),T=null;if(this._settings.overflowSuffix){var _=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,k=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${k.l[0]}${this._settings.overflowSuffix}`,T=[k.l.length>1?k.l[1]:""]}else T=[""];var I=S.length,B=0,R=g.n.length;for(A=this._settings.maxLines;A=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],d=0,u=i.length;dt)for(;s>0&&(a=this._context.measureText(e.substring(0,s)).width+n)>t;)s-=1;else for(;s=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],s=[],a=0;au?(c>0&&(l.push(d),d=""),d+=h[c],u=t-f-(0===c?n:0)):(u-=p,d+=` ${h[c]}`)}l.push(d),d="",i=i.concat(l),ae+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return A({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}var xe="undefined"==typeof self?globalThis:self,ye=(null===(b=xe.document)||void 0===b?void 0:b.fonts)||xe.fonts;var be=B(0,0,0,0);class we extends ve{constructor(e){super(e),C(this,"canvas",void 0),C(this,"context",void 0),C(this,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");var t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),_(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof R}addFontFace(e){_(e instanceof R),ye.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,canvasPages:void 0,lightning2TextRenderer:new me(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(r=e.props,n=r.fontFamily,[r.fontStyle,r.fontWeight,r.fontStretch,`${r.fontSize}px`,n].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void ye.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var r,n;if(e.fontInfo.loaded){if(!e.renderInfo){var o=e.props.maxLines,i="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,s=i>0&&o>0?Math.min(i,o):Math.max(i,o);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:N(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:s,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var a=e.props,l=a.x,d=a.y,u=a.width,h=a.height,c=a.scrollY,f=a.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=B(l,d,"none"!==f?l+u:1/0,"both"===f?d+h:1/0,be);F(this.rendererBounds,m,p),p.valid=!0}var x=p.y2-p.y1,y=Math.ceil(x/e.renderInfo.lineHeight);if(0===x)return g=void 0,v=void 0,void this.setStatus(e,"loaded");if(v&&g){var b=l+v.x1,w=d-c+v.y1,S=l+v.x2,A=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&A>=p.y2)return void this.setStatus(e,"loaded");Ap.y1&&(v.y1-=y*e.renderInfo.lineHeight,v.y2-=y*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-y,g[0].lineNumEnd=g[0].lineNumStart+y,g[0].valid=!1)}else{var C,_,k,I=e.renderInfo.lineHeight*y,R=Math.ceil(c/I),E=R*y,L=E-y,z=E+y;g=[{texture:null===(C=g)||void 0===C?void 0:C[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:E,lineNumEnd:E+y,valid:!1},{texture:null===(k=g)||void 0===k?void 0:k[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=R*I;v={x1:0,y1:M-I,x2:u,y2:M+2*I}}e.renderWindow=v,performance.now();var P,D=T(g);try{for(D.s();!(P=D.n()).done;){var O=P.value;if(!O.valid)if(O.lineNumStart<0){var U;null===(U=O.texture)||void 0===U||U.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),O.texture.setRenderableOwner(e,e.isRenderable),O.valid=!0}else{var W;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(O.lineNumStart,O.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(O.lineNumStart,O.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(W=O.texture)||void 0===W||W.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),O.texture.setRenderableOwner(e,e.isRenderable);O.valid=!0}}}catch(Y){D.e(Y)}finally{D.f()}this.setStatus(e,"loaded")}}renderQuads(e,t,r,n){var o=this.stage,i=e.canvasPages,s=e.textW,a=void 0===s?0:s,l=e.textH,d=void 0===l?0:l,u=e.renderWindow;if(i&&u){var h=e.props,c=h.x,f=h.y,p=h.scrollY,v=h.contain,g=h.width,m=h.height,x={x:c,y:f,width:"none"!==v?g:a,height:"both"===v?m:d};L({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),_(i,"canvasPages is not defined"),_(u,"renderWindow is not defined");var y,b,w,S,A,C,T=(u.y2-u.y1)/3,k=e.props,I=k.zIndex,B=k.color,R=n*z(B),E=M(4294967295,R);if(i[0].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(y=i[0].texture)||void 0===y||null===(y=y.dimensions)||void 0===y?void 0:y.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(S=i[1].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+u.y1+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.width)||0,height:(null===(C=i[2].texture)||void 0===C||null===(C=C.dimensions)||void 0===C?void 0:C.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+u.y1+T+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.canvasPages)||void 0===r||r.forEach((r=>{var n;null===(n=r.texture)||void 0===n||n.setRenderableOwner(e,t)}))}destroyState(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((t=>{var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,!1)}))}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,r){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,r),this.scheduleUpdateState(e))}}class Se extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}C(Se,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Ae extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}),C(this,"supportsIndexedTextures",!0)}bindTextures(e){var t=this.renderer,r=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach(((e,t)=>{r.activeTexture(t),r.bindTexture(e.ctxTexture)}));var n=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",n)}}C(Ae,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>`\n #define txUnits ${e}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) {\n ${Array.from(Array(e).keys()).map((e=>`\n ${0!==e?"else ":""}if (idx == ${e}) {\n return texture2D(textures[${e}], uv);\n }\n `)).join("")}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `});var Ce=new Map,Te=(e,t)=>{var r=JSON.stringify(e);if(Ce.has(r))return Ce.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Ce.set(r,n),n};class _e extends P{constructor(e,t,r){var n=_e.createShader(t,r);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...n.uniforms],shaderSources:{vertex:n.vertex,fragment:n.fragment}}),C(this,"effects",[]),this.effects=n.effects,this.calculateProps=D(this.calculateProps.bind(this))}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){var t=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach(((e,n)=>{var o,i=this.effects[n],s=t[i.name],a=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(a).forEach((e=>{var t=s.uniforms[e],n=l[e],o=t.validator?t.validator(a[e],a):a[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}bindProps(e){this.calculateProps(e.effects).forEach((e=>{this.setUniform(e.name,e.value)}))}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;for(var r=e.effects.length,n=0;n{var n=t[e.type],a=n.getEffectKey(e.props||{});r[a]=r[a]?++r[a]:1;var l=r[a];1===l&&s.push({key:a,type:e.type,props:e.props});var d=new n({ref:`${a}${1===l?"":l}`,target:a,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==s||s.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var a in o.methods){var d=a,u=o.methods[a];n[a]&&n[a]!==u&&(d=_e.resolveMethodDuplicate(a,u,n)),n[d]=u.replace("function",d),s.push({m:a,cm:d})}var h=o.onShaderMask instanceof Function?o.onShaderMask(i):o.onShaderMask,c=o.onColorize instanceof Function?o.onColorize(i):o.onColorize,f=o.onEffectMask instanceof Function?o.onEffectMask(i):o.onEffectMask;s.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");h&&(h=h.replace(n,r)),c&&(c=c.replace(n,r)),f&&(f=f.replace(n,r))}));var p=o.getMethodParameters(o.uniforms,i),v=p.length>0?`, ${p}`:"";h&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${h}\n }\n `),c&&(l+=`\n vec4 fx_${e.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${c}\n }\n `),f&&(l+=`\n vec4 fx_${e.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${f}\n }\n `)}));var d="";for(var u in n)d+=n[u];for(var h="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",c="\n\n ",f=0;f0?`, ${p.passParameters}`:"",g=t[p.name];g.onShaderMask&&(c+=`\n shaderMask = fx_${p.target}_onShaderMask(shaderMask ${v});\n `),g.onColorize&&(c+=`\n maskColor = fx_${p.target}_onColorize(shaderMask, maskColor, shaderColor${v});\n `),g.onEffectMask&&(h=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=a[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${h};\n `)}return{effects:a,uniforms:i,fragment:_e.fragment(o,d,l,c),vertex:_e.vertex()}}static resolveMethodDuplicate(e,t,r,n=0){var o=e+(n>0?n:"");return r[o]&&r[o]!==t?this.resolveMethodDuplicate(e,t,r,++n):o}static resolveDefaults(e,t){return{effects:Te(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var r,n="";return null===(r=e.effects)||void 0===r||r.forEach((e=>{var r=t[e.type].getEffectKey(e.props||{});n+=`,${r}`})),`DynamicShader${n}`}}C(_e,"z$__type__Props",void 0),C(_e,"vertex",(()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ")),C(_e,"fragment",((e,t,r,n)=>`\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${e}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${t}\n\n ${r}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${n}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `));class ke extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){this.setUniform("u_radius",e.radius)}canBatchShaderProps(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}C(ke,"z$__type__Props",void 0),C(ke,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var Ie=new Float32Array([1,0,0,0,1,0,0,0,1]);class Be extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){var t=Be.resolveDefaults(e);for(var r in t)if("transform"===r)this.setUniform("u_transform",!1,t[r]);else if("scrollY"===r)this.setUniform("u_scrollY",t[r]);else if("color"===r){var n=N(t.color);this.setUniform("u_color",n)}else"size"===r?this.setUniform("u_size",t[r]):"distanceRange"===r?this.setUniform("u_distanceRange",t[r]):"debug"===r&&this.setUniform("u_debug",t[r]?1:0)}static resolveDefaults(e={}){var t,r,n,o,i,s;return{transform:null!==(t=e.transform)&&void 0!==t?t:Ie,scrollY:null!==(r=e.scrollY)&&void 0!==r?r:0,color:null!==(n=e.color)&&void 0!==n?n:4294967295,size:null!==(o=e.size)&&void 0!==o?o:16,distanceRange:null!==(i=e.distanceRange)&&void 0!==i?i:1,debug:null!==(s=e.debug)&&void 0!==s&&s}}}C(Be,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});class Re extends fe{constructor(...e){super(...e),C(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}C(Re,"z$__type__Props",void 0),C(Re,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),C(Re,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),C(Re,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),C(Re,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Ee extends fe{constructor(...e){super(...e),C(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}C(Ee,"z$__type__Props",void 0),C(Ee,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(Ee,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),C(Ee,"onColorize","\n return color;\n ");class Ne extends fe{constructor(...e){super(...e),C(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],o=e.stops||[];if(0===o.length||o.length!==n.length){for(var i=n.length,s=0,a=o;se.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),C(Ne,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),C(Ne,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${te.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Fe extends fe{constructor(...e){super(...e),C(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}C(Fe,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),C(Fe,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class Le extends fe{constructor(...e){super(...e),C(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}C(Le,"z$__type__Props",void 0),C(Le,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(Le,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),C(Le,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),C(Le,"onColorize","\n return color;\n ");class ze extends fe{constructor(...e){super(...e),C(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}C(ze,"z$__type__Props",void 0),C(ze,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(ze,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),C(ze,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),C(ze,"onColorize","\n return color;\n ");class Me extends fe{constructor(...e){super(...e),C(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}C(Me,"z$__type__Props",void 0),C(Me,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(Me,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),C(Me,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),C(Me,"onColorize","\n return color;\n ");class Pe extends fe{constructor(...e){super(...e),C(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}C(Pe,"z$__type__Props",void 0),C(Pe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(Pe,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),C(Pe,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),C(Pe,"onColorize","\n return color;\n ");class De extends fe{constructor(...e){super(...e),C(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,r,n,o,i;return{amplitude:null!==(t=e.amplitude)&&void 0!==t?t:.2,narrowness:null!==(r=e.narrowness)&&void 0!==r?r:4,blockiness:null!==(n=e.blockiness)&&void 0!==n?n:2,minimizer:null!==(o=e.minimizer)&&void 0!==o?o:8,time:null!==(i=e.time)&&void 0!==i?i:Date.now()}}}C(De,"z$__type__Props",void 0),C(De,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),C(De,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),C(De,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class Oe extends fe{constructor(...e){super(...e),C(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}C(Oe,"z$__type__Props",void 0),C(Oe,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),C(Oe,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");class Ue extends fe{constructor(...e){super(...e),C(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,s=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],a=e.stops||[];if(0===a.length||a.length!==s.length){for(var l=s.length,d=0,u=a;de.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),C(Ue,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${re.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class We extends fe{constructor(...e){super(...e),C(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,s,a;return{width:null!==(t=e.width)&&void 0!==t?t:10,progress:null!==(r=e.progress)&&void 0!==r?r:.5,offset:null!==(n=e.offset)&&void 0!==n?n:0,range:null!==(o=e.range)&&void 0!==o?o:2*Math.PI,rounded:null!==(i=e.rounded)&&void 0!==i&&i,radius:null!==(s=e.radius)&&void 0!==s?s:1,color:null!==(a=e.color)&&void 0!==a?a:4294967295}}}C(We,"z$__type__Props",void 0),C(We,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),C(We,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),C(We,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),C(We,"onColorize","\n return color;\n ");class Ye extends fe{constructor(...e){super(...e),C(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:null!==(t=e.radius)&&void 0!==t?t:0}}}C(Ye,"z$__type__Props",void 0),C(Ye,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),C(Ye,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),C(Ye,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),C(Ye,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class je{constructor(){C(this,"shCache",new Map),C(this,"shConstructors",{}),C(this,"attachedShader",null),C(this,"effectConstructors",{}),C(this,"renderer",void 0),this.registerShaderType("DefaultShader",Se),this.registerShaderType("DefaultShaderBatched",Ae),this.registerShaderType("RoundedRectangle",ke),this.registerShaderType("DynamicShader",_e),this.registerShaderType("SdfShader",Be),this.registerEffectType("border",Ee),this.registerEffectType("borderBottom",Me),this.registerEffectType("borderLeft",Pe),this.registerEffectType("borderRight",Le),this.registerEffectType("borderTop",ze),this.registerEffectType("fadeOut",Oe),this.registerEffectType("linearGradient",Ne),this.registerEffectType("radialGradient",Ue),this.registerEffectType("grayscale",Fe),this.registerEffectType("glitch",De),this.registerEffectType("radius",Re),this.registerEffectType("radialProgress",We),this.registerEffectType("holePunch",Ye)}registerShaderType(e,t){this.shConstructors[e]=t}registerEffectType(e,t){this.effectConstructors[e]=t}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(e,t){if(!this.renderer)throw new Error("Renderer is not been defined");var r=this.shConstructors[e];if(!r)throw new Error(`Shader type "${e}" is not registered`);if("DynamicShader"===e)return this.loadDynamicShader(t);var n=r.resolveDefaults(t),o=r.makeCacheKey(n)||r.name;if(o&&this.shCache.has(o))return{shader:this.shCache.get(o),props:n};var i=new r(this.renderer,t);return o&&this.shCache.set(o,i),{shader:i,props:n}}loadDynamicShader(e){if(!this.renderer)throw new Error("Renderer is not been defined");var t=_e.resolveDefaults(e,this.effectConstructors),r=_e.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new _e(this.renderer,e,this.effectConstructors);return r&&this.shCache.set(r,n),{shader:n,props:t}}useShader(e){this.attachedShader!==e&&(this.attachedShader&&this.attachedShader.detach(),e.attach(),this.attachedShader=e)}}class He{constructor(){C(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return A({},this.data)}}var Qe=function(){var e=w(y().mark((function e(t){var r,n;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:if(n=e.sent,-1===t.indexOf(".ktx")){e.next=8;break}return e.abrupt("return",Ke(n));case 8:return e.abrupt("return",$e(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ke=function(){var e=w(y().mark((function e(t){var r,n,o,i,s,a,l;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=new DataView(t),n=16909060===r.getUint32(12),o=[],i={glInternalFormat:r.getUint32(28,n),pixelWidth:r.getUint32(36,n),pixelHeight:r.getUint32(40,n),numberOfMipmapLevels:r.getUint32(56,n),bytesOfKeyValueData:r.getUint32(60,n)},s=64,s+=i.bytesOfKeyValueData,a=0;a>2)*(u+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),s.push(f),l+=c,d>>=1,u>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:s,width:a.pixelWidth||0,height:a.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class Xe extends O{constructor(e,t){super(e),C(this,"props",void 0),this.props=Xe.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return w(y().mark((function t(){var r,n,o,i,s,a,l;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.src,o=r.premultiplyAlpha,n){t.next=3;break}return t.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){t.next=5;break}return t.abrupt("return",{data:n,premultiplyAlpha:o});case 5:if(!/\.(ktx|pvr)$/.test(n)){t.next=7;break}return t.abrupt("return",Qe(n));case 7:if(!e.txManager.imageWorkerManager){t.next=13;break}return t.next=10,e.txManager.imageWorkerManager.getImage(n,o);case 10:return t.abrupt("return",t.sent);case 13:if(!e.txManager.hasCreateImageBitmap){t.next=28;break}return t.next=16,fetch(n);case 16:return i=t.sent,t.next=19,i.blob();case 19:return s=t.sent,a=null!=o?o:e.hasAlphaChannel(s.type),t.next=23,createImageBitmap(s,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=a,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return(l=new Image).src=n,t.next=32,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 32:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 33:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=Xe.resolveDefaults(e);return!(t.src instanceof ImageData)&&`ImageTexture,${t.src},${t.premultiplyAlpha}`}static resolveDefaults(e){var t,r;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(r=e.premultiplyAlpha)||void 0===r||r}}}C(Xe,"z$__type__Props",void 0);class Ge{constructor(e,t=0){C(this,"iterator",void 0),C(this,"peekBuffer",[]),C(this,"_lastIndex",void 0),this.iterator=e,this.iterator=e,this._lastIndex=t-1,this.peekBuffer=[]}next(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}get lastIndex(){return this._lastIndex}}function Ve(e,t=0){var r,n;return y().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:r=t;case 1:if(!(r=f.y1,K=E<=f.y2,$=Q&&K;(y=M.next())&&!y.done;){var X=y.value;if(e===c.length)c.push({codepointIndex:X.cluster,maxY:B,maxX:I});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,H=R):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=H),X.mapped){var G=R+X.xOffset+X.width;if("none"!==h&&G>=j&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new Ge(Ve(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new Ge(Ve(m,0),0)),R=F.xStart,N=F.bufferOffset,h="none"}else{var V=R+X.xOffset,Z=E+X.yOffset;if($){-1===P&&(P=N);var q=p.getAtlasEntry(X.glyphId),J=q.x/p.data.common.scaleW,ee=q.y/p.data.common.scaleH,te=q.width/p.data.common.scaleW,re=q.height/p.data.common.scaleH;u[N++]=V,u[N++]=Z,u[N++]=J,u[N++]=ee,u[N++]=V+X.width,u[N++]=Z,u[N++]=J+te,u[N++]=ee,u[N++]=V,u[N++]=Z+X.height,u[N++]=J,u[N++]=ee+re,u[N++]=V+X.width,u[N++]=Z+X.height,u[N++]=J+te,u[N++]=ee+re}B=Math.max(B,Z+X.height),I=Math.max(I,V+X.width),R+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new Ge(Ve(m,0),0)),h="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),R=0,E+=w,e++,F.codepointIndex=-1,H=0,!v&&"both"===h&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===h?I:S,oe=0;oe"number"==typeof e?e:Je[e]||400;var tt=D((function(e,t,r,n,o){var i,s=et(r),a=T(e);try{for(a.s();!(i=a.n()).done;){var l=i.value[t];if(l){if(1===l.size)return console.warn(`TrFontManager: Only one font face found for family: '${t}' - will be used for all weights and styles`),l.values().next().value;var d,u=new Map,h=T(l);try{for(h.s();!(d=h.n()).done;){var c=d.value,f=et(c.descriptors.weight);if(f===s&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;u.set(f,c)}}catch(v){h.e(v)}finally{h.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${s} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===s&&u.has(500))return u.get(500);if(500===s&&u.has(400))return u.get(400);if(s<400){for(;s>0;){if(u.has(s))return u.get(s);s-=100}s=600}for(;s<1e3;){if(u.has(s))return u.get(s);s+=100}for(s=500;s>0;){if(u.has(s))return u.get(s);s-=100}}}}catch(v){a.e(v)}finally{a.f()}}));class rt{constructor(e){C(this,"textRenderers",void 0),this.textRenderers=e}addFontFace(e){for(var t in this.textRenderers){var r=this.textRenderers[t];r&&r.isFontFaceSupported(e)&&r.addFontFace(e)}}static resolveFontFace(e,t){var r=t.fontFamily,n=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return tt(e,r,n,o,i)}}var nt={x:0,y:0,width:0,height:0};class ot extends ve{constructor(e){super(e),C(this,"ssdfFontFamilies",{}),C(this,"msdfFontFamilies",{}),C(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),C(this,"sdfShader",void 0),C(this,"rendererBounds",void 0),this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}isFontFaceSupported(e){return e instanceof Y}addFontFace(e){_(e instanceof Y);var t=e.fontFamily,r="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(r){var n=r[t];n||(n=new Set,r[t]=n),n.add(e)}else console.warn(`Invalid font face type: ${e.type}`)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){var t=e.trFontFace,r=e.textH,n=e.lineCache,o=e.debugData,i=e.forceFullLayoutCalc;if(o.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){var s=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(s),void this.setStatus(e,"failed",new Error(s))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){_(t.data,"Font face data should be loaded");var a=e.props,l=a.text,d=a.fontSize,u=a.x,h=a.y,c=a.contain,f=a.width,p=a.height,v=a.lineHeight,g=a.verticalAlign,m=a.scrollable,x=a.overflowSuffix,y=a.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,C=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var T=24*l.length,k=e.vertexBuffer;(!k||k.length=I.x2&&h-b+B.y1<=I.y1&&h-b+B.y2>=I.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var R=e.props,E=R.offsetY,N=R.textAlign;if(!w.valid){if(!W(I,this.rendererBounds))return;qe(w,u,h,b,v,"both"===c?I.y2-I.y1:0,I,A)}var F=function(e,t,r,n,o,i,s,a,l){var d=Math.min(Math.max(s.firstLineIdx,0),a.length),u=0;"middle"===n?u=(t-e)/2:"bottom"===n&&(u=t-e);var h=o/i+d*t+u;if(!(l&&h>=l/i))return{sdfX:0,sdfY:h,lineIndex:d}}(S,C,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=Ze(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,k,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=k.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else t.once("loaded",(()=>{this.scheduleUpdateState(e)}))}renderQuads(e,t,r,n){var o,i;if(e.vertexBuffer){var s=this.stage.renderer,a=e.props,l=a.fontSize,d=a.color,u=a.contain,h=a.scrollable,c=a.zIndex,f=a.debug,p="both"===u&&h?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,m=e.textH,x=void 0===m?0:m,y=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,S=e.trFontFace,A=e.elementBounds,C=e.webGlBuffers;if(!C){var T=s.glw,k=4*Float32Array.BYTES_PER_ELEMENT,I=T.createBuffer();_(I),e.webGlBuffers=new j([{buffer:I,attributes:{a_position:{name:"a_position",size:2,type:T.FLOAT,normalized:!1,stride:k,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:T.FLOAT,normalized:!1,stride:k,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,_(e.webGlBuffers),C=e.webGlBuffers}if(!w){var B,R,E=s.glw,N=null!==(B=null===(R=C)||void 0===R?void 0:R.getBuffer("a_textureCoordinate"))&&void 0!==B?B:null;E.arrayBufferData(N,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(_(S),h&&"both"===u){_(A.valid);var F=H(A,nt);r.valid?(e.clippingRect.valid=!0,r=L(r,F,e.clippingRect)):(e.clippingRect.valid=!0,r=Q(F,e.clippingRect))}var z=new K(s.glw,s.options,C,this.sdfShader,{transform:t.data,color:$(d,n),size:l/((null===(o=S.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:y,debug:f.sdfShaderDebug},n,r,{height:x,width:g},0,c),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;_(M);var P=this.stage.txManager.getCtxTexture(M);z.addTexture(P),z.length=e.bufferNumFloats,z.numQuads=e.bufferNumQuads,s.addRenderOp(z)}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),null===(t=e.trFontFace)||void 0===t||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return rt.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){var t=e.props,r=t.x,n=t.contain,o=t.width,i=e.elementBounds;i.x1=r,i.x2="none"!==n?r+o:1/0}setElementBoundsY(e){var t=e.props,r=t.y,n=t.contain,o=t.height,i=e.elementBounds;i.y1=r,i.y2="both"===n?r+o:1/0}}function it(e,t){return st.apply(this,arguments)}function st(){return(st=w(y().mark((function e(t,r){var n,o,i;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,ce((()=>S.import(t)),void 0);case 4:n=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error(`The core extension module at '${t}' could not be loaded.`),console.error(e.t0),e.abrupt("return");case 12:if(n.default){e.next=15;break}return console.error(`The core extension module at '${t}' does not have a default export.`),e.abrupt("return");case 15:if(o=n.default,!(o.prototype instanceof X)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(r);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error(`The core extension at '${t}' threw an error.`),console.error(e.t1);case 27:e.next=30;break;case 29:console.error(`The core extension at '${t}' does not extend CoreExtension.`);case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function at(e){for(var t={boolean:!0,string:!0,number:!0},r=Object.keys(e),n=0;n2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),e[o]=i.substring(0,2048)),t[s]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class lt extends E{constructor(e,t,r){var n,o,i,s;super(),C(this,"root",null),C(this,"driver",void 0),C(this,"canvas",void 0),C(this,"settings",void 0),C(this,"inspector",null),C(this,"nodes",new Map),C(this,"nextTextureId",1),C(this,"textureTracker",void 0);var a={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(n=e.clearColor)&&void 0!==n?n:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(o=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==o&&o,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(i=e.enableContextSpy)&&void 0!==i&&i,enableInspector:null!==(s=e.enableInspector)&&void 0!==s&&s};this.settings=a;var l=a.appWidth,d=a.appHeight,u=a.deviceLogicalPixelRatio,h=a.devicePhysicalPixelRatio,c=a.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=a.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new ae(f):new se(f,this.settings.textureCleanupOptions);var v=l*u,g=d*u;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*h,x.height=g*h,x.style.width=`${v}px`,x.style.height=`${g}px`,!(m="string"==typeof t?document.getElementById(t):t))throw new Error("Could not find target element");r.onCreateNode=e=>{this.nodes.set(e.id,e)},r.onBeforeDestroyNode=e=>{this.nodes.delete(e.id)},r.onFpsUpdate=e=>{this.emit("fpsUpdate",e)},r.onFrameTick=e=>{this.emit("frameTick",e)},r.onIdle=()=>{this.emit("idle")},m.appendChild(x),c&&!k()&&(this.inspector=new he(x,a))}init(){var e=this;return w(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.driver.init(e,e.settings,e.canvas);case 2:e.root=e.driver.getRootNode();case 3:case"end":return t.stop()}}),t)})))()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var t,r,n,o,i,s,a,l,d,u,h,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,w=A(A({},this.resolveNodeDefaults(e)),{},{text:null!==(r=e.text)&&void 0!==r?r:"",textRendererOverride:null!==(n=e.textRendererOverride)&&void 0!==n?n:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(s=e.fontWeight)&&void 0!==s?s:"normal",fontStretch:null!==(a=e.fontStretch)&&void 0!==a?a:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(u=e.scrollable)&&void 0!==u&&u,scrollY:null!==(h=e.scrollY)&&void 0!==h?h:0,offsetY:null!==(c=e.offsetY)&&void 0!==c?c:0,letterSpacing:null!==(f=e.letterSpacing)&&void 0!==f?f:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(m=e.verticalAlign)&&void 0!==m?m:"top",overflowSuffix:null!==(x=e.overflowSuffix)&&void 0!==x?x:"...",debug:null!==(y=e.debug)&&void 0!==y?y:{}});return this.inspector?this.inspector.createTextNode(this.driver,w):this.driver.createTextNode(w)}resolveNodeDefaults(e){var t,r,n,o,i,s,a,l,d,u,h,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,k,I,B,R,E,N,F,L,z,M,P,D,O,U,W,Y,j,H,Q,K,$,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:X,V=null!==(i=null!==(s=null!==(a=e.colorTr)&&void 0!==a?a:e.colorTop)&&void 0!==s?s:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(d=null!==(u=e.colorBl)&&void 0!==u?u:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:X,q=null!==(h=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==h?h:X,J=at(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(m=e.width)&&void 0!==m?m:0,height:null!==(x=e.height)&&void 0!==x?x:0,alpha:null!==(y=e.alpha)&&void 0!==y?y:1,autosize:null!==(b=e.autosize)&&void 0!==b&&b,clipping:null!==(w=e.clipping)&&void 0!==w&&w,color:X,colorTop:null!==(S=e.colorTop)&&void 0!==S?S:X,colorBottom:null!==(A=e.colorBottom)&&void 0!==A?A:X,colorLeft:null!==(C=e.colorLeft)&&void 0!==C?C:X,colorRight:null!==(T=e.colorRight)&&void 0!==T?T:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(_=e.zIndex)&&void 0!==_?_:0,zIndexLocked:null!==(k=e.zIndexLocked)&&void 0!==k?k:0,parent:null!==(I=e.parent)&&void 0!==I?I:null,texture:null!==(B=e.texture)&&void 0!==B?B:null,shader:null!==(R=e.shader)&&void 0!==R?R:null,src:null!==(E=e.src)&&void 0!==E?E:"",scale:null!==(N=e.scale)&&void 0!==N?N:null,scaleX:null!==(F=null!==(L=e.scaleX)&&void 0!==L?L:e.scale)&&void 0!==F?F:1,scaleY:null!==(z=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==z?z:1,mount:null!==(P=e.mount)&&void 0!==P?P:0,mountX:null!==(D=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==D?D:0,mountY:null!==(U=null!==(W=e.mountY)&&void 0!==W?W:e.mount)&&void 0!==U?U:0,pivot:null!==(Y=e.pivot)&&void 0!==Y?Y:.5,pivotX:null!==(j=null!==(H=e.pivotX)&&void 0!==H?H:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(Q=null!==(K=e.pivotY)&&void 0!==K?K:e.pivot)&&void 0!==Q?Q:.5,rotation:null!==($=e.rotation)&&void 0!==$?$:0,data:J}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,r){var n=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:A(A({},r),{},{id:n})};return this.textureTracker.registerTexture(o),o}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class dt extends E{constructor(e,t,r){super(),C(this,"node",void 0),C(this,"props",void 0),C(this,"settings",void 0),C(this,"propStartValues",{}),C(this,"restoreValues",{}),C(this,"progress",0),C(this,"delayFor",0),C(this,"timingFunction",void 0),C(this,"propsList",void 0),this.node=e,this.props=t,this.settings=r,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach((t=>{this.propStartValues[t]=e[t]})),this.timingFunction=e=>e,r.easing&&"string"==typeof r.easing&&(this.timingFunction=G(r.easing)),this.delayFor=r.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach((e=>{this.node[e]=this.propStartValues[e]}))}reverse(){this.progress=0,Object.keys(this.props).forEach((e=>{var t=this.props[e],r=this.propStartValues[e];this.props[e]=r,this.propStartValues[e]=t})),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,r){return(this.timingFunction(e)||e)*(r-t)+t}update(e){var t=this.settings,r=t.duration,n=t.loop,o=t.easing,i=t.stopMethod;if(r)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/r,this.progress>1&&(this.progress=n?0:1,i))this.emit("finished",{});else{for(var s=0;s{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){_(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){_(this.stoppedResolve);var e=this.animation.settings,t=e.loop;if("reverse"===e.stopMethod)return this.animation.reverse(),void this.start();this.stoppedResolve(),this.stoppedResolve=null,t||this.manager.unregisterAnimation(this.animation)}}class ht{constructor(e){C(this,"data",void 0),e?(this.data=new Float32Array(9),this.data[0]=e[0],this.data[3]=e[3],this.data[6]=e[6],this.data[1]=e[1],this.data[4]=e[4],this.data[7]=e[7],this.data[2]=e[2],this.data[5]=e[5],this.data[8]=e[8]):this.data=new Float32Array(9)}static get temp(){return ft}static multiply(e,t,r){var n=e.data[0]*t.data[0]+e.data[3]*t.data[1]+e.data[6]*t.data[2],o=e.data[0]*t.data[3]+e.data[3]*t.data[4]+e.data[6]*t.data[5],i=e.data[0]*t.data[6]+e.data[3]*t.data[7]+e.data[6]*t.data[8],s=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],a=e.data[1]*t.data[3]+e.data[4]*t.data[4]+e.data[7]*t.data[5],l=e.data[1]*t.data[6]+e.data[4]*t.data[7]+e.data[7]*t.data[8],d=e.data[2]*t.data[0]+e.data[5]*t.data[1]+e.data[8]*t.data[2],u=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],h=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new ht),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=s,r.data[4]=a,r.data[7]=l,r.data[2]=d,r.data[5]=u,r.data[8]=h,r}static identity(e){return e||(e=new ht),e.data[0]=1,e.data[3]=0,e.data[6]=0,e.data[1]=0,e.data[4]=1,e.data[7]=0,e.data[2]=0,e.data[5]=0,e.data[8]=1,e}static translate(e,t,r){return r||(r=new ht),r.data[0]=1,r.data[3]=0,r.data[6]=e,r.data[1]=0,r.data[4]=1,r.data[7]=t,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static scale(e,t,r){return r||(r=new ht),r.data[0]=e,r.data[3]=0,r.data[6]=0,r.data[1]=0,r.data[4]=t,r.data[7]=0,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static rotate(e,t){var r=Math.cos(e),n=Math.sin(e);return t||(t=new ht),t.data[0]=r,t.data[3]=-n,t.data[6]=0,t.data[1]=n,t.data[4]=r,t.data[7]=0,t.data[2]=0,t.data[5]=0,t.data[8]=1,t}static copy(e,t,r){return t||(t=new ht),t.data[0]=e.data[0],t.data[1]=e.data[1],t.data[2]=e.data[2],t.data[3]=e.data[3],t.data[4]=e.data[4],t.data[5]=e.data[5],t.data[6]=e.data[6],t.data[7]=e.data[7],t.data[8]=e.data[8],t}translate(e,t){return this.data[6]=this.data[0]*e+this.data[3]*t+this.data[6],this.data[7]=this.data[1]*e+this.data[4]*t+this.data[7],this}scale(e,t){return this.data[0]=this.data[0]*e,this.data[3]=this.data[3]*t,this.data[1]=this.data[1]*e,this.data[4]=this.data[4]*t,this}rotate(e){if(0===e||!(e%Math.PI*2))return this;var t=Math.cos(e),r=Math.sin(e),n=this.data[0]*t+this.data[3]*r,o=this.data[3]*t-this.data[0]*r,i=this.data[1]*t+this.data[4]*r,s=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=s,this}multiply(e){return ht.multiply(this,e,this)}get tx(){return this.data[6]}get ty(){return this.data[7]}get ta(){return this.data[0]}get tb(){return this.data[3]}get tc(){return this.data[1]}get td(){return this.data[4]}transformPoint(e,t){return[this.data[0]*e+this.data[3]*t+this.data[6],this.data[1]*e+this.data[4]*t+this.data[1]]}}var ct,ft=new ht;class pt{constructor(e){C(this,"data",void 0),this.data=new Float32Array(8),e&&(this.data[0]=e[0],this.data[2]=e[2],this.data[4]=e[4],this.data[6]=e[6],this.data[1]=e[1],this.data[3]=e[3],this.data[5]=e[5],this.data[7]=e[7])}static translate(e,t,r,n,o,i,s,a,l){return l||(l=new pt),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=s,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=a,l}get x1(){return this.data[0]}get x2(){return this.data[2]}get x3(){return this.data[4]}get x4(){return this.data[6]}get y1(){return this.data[1]}get y2(){return this.data[3]}get y3(){return this.data[5]}get y4(){return this.data[7]}}!function(e){e[e.Init=0]="Init",e[e.OutOfBounds=2]="OutOfBounds",e[e.InBounds=4]="InBounds",e[e.InViewport=8]="InViewport"}(ct||(ct={}));var vt,gt=new Map;gt.set(ct.Init,"init"),gt.set(ct.OutOfBounds,"outOfBounds"),gt.set(ct.InBounds,"inBounds"),gt.set(ct.InViewport,"inViewport"),function(e){e[e.Children=1]="Children",e[e.ScaleRotate=2]="ScaleRotate",e[e.Local=4]="Local",e[e.Global=8]="Global",e[e.Clipping=16]="Clipping",e[e.CalculatedZIndex=32]="CalculatedZIndex",e[e.ZIndexSortedChildren=64]="ZIndexSortedChildren",e[e.PremultipliedColors=128]="PremultipliedColors",e[e.WorldAlpha=256]="WorldAlpha",e[e.RenderState=512]="RenderState",e[e.IsRenderable=1024]="IsRenderable",e[e.None=0]="None",e[e.All=2047]="All"}(vt||(vt={}));class mt extends E{constructor(e,t){super(),C(this,"stage",void 0),C(this,"children",[]),C(this,"props",void 0),C(this,"updateType",vt.All),C(this,"globalTransform",void 0),C(this,"scaleRotateTransform",void 0),C(this,"localTransform",void 0),C(this,"renderCoords",void 0),C(this,"renderBound",void 0),C(this,"strictBound",void 0),C(this,"preloadBound",void 0),C(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),C(this,"isRenderable",!1),C(this,"renderState",ct.Init),C(this,"worldAlpha",1),C(this,"premultipliedColorTl",0),C(this,"premultipliedColorTr",0),C(this,"premultipliedColorBl",0),C(this,"premultipliedColorBr",0),C(this,"calcZIndex",0),C(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})})),C(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),C(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=A(A({},t),{},{parent:null}),this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,r=null){this.props.texture&&this.unloadTexture();var n=this.stage.txManager.loadTexture(e,t,r);this.props.texture=n,this.props.textureOptions=r,this.setUpdateType(vt.IsRenderable),queueMicrotask((()=>{"loaded"===n.state?this.onTextureLoaded(n,n.dimensions):"failed"===n.state?this.onTextureFailed(n,n.error):"freed"===n.state&&this.onTextureFreed(n),n.on("loaded",this.onTextureLoaded),n.on("failed",this.onTextureFailed),n.on("freed",this.onTextureFreed)}))}unloadTexture(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(vt.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();_(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(vt.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&vt.Children||t.setUpdateType(vt.Children)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=ht.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){_(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,r=this.props.mountX*this.props.width,n=this.props.mountY*this.props.height;this.localTransform=ht.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(vt.Global)}update(e,t){this.updateType&vt.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(vt.Local)),this.updateType&vt.Local&&(this.updateLocalTransform(),this.setUpdateType(vt.Global));var r=this.props.parent,n=vt.None;this.updateType&vt.Global&&(_(this.localTransform),this.globalTransform=ht.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(vt.Clipping|vt.RenderState|vt.Children),n|=vt.Global),this.updateType&vt.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(vt.Children),n|=vt.Clipping),this.updateType&vt.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(vt.Children|vt.PremultipliedColors|vt.IsRenderable),n|=vt.WorldAlpha),this.updateType&vt.PremultipliedColors&&(this.premultipliedColorTl=M(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=M(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=M(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=M(this.props.colorBr,this.worldAlpha,!0))),this.updateType&vt.RenderState&&(this.updateRenderState(t),this.setUpdateType(vt.IsRenderable)),this.updateType&vt.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&vt.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(vt.ZIndexSortedChildren)),this.updateType&vt.Children&&this.children.length&&this.children.forEach((t=>{t.setUpdateType(n),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&vt.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}checkRenderBounds(e){_(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=B(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=B(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),Z(this.renderBound,this.strictBound)?ct.InViewport:Z(this.renderBound,this.preloadBound)?ct.InBounds:ct.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===ct.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rct.InBounds&&t===ct.OutOfBounds)&&(this.emit(gt.get(ct.InBounds),{previous:r,current:t}),r=ct.InBounds);var n=gt.get(t);_(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ct[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>ct.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}calculateRenderCoords(){var e=this.width,t=this.height,r=this.globalTransform;_(r);var n=r.tx,o=r.ty,i=r.ta,s=r.tb,a=r.tc,l=r.td;if(0===s&&0===a){var d=n,u=n+e*i,h=o,c=o+t*l;this.renderCoords=pt.translate(d,h,u,h,u,c,d,c,this.renderCoords)}else this.renderCoords=pt.translate(n,o,n+e*i,o+e*a,n+e*i+t*s,o+e*a+t*l,n+t*s,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;_(t),_(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,s=e.x3,a=e.y3;if(0===r||0===n)this.renderBound=B(o,i,s,a,this.renderBound);else{var l=e.x2,d=e.x4,u=e.y2,h=e.y4;this.renderBound=B(Math.min(o,l,s,d),Math.min(i,u,a,h),Math.max(o,l,s,d),Math.max(i,u,a,h),this.renderBound)}}calculateClippingRect(e){_(this.globalTransform);var t=this.clippingRect,r=this.props,n=this.globalTransform,o=r.clipping,i=0!==n.tb||0!==n.tc;o&&!i?(t.x=n.tx,t.y=n.ty,t.width=this.width*n.ta,t.height=this.height*n.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?L(e,t,t):e.valid&&(Q(e,t),t.valid=!0)}calculateZIndex(){var e,t,r=this.props,n=r.zIndex||0,o=(null===(e=r.parent)||void 0===e?void 0:e.zIndex)||0,i=n;null!==(t=r.parent)&&void 0!==t&&t.zIndexLocked&&(i=n{e.setUpdateType(vt.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(vt.CalculatedZIndex|vt.Children),this.children.forEach((e=>{e.setUpdateType(vt.CalculatedZIndex)}))}get parent(){return this.props.parent}set parent(e){var t=this.props.parent;if(t!==e){if(this.props.parent=e,t){var r=t.children.indexOf(this);_(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(vt.Children|vt.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(vt.All),e.setUpdateType(vt.Children|vt.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}var xt=1;function yt(){return xt++}class bt extends E{constructor(e,t,r,n){var o;super(),C(this,"rendererMain",void 0),C(this,"stage",void 0),C(this,"id",void 0),C(this,"coreNode",void 0),C(this,"_children",[]),C(this,"_src",""),C(this,"_parent",null),C(this,"_texture",null),C(this,"_shader",null),C(this,"_data",{}),C(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),C(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),C(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),C(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),C(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),C(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),C(this,"onInViewport",((e,t)=>{this.emit("inViewport",t)})),this.rendererMain=t,this.stage=r,this.id=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:yt(),this.coreNode=n||new mt(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){null!==e&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var t,r=this._parent;if(this._parent=e,this.coreNode.parent=null!==(t=null==e?void 0:e.coreNode)&&void 0!==t?t:null,r){var n=r.children.indexOf(this);_(-1!==n,"MainOnlyNode.parent: Node not found in old parent's children!"),r.children.splice(n,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.texture=e?this.rendererMain.createTexture("ImageTexture",{src:e}):null)}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=at(e)}destroy(){this.emit("beforeDestroy",{});for(var e=this.children[0];e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){var r=new dt(this.coreNode,e,t);return new ut(this.stage.animationManager,r)}}class wt{constructor(){C(this,"activeAnimations",new Set)}registerAnimation(e){this.activeAnimations.add(e)}unregisterAnimation(e){this.activeAnimations.delete(e)}update(e){this.activeAnimations.forEach((t=>{t.update(e)}))}}class St{constructor(e){C(this,"imageWorkersEnabled",!0),C(this,"messageManager",{}),C(this,"workers",[]),C(this,"workerIndex",0),this.workers=this.createWorkers(e),this.workers.forEach((e=>{e.onmessage=this.handleMessage.bind(this)}))}handleMessage(e){var t=e.data,r=t.src,n=t.data,o=t.error,i=this.messageManager[r];if(i){var s=x(i,2),a=s[0],l=s[1];delete this.messageManager[r],o?l(new Error(o)):a(n)}}createWorkers(e=1){for(var t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),r=(self.URL?URL:webkitURL).createObjectURL(t),n=[],o=0;o{try{if(this.workers){var o=this.convertUrlToAbsolute(e);this.messageManager[o]=[r,n],this.getNextWorker().postMessage({src:o,premultiplyAlpha:t})}}catch(i){n(i)}}))}}class At extends O{constructor(e,t){super(e),C(this,"props",void 0),this.props=At.resolveDefaults(t)}getTextureData(){var e=this;return w(y().mark((function t(){var r,n,o,i,s,a,l;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=e.props,n=r.width,o=r.height,i=n*o*4,s=new Uint8ClampedArray(i),a=0;a{})}setTextureMemUse(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}gc(){this.textures.forEach(((e,t)=>{t.renderable||t.free()}))}}class _t extends E{constructor(e){super(),C(this,"options",void 0),C(this,"animationManager",void 0),C(this,"txManager",void 0),C(this,"txMemManager",void 0),C(this,"fontManager",void 0),C(this,"textRenderers",void 0),C(this,"shManager",void 0),C(this,"renderer",void 0),C(this,"root",void 0),C(this,"boundsMargin",void 0),C(this,"deltaTime",0),C(this,"lastFrameTime",0),C(this,"currentFrameTime",0),C(this,"fpsNumFrames",0),C(this,"fpsElapsedTime",0),C(this,"renderRequested",!1),C(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,s=e.appHeight,a=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,u=e.txMemByteThreshold;this.txManager=new Ct(d),this.txMemManager=new Tt(u),this.shManager=new je,this.animationManager=new wt,this.contextSpy=l?new He:null;var h=[0,0,0,0];a&&(h=Array.isArray(a)?a:[a,a,a,a]),this.boundsMargin=h,null!=o&&o.monitorTextureCache&&setInterval((()=>{_(this.txManager);var e=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),this.renderer=new ee({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=r?r:4278190080,bufferMemory:2e6,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new we(this),sdf:new ot(this)},this.fontManager=new rt(this.textRenderers);var c,f,p,v=new mt(this,{id:n,x:0,y:0,width:i,height:s,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=v,c=this,f=!1,p=()=>{if(c.updateAnimations(),!c.hasSceneUpdates())return c.calculateFps(),setTimeout(p,16.666666666666668),void(f||(c.emit("idle"),f=!0));f=!1,c.drawFrame(),requestAnimationFrame(p)},requestAnimationFrame(p)}updateAnimations(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,r,n,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(r=this.contextSpy)||void 0===r?void 0:r.getData())&&void 0!==t?t:null}),null===(n=this.contextSpy)||void 0===n||n.reset()}}addQuads(e){_(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t{var e=this.contain,t=this.trState.props.width,r=this.trState.props.height,n=this.trState.textW||0,o=this.trState.textH||0;"both"===e?(this.props.width=t,this.props.height=r):"width"===e?(this.props.width=t,this.props.height=o):"none"===e&&(this.props.width=n,this.props.height=o),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})})),C(this,"onTextFailed",((e,t)=>{this.emit("failed",{type:"text",error:t})})),this._textRendererOverride=t.textRendererOverride;var r=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix}),n=r.resolvedTextRenderer,o=r.textRendererState;this.textRenderer=n,this.trState=o}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),"none"===this.contain&&this.setUpdateType(vt.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),"both"!==this.contain&&this.setUpdateType(vt.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);var t=this.resolveTextRendererAndState(this.trState.props),r=t.resolvedTextRenderer,n=t.textRendererState;this.textRenderer=r,this.trState=n}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),_(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return""!==this.trState.props.text||super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){_(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){var t=this.stage.resolveTextRenderer(e,this._textRendererOverride),r=t.createState(e);return r.emitter.on("loaded",this.onTextLoaded),r.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(r),{resolvedTextRenderer:t,textRendererState:r}}}class It extends bt{constructor(e,t,r){super(e,t,r,new kt(r,{id:yt(),x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStretch:e.fontStretch,fontStyle:e.fontStyle,contain:e.contain,scrollable:e.scrollable,letterSpacing:e.letterSpacing,textAlign:e.textAlign,scrollY:e.scrollY,offsetY:e.offsetY,textRendererOverride:e.textRendererOverride,lineHeight:e.lineHeight,maxLines:e.maxLines,textBaseline:e.textBaseline,verticalAlign:e.verticalAlign,overflowSuffix:e.overflowSuffix,debug:e.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(e){this.coreNode.text=e}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(e){this.coreNode.textRendererOverride=e}get fontSize(){return this.coreNode.fontSize}set fontSize(e){this.coreNode.fontSize=e}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(e){this.coreNode.fontFamily=e}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(e){this.coreNode.fontWeight=e}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(e){this.coreNode.fontStretch=e}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(e){this.coreNode.fontStyle=e}get textAlign(){return this.coreNode.textAlign}set textAlign(e){this.coreNode.textAlign=e}get contain(){return this.coreNode.contain}set contain(e){this.coreNode.contain=e}get scrollable(){return this.coreNode.scrollable}set scrollable(e){this.coreNode.scrollable=e}get scrollY(){return this.coreNode.scrollY}set scrollY(e){this.coreNode.scrollY=e}get offsetY(){return this.coreNode.offsetY}set offsetY(e){this.coreNode.offsetY=e}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(e){this.coreNode.letterSpacing=e}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(e){e&&(this.coreNode.lineHeight=e)}get maxLines(){return this.coreNode.maxLines}set maxLines(e){e&&(this.coreNode.maxLines=e)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(e){e&&(this.coreNode.textBaseline=e)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(e){e&&(this.coreNode.verticalAlign=e)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(e){e&&(this.coreNode.overflowSuffix=e)}get debug(){return this.coreNode.debug}set debug(e){this.coreNode.debug=e}}class Bt{constructor(){C(this,"root",null),C(this,"stage",null),C(this,"rendererMain",null)}init(e,t,r){var n=this;return w(y().mark((function o(){var i;return y().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new _t({rootId:yt(),appWidth:t.appWidth,appHeight:t.appHeight,txMemByteThreshold:t.txMemByteThreshold,boundsMargin:t.boundsMargin,deviceLogicalPixelRatio:t.deviceLogicalPixelRatio,devicePhysicalPixelRatio:t.devicePhysicalPixelRatio,clearColor:t.clearColor,canvas:r,fpsUpdateInterval:t.fpsUpdateInterval,enableContextSpy:t.enableContextSpy,numImageWorkers:t.numImageWorkers,debug:{monitorTextureCache:!1}}),n.rendererMain=e,_(n.stage.root),i=new bt(e.resolveNodeDefaults({}),n.rendererMain,n.stage,n.stage.root),n.root=i,i.once("beforeDestroy",n.onBeforeDestroyNode.bind(n,i)),n.onCreateNode(i),!t.coreExtensionModule){o.next=10;break}return o.next=10,it(t.coreExtensionModule,n.stage);case 10:n.stage.on("fpsUpdate",((e,t)=>{n.onFpsUpdate(t)})),n.stage.on("frameTick",((e,t)=>{n.onFrameTick(t)})),n.stage.on("idle",(()=>{n.onIdle()}));case 13:case"end":return o.stop()}}),o)})))()}createNode(e){_(this.rendererMain),_(this.stage);var t=new bt(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){_(this.rendererMain),_(this.stage);var t=new It(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}destroyNode(e){e.destroy()}releaseTexture(e){var t=this.stage;_(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return _(this.root),this.root}onCreateNode(e){throw new Error("Method not implemented.")}onBeforeDestroyNode(e){throw new Error("Method not implemented.")}onFpsUpdate(e){throw new Error("Method not implemented.")}onFrameTick(e){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}var Rt,Et=(e,t)=>e===t,Nt=Symbol("solid-proxy"),Ft=Symbol("solid-track"),Lt={equals:Et},zt=gr,Mt=1,Pt=2,Dt={owned:null,cleanups:null,context:null,owner:null},Ot={},Ut=null,Wt=null,Yt=null,jt=null,Ht=null,Qt=0;function Kt(e,t){var r=Yt,n=Ut,o=0===e.length,i=void 0===t?n:t,s=o?Dt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>er((()=>br(s)))));Ut=s,Yt=null;try{return vr(a,!0)}finally{Yt=r,Ut=n}}function $t(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Lt,t):Lt).equals||void 0};return[ur.bind(r),e=>("function"==typeof e&&(e=e(r.value)),hr(r,e))]}function Xt(e,t,r){cr(fr(e,t,!0,Mt))}function Gt(e,t,r){cr(fr(e,t,!1,Mt))}function Vt(e,t,r){zt=mr;var n=fr(e,t,!1,Mt);r&&r.render||(n.user=!0),Ht?Ht.push(n):cr(n)}function Zt(e,t,r){r=r?Object.assign({},Lt,r):Lt;var n=fr(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,cr(n),ur.bind(n)}function qt(e,t,r){var n,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});var s=null,a=Ot,l=!1,d="initialValue"in i,u="function"==typeof n&&Zt(n),h=new Set,c=x((i.storage||$t)(i.initialValue),2),f=c[0],p=c[1],v=x($t(void 0),2),g=v[0],m=v[1],y=x($t(void 0,{equals:!1}),2),b=y[0],w=y[1],S=x($t(d?"ready":"unresolved"),2),A=S[0],C=S[1];function _(e,t,r,n){return s===e&&(s=null,void 0!==n&&(d=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),a=Ot,function(e,t){vr((()=>{void 0===t&&p((()=>e)),C(void 0!==t?"errored":d?"ready":"unresolved"),m(t);var r,n=T(h.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}h.clear()}),!1)}(t,r)),t}function k(){var e=Rt,t=f(),r=g();if(void 0!==r&&!s)throw r;return Yt&&!Yt.user&&e&&Xt((()=>{b(),s&&(e.resolved||h.has(e)||(e.increment(),h.add(e)))})),t}function I(e=!0){if(!1===e||!l){l=!1;var t=u?u():n;if(null!=t&&!1!==t){var r,i=a!==Ot?a:er((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(s=i,"value"in i?("success"===i.status?_(s,i.value,void 0,t):_(s,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),vr((()=>{C(d?"refreshing":"pending"),w()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,wr(e),t))))):(_(s,i,void 0,t),i)}_(s,er(f))}}return Object.defineProperties(k,{state:{get:()=>A()},error:{get:()=>g()},loading:{get(){var e=A();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return k();var e=g();if(e&&!s)throw e;return f()}}}),u?Xt((()=>I(!1))):I(!1),[k,{refetch:I,mutate:p}]}function Jt(e,t=Et,r){var n=new Map,o=fr((r=>{var o,i=e(),s=T(n.entries());try{for(s.s();!(o=s.n()).done;){var a=x(o.value,2),l=a[0],d=a[1];if(t(l,i)!==t(l,r)){var u,h=T(d.values());try{for(h.s();!(u=h.n()).done;){var c=u.value;c.state=Mt,c.pure?jt.push(c):Ht.push(c)}}catch(f){h.e(f)}finally{h.f()}}}}catch(f){s.e(f)}finally{s.f()}return i}),void 0,!0,Mt);return cr(o),e=>{var r,i=Yt;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),nr((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function er(e){if(null===Yt)return e();var t=Yt;Yt=null;try{return e()}finally{Yt=t}}function tr(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var s;if(o){s=Array(e.length);for(var a=0;at(s,n,r)));return n=s,l}}function rr(e){Vt((()=>er(e)))}function nr(e){return null===Ut||(null===Ut.cleanups?Ut.cleanups=[e]:Ut.cleanups.push(e)),e}function or(){return Ut}function ir(e,t){var r=Ut,n=Yt;Ut=e,Yt=null;try{return vr(t,!0)}catch(o){Sr(o)}finally{Ut=r,Yt=n}}function sr(e){var t=Yt,r=Ut;return Promise.resolve().then((()=>{Yt=t,Ut=r,vr(e,!1),Yt=Ut=null}))}function ar(e,t){var r=Symbol("context");return{id:r,Provider:Cr(r),defaultValue:e}}function lr(e){return Ut&&Ut.context&&void 0!==Ut.context[e.id]?Ut.context[e.id]:e.defaultValue}function dr(e){var t=Zt(e),r=Zt((()=>Ar(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function ur(){if(this.sources&&this.state)if(this.state===Mt)cr(this);else{var e=jt;jt=null,vr((()=>xr(this)),!1),jt=e}if(Yt){var t=this.observers?this.observers.length:0;Yt.sources?(Yt.sources.push(this),Yt.sourceSlots.push(t)):(Yt.sources=[this],Yt.sourceSlots=[t]),this.observers?(this.observers.push(Yt),this.observerSlots.push(Yt.sources.length-1)):(this.observers=[Yt],this.observerSlots=[Yt.sources.length-1])}return this.value}function hr(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&vr((()=>{for(var t=0;t1e6)throw jt=[],new Error}),!1)),t}function cr(e){if(e.fn){br(e);var t=Qt;!function(e,t,r){var n,o=Ut,i=Yt;Yt=Ut=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=Mt,e.owned&&e.owned.forEach(br),e.owned=null),e.updatedAt=r+1,Sr(s)}finally{Yt=i,Ut=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?hr(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function fr(e,t,r,n=Mt,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ut,context:Ut?Ut.context:null,pure:r};return null===Ut||Ut!==Dt&&(Ut.owned?Ut.owned.push(i):Ut.owned=[i]),i}function pr(e){if(0!==e.state){if(e.state===Pt)return xr(e);if(e.suspense&&er(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===Mt)cr(e);else if(e.state===Pt){var n=jt;jt=null,vr((()=>xr(e,t[0])),!1),jt=n}}}function vr(e,t){if(jt)return e();var r=!1;t||(jt=[]),Ht?r=!0:Ht=[],Qt++;try{var n=e();return function(e){jt&&(gr(jt),jt=null);if(e)return;var t=Ht;Ht=null,t.length&&vr((()=>zt(t)),!1)}(r),n}catch(o){r||(Ht=null),jt=null,Sr(o)}}function gr(e){for(var t=0;t=0;t--)br(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function wr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function Sr(e,t=Ut){throw wr(e)}function Ar(e){if("function"==typeof e&&!e.length)return Ar(e());if(Array.isArray(e)){for(var t=[],r=0;rr=er((()=>(Ut.context=A(A({},Ut.context),{},{[e]:t.value}),dr((()=>t.children)))))),void 0),r}}var Tr=Symbol("fallback");function _r(e){for(var t=0;te(t||{})))}function Ir(){return!0}var Br={get:(e,t,r)=>t===Nt?r:e.get(t),has:(e,t)=>t===Nt||e.has(t),set:Ir,deleteProperty:Ir,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:Ir,deleteProperty:Ir}),ownKeys:e=>e.keys()};function Rr(e){return(e="function"==typeof e?e():e)?e:{}}function Er(){for(var e=0,t=this.length;e=0;r--){var n=Rr(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in Rr(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;s--){var a=e[s];if(a)for(var l=Object.getOwnPropertyNames(a),d=function(){var e=l[u];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(a,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(a)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:Er.bind(o[e]=[t.get.bind(a)])}:void 0!==t.value?t:void 0},u=l.length-1;u>=0;u--)d()}for(var h={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(h,p,v):h[p]=v?v.value:void 0}return h}var Fr=e=>`Stale read from <${e}>.`;function Lr(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Zt(function(e,t,r={}){var n=[],o=[],i=[],s=0,a=t.length>1?[]:null;return nr((()=>_r(i))),()=>{var l,d,u=e()||[];return u[Ft],er((()=>{var e,t,c,f,p,v,g,m,x,y=u.length;if(0===y)0!==s&&(_r(i),i=[],n=[],o=[],s=0,a&&(a=[])),r.fallback&&(n=[Tr],o[0]=Kt((e=>(i[0]=e,r.fallback()))),s=1);else if(0===s){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===u[m];g--,m--)c[m]=o[g],f[m]=i[g],a&&(p[m]=a[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=u[d],l=e.get(x),t[d]=void 0===l?-1:l,e.set(x,d);for(l=v;l<=g;l++)x=n[l],void 0!==(d=e.get(x))&&-1!==d?(c[d]=o[l],f[d]=i[l],a&&(p[d]=a[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function zr(e){var t=e.keyed,r=Zt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Zt((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?er((()=>o(t?n:()=>{if(!er(r))throw Fr("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var Mr,Pr;function Dr(e={},t="app"){var r=new Bt;return Mr=new lt(e,t,r),Pr=Mr.createShader.bind(Mr),Mr}class Or extends Array{constructor(e){super(),C(this,"_parent",void 0),this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){var r=this.indexOf(t);this.splice(r,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}var Ur={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Wr(e,t,...r){false}function Yr(e){return"function"==typeof e}function jr(e){return Array.isArray(e)}function Hr(e,t={}){if(jr(e))e.forEach((e=>{Hr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class Qr extends Array{constructor(e,t={}){return jr(t)?(super(...t),C(this,"onChange",void 0)):"string"==typeof t?(super(t),C(this,"onChange",void 0)):(super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),C(this,"onChange",void 0)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}var Kr=x($t(void 0),2),$r=Kr[0],Xr=Kr[1],Gr=Ur.animationSettings;function Vr(e){for(var t=[],r=0,n=Object.entries(e);rXr(this)))}else this.autofocus=!0}isTextNode(){return"text"===this.name}_resizeOnTextLoad(){this.lng.on("loaded",((e,t)=>{if("text"===t.type){var r=t.dimensions;this.parent.updateLayout(this,r)}}))}getText(){return this.children.map((e=>e.text)).join("")}destroy(){var e;this._queueDelete&&(null===(e=this.lng)||void 0===e||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){for(var t in jr(e)?this._style=Hr(e):this._style=e,this._style)void 0===this[t]&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find((t=>t.id===e))}searchChildrenById(e){var t,r=T(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof qr){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new Qr(this._stateChanged.bind(this),e),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new Qr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Gr}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){var r;if(Wr(),Yr(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],r=!1,n=0;n(e.flexOrder||0)-(t.flexOrder||0)));var i=t.length,s="row"===(e.flexDirection||"row"),a=s?"width":"height",l=s?"height":"width",d=s?"marginLeft":"marginTop",u=s?"marginRight":"marginBottom",h=s?"x":"y",c=s?"y":"x",f=e[a]||0,p=e[l]||0,v=e.gap||0,g=e.justifyContent||"flexStart",m=e.alignItems,x=0;["center","spaceBetween","spaceEvenly"].includes(g)&&(x=t.reduce(((e,t)=>e+(t[a]||0)),0));var y=p&&m?e=>{"flexStart"===m?e[c]=0:"center"===m?e[c]=(p-(e[l]||0))/2:"flexEnd"===m&&(e[c]=p-(e[l]||0))}:e=>e;if("flexStart"===g){var b=0;if(t.forEach((e=>{e[h]=b+(e[d]||0),b+=(e[a]||0)+v+(e[d]||0)+(e[u]||0),y(e)})),"fixed"!==e.flexBoundary){var w=b-v;if(w!==e[a])return e[a]=w,!0}}else if("flexEnd"===g)for(var S=f,A=i-1;A>=0;A--){var C=t[A];_(C),C[h]=S-(C[a]||0)-(C[u]||0),S-=(C[a]||0)+v+(C[d]||0)+(C[u]||0),y(C)}else if("center"===g){var T=(f-(x+v*(i-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[a]||0)+v,y(e)}))}else if("spaceBetween"===g){var k=(f-x)/(i-1),I=0;t.forEach((e=>{e[h]=I,I+=(e[a]||0)+k,y(e)}))}else if("spaceEvenly"===g){var B=(f-x)/(i+1),R=B;t.forEach((e=>{e[h]=R,R+=(e[a]||0)+B,y(e)}))}return!1}(this))null===(r=this.parent)||void 0===r||r.updateLayout();Yr(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Wr(0,0,this.states),this.forwardStates){var e=this.states.slice();this.children.forEach((t=>t.states=e))}var t=this.states;if(this._undoStyles||this.style&&function(e,t){var r,n=T(t);try{for(n.s();!(r=n.n()).done;)if(r.value in e)return!0}catch(o){n.e(o)}finally{n.f()}return!1}(this.style,t)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((e=>{r[e]=this.style[e]}));var n=t.reduce(((e,t)=>{var r=this.style[t];return r&&(e=A(A({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,r,n)}}render(){var e=this,t=this.parent;if(t)if(t.lng)if(this.lng)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),this.states.length&&this._stateChanged();var r=e._renderProps;if(r.x=r.x||0,r.y=r.y||0,t.lng&&(r.parent=t.lng),e._effects&&(this.shader=Vr(e._effects)),e.isTextNode()){if(Ur.fontSettings)for(var n in Ur.fontSettings)void 0===r[n]&&(r[n]=Ur.fontSettings[n]);r.text=e.getText(),r.contain&&(r.width||(r.width=(t.width||0)-r.x-(r.marginRight||0),e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-r.y-(r.marginBottom||0),e._autosized=!0)),Wr(0,0),e.lng=Mr.createTextNode(r),r.width&&r.height||(e._autosized=!0,e._resizeOnTextLoad())}else r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-r.x,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-r.y,e._autosized=!0),r.color||r.src||(r.color=0)),Wr(0,0),e.lng=Mr.createNode(r);e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad),Yr(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach((([t,r])=>{var n;null===(n=e.lng)||void 0===n||n.on(t,((t,n)=>r(e,n)))})),e.lng.div&&(e.lng.div.solid=e),"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus(),delete this._renderProps}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var Jr=function(){var e=tn[en];Object.defineProperty(qr.prototype,e,{get(){return this.lng?this.lng[e]:this._renderProps[e]},set(t){this._sendToLightningAnimatable(e,t)}})},en=0,tn=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"];en{return t=pn("text"),gn(t,e,!1),t;var t},an=e=>{return t=pn("node"),gn(t,e,!1),t;var t};function ln({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:l,getNextSibling:d}){function u(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return h(e,t,n,r);Gt((n=>h(e,t(),n,r)),n)}function h(e,i,s,a,d){for(;"function"==typeof s;)s=s();if(i===s)return s;var u=typeof i,m=void 0!==a;if("string"===u||"number"===u)if("number"===u&&(i=i.toString()),m){var x=s[0];x&&r(x)?n(x,i):x=t(i),s=p(e,s,a,x)}else""!==s&&"string"==typeof s?n(l(e),s=i):(p(e,s,a,t(i)),s=i);else if(null==i||"boolean"===u)s=p(e,s,a);else{if("function"===u)return Gt((()=>{for(var t=i();"function"==typeof t;)t=t();s=h(e,t,s,a)})),()=>s;if(Array.isArray(i)){var y=[];if(c(y,i,d))return Gt((()=>s=h(e,y,s,a,!0))),()=>s;if(0===y.length){var b=p(e,s,a);if(m)return s=b}else Array.isArray(s)?0===s.length?v(e,y,a):f(e,s,y):null==s||""===s?v(e,y):f(e,m&&s||[l(e)],y);s=y}else{if(Array.isArray(s)){if(m)return s=p(e,s,a,i);p(e,s,null,i)}else null!=s&&""!==s&&l(e)?g(e,i,l(e)):o(e,i);s=i}}return s}function c(e,r,n){for(var o=!1,i=0,s=r.length;im-u)for(var w=t[l];u=0;c--){var f=r[c];if(u!==f){var p=a(f)===e;h||c?p&&i(e,f):p?g(e,u,f):o(e,u,n)}else h=!0}else o(e,u,n);return[u]}function v(e,t,r){for(var n=0,i=t.length;nr.children=h(e,t.children,r.children))),Gt((()=>t.ref&&t.ref(e))),Gt((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(s(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Kt((n=>{r=n,u(t,e())})),r},insert:u,spread(e,t,r){"function"==typeof t?Gt((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(s(e,t,r,n),r),mergeProps:Nr,effect:Gt,memo:Zt,createComponent:kr,use:(e,t,r)=>er((()=>e(t,r)))}}var dn={createElement:e=>new qr(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Wr(0,0),e.text=t;var r=e.parent;_(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Wr(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof qr?e.lng&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Wr(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof qr&&queueMicrotask((()=>t.destroy()))},getParentNode:e=>e.parent,getFirstChild:e=>e.children[0],getNextSibling(e){var t=e.parent.children||[],r=t.indexOf(e)+1;if(rr||document});r;){var n=r[t];if(n&&!r.disabled){var o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}var An;function Cn(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),()=>e.delete(t)},confirm:function(r,n){if(t)return!(t=!1);var o,i={to:r,options:n,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0},s=T(e);try{var a=function(){var e=o.value;e.listener(A(A({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,A(A({},n),{},{resolve:!1}))}}))};for(s.s();!(o=s.n()).done;)a()}catch(l){s.e(l)}finally{s.f()}return!i.defaultPrevented}}}function Tn(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(A(A({},window.history.state),{},{_depth:window.history.length-1}),""),An=window.history.state._depth}Tn();var _n=/^(?:[a-z0-9]+:)?\/\//i,kn=/^\/+|(\/)\/+$/g,In="http://sr";function Bn(e,t=!1){var r=e.replace(kn,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function Rn(e,t,r){if(!_n.test(t)){var n=Bn(e),o=r&&Bn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+Bn(t,!i)}}function En(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Nn(e,t,r){var n=x(e.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),a=s.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-a;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:a?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],u=0;u0===t.localeCompare(e,void 0,{sensitivity:"base"});return void 0===t||("string"==typeof t?r(t):"function"==typeof t?t(e):Array.isArray(t)?t.some(r):t instanceof RegExp&&t.test(e))}function Ln(e){var t=new Map,r=or();return new Proxy({},{get:(n,o)=>(t.has(o)||ir(r,(()=>t.set(o,Zt((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function zn(e){var t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];for(var r=e.slice(0,t.index),n=e.slice(t.index+t[0].length),o=[r,r+=t[1]];t=/^(\/\:[^\/]+)\?/.exec(n);)o.push(r+=t[1]),n=n.slice(t[0].length);return zn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Mn,Pn=ar(),Dn=ar(),On=()=>function(e,t){if(null==e)throw new Error(t);return e}(lr(Pn)," and 'use' router primitives can be only used inside a Route."),Un=()=>On().navigatorFactory(),Wn=()=>On().location,Yn=()=>On().params;function jn(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,s=!o||Array.isArray(o)&&!o.length,a={key:e,component:r,load:n,info:i};return Qn(e.path).reduce(((r,n)=>{var o,i,l=T(zn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,u=(i=d,Bn(t).replace(/\/*(\*.*)?$/g,"")+Bn(i)),h=s?u:u.split("/*",1)[0];h=h.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(A(A({},a),{},{originalPath:d,pattern:h,matcher:Nn(h,!s,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Hn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=x(r.pattern.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),s.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),s.length-(void 0===i?0:1)))-t,matcher(t){for(var r=[],n=e.length-1;n>=0;n--){var o=e[n],i=o.matcher(t);if(!i)return null;r.unshift(A(A({},i),{},{route:o}))}return r}};var r,n,o,i,s}function Qn(e){return Array.isArray(e)?e:[e]}function Kn(e,t="",r=[],n=[]){for(var o=Qn(e),i=0,s=o.length;it.score-e.score))}function $n(e,t){for(var r=0,n=e.length;re),u=l.renderPath||(e=>e),h=l.beforeLeave||Cn(),c=Rn("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&s({value:c,replace:!0,scroll:!1});var f=x($t(!1),2),p=f[0],v=f[1],g=function(){var e=w(y().mark((function e(t){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,sr(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),m=x($t(i().value),2),b=m[0],S=m[1],C=x($t(i().state),2),T=C[0],_=C[1],k=function(e,t){var r=new URL(In),n=Zt((t=>{var n=e();try{return new URL(n,r)}catch(o){return console.error(`Invalid path ${n}`),t}}),r,{equals:(e,t)=>e.href===t.href}),o=Zt((()=>n().pathname)),i=Zt((()=>n().search),!0),s=Zt((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return t()},get key(){return""},query:Ln(tr(i,(()=>En(n()))))}}(b,T),I=[],B=$t([]),R=Zt((()=>$n(t(),k.pathname))),E=Ln((()=>{for(var e=R(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>Rn(c,e)};return Gt((()=>{var e=i(),t=e.value,r=e.state;er((()=>{t!==b()&&g((()=>{Mn="native",S(t),_(r),B[1]([])})).then((()=>{Mn=void 0}))}))})),{base:N,location:k,params:E,isRouting:p,renderPath:u,parsePath:d,navigatorFactory:function(e){return e=e||lr(Dn)||N,(t,r)=>function(e,t,r){er((()=>{if("number"!=typeof t){var n=A({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,a=n.scroll,d=n.state,u=i?e.resolvePath(t):Rn("",t);if(void 0===u)throw new Error(`Path '${t}' is not a routable path`);if(I.length>=100)throw new Error("Too many redirects");var c=b();if((u!==c||d!==T())&&h.confirm(u,r)){var f=I.push({value:c,replace:o,scroll:a,state:T()});g((()=>{Mn="navigate",S(u),_(d),B[1]([])})).then((()=>{var e,t;I.length===f&&(Mn=void 0,e={value:u,state:d},(t=I[0])&&(e.value===t.value&&e.state===t.state||s(A(A({},e),{},{replace:t.replace,scroll:t.scroll})),I.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:R,beforeLeave:h,preloadRoute:function(e,n){var o=$n(t(),e.pathname),i=Mn;Mn="preload";var s=function(){var t=o[a],i=t.route,s=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&ir(r(),(()=>l({params:s,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:En(e),state:null,key:""},intent:"preload"})))};for(var a in o)s();Mn=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:B}}var Gn=e=>t=>{var r,n=t.base,o=dr((()=>t.children)),i=Zt((()=>Kn(o(),t.base||""))),s=Xn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(s),fn(Pn.Provider,{value:s,get children(){return fn(Vn,{routerState:s,get root(){return t.root},get load(){return t.rootLoad},get children(){return[cn((()=>(r=or())&&null)),fn(Zn,{routerState:s,get branches(){return i()}})]}})}})};function Vn(e){var t=e.routerState.location,r=e.routerState.params,n=Zt((()=>e.load&&er((()=>e.load({params:r,location:t,intent:"preload"})))));return fn(zr,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>fn(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Zn(e){var t,r=[],n=Zt(tr(e.routerState.matches,((o,i,s)=>{for(var a=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],u=o[t];s&&d&&u.route.key===d.route.key?l[t]=s[t]:(a=!1,r[t]&&r[t](),Kt((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,s=e.params,a=n().route,l=a.pattern,d=a.component,u=a.load,h=Zt((()=>n().path));d&&d.preload&&d.preload();var c=u?u({params:s,location:i,intent:Mn||"initial"}):void 0;return{parent:t,pattern:l,path:h,outlet:()=>d?kr(d,{params:s,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>Rn(o.path(),e,h())}}(e.routerState,l[t-1]||e.routerState.base,qn((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},u=0,h=o.length;ue())),s&&a?s:(t=l[0],l)})));return qn((()=>n()&&t))()}var qn=e=>()=>fn(zr,{get when(){return e()},keyed:!0,children:e=>fn(Dn.Provider,{value:e,get children(){return e.outlet()}})}),Jn=e=>{var t=dr((()=>e.children));return Nr(e,{get children(){return t()}})};function eo(e,t){var r=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}(`#${e}`);r?r.scrollIntoView():t&&window.scrollTo(0,0)}var to=new Map;function ro(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),s={};function a(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var r=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(r&&(!t||r.hasAttribute("link"))){var n="http://www.w3.org/2000/svg"===r.namespaceURI,i=n?r.href.baseVal:r.href;if(!(n?r.target.baseVal:r.target)&&(i||r.hasAttribute("state"))){var s=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||s&&s.includes("external"))){var a=n?new URL(i,document.baseURI):new URL(i);if(!(a.origin!==window.location.origin||o&&a.pathname&&!a.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,a]}}}}}function l(e){var t=a(e);if(t){var r=x(t,2),o=r[0],s=r[1],l=n.parsePath(s.pathname+s.search+s.hash),d=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:d&&JSON.parse(d)})}}function d(e){var t=a(e);if(t){var r=x(t,2),o=r[0],i=r[1];s[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function u(e){var t=a(e);if(t){var r=x(t,2),o=r[0],i=r[1];s[i.pathname]||(s[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete s[i.pathname]}),200))}}function h(e){var t=a(e);if(t){var r=x(t,2)[1];s[r.pathname]&&(clearTimeout(s[r.pathname]),delete s[r.pathname])}}function c(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,In);if(!(t=n.parsePath(o.pathname+o.search)).startsWith(r))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=to.get(t);if(i){e.preventDefault();var s=new FormData(e.target);e.submitter&&e.submitter.name&&s.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},s)}}}!function(e,t=window.document){for(var r=t[wn]||(t[wn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",u),document.removeEventListener("mouseout",h),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function no(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=x(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function oo(e){var t=()=>window.location.hash.slice(1),r=Cn();return function(e){var t=!1,r=e=>"string"==typeof e?{value:e}:e,n=function([e,t],r,n){return[r?()=>r(e()):e,n?e=>t(n(e)):t]}($t(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&nr(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Gn({signal:n,create:e.create,utils:e.utils})}({get:t,set({value:e,replace:t,scroll:r,state:n}){t?window.history.replaceState(function(e){return A(A({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");eo(o>=0?e.slice(o+1):"",r),Tn()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=An;Tn();var o=null==n?null:An-n;r?r=!1:o&&t(o)?(r=!0,window.history.go(-o)):e()}}(e,(e=>!r.confirm(e&&e<0?e:t()))),n.addEventListener(o,i),()=>n.removeEventListener(o,i);var n,o,i},create:ro(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:no,beforeLeave:r}})(e)}var io=nr;function so(e,t=or()){var r,n,o=0;return()=>(o++,nr((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Kt((t=>r=e(n=t)),t),r)}var ao=so((()=>{var e,t,r,n,o=x($t(null),2),i=o[0],s=o[1];return e=window,t="keydown",r=e=>{s(e),setTimeout((()=>s(null)))},e.addEventListener(t,r,n),io(e.removeEventListener.bind(e,t,r,n)),i}));function lo(e){return"function"==typeof e}var uo,ho={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},co=x($t([]),2),fo=co[0],po=co[1],vo=e=>{var t=ao();if(e)for(var r=function(){var e,t=x(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{ho[e]=r})):ho[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),lo(n.onFocus)&&n.onFocus.call(n,e,t)),o.push(n),n=n.parent;return r.forEach((r=>{o.includes(r)||(r.states.remove("focus"),lo(r.onBlur)&&r.onBlur.call(r,e,t))})),po(o),o}),{defer:!0})),Vt((()=>{var e=t();if(e){var r=ho[e.key]||ho[e.keyCode];er((()=>{var t,n=void 0,o=T(fo());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var s=i[`on${r}`];if(lo(s)&&!0===s.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(lo(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(a){o.e(a)}finally{o.f()}return!1}))}})),fo};function go(e,t){var r,n,o,i,s=t();if(Array.isArray(s))if(2===s.length)r=i=s[0],n=o=s[1];else if(3===s.length)r=s[0],n=o=s[1],i=s[2];else{var a=x(s,4);r=a[0],o=a[1],i=a[2],n=a[3]}else r=o=i=n=s;e.onBeforeLayout=(t,s)=>{if(s){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var a=e.children[0];a&&(a.x=n,a.marginLeft=n);var l=0;e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i}}}function mo(e){return new Promise((t=>{setTimeout(t,e)}))}function xo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var s=new SpeechSynthesisUtterance(e);s.lang=r,s.onend=()=>{o()},s.onerror=e=>{i(e)},t.push(s),n.speak(s)}))}function yo(e,t,r=!0){var n=window.speechSynthesis,o=function(e=[]){var t,r=[];for(t=0;t0)){e.next=46;break}return e.prev=20,e.next=23,xo(r,s,t);case 23:d=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return d--,console.warn(`Speech synthesis network error. Retries left: ${d}`),e.next=34,mo(500*(l-d));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}d=0,e.next=41;break;case 40:throw new Error(`SpeechSynthesisErrorEvent: ${e.t0.error}`);case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof r){e.next=55;break}return u=yo(r(),t,!1),i.push(u),e.next=53,u.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return h=yo(r,t,!1),i.push(h),e.next=60,h.series;case 60:e.next=1;break;case 62:return e.prev=62,a=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return a},append:e=>{o.push(e)},cancel:()=>{a&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),a=!1)}}}function bo(e,t="en-US"){return uo&&uo.cancel(),uo=yo(e,t)}var wo,So,Ao=(e,t)=>{var r,n=()=>clearTimeout(r);or()&&nr(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},Co=[],To=!1;function _o(e,t){var r,n=Ao(e,t),o=e=>{r=e,n(e)};return o.flush=()=>{n.clear(),e(r)},o.clear=n.clear,o}function ko(e){return e.id||e.name}function Io(e=[]){if(Bo.onFocusChange&&Bo.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!Co.includes(e)));if(wo(),t||!Bo.onFocusChange){Co=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([ko(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([ko(t),"Title",t.title]),n.push(t.title)):e.push([ko(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([ko(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([ko(t),"No Context",""]),e)),o),Bo.debug&&console.table(o),n.length?Bo.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}Bo.onFocusChange([])}}var Bo={debug:!1,enabled:!0,cancel:function(){So&&So.cancel()},clearPrevFocus:function(e=0){Co=Co.slice(0,e),wo()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;Bo.onFocusChange&&Bo.enabled&&(Bo.onFocusChange.flush(),t&&So&&So.active?So.append(e):(Bo.cancel(),function(e){if(!To)So=bo(e)}(e)),r&&(To=!0,null===(n=So)||void 0===n||n.series.finally((()=>{To=!1,Bo.refresh()})).catch(console.error)));return So},refresh:function(e=0){Bo.clearPrevFocus(e),Bo.onFocusChange&&Bo.onFocusChange(er((()=>fo())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){Bo.onFocusChange=_o(Io,e),wo=_o((()=>{Co=[]}),t)}};var Ro,Eo,No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,jo,Ho,Qo,Ko,$o,Xo=x($t(""),2),Go=Xo[0],Vo=Xo[1],Zo={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAA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=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLA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BRgPDezdnHvPr+alV2EiaL0DlF2Dbn20bdB40XtHwQ5nOHqAC0SyCjEM1Wkv57AqACkRvBvB2p7hrDzI6yzU7s90EUPNBxtnR4SjwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function qo(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};return Vt(tr(Go,(i=>{!function(i){i.startsWith("#")?(e.color=bn(i),e.src="",e.alpha=1,n=1,t.alpha=0,r.alpha=0):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,n=1):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),e.animate({alpha:0},o).start()):2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start()))}(i)}),{defer:!0})),fn(an,{width:1920,height:1080,zIndex:-5,get children(){return[fn(an,{ref(t){"function"==typeof e?e(t):e=t},style:i}),fn(an,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),fn(an,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return bn(Zo.color.materialBrand)},width:1920,height:1080})]}})}var Jo={equals:(e,t)=>e===t},ei=vi,ti=1,ri=2,ni=null,oi=null,ii=null,si=null,ai=null,li=0;function di(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Jo,t):Jo).equals||void 0};return[ui.bind(r),e=>("function"==typeof e&&(e=e(r.value)),hi(r,e))]}function ui(){if(this.sources&&this.state)if(this.state===ti)ci(this);else{var e=si;si=null,pi((()=>gi(this)),!1),si=e}if(ii){var t=this.observers?this.observers.length:0;ii.sources?(ii.sources.push(this),ii.sourceSlots.push(t)):(ii.sources=[this],ii.sourceSlots=[t]),this.observers?(this.observers.push(ii),this.observerSlots.push(ii.sources.length-1)):(this.observers=[ii],this.observerSlots=[ii.sources.length-1])}return this.value}function hi(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&pi((()=>{for(var t=0;t1e6)throw si=[],new Error}),!1)),t}function ci(e){if(e.fn){xi(e);var t=li;!function(e,t,r){var n,o=ni,i=ii;ii=ni=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=ti,e.owned&&e.owned.forEach(xi),e.owned=null),e.updatedAt=r+1,yi(s)}finally{ii=i,ni=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?hi(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function fi(e){if(0!==e.state){if(e.state===ri)return gi(e);if(e.suspense&&function(e){if(null===ii)return e();var t=ii;ii=null;try{return e()}finally{ii=t}}(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===ti)ci(e);else if(e.state===ri){var n=si;si=null,pi((()=>gi(e,t[0])),!1),si=n}}}function pi(e,t){if(si)return e();var r=!1;t||(si=[]),ai?r=!0:ai=[],li++;try{var n=e();return function(e){si&&(vi(si),si=null);if(e)return;var t=ai;ai=null,t.length&&pi((()=>ei(t)),!1)}(r),n}catch(o){r||(ai=null),si=null,yi(o)}}function vi(e){for(var t=0;t=0;t--)xi(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function yi(e,t=ni){var r=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw r}function bi(e){if(!e||!e[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");var t,r={},n=T(e);try{for(n.s();!(t=n.n()).done;){var o=x(t.value,2),i=o[0],s=o[1];r[i]=s}}catch(a){n.e(a)}finally{n.f()}return r}var wi=["focus","disabled"],Si=["brand","inverse","neutral"];function Ai({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=wi,toneKeys:s=Si},a=!1){var l=t=>bi(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,bi(Object.entries(n).map((([e,t])=>{var r=l(t);return Object.entries(t).filter((([e,t])=>i.includes(e))).forEach((([e,t])=>{r[e]=l(t)})),[e,r]}))));a&&console.log(d);var u=((e,t)=>A(A({},e),t.base))(e,d);a&&console.log(u);var h=((e,t)=>bi(i.map((r=>[r,A(A({},null==e?void 0:e[r]),null==t?void 0:t[r])]))))(t,d);a&&console.log(h);var c=((e,t,r)=>bi(s.map((n=>{var o,s,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(s=null==t?void 0:t[n])&&void 0!==s?s:{}].map(Object.keys))).forEach((r=>{var o,s,l;i.includes(r)||(a[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(s=null==e?void 0:e[n])?void 0:s[r])})),i.forEach((o=>{var i,s;a[o]=A(A(A({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(s=null==t?void 0:t[n])?void 0:s[o])})),[n,a]}))))(r,d,h);return a&&console.log(c),{base:A(A({},u),h),tones:c}})(t,r,n)}function Ci(e=0){return(t,r,n=0,o)=>{var i,s,a;if(0!==t.children.length){var l="row"===t.flexDirection?"width":"height",d="row"===t.flexDirection?"x":"y",u=t.gap||0,h=t.scroll||"auto",c=function(e){var t,r;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},r=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},r=e.height);return[t,r]}(t),f=x(c,2),p=f[0],v=f[1],g=null!==(i=t[d])&&void 0!==i?i:0,m=null!==(s=null==r?void 0:r[d])&&void 0!==s?s:0,y=null!==(a=null==r?void 0:r[l])&&void 0!==a?a:0,b=void 0===o?"none":n>o?"positive":"negative",w=g;if("auto"===h)null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(w="positive"===b?g-y-u:g+y+u):(Math.abs(g)+vm)w=-m+e;else if("edge"===h&&"positive"===b&&Math.abs(g)+v{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return 1===t.length?t[0]:function(...e){var r,n,o=T(t);try{for(o.s();!(n=o.n()).done;){if(!0===(r=n.value.apply(this,e)))return r}}catch(i){o.e(i)}finally{o.f()}return r}};function _i(){if(!this||void 0===this.selected||0===this.children.length)return!1;for(var e=this.children[this.selected];null==e?void 0:e.skipFocus;)this.selected++,e=this.children[this.selected];return e instanceof qr&&(e.setFocus(),!0)}function ki(e){return function(){var t,r,n,o=this.children.length,i=this.wrap,s=this.selected||0;if(0===o)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=s,null==(n=this.children[this.selected])?void 0:n.states.has("focus")))return!1;var a=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,a,this.selected,s),this.plinko&&void 0!==s){var l=this.children[s].selected||0;a.selected=lfn(an,xn(e,{get style(){var t,r;return[...[e.style].flat(),null==(r=Xi.Container.tones)?void 0:r[null!==(t=e.tone)&&void 0!==t?t:Xi.tone],Xi.Container.base]},forwardStates:!0,get children(){return fn(sn,{get style(){var t,r;return[...[null==(r=e.style)?void 0:r.Text].flat(),Xi.Text.tones[null!==(t=e.tone)&&void 0!==t?t:Xi.tone],Xi.Text.base]},get children(){return e.children}})}})),Vi=(null==(Lo=Zo)?void 0:Lo.componentConfig).Checkbox,Zi=void 0===Vi?{styles:{}}:Vi,qi=(Zi.defaultTone,m(Zi,o)),Ji=Zo.stroke.sm,es=Zo.spacer.xxl,ts={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:es,height:es,display:"flex",justifyContent:"center",color:Zo.color.fillNeutral,alignItems:"center",borderRadius:es/4,border:{color:Zo.color.strokeInverse,width:Ji}},modes:{disabled:{alpha:Zo.alpha.inactive}},tones:{brand:{borderRadius:es/4,border:{color:Zo.color.strokeNeutralSecondary,width:Ji},color:Zo.color.fillNeutralSecondary,checked:{borderRadius:es/4,border:{color:Zo.color.strokeNeutralSecondary,width:Ji},color:Zo.color.fillBrand}},neutral:{borderRadius:es/4,border:{color:Zo.color.strokeNeutralSecondary,width:Ji},color:Zo.color.fillInverseSecondary,checked:{borderRadius:es/4,border:{color:Zo.color.strokeNeutralSecondary,width:Ji},color:Zo.color.fillNeutral}},inverse:{borderRadius:es/4,border:{color:Zo.color.strokeInverseSecondary,width:Ji},color:Zo.color.fillNeutralSecondary,checked:{borderRadius:es/4,border:{color:Zo.color.strokeInverseSecondary,width:Ji},color:Zo.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:qi},rs={themeKeys:{color:"color"},base:{width:Zo.spacer.lg,height:Zo.spacer.lg,src:Zo.asset.check},tones:{neutral:{color:Zo.color.fillInverse},inverse:{color:Zo.color.fillNeutral},brand:{color:Zo.color.fillInverse}},themeStyles:qi};Ai(ts),Ai(rs);var ns=(null==(zo=Zo)?void 0:zo.componentConfig).Icon,os=void 0===ns?{styles:{}}:ns,is=(os.defaultTone,m(os,i));Ai({themeKeys:{color:"color"},base:{width:100,height:100,color:Zo.color.fillInverse},tones:{inverse:{color:Zo.color.fillInverse},brand:{color:Zo.color.fillBrand}},themeStyles:is});var ss=(null==(Mo=Zo)?void 0:Mo.componentConfig).Column,as=void 0===ss?{styles:{}}:ss,ls=as.defaultTone,ds=m(as,s),us={tone:ls||"neutral",Container:Ai({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:Zo.layout.gutterY,itemTransition:A(A({},Zo.animation.standardEntrance),{},{duration:Zo.animation.duration.fast})},themeStyles:ds})},hs=e=>{var t=ki("up"),r=ki("down");return fn(an,xn(e,{get onUp(){return Ti(e.onUp,t)},get onDown(){return Ti(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:_i,get onCreate(){return Ti((t=>{var r,n;return Ci(e.y).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return Ti(e.onSelectedChanged,"none"!==e.scroll?Ci(e.y):void 0)},get style(){var t;return[...[e.style].flat(),us.Container.tones[null!==(t=e.tone)&&void 0!==t?t:us.tone],us.Container.base]}}))},cs=(null==(Po=Zo)?void 0:Po.componentConfig).Label,fs=void 0===cs?{styles:{}}:cs,ps=(fs.defaultTone,m(fs,a)),vs={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Zo.color.textNeutral,padding:[Zo.spacer.md,Zo.spacer.lg],borderRadius:[Zo.radius.md,Zo.radius.md,Zo.radius.md,Zo.radius.none],height:Zo.typography.caption1.lineHeight+Zo.spacer.md,neutral:{backgroundColor:Zo.color.fillNeutral}},tones:{inverse:{color:Zo.color.fillInverse},brand:{color:Zo.color.fillBrand,focus:{color:Zo.color.orange}}},themeStyles:ps},gs={themeKeys:{color:"textColor"},base:A(A({},Zo.typography.caption1),{},{color:Zo.color.textInverse}),tones:{inverse:{color:Zo.color.textNeutral},brand:{color:Zo.color.textNeutral}},themeStyles:ps};Ai(vs),Ai(gs);var ms=(null==(Do=Zo)?void 0:Do.componentConfig).Rating,xs=void 0===ms?{styles:{},defaultTone:"neutral"}:ms,ys=xs.styles,bs=(xs.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Zo.spacer.sm},toneModes:{},themeStyles:ys}),ws={themeKeys:{color:"textColor"},base:A({color:Zo.color.textNeutral},Zo.typography.body2),toneModes:{},themeStyles:ys},Ss={themeKeys:{color:"color"},base:{height:Zo.typography.body2.lineHeight,width:Zo.typography.body2.lineHeight,color:Zo.color.fillNeutral,marginRight:Zo.spacer.sm},toneModes:{},themeStyles:ys};Ai(bs),Ai(Ss),Ai(ws);var As=(null==(Oo=Zo)?void 0:Oo.componentConfig).Details,Cs=void 0===As?{styles:{}}:As,Ts=(Cs.defaultTone,m(Cs,l)),_s={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Zo.spacer.lg,badgeContentSpacing:Zo.spacer.sm,ratingContentSpacing:Zo.spacer.lg},themeStyles:Ts},ks={themeKeys:{color:"textColor"},base:A(A({},Zo.typography.body2),{},{marginRight:Zo.spacer.lg,color:Zo.color.textNeutral}),tones:{neutral:{disabled:{color:Zo.color.textNeutralDisabled}},inverse:{color:Zo.color.textInverse,disabled:{color:Zo.color.textNeutralDisabled}},brand:{color:Zo.color.textNeutral,disabled:{color:Zo.color.textNeutralDisabled}}},themeStyles:Ts};Ai(_s),Ai(ks);var Is=(null==(Uo=Zo)?void 0:Uo.componentConfig).Metadata,Bs=void 0===Is?{styles:{}}:Is,Rs=(Bs.defaultTone,m(Bs,d)),Es={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Zo.alpha.primary},modes:{disabled:{alpha:Zo.alpha.inactive}},themeStyles:Rs},Ns={themeKeys:{color:"textColor"},base:A(A({maxLines:1,contain:"width"},Zo.typography.headline3),{},{color:Zo.color.textNeutral}),tones:{neutral:{disabled:{color:Zo.color.textNeutralDisabled}},inverse:{color:Zo.color.textInverse,disabled:{color:Zo.color.textNeutralDisabled}},brand:{color:Zo.color.textNeutral,disabled:{color:Zo.color.textNeutralDisabled}}},themeStyles:Rs},Fs={themeKeys:{color:"textColor"},base:A(A({contain:"width",maxLines:2},Zo.typography.body2),{},{color:Zo.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Zo.color.textNeutralDisabled}},inverse:{color:Zo.color.textInverseSecondary,disabled:{color:Zo.color.textNeutralDisabled}},brand:{color:Zo.color.textNeutralSecondary,disabled:{color:Zo.color.textNeutralDisabled}}},themeStyles:Rs};Ai(Es),Ai(Fs),Ai(Ns);var Ls=(null==(Wo=Zo)?void 0:Wo.componentConfig).ProgressBar,zs=void 0===Ls?{styles:{}}:Ls,Ms=(zs.defaultTone,m(zs,u)),Ps={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Zo.spacer.md,color:Zo.color.fillNeutralTertiary,borderRadius:Zo.radius.xs},tones:{inverse:{color:Zo.color.fillInverseTertiary}},themeStyles:Ms},Ds={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Zo.radius.xs,color:Zo.color.fillNeutral},tones:{inverse:{color:Zo.color.fillInverse},brand:{color:Zo.color.fillBrand}},themeStyles:Ms};Ai(Ps),Ai(Ds);var Os=(null==(Yo=Zo)?void 0:Yo.componentConfig).Row,Us=void 0===Os?{styles:{}}:Os,Ws=Us.defaultTone,Ys=m(Us,h),js={tone:Ws,Container:Ai({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:Zo.layout.gutterX,itemTransition:A(A({},Zo.animation.standardEntrance),{},{duration:Zo.animation.duration.fast})},themeStyles:Ys})},Hs=e=>{var t=ki("left"),r=ki("right");return fn(an,xn(e,{get selected(){return e.selected||0},get onLeft(){return Ti(e.onLeft,t)},get onRight(){return Ti(e.onRight,r)},forwardFocus:_i,get onCreate(){return Ti((t=>{var r,n;return Ci(e.x).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return Ti(e.onSelectedChanged,"none"!==e.scroll?Ci(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:js.tone},get style(){return[...[e.style].flat(),js.Container.tones[e.tone||js.tone],js.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:js.tone}}))},Qs=(null==(jo=Zo)?void 0:jo.componentConfig).Keyboard,Ks=void 0===Qs?{styles:{}}:Qs,$s=(Ks.defaultTone,m(Ks,c)),Xs={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Zo.spacer.md,screenW:Zo.layout.screenW,marginX:Zo.layout.marginX,height:100},themeStyles:$s},Gs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Zo.spacer.md,height:9*Zo.spacer.md,paddingX:Zo.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Zo.color.fillNeutral,padding:[Zo.spacer.xxxl,Zo.spacer.xl],baseWidth:7*Zo.spacer.md,color:Zo.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Zo.radius.sm},modes:{focus:{color:Zo.color.interactiveNeutralFocus,contentColor:Zo.color.fillInverse},disabled:{color:Zo.color.fillNeutralDisabled,contentColor:Zo.color.fillNeutralDisabled}},tones:{inverse:{color:Zo.color.interactiveInverse,focus:{color:Zo.color.interactiveInverseFocus,contentColor:Zo.color.fillNeutral}},brand:{focus:{contentColor:Zo.color.fillNeutral}}},themeStyles:$s},Vs={themeKeys:{color:"textColor"},base:A({textAlign:"left",color:Zo.color.textNeutral},Zo.typography.headline2),modes:{focus:{color:Zo.color.textInverse},disabled:{color:Zo.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Zo.color.textNeutral}}},themeStyles:$s};Ai(Xs),Ai(Gs),Ai(Vs);var Zs=(null==(Ho=Zo)?void 0:Ho.componentConfig).Key,qs=void 0===Zs?{styles:{}}:Zs,Js=(qs.defaultTone,m(qs,f)),ea={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Zo.spacer.md,height:9*Zo.spacer.md,paddingX:Zo.spacer.md,contentColor:Zo.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Zo.spacer.md],baseWidth:7*Zo.spacer.md,color:Zo.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Zo.radius.sm},modes:{focus:{color:Zo.color.interactiveNeutralFocus,contentColor:Zo.color.fillInverse},disabled:{color:Zo.color.fillNeutralDisabled,contentColor:Zo.color.fillNeutralDisabled}},tones:{inverse:{color:Zo.color.interactiveInverse,focus:{color:Zo.color.interactiveInverseFocus,contentColor:Zo.color.fillNeutral}},brand:{focus:{contentColor:Zo.color.fillNeutral}}},themeStyles:Js},ta={themeKeys:{color:"textColor"},base:A({textAlign:"left",color:Zo.color.textNeutral},Zo.typography.headline2),modes:{focus:{color:Zo.color.textInverse},disabled:{color:Zo.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Zo.color.textNeutral}}},themeStyles:Js};Ai(ea),Ai(ta);var ra=(null==(Qo=Zo)?void 0:Qo.componentConfig).Input,na=void 0===ra?{styles:{}}:ra,oa=(na.defaultTone,m(na,p)),ia={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:oa},sa={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:function(e,t=1){var r=e.layout.screenW,n=e.layout.columnCount,o=e.layout.marginX,i=e.layout.gutterX;if(!(t<1||t>n))return(r-2*o-(t-1)*i)/t;console.error(`Column expects a number between 1 & ${n}. Received ${t}`)}(Zo,4),height:100,display:"flex",flexDirection:"column",padding:[Zo.spacer.xxxl,Zo.spacer.xl],color:Zo.color.interactiveNeutral,contentColor:Zo.color.fillInverse,borderRadius:Zo.radius.sm,marginX:Zo.spacer.xxxl},modes:{focus:{color:Zo.color.interactiveNeutralFocus},disabled:{color:Zo.color.fillNeutralDisabled}},tones:{inverse:{color:Zo.color.interactiveInverse},brand:{color:Zo.color.interactiveBrand,focus:{color:Zo.color.fillNeutral}}},themeStyles:oa},aa={themeKeys:{color:"textColor"},base:A({textAlign:"left",color:Zo.color.textNeutral},Zo.typography.button1),themeStyles:oa};Ai(ia),Ai(sa),Ai(aa);var la=(null==(Ko=Zo)?void 0:Ko.componentConfig).Tile,da=void 0===la?{styles:{}}:la,ua=(da.defaultTone,m(da,v)),ha=(null==($o=Zo)?void 0:$o.componentConfig).Surface,ca=void 0===ha?{styles:{}}:ha,fa=(ca.defaultSurfaceTone,m(ca,g)),pa={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Zo.spacer.xl,paddingYBetweenContent:Zo.spacer.md,borderRadius:Zo.radius.md,alpha:Zo.alpha.primary},modes:{disabled:{alpha:Zo.alpha.inactive}},themeStyles:A(A({},fa),ua)},va={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:ua},ga={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:ua},ma={themeKeys:{},base:{width:5*Zo.spacer.lg,height:Zo.spacer.xxl+Zo.spacer.md},themeStyles:ua};Ai(pa),Ai(va),Ai(ga),Ai(ma);var xa={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},ya={x:10,fontSize:22,textColor:bn("#f6f6f6")},ba={fontSize:22,textColor:bn("#f6f6f6")},wa=x(di(0),2),Sa=wa[0],Aa=wa[1],Ca=x(di(0),2),Ta=Ca[0],_a=Ca[1],ka=x(di(99),2),Ia=ka[0],Ba=ka[1],Ra=x(di(0),2),Ea=Ra[0],Na=Ra[1],Fa=x(di(0),2),La=Fa[0],za=Fa[1],Ma=x(di(0),2),Pa=Ma[0],Da=Ma[1],Oa=x(di(0),2),Ua=Oa[0],Wa=Oa[1],Ya=0,ja=0;function Ha(e){e.renderer.on("fpsUpdate",((e,t)=>{var r,n,o,i,s="number"==typeof t?t:t.fps;s>5&&((e=>{e&&(Aa(e),Ba((t=>Math.min(e,t))),Na((t=>Math.max(e,t))),ja+=e,Ya++,_a(Math.round(ja/Ya)))})(s),r=e.root.stage,n=0,o=0,i=0,r.txManager.textureIdCache.forEach(((e,t,r)=>{"loaded"===e.state&&n++,"loading"===e.state&&o++,"failed"===e.state&&i++})),za(n),Da(o),Wa(i))}))}var Qa=e=>fn(an,xn(e,{style:xa,get children(){return[fn(an,{get children(){return[fn(sn,{style:ya,children:"FPS:"}),fn(sn,{style:ba,x:90,get children(){return Sa()}})]}}),fn(an,{x:160,get children(){return[fn(sn,{style:ya,children:"AVG:"}),fn(sn,{style:ba,x:100,get children(){return Ta()}})]}}),fn(an,{x:0,y:20,get children(){return[fn(sn,{style:ya,children:"MIN:"}),fn(sn,{style:ba,x:90,get children(){return Ia()}})]}}),fn(an,{x:160,y:20,get children(){return[fn(sn,{style:ya,children:"MAX:"}),fn(sn,{style:ba,x:100,get children(){return Ea()}})]}}),fn(an,{x:0,y:50,get children(){return[fn(sn,{style:ya,children:"Loaded Textures Cnt:"}),fn(sn,{style:ya,x:270,get children(){return La()}})]}}),fn(an,{x:0,y:80,get children(){return[fn(sn,{style:ya,children:"Loading Textures Cnt:"}),fn(sn,{style:ya,x:270,get children(){return Pa()}})]}}),fn(an,{x:0,y:110,get children(){return[fn(sn,{style:ya,children:"Failed Textures Cnt:"}),fn(sn,{style:ya,x:270,get children(){return Ua()}})]}})]}})),Ka={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:Zo.layout.marginX}},Gradient:{zIndex:99,color:bn("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:bn("#424242")},active:{width:328,height:70}}},$a="/solid-demo-app/",Xa=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Ga(e){var t,r,n,o=(t=$a+"assets/icons_white.png",r=Xa,n=Mr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,s=t.height;return e[t.name]=Mr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:s}),e}),{}));return fn(an,xn(e,{get texture(){return o[e.name]},get width(){return o[e.name].props.width},get height(){return o[e.name].props.height},get x(){return(100-(o[e.name].props.width||0))/2},get y(){return(100-(o[e.name].props.height||0))/2}}))}function Va(e){return fn(an,xn(e,{forwardStates:!0,get style(){return Ka.NavButton},get children(){return[fn(an,{y:-16,get children(){return fn(Ga,{scale:.5,get name(){return e.icon}})}}),fn(sn,{get style(){return A(A({},Zo.typography.button1),{},{fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}})},get children(){return e.children}})]}}))}function Za(e){var t,r=Un();function n(t){var n,o,i,s;if((n=()=>t,i=Wn(),s=Zt((()=>zn(n()).map((e=>Nn(e,void 0,o))))),Zt((()=>{var e,t=T(s());try{for(t.s();!(e=t.n()).done;){var r=(0,e.value)(i.pathname);if(r)return r}}catch(n){t.e(n)}finally{t.f()}})))())return e.focusPage();r(t)}return[fn(an,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return e.showWidgets?1:0},get children(){return[fn(sn,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),fn(an,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),fn(hs,xn(e,{onFocus:function(){t.states.add("focus"),this.children.forEach((e=>e.states.add("active"))),this.children.selected.setFocus()},onBlur:function(){t.states.remove("focus"),this.selected=0,this.children.forEach((e=>e.states.remove("active")))},get style(){return Ka.Column},scroll:"none",get children(){return[fn(Va,{onEnter:()=>n("/browse/all"),icon:"trending",children:"Trending"}),fn(Va,{icon:"movie",onEnter:()=>n("/browse/movie"),children:"Movies"}),fn(Va,{icon:"tv",onEnter:()=>n("/browse/tv"),children:"TV"}),fn(Va,{icon:"experiment",onEnter:()=>n("/examples"),children:"Examples"})]}})),fn(an,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ka.Gradient}})]}var qa=e=>{vo({Announcer:"a",Menu:"m",Escape:"Escape",Backspace:"Backspace"});var t=(Bo.setupTimers(),Vt(tr(fo,Bo.onFocusChange,{defer:!0})),Bo);t.enabled=!1;var r,n,o=Un();function i(){return!r.states.has("focus")&&(n=$r(),r.setFocus())}rr((()=>{Ha({renderer:Mr})}));var s=x($t(!0),2),a=s[0],l=s[1],d=Wn(),u=["/browse","/entity"];return Vt((()=>{var e=d.pathname,t=u.some((t=>e.startsWith(t)));"/"===e&&(t=!0),l(t)})),fn(an,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[fn(qo,{}),fn(Qa,{mountX:1,x:1910,y:10,get alpha(){return a()?1:0}}),cn((()=>e.children)),fn(Za,{ref(e){"function"==typeof r?r(e):r=e},focusPage:()=>n.setFocus(),get showWidgets(){return a()}})]}})},Ja={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:Zo.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:bn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:bn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:bn("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:bn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:Zo.layout.screenW-2*Zo.layout.marginX,x:Zo.layout.marginX+Zo.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:bn("#0000ff")},peopleBio:A(A({},Zo.typography.body1),{},{contain:"both",width:780,height:340})},el={width:120,height:40,color:bn("#000000"),borderRadius:8,border:{width:2,color:bn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:bn("#333333")}},transition:{scale:!0,color:!0}},tl={container:el,topBar:{color:bn("#00A699"),height:8,y:2,x:-4,width:el.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:bn("#F6F6F9"),height:el.height,width:el.width}},rl=386,nl=136,ol=(bn("#715cab"),bn("#5a39a2"),bn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:bn("#FFFFFF"),height:nl,width:rl,focus:{fontSize:40},disabled:{color:bn("#909090")}});function il(e){return fn(an,xn(e,{get style(){return Ja.Thumbnail}}))}function sl(e){var t=function(e,...t){if(Nt in e){var r=new Set(t.length>1?t.flat():t[0]),n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},Br)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},Br)),n}var o,i={},s=t.map((()=>({}))),a=T(Object.getOwnPropertyNames(e));try{for(a.s();!(o=a.n()).done;){var l,d=o.value,u=Object.getOwnPropertyDescriptor(e,d),h=!u.get&&!u.set&&u.enumerable&&u.writable&&u.configurable,c=!1,f=0,p=T(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,h?s[f][d]=u.value:Object.defineProperty(s[f],d,u)),++f}catch(v){p.e(v)}finally{p.f()}c||(h?i[d]=u.value:Object.defineProperty(i,d,u))}}catch(v){a.e(v)}finally{a.f()}return[...s,i]}(e,["items"]),r=x(t,2),n=r[0],o=r[1];return fn(Hs,xn(o,{get style(){return Ja.Row},get children(){return fn(Lr,{get each(){return n.items},children:e=>fn(il,e)})}}))}var al,ll,dl="https://api.themoviedb.org/3",ul="w185",hl={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function cl(e,t=ul){return ll+t+e}function fl(e,t={}){return fetch(dl+e,A(A({},hl),t)).then((e=>e.json()))}function pl(){return fl("/configuration").then((e=>{var t;return al=e,ll=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var vl={get:function(e,t={}){return al?fl(e,t):pl().then((()=>fl(e,t)))},loadConfig:pl};function gl(e=[]){return e.map((e=>{return{src:cl(e.poster_path||e.profile_path),tileSrc:cl(e.backdrop_path||e.profile_path,"w300"),backdrop:cl(e.backdrop_path,"w1280"),href:`/entity/${e.media_type||"people"}/${e.id}`,shortTitle:(t=e.title||e.name,r=30,t.length>r?t.substring(0,r-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,r}))}var ml=new Map,xl=new Map;function yl(e){var t=x($t([]),2),r=t[0],n=t[1],o=x($t(1),2),i=o[0],s=o[1],a=x($t(!1),2),l=a[0],d=a[1],u=x(qt(i,e),1)[0];return Xt((()=>{var e=u();e&&vr((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:s,setPages:n,end:l,setEnd:d}}var bl=900,wl=A(A({},Zo.typography.display2),{},{maxLines:1,width:bl,contain:"width"}),Sl=e=>fn(sn,xn(e,{style:wl})),Al=A(A({},Zo.typography.body1),{},{lineHeight:32,width:bl,maxLines:3,contain:"width"}),Cl={fontSize:16,lineHeight:20},Tl=e=>fn(sn,xn(e,{style:Al,get children(){return e.children}})),_l=e=>{return t=pn("node"),yn(go,t,(()=>[8,13,11,13])),gn(t,xn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),vn(t,fn(sn,{style:Cl,get children(){return e.children}})),t;var t},kl=Zo.typography.body2,Il=e=>fn(an,{style:{display:"flex",flexDirection:"row",gap:18,width:bl,height:48},get children(){return[fn(an,{y:-4,src:"./assets/stars.png",width:188,height:31}),fn(an,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*e.voteAverage/10},height:31,get children(){return fn(an,{src:"./assets/stars-full.png",width:188,height:31})}}),fn(sn,{style:kl,get children(){return[cn((()=>e.voteCount))," reviews"]}}),fn(sn,{style:kl,get children(){return e.metaText}}),fn(Lr,{get each(){return e.badges},children:e=>fn(_l,{y:-5,children:e})})]}}),Bl=e=>fn(an,xn(e,{style:{display:"flex",flexDirection:"column",width:bl,height:220,gap:16},get children(){return[fn(Sl,{get children(){return e.title}}),fn(Tl,{get children(){return e.description}}),fn(zr,{get when(){return e.voteCount},get children(){return fn(Il,{get metaText(){return e.metaText},get badges(){return e.badges},get voteCount(){return e.voteCount},get voteAverage(){return e.voteAverage}})}})]}}));function Rl(e){return e.split("-")[0]}function El({type:e,id:t}){return vl.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?gl(t.slice(0,7)):vl.get(`/trending/${e}/week?page=1`).then((({results:e})=>gl(e.slice(0,7))))))}function Nl({type:e,id:t}){return vl.get(`/${e}/${t}/credits`).then((({cast:e})=>gl(e.slice(0,7))))}function Fl({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return vl.get(`/${e}/${t}`).then((t=>{return A({backgroundImage:cl(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:"movie"===e?(i=t.runtime,s=i%60,Math.floor(i/60)+"h "+(s<10?"0":"")+s+"min "+(n=t.release_date,o=n.split("-"),o[1]+"/"+o[2]+"/"+o[0])):`${Rl(t.first_air_date)} - ${Rl(t.last_air_date)}`,reviews:r}},t);var n,o,i,s}))}var Ll=()=>{var e=Yn(),t=x($t(0),2),r=t[0],n=t[1],o=x($t(),2),i=o[0];o[1];qt(i,Fl);var s=x($t({}),2),a=s[0],l=s[1],d=Un(),u=Jt((()=>0)),h=Zt((()=>{return yl((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(ml.has(r))return ml.get(r);var n=vl.get(r).then((e=>{var r=e.results.filter((e=>!e.adult)),n=function(e,t=7){for(var r=[],n=0,o=e.length;nVo(e)),400),f=Ao((e=>l(e)),200);function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),n(-1*(this.y||0)+24);var t=h().pages().length;(0===t||this.parent.selected&&this.parent.selected>=t-2)&&h().setPage((e=>e+1))}function v(){var e=this.children.selected;return _(e&&e.href),d(e.href),!0}return Vt(tr($r,(e=>{e.backdrop&&c(e.backdrop),e.heroContent&&f(e.heroContent)}),{defer:!0})),fn(zr,{get when(){return h().pages().length},get children(){return[fn(Bl,xn({y:360,x:162},a)),fn(an,{clipping:!0,get style(){return Ja.itemsContainer},get children(){return fn(hs,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return Ja.Column},get children(){return fn(Lr,{get each(){return h().pages()},children:(e,t)=>fn(sl,{get autofocus(){return u(t())},items:e,width:1620,onFocus:p,onEnter:v})})}})}})]}})},zl=()=>{var e=Un(),t=Jt((()=>0));function r(){var t=this.children.selected;_(t&&t.id),e("/"+t.id)}var n=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(e){var t=x($t(4294967295),2),r=t[0],n=t[1];return fn(an,xn(e,{onFocus:()=>n(255),onBlur:()=>n(4294967295),style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return fn(an,{x:30,get children(){return[fn(sn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),fn(sn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),fn(sn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=x($t(140),2),s=i[0],a=i[1];function l(e){a(-400*e.selected+140)}return fn(an,{colorTop:1147903743,colorBottom:743406847,get children(){return[fn(an,{x:120,get children(){return[fn(an,{src:"/assets/solidjs.png",width:101,height:90,y:40}),fn(sn,{fontSize:90,x:110,y:40,children:"Examples"}),fn(an,{y:140,height:1,width:1800,color:3906468351})]}}),fn(Hs,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return s()},y:300,width:4400,get style(){return Ja.Row},justifyContent:"flexStart",gap:40,get children(){return fn(Lr,{each:n,children:(e,r)=>fn(o,xn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},Ml=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:bn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:bn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return rr((()=>{Vo("#000000")})),fn(an,{autofocus:!0,style:e,get children(){return[fn(sn,{style:r,children:"Title of the Page"}),fn(sn,{style:n,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),fn(an,{style:t,get children(){return[fn(sn,{style:o,children:"Subline Text"}),fn(an,{width:28,height:28,src:"/assets/rt-popcorn.png"}),fn(sn,{style:o,children:"More Text"})]}})]}})},Pl=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:bn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:bn("00000000")},o={fontSize:42},i={fontSize:26};rr((()=>{Vo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var s=x($t(),2),a=s[0],l=s[1],d=x($t(),2),u=d[0];d[1];setTimeout((()=>{var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var h={width:400,height:300,color:bn("#0000ff")},c={color:bn("#f54242"),focus:{color:bn("#4287f5")}};function f(e){var t=dr((()=>e.children));return fn(an,xn(e,{get style(){return[c,e.style,[h]]},get children(){return[fn(an,{id:"child1",width:100,height:100,get color(){return bn("#ff0000")},y:25,get children(){return[cn((()=>t())),fn(an,{id:"subChild",x:150,width:100,height:100,get color(){return bn("#00ff00")}}),fn(sn,{get children(){return e.title}})]}}),fn(an,{width:100,height:100,get color(){return bn("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:bn("#cccccc"),focus:{color:bn("#000000")}},g={color:bn("#ffffff"),focus:{color:bn("#f6f6cc")}};return fn(an,{style:r,get children(){return[fn(sn,{style:o,children:"Title of the Page"}),fn(an,{style:n,get children(){return[fn(sn,{get children(){return u()}}),fn(sn,{style:i,get children(){return["Sub ",cn((()=>a()))," Text"]}}),fn(zr,{get when(){return a()},get children(){return fn(an,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),fn(sn,{style:i,children:"More Text"})]}}),fn(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[g,v],get children(){return fn(sn,{children:"Child Test"})}}),fn(an,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return bn("#00ff00")},x:900,y:400,get alpha(){return e.states.has("focus")?1:.2}})]}})},Dl=()=>{var e,t,r=x($t([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:bn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},s={fontSize:32,x:960,y:540,mount:.5,lineheight:52},a=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return rr((()=>{Vo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=a(-90,90),e.x=a(-300,2220),e.y=a(-300,1380)}),2500)})),nr((()=>{clearInterval(t)})),fn(an,{get children(){return[fn(sn,{style:s,get children(){return n().join("\n")}}),fn(an,{autofocus:!0,style:i,ref(t){"function"==typeof e?e(t):e=t},onEvents:[["inBounds",e=>l("inBounds")],["outOfBounds",e=>l("outOfBounds")],["inViewport",e=>l("inViewport")],["outOfViewport",e=>l("outOfViewport")]]})]}})},Ol=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:bn("00000000"),gap:26,y:400};function r(e){return fn(an,xn(e,{forwardStates:!0,get style(){return tl.container},get children(){return fn(sn,{get style(){return tl.text},get children(){return e.children}})}}))}var n=e=>{return t=pn("node"),yn(go,t,(()=>[10,15])),gn(t,xn(e,{get style(){return{color:bn("#000000be"),borderRadius:8,border:{width:2,color:bn("#ffffff")}}}}),!0),vn(t,fn(sn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[fn(Hs,{x:100,y:200,gap:5,style:t,get children(){return[fn(n,{children:"HD"}),fn(n,{children:"PG13"}),fn(n,{children:"NC17"}),fn(sn,{fontSize:30,children:"I like bananas"}),fn(n,{children:"DOLBY"})]}}),fn(Hs,{x:100,gap:40,style:t,get children(){return[fn(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),fn(r,{states:{active:!0,disabled:!1},children:"Movies"}),fn(r,{states:"active",children:"Sports"}),fn(r,{states:"disabled",children:"News"})]}})]},Ul=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:bn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return fn(an,xn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=x($t(50),2),o=n[0],i=n[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}rr((()=>{Vo("#333333")}));var a=50;return fn(hs,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return Ja.Column},get children(){return[fn(sn,{style:t,children:"Flex Start"}),fn(Hs,{gap:a,style:e,onFocus:s,get children(){return[fn(r,{autofocus:!0}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(sn,{style:t,children:"Flex Start - Margin Left"}),fn(Hs,{gap:a,style:e,onFocus:s,get children(){return[fn(r,{marginLeft:100}),fn(r,{}),fn(r,{marginLeft:100}),fn(r,{}),fn(r,{})]}}),fn(sn,{style:t,children:"Flex End"}),fn(Hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(sn,{style:t,children:"Flex End - Margin Right"}),fn(Hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[fn(r,{}),fn(r,{marginRight:100}),fn(r,{}),fn(r,{}),fn(r,{marginRight:100})]}}),fn(sn,{style:t,children:"Center - No Margin Support"}),fn(Hs,{gap:a,justifyContent:"center",style:e,onFocus:s,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(sn,{style:t,children:"Space Between - No Margin Support"}),fn(Hs,{gap:a,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(sn,{style:t,children:"Space Evenly - No Margin Support"}),fn(Hs,{gap:a,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}})]}})},Wl=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:bn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return fn(an,xn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=x($t(50),2),i=o[0],s=o[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),s(150+-1*(this.y||0))}rr((()=>{Vo("#333333")}));var l=50;return fn(hs,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return Ja.Column},get children(){return[fn(sn,{style:t,children:"Flex Start - AlignItems: center"}),fn(Hs,{alignItems:"center",gap:l,style:e,onFocus:a,get children(){return[fn(r,{autofocus:!0,get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}}),fn(sn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),fn(Hs,{gap:l,alignItems:"flexStart",style:e,onFocus:a,get children(){return[fn(r,{marginLeft:100,get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{marginLeft:100,get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}}),fn(sn,{style:t,children:"Flex End - AlignItems: flexEnd"}),fn(Hs,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:a,get children(){return[fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}}),fn(sn,{style:t,children:"Flex End - Margin Right"}),fn(Hs,{gap:l,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[fn(r,{get height(){return n()}}),fn(r,{marginRight:100,get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{marginRight:100,get height(){return n()}})]}}),fn(sn,{style:t,children:"Center - No Margin Support"}),fn(Hs,{gap:l,justifyContent:"center",style:e,onFocus:a,get children(){return[fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}}),fn(sn,{style:t,children:"Space Between - No Margin Support"}),fn(Hs,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}}),fn(sn,{style:t,children:"Space Evenly - No Margin Support"}),fn(Hs,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}}),fn(r,{get height(){return n()}})]}})]}})},Yl=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:bn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:bn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:bn("#1769aa")};return fn(an,xn(e,{style:t}))}var n=x($t(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}rr((()=>{Vo("#333333")}));var s=50;return[fn(sn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),fn(Hs,{gap:s,style:e,onFocus:i,get children(){return[fn(hs,{gap:30,style:t,alignItems:"center",get children(){return[fn(r,{autofocus:!0}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,style:t,onFocus:i,alignItems:"flexStart",get children(){return[fn(r,{marginTop:100}),fn(r,{}),fn(r,{marginTop:100}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{marginBottom:100}),fn(r,{}),fn(r,{}),fn(r,{marginBottom:100})]}}),fn(hs,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}})]}})]},jl=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:bn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:bn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:bn("#1769aa")};return fn(an,xn(e,{style:t}))}var n=x($t(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}rr((()=>{Vo("#333333")}));var s=50;return[fn(sn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),fn(Hs,{gap:s,style:e,onFocus:i,get children(){return[fn(hs,{gap:30,style:t,get children(){return[fn(r,{autofocus:!0}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,style:t,onFocus:i,get children(){return[fn(r,{marginTop:100}),fn(r,{}),fn(r,{marginTop:100}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{marginBottom:100}),fn(r,{}),fn(r,{}),fn(r,{marginBottom:100})]}}),fn(hs,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}}),fn(hs,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{}),fn(r,{})]}})]}})]},Hl=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:bn("00000000"),gap:26,y:400,x:100},r={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},n=["RoundedRectangle",{radius:65}];function o(e){return fn(an,xn(e,{forwardStates:!0,style:r,shader:n,get children(){return fn(sn,{style:ol,get children(){return e.children}})}}))}return fn(Hs,{style:t,get children(){return[fn(o,{autofocus:!0,onEnter:e,children:"Focused"}),fn(o,{states:{active:!0,disabled:!1},children:"Normal"}),fn(o,{states:"disabled",children:"Disabled"})]}})},Ql="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Kl(){return(Kl=w(y().mark((function e(){var t,r;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),r=new shaka.Player,e.next=4,r.attach(t);case 4:return window.player=r,r.addEventListener("error",$l),e.prev=6,e.next=9,r.load(Ql);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),Xl(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function $l(e){Xl(e.detail)}function Xl(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Kl.apply(this,arguments)}():console.error("Browser not supported!")}));var Gl=()=>{var e=Yn(),t=Un(),r=x(qt((()=>A({},e)),Fl),1)[0],n=x(qt((()=>A({},e)),Nl),1)[0],o=x(qt((()=>A({},e)),El),1)[0],i=x($t(0),2),s=i[0],a=i[1];Vt(tr(r,(e=>{Vo(e.backgroundImage)}),{defer:!0}));var l,d,u,h=640,c={color:bn("#000000"),alpha:0,width:1900,height:890,x:-160,y:h,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=h,d.y=h,d.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,d.y=160,d.alpha=.9}function v(){var e=this.children.selected;_(e&&e.href),t(e.href)}function g(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),u.setFocus(),a(0)}function m(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();Xr(e),a(.9)}return fn(zr,{get when(){return r()},keyed:!0,get children(){return[fn(an,{x:170,onUp:()=>u.setFocus(),onEscape:g,get children(){return[fn(Bl,xn({y:260},(()=>r().heroContent))),fn(Hs,{ref(e){"function"==typeof u?u(e):u=e},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>l.setFocus(),onEnter:m,get children(){return[fn(Gi,{width:300,autofocus:!0,children:"Play"}),fn(Gi,{width:300,children:"Resume"})]}}),fn(hs,{ref(e){"function"==typeof l?l(e):l=e},x:0,y:h,get style(){return Ja.Column},zIndex:5,get children(){return fn(zr,{get when(){return cn((()=>!!o()))()&&n()},get children(){return[fn(sn,{skipFocus:!0,get style(){return Ja.RowTitle},children:"Recommendations"}),fn(sl,{onFocus:f,onEnter:v,get items(){return o()},width:1620}),fn(sn,{skipFocus:!0,get style(){return Ja.RowTitle},children:"Cast and Crew"}),fn(sl,{onFocus:p,onEnter:v,get items(){return n()},width:1620})]}})}}),fn(an,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),fn(an,{get alpha(){return s()},get color(){return bn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function Vl({id:e}){return vl.get(`/person/${e}/combined_credits`).then((({cast:e})=>gl(e.slice(0,7))))}function Zl({id:e}){return vl.get(`/person/${e}`).then((e=>A({backgroundImage:cl(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var ql=()=>{var e=Yn(),t=Un(),r=x(qt((()=>A({},e)),Zl),1)[0],n=x(qt((()=>A({},e)),Vl),1)[0],o={color:bn("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;_(e&&e.href),t(e.href)}return rr((()=>{Vo("#333333")})),fn(zr,{get when(){return r()},keyed:!0,get children(){return[fn(an,{get src(){return r().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),fn(an,{x:150,y:200,width:800,gap:24,get style(){return Ja.Column},zIndex:3,get children(){return[fn(sn,{contain:"width",get style(){return Zo.typography.display2},get children(){return r().name}}),fn(sn,{contain:"both",get style(){return Ja.peopleBio},get children(){return r().biography}})]}}),fn(an,{style:o}),fn(hs,{y:670,x:140,get style(){return Ja.Column},get children(){return fn(zr,{get when(){return n()},get children(){return[fn(sn,{skipFocus:!0,get style(){return Ja.RowTitle},children:"Credits"}),fn(sl,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},Jl=()=>{return e=pn("node"),mn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},ed=new URL("AppCoreExtensions-legacy-CjL-s2b8.js",S.meta.url).href;Ur.debug=!1,Ur.animationsEnabled=!0,Ur.fontSettings.fontFamily="Ubuntu",Ur.fontSettings.color=bn("#f6f6f6"),Ur.fontSettings.fontSize=32,Ur.rendererOptions={coreExtensionModule:ed,fpsUpdateInterval:200,enableInspector:!0},hn((()=>fn(oo,{root:e=>fn(qa,e),get children(){return[fn(Jn,{path:"",component:Ll}),fn(Jn,{path:"examples",component:zl}),fn(Jn,{path:"browse/:filter",component:Ll}),fn(Jn,{path:"text",component:Ml}),fn(Jn,{path:"buttons",component:Ol}),fn(Jn,{path:"flex",component:Ul}),fn(Jn,{path:"create",component:Pl}),fn(Jn,{path:"viewport",component:Dl}),fn(Jn,{path:"flexsize",component:Wl}),fn(Jn,{path:"flexcolumnsize",component:Yl}),fn(Jn,{path:"flexcolumn",component:jl}),fn(Jn,{path:"buttonsmaterial",component:Hl}),fn(Jn,{path:"entity/people/:id",component:ql}),fn(Jn,{path:"entity/:type/:id",component:Gl}),fn(Jn,{path:"*all",component:Jl})]}})))}}}))}(); +//# sourceMappingURL=index-legacy-DMeX0taR.js.map diff --git a/assets/index-legacy-DMeX0taR.js.map b/assets/index-legacy-DMeX0taR.js.map new file mode 100644 index 0000000..38a61d7 --- /dev/null +++ b/assets/index-legacy-DMeX0taR.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-legacy-DMeX0taR.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.0_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_6vkiwwm6gksv7h5ofy2pmddjzm/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.4_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For as For$1, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgi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KZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEF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gZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, Row, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal, onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n Backspace: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n Backspace: \"Backspace\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { createEffect } from \"solid-js/types/server/reactive.js\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","fontFace","ffs","i","length","_load","fonts","fontSetting","check","load","catch","then","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","WebTrFontFace","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","val","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step6","_iterator6","glyph","mapped","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","descriptors","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","d","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","init","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref13","_props$scaleX","_ref14","_props$scaleY","_props$mount","_ref15","_props$mountX","_ref16","_props$mountY","_props$pivot2","_ref17","_props$pivotX","_ref18","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","temp","tempMatrix","multiply","a","b","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","destroy","removeAllListeners","_this$props2","absX","_this$props$parent","_this$props$parent2","absY","_this$props$parent$ab","_this$props$parent3","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","equalFn$1","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref20","storage","initialValue","setValue","_createSignal$2","setError","_createSignal$3","_createSignal$4","track","trigger","_createSignal$6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal$8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal$10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","_renderProps","_effects","lng","_p$lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_callee8$","_context9","setFocus","forwardFocus","focusedIndex","autofocus","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_iterator15","_step15","found","states","_states","_stateChanged","_animationSettings","_this$parent","onBeforeLayout","display","hasOrder","flexItem","flexOrder","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","flexBoundary","calculatedSize","toPad","calculateFlex","onLayout","forwardStates","_undoStyles","_iterator14","_step14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_autosized","marginBottom","isNaN","onFail","onLoad","onCreate","handler","_node$lng","inode","solid","_loop2","_i17","_LightningRendererNum","_loop3","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref21","_callee9","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step16","defaultPrevented","preventDefault","_iterator16","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useLocation","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step18","_iterator18","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step19","_iterator19","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal$12","isRouting","setIsRouting","_ref22","_callee10","_context11","finish","_x9","_createSignal$14","reference","setReference","_createSignal$16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal$18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal$20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step20","finalFocusElm","_iterator20","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_q","_r","_createSignal$22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","r$","value2","objectFromEntries","_step21","_iterator21","_step21$value","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref24","_ref25","_a2","_b2","_ref26","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_componentRef$axis","_ref27","_ref28","axis","_updateLastIndex","lastItem","updateLastIndex","_updateLastIndex2","rootPosition","selectedPosition","selectedSize","direct","scrollIndex","abs","currentChildIndex","_currentChild$dimensi","chainFunctions","onlyFunctions","func","innerArgs","_step22","_iterator22","onGridFocus","skipFocus","handleNavigation","_c2","onSelectedChanged","plinko","num","_ref29$Artwork","Artwork","_ref29$Artwork2","themeStyles$e","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref30$Badge","Badge","_ref30$Badge2","themeStyles$d","_excluded2","container$e","inverse","brand","text$7","icon$2","_ref31$Button","Button","_ref31$Button2","defaultTone$d","themeStyles$c","_excluded3","_ref32$Surface","Surface","_ref32$Surface2","surfaceDefaultTone","surfaceThemeStyles$1","_excluded4","container$d","contentColor","focus","content","text$6","styles$c","Container","Content","_props$tone","flat","Text$7","_props$tone2","_ref33$Checkbox","Checkbox","_ref33$Checkbox2","themeStyles$b","_excluded5","strokeWidth","container$c","checked","neutral","icon$1","_ref34$Icon","Icon","_ref34$Icon2","themeStyles$a","_excluded6","_ref35$Column","Column","_ref35$Column2","defaultTone$a","themeStyles$9","_excluded7","styles$9","itemTransition","onUp","onDown","_props$selected","_props$selected2","_props$tone3","_ref36$Label","Label","_ref36$Label2","themeStyles$8","_excluded8","container$9","backgroundColor","text$5","_ref37$Rating","Rating","_ref37$Rating2","themeStyles$7","container$8","itemSpacing","toneModes","text$4","_ref38$Details","Details","_ref38$Details2","themeStyles$6","_excluded9","container$7","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$3","_ref39$Metadata","Metadata","_ref39$Metadata2","themeStyles$5","_excluded10","container$6","titleText","descriptionText","_ref40$ProgressBar","ProgressBar","_ref40$ProgressBar2","themeStyles$4","_excluded11","container$5","_ref41$Row","Row","_ref41$Row2","defaultTone$4","themeStyles$3","_excluded12","styles$3","onLeft","onRight","_props$selected3","_props$selected4","_props$tone4","_props$tone5","_ref42$Keyboard","_ref42$Keyboard2","themeStyles$2","_excluded13","container$3","keySpacing","baseWidth","sizes","paddingX","text$2","_ref43$Key","Key","_ref43$Key2","themeStyles$1","_excluded14","container$2","text$1","_ref44$Input","Input","_ref44$Input2","_excluded15","container$1","actualTitle","theme2","upCount","getWidthByUpCount$1","_ref45$Tile","Tile","_ref45$Tile2","tileThemeStyles","_excluded16","_ref46$Surface","_ref46$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded17","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","_createSignal2","setFps","_createSignal4","avgFps","setAvgFps","_createSignal6","minFps","setMinFps","_createSignal8","maxFps","setMaxFps","_createSignal10","isLoadedCount","setIsLoadedCount","_createSignal12","isLoadingCount","setIsLoadingCount","_createSignal14","isFailedCount","setIsFailedCount","totalFps","setupFPS","isLoadedCount2","isLoadingCount2","isFailedCount2","fps2","calcFps","FPSCounter","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","handleNavigate","page","isOnPage","matchers","_step17","_iterator17","focusPage","showWidgets","onEnter","App","Menu","announcer","navDrawer","lastFocused","focusNavDrawer","_createSignal$24","setShowWidgets","showOnPaths","currentPath","matchesPartial","onAnnouncer","onLast","back","onMenu","onBackspace","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal$26","pages","setPages","_createSignal$28","setPage","_createSignal$30","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","voteAverage","voteCount","metaText","badges","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","rtCrit","rtFan","backgroundImage","vote_average","vote_count","minutes","runtime","remainingMinutes","minutesToHMM","release_date","parts","first_air_date","last_air_date","reviews","Browse","_createSignal$32","columnY","setcolumnY","_createSignal$34","entityProvider","_createSignal$36","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","delayedBackgrounds","delayedHero","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal$38","setColor","_createSignal$40","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal$42","insertTest","setInsertTest","_createSignal$44","emptyTest","setEmptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal$46","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal$48","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal$50","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal$52","_this$children$select4","_createSignal$54","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal$56","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","entityActions","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"ugVAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,CAC1B,ECFE,MAAMG,WAAuCL,GAIhDC,WAAAA,CAAYC,EAAiBI,GAAS,IAAAC,EAAAC,EAClCC,MAAMP,GAAiBC,oBAJd,IAAIO,KAAKP,EACIC,KAAA,0BAAA,IAAIO,KAAKR,EAAAC,KAAA,eAAA,GAI/BA,KAAKE,QAAU,CACXM,iCAAwBL,EAAED,EAAQM,gCAAwB,IAAAL,EAAAA,EAAI,IAC9DM,8BAAoE,QAAvCL,EAAEF,EAAQO,qCAA6BL,IAAAA,EAAAA,EAAI,KAI5EM,aAAY,KACR,IAEyDC,EAFnDC,EAAMC,KAAKD,MACXE,EAAcd,KAAKE,QAAQO,8BAA8BM,EAAAC,EAClChB,KAAKiB,yBAAuB,IAAzD,IAAAF,EAAAG,MAAAP,EAAAI,EAAAI,KAAAC,MAA2D,CAAA,IAAhDC,EAAcV,EAAAW,MACjBV,EAAMS,EAAeE,WAAaT,IAClCd,KAAKF,gBAAgBuB,EAAeG,IACpCxB,KAAKyB,WAAWC,OAAOL,EAAeG,IACtCxB,KAAKiB,wBAAwBS,OAAOL,GAE3C,CAAA,CAAAM,MAAAA,GAAAZ,EAAAa,EAAAD,EAAAZ,CAAAA,QAAAA,EAAAc,GACb,IAAW7B,KAAKE,QAAQM,yBACnB,CACDsB,eAAAA,CAAgBC,GAAS,IAAAC,EACfC,EAA2B,QAAlBD,EAAGD,EAAQ7B,eAAO,IAAA8B,OAAA,EAAfA,EAAiBR,GAEnC,GADAU,EAAaD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Yz1B,GAC7Ce,GAAK,CAAC3I,KAAI,iBAAkBgD,UAAW09B,KAAkB94B,GACzDe,GAAK,CAAC3I,KAAI,aAAcgD,UAAWy6B,KAAc71B,GACjDe,GAAK,CAAC3I,KAAI,kBAAmBgD,UAAW29B,KAAmB/4B,GAC3De,GAAK,CAAC3I,KAAI,oBAAqBgD,UAAWo9B,KAAMx4B,GAChDe,GAAK,CAAC3I,KAAI,mBAAoBgD,UAAWg8B,KAAMp3B,GAC/Ce,GAAK,CAAC3I,KAAI,OAAQgD,UAAWq9B,KAAQ","x_google_ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,98,101]} \ No newline at end of file diff --git a/assets/solidWord.png b/assets/solidWord.png new file mode 100644 index 0000000000000000000000000000000000000000..017372991290da19cb686b013097393a5d9ce1cd GIT binary patch literal 12524 zcmZ{K1z1~K({6%06n8D|Qrz9$U5XWVm*7y`U5mTBYw_alZUu@Lx%8a#|KGXab8qrw zuh}#6&aBC-mF#4{;fnGSh;X=Y0000{N>WrA003gY%WN=E??`#80YF^9pJ?wAKpKemzp^rr>K`9403g&70P&BH_WSrpr2BLD z-w`|)_@9WmVE^L{#Lfl(9~r>*2bURxZ}dLE+DmFV0RRkSe_lZMLIGC*0Bp=sRnu8h zPL|um&W6G0vz@UigS(CW9~6Mso%>z1F?BW~cDJ#%b>epCBmK*R`(6H{W+Wy4%f;D> zk5p4mkyyme(Uh2-fr){Mlpl_mn3&h`vl+LtsQ5qd_cK0H3ukA0Zbn8oH#Y`1Rt7sq zb4F$^E-pqU7Dg5p`gad{Cl6a^BX@dRC$hhT{7)QFQzsKgOM7QaJ6qyEagB`aT%7qx zN&h7J-^btcbhb46PbOQZf696kbp-zd%h*#DL1-`f91C^%Z0 zzQ2`!&5Ze&d^%l}V(+=`a&rq-IGmNurgPJgOl`%}&T)AHX)5j$%;M-_V`6I1^8 zM1Mj4rTTC0zw&7PCl3ePztjB7@DGre@lU(|)&9TN)?eE9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^ zgXRi@QDDi%*00OVhSv9N|E!-;VE;9{lz(yx190=vZG-G$H(gc+~4=DvS`CTz%m$wN^~Ov+m6GbY?Eg13&fI+ZA&c560Z$S~1Y zWq9KC*UiJ5^LU4=FMQ~s{+4@tpd;YpVYq$5T*7w9VZ;hc*fw z9g1!TLlg34m7a3Z_aZNG&Fnd;5MWr?RY#A%V&gOqdX^LSf0pUrs(t4a&s G#Qy<9+}51{ literal 0 HcmV?d00001 diff --git a/assets/stars.png b/assets/stars.png new file mode 100644 index 0000000000000000000000000000000000000000..78426f0feeca74ce0fe4f4905a7d2e9d4876610b GIT binary patch literal 2751 zcmZ`*XH-+!8od-{sE#P86r)I)k!Gk;ga;}uMi3R0P#i#lUbIt%D6e)PN_+hVLJpLK*0RV}I_UEjwMCN}f@Jdp4Rqk%pf&B0btJAsXWK_rr zBVrS+u3|VK0h)Ta>H*HV57U_4p^eILE)y+MZ5ciEoj^TAP4sq?qhIs?W54x&g|kqM zbUUqBRJ{1U6Ib@P>|===+A)h~TJ`nUjYHx6ukTu(y1ka)3`fsp#l+UH=j-c(Hh2Ty zG4l2w24|YA?QD}>jrIj967PHBNq>H=cIf;T5Zfx>b3X`jZ>6OptI*===2oXPf2X-BV_WsiKQ7 zzP2u6{ca-q#k*uEV>=N}oJ1m2d7VM4nXWjj@|uG<(aG8FXM{O?joSUE{j`)y)ZqAw_zEcRrwIdSQa;VOuB0=!_qE#bdN?c%wVny z^AcPol*EEvnr1u^YdDJMeDFVS9FMRIwTyuBTlD9;reBn>IS!Rk(rrhp4LUsxILLK^C$I?c za`_Ydua*o=34dNO{Zcf<_SFRAQ%PB?{}eLAGR$mq;8xkbNj4PS3*l77%RDQ38xxZ| zV*%(MT-cBXVz~~zAyGCj%N|4ABqi-Ql;xZ>*-@Cs1zxGKNT8xmbg$LM-5|Xr{;VwD zv$=Qdw#H|R#ujmAeLN&WBLv>vnoF+kG*6K;nH#xOl8TY5YXVmoi*Rj_djwJ#rPt*X z(Zg-}BI!9S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