lecodes-cli 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +958 -119
- package/package.json +13 -12
- package/runtime/sdk-types.json +1 -1
- package/runtime/web/VERSION.json +3 -3
- package/runtime/web/assets/{inspect-C7x78PNs.js → inspect-DdJ50Kun.js} +2 -2
- package/runtime/web/player.js +18 -18
- package/runtime/web-lite/assets/Roboto-Variable-DHm9jpd-.woff2 +0 -0
- package/runtime/web-lite/assets/creatorTween-PF8B6T8V.wasm +0 -0
- package/runtime/web-lite/index.html +23 -0
- package/runtime/web-lite/lite.js +201 -0
- package/src/commands/design/comments.ts +1 -1
- package/src/commands/design/context.ts +1 -1
- package/src/commands/design/index.ts +1 -1
- package/src/commands/dev.ts +17 -53
- package/src/commands/index.ts +2 -0
- package/src/commands/test.ts +55 -6
- package/src/commands/update/index.ts +6 -4
- package/src/commands/web.ts +171 -0
- package/src/compile/fonts.ts +5 -2
- package/src/dev/devServer.ts +20 -1
- package/src/dev/watchProject.ts +53 -0
- package/src/dev/webRunner.ts +10 -0
- package/src/hosts/archives.ts +32 -0
- package/src/hosts/liteBrowser.mjs +86 -0
- package/src/hosts/liteRunner.ts +386 -0
- package/src/hosts/peerInstall.ts +8 -4
- package/src/web/build.ts +171 -0
- package/src/web/preview.ts +50 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<title>LeCodes</title>
|
|
7
|
+
<style>
|
|
8
|
+
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #000; }
|
|
9
|
+
#app { width: 100%; height: 100%; }
|
|
10
|
+
#error {
|
|
11
|
+
position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 50%; overflow: auto;
|
|
12
|
+
box-sizing: border-box; padding: 12px 16px; background: rgba(20, 0, 0, 0.92); color: #ff7a6e;
|
|
13
|
+
font: 12.5px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap;
|
|
14
|
+
}
|
|
15
|
+
#error:empty { display: none; }
|
|
16
|
+
</style>
|
|
17
|
+
<script type="module" crossorigin src="./lite.js"></script>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="app"></div>
|
|
21
|
+
<div id="error"></div>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
var ir=Object.defineProperty;var ar=(e,t,n)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>ar(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const cr=e=>{if(typeof e=="string")return e;if(e instanceof Error)return e.stack?`${String(e)}
|
|
2
|
+
${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},lr=(e,t)=>{const n=r=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(r),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let o=-1;const a=async()=>{try{const{v:r}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof r=="number"&&t(r)}catch{}setTimeout(a,2500)};setTimeout(a,2500);const i=()=>{let r;try{r=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}r.onopen=()=>r.send(JSON.stringify({type:"hello",v:o})),r.onmessage=c=>{let u={};try{u=JSON.parse(String(c.data))}catch{return}u.type==="reload"&&typeof u.v=="number"&&t(u.v)},r.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:r=>`${e}/bundle.js?t=web&v=${r}`,versionOf(r,c){const u=Number(r.headers.get("x-lecodes-v"));return r.headers.has("x-lecodes-v")&&Number.isFinite(u)?u:c},ran(r){o=r},log:(r,c)=>n({type:"log",level:r,text:c.map(cr).join(" ")}),error:r=>n({type:"error",text:r})}},ur=(e,t)=>{try{const n=new URL(e,t);return n.origin===new URL(t).origin&&(n.protocol==="http:"||n.protocol==="https:")?n.href:null}catch{return null}},Tt="2.0.3",et=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},fr=(e,t)=>et(e)!==null&&et(e)===et(t),dr=""+new URL("assets/Roboto-Variable-DHm9jpd-.woff2",import.meta.url).href,dn="Roboto",pr=[`400 14px ${dn}`],_t="data-lecodes-fonts",mr=async(e=pr,t)=>{const n=t??(typeof document>"u"?void 0:document);if(!(!n||!n.fonts)){if(!n.head.querySelector(`style[${_t}]`)){const o=new URL(dr,document.baseURI).href,a=n.createElement("style");a.setAttribute(_t,""),a.textContent=`@font-face{font-family:"${dn}";src:url("${o}") format("woff2");font-weight:100 900;font-display:swap}`,n.head.appendChild(a)}try{await Promise.all(e.map(o=>n.fonts.load(o)))}catch{}}},hr=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const o=[];for(const a of n[1].split(";")){const i=a.indexOf("=");if(i===-1)continue;const r=/^(.+)@(\d+)(i?)$/.exec(a.slice(0,i));r&&o.push({family:r[1],weight:parseInt(r[2],10),italic:r[3]==="i",url:a.slice(i+1).replace("{fmt}",t)})}return o},gr=async(e,t,n=2e3)=>{const o=t??(typeof document>"u"?void 0:document);if(!(o!=null&&o.fonts)||e.length===0)return;const a=[];for(const i of e)try{const r=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});o.fonts.add(r),a.push(r.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(a),new Promise(i=>setTimeout(i,n))])},yr=e=>{var u,d,v,p;const t=e.slice(0,2e3),n=new Set,o=t.match(/\/\/ preload: (.+)/);if(o)for(const f of o[1].split(";"))n.add(f);const a=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((u=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:u[1])??null,r=((v=(d=t.match(/^\/\/ name: (.+)$/m))==null?void 0:d[1])==null?void 0:v.trim())??null,c=new Set((((p=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:p[1])??"").split(";").map(f=>f.trim()).filter(Boolean));return{sdk:i,name:r,preloads:n,gl:a,is2d:t.includes("// 2d: enable"),plugins:c,bootFonts:hr(t)}},br=1,vr=2,Er=3,wr=4,Sr=5,Tr=6,kt=7,_r=8,Rt=9,kr=10,Rr=11,xr=12,Lr=13,Ar=14,$r=15,Cr=16,xt=17,Or=18,Lt=19,Ie=20,Mr=26,Nr=27,Pr=30,At=31,Ir=32,Fr=33,$t=34,Ct=35,We=1,Dr=2,Br=4,ge=8,Ur=16,tt=32,Wr=64,nt=128,Hr=256,zr=512,Vr=1024,Gr=2048,jr=4096,Ot=8192,Kr=32768,Yr=1<<18,Xr=255,Mt=256,Nt=512,qr=1024,se=0,Jr=1,Qr=2,Zr=3,Ke=4,He=255,pn=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},Pt={text:{type:"text"},password:{type:"password"},search:{type:"search"},tel:{type:"tel"},email:{type:"email"},url:{type:"url"},number:{type:"text",mode:"numeric"},decimal:{type:"text",mode:"decimal"},date:{type:"date"},time:{type:"time"}},It=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,re=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},eo=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,o=t("placeholder");if(re(n,"placeholder",o==null?null:String(o)),e.type==="input"){const c=Pt[String(t("type")??"text")]??Pt.text,u=n;u.type!==c.type&&(u.type=c.type),re(n,"inputmode",c.mode??null);const d=t("enterKey");re(n,"enterkeyhint",d==null?null:String(d))}const a=t("autocapitalize");re(n,"autocapitalize",a==null?null:String(a));const i=t("autocorrect");i==null?(re(n,"autocorrect",null),re(n,"spellcheck",null)):(re(n,"autocorrect",It(i,!0)?"on":"off"),re(n,"spellcheck",It(i,!0)?"true":"false"));const r=Number(t("maxLength")??0);re(n,"maxlength",r>0?String(Math.round(r)):null)},Ye={width:"layout",height:"layout",minWidth:"layout",minHeight:"layout",maxWidth:"layout",maxHeight:"layout",flexBasis:"layout",flexGrow:"layout",flexShrink:"layout",aspectRatio:"layout",gap:"layout",rowGap:"layout",columnGap:"layout",padding:"layout",paddingTop:"layout",paddingRight:"layout",paddingBottom:"layout",paddingLeft:"layout",paddingHorizontal:"layout",paddingVertical:"layout",paddingStart:"layout",paddingEnd:"layout",margin:"layout",marginTop:"layout",marginRight:"layout",marginBottom:"layout",marginLeft:"layout",marginHorizontal:"layout",marginVertical:"layout",marginStart:"layout",marginEnd:"layout",left:"layout",right:"layout",top:"layout",bottom:"layout",start:"layout",end:"layout",inset:"layout",flexDirection:"enum",justifyContent:"enum",alignItems:"enum",alignSelf:"enum",position:"enum",flexWrap:"enum",boxSizing:"enum",display:"enum",overflow:"enum",scrollDirection:"enum",borderWidth:"len",borderTopWidth:"len",borderRightWidth:"len",borderBottomWidth:"len",borderLeftWidth:"len",borderHorizontalWidth:"len",borderVerticalWidth:"len",borderStartWidth:"len",borderEndWidth:"len",color:"color",backgroundColor:"color",borderColor:"color",borderTopColor:"color",borderRightColor:"color",borderBottomColor:"color",borderLeftColor:"color",placeholderColor:"color",refreshControlColor:"color",tintColor:"color",rippleColor:"color",overlayColor:"color",backgroundImage:"str",backgroundSize:"enum",backgroundGradient:"str",borderRadius:"len",borderTopLeftRadius:"len",borderTopRightRadius:"len",borderBottomRightRadius:"len",borderBottomLeftRadius:"len",opacity:"num",transform:"str",transformOrigin:"str",pointerEvents:"enum",fontSize:"len",fontWeight:"num",fontStyle:"enum",fontFamily:"str",lineHeight:"len",letterSpacing:"len",textAlign:"enum",textDecoration:"enum",lineClamp:"num",textOverflow:"enum",objectFit:"enum",placeholder:"str",type:"enum",enterKey:"enum",autocapitalize:"enum",autocorrect:"num",maxLength:"num",keyboardShrink:"num",keyboardDismiss:"num",showScrollbar:"num",overscrollMode:"enum",keyboardDismissMode:"enum",snap:"enum",sheetDetents:"str",sheetDetent:"num",sheetDismissible:"num",dim:"num"},to={p:"padding",pt:"paddingTop",pr:"paddingRight",pb:"paddingBottom",pl:"paddingLeft",px:"paddingHorizontal",py:"paddingVertical",m:"margin",mt:"marginTop",mr:"marginRight",mb:"marginBottom",ml:"marginLeft",mx:"marginHorizontal",my:"marginVertical",bgColor:"backgroundColor",bgImage:"backgroundImage",bgSize:"backgroundSize",bgGradient:"backgroundGradient"},no=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],ro={display:"flex",overflow:"visible",scrollDirection:"vertical",borderWidth:0,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderHorizontalWidth:0,borderVerticalWidth:0,borderStartWidth:0,borderEndWidth:0,backgroundColor:0,borderColor:0,borderTopColor:0,borderRightColor:0,borderBottomColor:0,borderLeftColor:0,backgroundImage:"",backgroundSize:"cover",borderRadius:0,borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomRightRadius:0,borderBottomLeftRadius:0,opacity:1,transform:"identity",transformOrigin:"50% 50%",pointerEvents:"all",fontSize:14,fontWeight:400,fontStyle:"normal",lineHeight:"normal",letterSpacing:0,textAlign:"start",textDecoration:"none",lineClamp:0,textOverflow:"ellipsis",objectFit:"cover",placeholder:"",type:"text",enterKey:"done",autocapitalize:"sentences",autocorrect:1,maxLength:0,keyboardShrink:1,keyboardDismiss:1,showScrollbar:1,overscrollMode:"default",keyboardDismissMode:"interactive",snap:"none",sheetDetents:"",sheetDetent:0,sheetDismissible:1,dim:0},oo=["duration","delay","layer","commit","loop","loopMode","name"],so=/\b(?:calc|min|max|clamp)\(/,io=e=>{if(!so.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let a=0;const i=n;for(;n<e.length;n++)if(e[n]==="(")a++;else if(e[n]===")"&&--a===0)break;t+=e.slice(i,Math.min(n+1,e.length));continue}const o=e[n];if(o==="+"||o==="-"){const a=t[t.length-1]??"";if(!(o==="-"&&(a==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(a)){for(t=t.trimEnd()+" "+o+" ";e[n+1]===" ";)n++;continue}}t+=o}return t.replace(/\d*\.\d+|\d+/g,(n,o,a)=>{const i=a.slice(0,o).trimEnd(),r=a.slice(o+n.length).trimStart();return/[\w.%]$/.test(i)||/^[\w.%]/.test(r)||/[*/]$/.test(i)||/^[*/]/.test(r)?n:n+"px"})},ao={top:"12px",bottom:"4px",left:"16px",right:"16px"},mn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${ao[e]})))`,co={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Ce=e=>io(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>mn(n)).replace(new RegExp("(?<![-\\w])safe-(top|bottom|left|right)\\b","g"),(t,n)=>`var(--safe-${n}, 0px)`).replace(/(\d)(vmin|vmax|vw|vh)\b/g,(t,n,o)=>n+co[o]),yt=/^-?\d*\.?\d+$/,ie=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return yt.test(t)?t+"px":Ce(t)},we=e=>{if(typeof e=="number")return"#"+(e>>>0).toString(16).padStart(e<=16777215?6:8,"0");const t=String(e);return t==="clear"?"transparent":t},lo=/^(rotate|skew)/,uo=/^translate/,fo=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,o,a)=>{const i=uo.test(o)?"px":lo.test(o)?"deg":null;return i===null?n:`${o}(${a.split(",").map(r=>{const c=r.trim();return yt.test(c)?c+i:Ce(c)}).join(", ")})`})},hn=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>yt.test(t)?t+"px":Ce(t)).join(" "),te=0,ne=1,Le=2,ze=["top","right","bottom","left"],po=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?mn(t):ie(e),ut=(e,t)=>{const n=(a,i)=>({rank:i,to:r=>a.map(c=>[t(c),po(r,c)])}),o=a=>({rank:ne,to:i=>[[t(a),ie(i)]]});return{[e]:n(ze,te),[`${e}Horizontal`]:n(["left","right"],ne),[`${e}Vertical`]:n(["top","bottom"],ne),[`${e}Start`]:o("inline-start"),[`${e}End`]:o("inline-end"),[`${e}Top`]:n(["top"],Le),[`${e}Right`]:n(["right"],Le),[`${e}Bottom`]:n(["bottom"],Le),[`${e}Left`]:n(["left"],Le)}},mo=()=>{const e=ut("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},bt=e=>{const t=[];let n=0,o="";for(const a of e.trim()){if(a==="("&&n++,a===")"&&n--,/\s/.test(a)&&n===0){o&&t.push(o),o="";continue}o+=a}return o&&t.push(o),t},ho=new Set(["none","solid","dashed","dotted","double","hidden"]),go=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,Re=(e,t)=>({rank:t,to:n=>{let o=null,a=null,i=null;if(typeof n=="number")o=n+"px";else for(const c of bt(String(n)))ho.has(c)?i=c:go.test(c)?o=ie(c):a=we(c);const r=[];for(const c of e)r.push([`border-${c}-width`,o??(a?"1px":"0px")]),r.push([`border-${c}-color`,a??"transparent"]),i&&r.push([`border-${c}-style`,i]);return r}}),yo=e=>{const t=String(e).trim(),n=(i,r,c)=>[["flex-grow",i],["flex-shrink",r],["flex-basis",c]];if(t==="none")return n("0","0","auto");if(t==="auto")return n("1","1","auto");if(t==="initial")return n("0","1","auto");const o=bt(t),a=i=>i!==void 0&&/^-?\d*\.?\d+$/.test(i);return a(o[0])?o.length===1?n(o[0],"1","0%"):a(o[1])?n(o[0],o[1],o[2]!==void 0?ie(o[2]):"0%"):n(o[0],"1",ie(o[1])):n("1","1",ie(o[0]??"auto"))},gn=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},yn=(e,t)=>{if(gn(e))return`url("${t.bufferUrl(e._h.id)}")`;const n=String(e??"");return n===""?"none":n.startsWith("id:")?`url("${t.bufferUrl(Number(n.slice(3)))}")`:`url("${n.replace(/["\\\n]/g,o=>"\\"+o)}")`},bo=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,bn=e=>{const t=String(e??"").trim();return t===""?"none":Ce(t)},vo=(e,t)=>{const n=typeof e=="string"&&bo.test(e),o=gn(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?bn(e):"none"],["--lc-bg-img",o?yn(e,t):"none"],["background-color",n||o?"transparent":we(e)]]},Eo=e=>{const t=typeof e=="number"?[e+"px"]:bt(String(e)).map(r=>hn(r)),[n,o=n,a=n,i=o]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",o??"0px"],["border-bottom-right-radius",a??"0px"],["border-bottom-left-radius",i??"0px"]]},wo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),So=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||wo.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},To=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",_o=e=>t=>e[String(t)]??String(t),Oe={width:{css:"width",as:"len"},height:{css:"height",as:"len"},minWidth:{css:"min-width",as:"len"},minHeight:{css:"min-height",as:"len"},maxWidth:{css:"max-width",as:"len"},maxHeight:{css:"max-height",as:"len"},flexBasis:{css:"flex-basis",as:"len"},flexGrow:{css:"flex-grow",as:"num"},flexShrink:{css:"flex-shrink",as:"num"},aspectRatio:{css:"aspect-ratio",as:"num"},gap:{css:["row-gap","column-gap"],as:"len",rank:te},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...ut("padding",e=>`padding-${e}`),...ut("margin",e=>`margin-${e}`),inset:{css:ze,as:"len",rank:te},top:{css:"top",as:"len"},right:{css:"right",as:"len"},bottom:{css:"bottom",as:"len"},left:{css:"left",as:"len"},start:{css:"inset-inline-start",as:"len",rank:ne},end:{css:"inset-inline-end",as:"len",rank:ne},flexDirection:{css:"flex-direction",as:"raw"},justifyContent:{css:"justify-content",as:"raw"},alignItems:{css:"align-items",as:"raw"},alignSelf:{css:"align-self",as:"raw"},position:{css:"position",as:"raw"},flexWrap:{css:"flex-wrap",as:"raw"},boxSizing:{css:"box-sizing",as:"raw"},display:{css:"display",as:"raw"},overflow:{rank:te,to:e=>{const t=e==="scroll"?"auto":String(e);return[["overflow-x",t],["overflow-y",t]]}},scrollDirection:{to:e=>e==="horizontal"?[["overflow-x","auto"],["overflow-y","hidden"],["flex-direction","row"]]:e==="all"?[["overflow-x","auto"],["overflow-y","auto"]]:[["overflow-x","hidden"],["overflow-y","auto"],["flex-direction","column"]],rank:ne},...mo(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:ze.map(e=>`border-${e}-color`),rank:te},borderTopColor:{css:"border-top-color"},borderRightColor:{css:"border-right-color"},borderBottomColor:{css:"border-bottom-color"},borderLeftColor:{css:"border-left-color"},placeholderColor:{css:"--lc-placeholder"},refreshControlColor:{css:"--lc-refresh"},tintColor:{css:"--lc-tint"},overlayColor:{css:"--lc-overlay"},rippleColor:{none:"a browser has no ripple: the press feedback of a page is `$pressed`"},backgroundImage:{to:(e,t)=>[["--lc-bg-img",yn(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",bn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"]]},borderRadius:{to:Eo,rank:te},borderTopLeftRadius:{css:"border-top-left-radius"},borderTopRightRadius:{css:"border-top-right-radius"},borderBottomRightRadius:{css:"border-bottom-right-radius"},borderBottomLeftRadius:{css:"border-bottom-left-radius"},opacity:{css:"opacity"},transform:{to:e=>[["transform",fo(e)]]},transformOrigin:{css:"transform-origin",as:"lens"},pointerEvents:{to:e=>[["pointer-events",e==="none"?"none":"auto"]]},dim:{css:"--lc-dim"},fontSize:{css:"font-size"},fontWeight:{css:"font-weight",as:"raw"},fontStyle:{to:e=>[["font-style",e===2?"italic":e===0?"normal":String(e)]]},fontFamily:{to:e=>[["font-family",So(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":ie(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:te,to:e=>Number(e)>0?[["display","-webkit-box"],["-webkit-box-orient","vertical"],["-webkit-line-clamp",String(Math.round(Number(e)))],["overflow-x","hidden"],["overflow-y","hidden"]]:[["-webkit-line-clamp","none"]]},textOverflow:{css:"text-overflow"},objectFit:{to:e=>[["object-fit",String(e)],["--lc-fit",e==="fill"?"100% 100%":String(e)]]},placeholder:{attr:!0},type:{attr:!0},enterKey:{attr:!0},autocapitalize:{attr:!0},autocorrect:{attr:!0},maxLength:{attr:!0},keyboardShrink:{attr:!0},keyboardDismiss:{attr:!0},showScrollbar:{to:e=>[["scrollbar-width",To(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",_o({default:"auto",none:"none",absorb:"contain"})(e)]]},keyboardDismissMode:{attr:!0},snap:{to:e=>e==="none"?[["scroll-snap-type","none"],["--lc-snap","none"]]:[["scroll-snap-type","both mandatory"],["--lc-snap",String(e)]]},sheetDetents:{attr:!0},sheetDetent:{attr:!0},sheetDismissible:{attr:!0},background:{to:vo,rank:te},border:Re(ze,te),borderTop:Re(["top"],ne),borderRight:Re(["right"],ne),borderBottom:Re(["bottom"],ne),borderLeft:Re(["left"],ne),flex:{to:yo,rank:te}},ce=e=>to[e]??e,ko=e=>e in Oe,vn=e=>{const t=Oe[e];return!!t&&"attr"in t},Ro={overflow:"overflow-x",pointerEvents:"pointer-events",fontFamily:"font-family",fontStyle:"font-style",lineHeight:"line-height",objectFit:"object-fit",transform:"transform",borderRadius:"border-top-left-radius",borderWidth:"border-top-width",borderColor:"border-top-color",backgroundImage:"--lc-bg-img",backgroundGradient:"--lc-bg-grad",backgroundSize:"background-size",showScrollbar:"scrollbar-width",overscrollMode:"overscroll-behavior",snap:"--lc-snap",lineClamp:"-webkit-line-clamp",borderTopWidth:"border-top-width",borderRightWidth:"border-right-width",borderBottomWidth:"border-bottom-width",borderLeftWidth:"border-left-width",borderHorizontalWidth:"border-left-width",borderVerticalWidth:"border-top-width",borderStartWidth:"border-inline-start-width",borderEndWidth:"border-inline-end-width"},ft=e=>{const t=Oe[e];return t&&"css"in t&&typeof t.css=="string"?t.css:Ro[e]??null},xo={len:ie,lens:hn,num:e=>String(e),raw:e=>String(e),color:we},Lo={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},Ft=e=>{const t=Oe[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:Le},Ve=(e,t,n)=>{const o=[...e].filter(([,i])=>i!=null);o.sort((i,r)=>Ft(i[0])-Ft(r[0]));const a=new Map;for(const[i,r]of o){const c=Oe[i];if(!c){n==null||n(i);continue}if("attr"in c||"none"in c)continue;if("to"in c){for(const[v,p]of c.to(r,t))a.set(v,p);continue}const u=xo[c.as??Lo[Ye[i]??"layout"]],d=u(r);if(typeof c.css=="string")a.set(c.css,d);else for(const v of c.css)a.set(v,d)}return a},Dt=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),En=0,wn=1,Ae=2,$e=3,Sn=4,ve=65,Xe=1.70158,Fe=Xe*1.525,Bt=Xe+1,Ut=2*Math.PI/3,Wt=2*Math.PI/4.5,De=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,dt=[["linear",e=>e],["inSine",e=>1-Math.cos(e*Math.PI/2)],["outSine",e=>Math.sin(e*Math.PI/2)],["inOutSine",e=>-(Math.cos(Math.PI*e)-1)/2],["inQuad",e=>e*e],["outQuad",e=>1-(1-e)*(1-e)],["inOutQuad",e=>e<.5?2*e*e:1-(-2*e+2)**2/2],["inCubic",e=>e*e*e],["outCubic",e=>1-(1-e)**3],["inOutCubic",e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2],["inQuart",e=>e**4],["outQuart",e=>1-(1-e)**4],["inOutQuart",e=>e<.5?8*e**4:1-(-2*e+2)**4/2],["inExpo",e=>e===0?0:2**(10*e-10)],["outExpo",e=>e===1?1:1-2**(-10*e)],["inOutExpo",e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2],["inCirc",e=>1-Math.sqrt(1-e*e)],["outCirc",e=>Math.sqrt(1-(e-1)**2)],["inOutCirc",e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2],["inBack",e=>Bt*e*e*e-Xe*e*e],["outBack",e=>1+Bt*(e-1)**3+Xe*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((Fe+1)*2*e-Fe)/2:((2*e-2)**2*((Fe+1)*(e*2-2)+Fe)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Ut)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Ut)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Wt))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Wt)/2+1],["inBounce",e=>1-De(1-e)],["outBounce",De],["inOutBounce",e=>e<.5?(1-De(1-2*e))/2:(1+De(2*e-1))/2],["smoothstep",e=>e*e*(3-2*e)]],Ao={in:"inQuad",out:"outQuad",inOut:"inOutQuad",easeIn:"inQuad",easeOut:"outQuad",easeInOut:"inOutQuad","ease-in":"inQuad","ease-out":"outQuad","ease-in-out":"inOutQuad"},$o=e=>{const t=Ao[e]??e;for(let n=0;n<dt.length;n++)if(dt[n][0]===t)return n;return-1},Co=[.25,.1,.25,1],Be={kind:En,p:[0,0,0,0]},Oo=e=>{const t=new Float32Array(ve);for(let n=0;n<ve;n++)t[n]=e(n/(ve-1));return t[0]=0,t[ve-1]=1,t},Mo=e=>{if(e===void 0)return Be;if(typeof e=="function")return{kind:Sn,p:[0,0,0,0],table:Oo(e)};if(Array.isArray(e)){const[a,i,r,c]=e;return{kind:Ae,p:[a,i,r,c]}}const t=e.trim();if(t==="linear")return Be;if(t==="ease")return{kind:Ae,p:Co};if(t==="steps")return{kind:$e,p:[1,0,0,0]};let n=/^steps\(\s*(\d+)\s*(?:,\s*(start|end|jump-start|jump-end)\s*)?\)$/.exec(t);if(n)return{kind:$e,p:[Math.max(1,parseInt(n[1],10)),n[2]==="start"||n[2]==="jump-start"?1:0,0,0]};if(n=/^cubic-bezier\(\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*\)$/.exec(t),n)return{kind:Ae,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const o=$o(t);return o===0?Be:o>0?{kind:wn,p:[o,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Be)},No=(e,t,n,o,a)=>{const i=1-3*o+3*t,r=3*o-6*t,c=3*t,u=1-3*a+3*n,d=3*a-6*n,v=3*n;let p=e;for(let f=0;f<8;f++){const E=((i*p+r)*p+c)*p-e,s=(3*i*p+2*r)*p+c;if(Math.abs(E)<1e-6||Math.abs(s)<1e-6)break;p-=E/s}return p=Math.min(1,Math.max(0,p)),((u*p+d)*p+v)*p},Po=(e,t)=>{if(t<=0)return e.kind===$e&&e.p[1]===1?1/e.p[0]:0;if(t>=1)return 1;switch(e.kind){case wn:return dt[e.p[0]][1](t);case Ae:return No(t,e.p[0],e.p[1],e.p[2],e.p[3]);case $e:{const n=e.p[0];return e.p[1]===1?Math.min(1,Math.ceil(t*n)/n):Math.floor(t*n)/n}case Sn:{const n=e.table,o=t*(ve-1),a=Math.floor(o),i=n[a],r=n[Math.min(a+1,ve-1)];return i+(r-i)*(o-a)}default:return t}},Ht=24,zt=e=>String(Math.round(e*1e4)/1e4),Io="cubic-bezier(0.3333, 0, 0.6667, 1)",Fo=e=>{if(e===void 0||e==="smoothstep")return Io;const t=Mo(e);switch(t.kind){case En:return"linear";case Ae:return`cubic-bezier(${t.p.map(zt).join(", ")})`;case $e:return`steps(${t.p[0]}, ${t.p[1]===1?"jump-start":"jump-end"})`}const n=[];for(let o=0;o<=Ht;o++)n.push(zt(Po(t,o/Ht)));return`linear(${n.join(", ")})`},Tn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],Do=["--lc-bg-grad","--lc-bg-img","--lc-tint","--lc-overlay","--lc-refresh","--lc-fit","--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"],_n="lc-app",Bo=`
|
|
3
|
+
@layer ${Tn.join(", ")};
|
|
4
|
+
|
|
5
|
+
@layer lc-base {
|
|
6
|
+
.lc-root {
|
|
7
|
+
position: relative;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
container-type: size;
|
|
10
|
+
container-name: ${_n};
|
|
11
|
+
color: var(--color, #fff);
|
|
12
|
+
font-family: var(--fontFamily, "Roboto"), system-ui, sans-serif;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
line-height: 1.2;
|
|
16
|
+
text-align: start;
|
|
17
|
+
user-select: none;
|
|
18
|
+
-webkit-user-select: none;
|
|
19
|
+
-webkit-tap-highlight-color: transparent;
|
|
20
|
+
-webkit-text-size-adjust: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.lc {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
flex: 0 0 auto;
|
|
27
|
+
align-items: stretch;
|
|
28
|
+
align-content: flex-start;
|
|
29
|
+
position: relative;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
min-height: 0;
|
|
33
|
+
margin: 0;
|
|
34
|
+
padding: 0;
|
|
35
|
+
border: 0 solid transparent;
|
|
36
|
+
background-image: var(--lc-bg-grad, none), var(--lc-bg-img, none);
|
|
37
|
+
background-repeat: no-repeat;
|
|
38
|
+
background-position: center;
|
|
39
|
+
background-size: cover;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* A destination fills the app. It lets a touch through to what is under it (a scene) except
|
|
43
|
+
where something of its own takes touches. */
|
|
44
|
+
.lc-screen {
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset: 0;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
/* (every screen sets it: a screen inside a screen does not take the outer one's) */
|
|
50
|
+
--lc-dim: 0;
|
|
51
|
+
}
|
|
52
|
+
.lc-screen::after {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
z-index: 2147483647;
|
|
57
|
+
background: #000;
|
|
58
|
+
opacity: var(--lc-dim, 0);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
/* A screen the router covered keeps its subtree, its layout and its state. */
|
|
62
|
+
.lc-covered { visibility: hidden !important; pointer-events: none !important; }
|
|
63
|
+
|
|
64
|
+
.lc-i, .lc-scrollable, input.lc, textarea.lc { pointer-events: auto; }
|
|
65
|
+
|
|
66
|
+
/* The core measures a text against the width its parent has: it wraps there even where
|
|
67
|
+
nothing shrinks it. */
|
|
68
|
+
.lc-text {
|
|
69
|
+
display: block;
|
|
70
|
+
max-width: 100%;
|
|
71
|
+
white-space: pre-wrap;
|
|
72
|
+
overflow-wrap: break-word;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
button.lc {
|
|
76
|
+
appearance: none;
|
|
77
|
+
background-color: transparent;
|
|
78
|
+
color: inherit;
|
|
79
|
+
font: inherit;
|
|
80
|
+
letter-spacing: inherit;
|
|
81
|
+
text-align: inherit;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
84
|
+
button.lc:focus:not(:focus-visible) { outline: none; }
|
|
85
|
+
|
|
86
|
+
img.lc {
|
|
87
|
+
display: block;
|
|
88
|
+
object-fit: cover;
|
|
89
|
+
-webkit-user-drag: none;
|
|
90
|
+
}
|
|
91
|
+
/* An svg with a tint: its alpha is the mask, the tint the fill — the style's, else the one the
|
|
92
|
+
source came with. A div has no size of its own: the source's is given to it (--lc-iw /
|
|
93
|
+
--lc-ir), under any style of the app. */
|
|
94
|
+
.lc.lc-image-mask {
|
|
95
|
+
width: var(--lc-iw, auto);
|
|
96
|
+
aspect-ratio: var(--lc-ir, auto);
|
|
97
|
+
background-image: none;
|
|
98
|
+
background-color: var(--lc-tint, var(--lc-src-tint, currentColor));
|
|
99
|
+
-webkit-mask: var(--lc-src) center / var(--lc-fit, cover) no-repeat;
|
|
100
|
+
mask: var(--lc-src) center / var(--lc-fit, cover) no-repeat;
|
|
101
|
+
}
|
|
102
|
+
/* A part of an atlas (sourceRect): the atlas is the background, scaled so the part fills the box. */
|
|
103
|
+
.lc.lc-image-crop {
|
|
104
|
+
width: var(--lc-iw, auto);
|
|
105
|
+
height: var(--lc-ih, auto);
|
|
106
|
+
background-image: var(--lc-src);
|
|
107
|
+
background-size: var(--lc-crop-size, auto);
|
|
108
|
+
background-position: var(--lc-crop-pos, 0 0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
input.lc, textarea.lc {
|
|
112
|
+
display: block;
|
|
113
|
+
appearance: none;
|
|
114
|
+
background-color: transparent;
|
|
115
|
+
color: inherit;
|
|
116
|
+
font: inherit;
|
|
117
|
+
letter-spacing: inherit;
|
|
118
|
+
text-align: inherit;
|
|
119
|
+
outline: none;
|
|
120
|
+
resize: none;
|
|
121
|
+
user-select: text;
|
|
122
|
+
-webkit-user-select: text;
|
|
123
|
+
}
|
|
124
|
+
textarea.lc { field-sizing: content; }
|
|
125
|
+
input.lc::placeholder, textarea.lc::placeholder { color: var(--lc-placeholder, #aaa); opacity: 1; }
|
|
126
|
+
|
|
127
|
+
.lc-scrollable {
|
|
128
|
+
overflow-x: hidden;
|
|
129
|
+
overflow-y: auto;
|
|
130
|
+
scrollbar-width: thin;
|
|
131
|
+
--lc-snap: none;
|
|
132
|
+
}
|
|
133
|
+
.lc-scrollable > .lc { scroll-snap-align: var(--lc-snap, none); }
|
|
134
|
+
|
|
135
|
+
/* ---- the spinner of a pull to refresh (../refresh.ts) */
|
|
136
|
+
.lc-refresh {
|
|
137
|
+
position: absolute;
|
|
138
|
+
left: 50%;
|
|
139
|
+
top: -36px;
|
|
140
|
+
z-index: 5;
|
|
141
|
+
width: 28px;
|
|
142
|
+
height: 28px;
|
|
143
|
+
margin-left: -14px;
|
|
144
|
+
border-radius: 50%;
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
border: 3px solid color-mix(in srgb, var(--lc-refresh-color, #8e8e93) 25%, transparent);
|
|
147
|
+
border-top-color: var(--lc-refresh-color, #8e8e93);
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
will-change: transform;
|
|
150
|
+
}
|
|
151
|
+
.lc-refresh.lc-settling { transition: transform 0.2s ease; }
|
|
152
|
+
.lc-refresh.lc-spinning { animation: lc-spin 0.8s linear infinite; }
|
|
153
|
+
@keyframes lc-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
|
|
154
|
+
|
|
155
|
+
/* ---- widgets (../widgets.ts) */
|
|
156
|
+
.lc-widget-frame {
|
|
157
|
+
position: absolute;
|
|
158
|
+
inset: 0;
|
|
159
|
+
z-index: 10;
|
|
160
|
+
display: flex;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: center;
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
.lc-scrim { position: absolute; inset: 0; pointer-events: auto; }
|
|
167
|
+
/* A widget lets a touch through where nothing of it takes one (a HUD over a scene) — but
|
|
168
|
+
behind a scrim there is nothing a touch could be meant for: the widget's box takes it. */
|
|
169
|
+
.lc-widget { pointer-events: none; }
|
|
170
|
+
.lc-widget-frame.lc-scrimmed .lc-widget { pointer-events: auto; }
|
|
171
|
+
.lc-sheet { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
|
|
172
|
+
.lc-toasts {
|
|
173
|
+
position: absolute;
|
|
174
|
+
left: 0; right: 0;
|
|
175
|
+
bottom: calc(var(--safe-bottom, 0px) + 24px);
|
|
176
|
+
z-index: 20;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 8px;
|
|
181
|
+
pointer-events: none;
|
|
182
|
+
}
|
|
183
|
+
.lc-toast {
|
|
184
|
+
max-width: 80%;
|
|
185
|
+
padding: 10px 16px;
|
|
186
|
+
border-radius: 20px;
|
|
187
|
+
background: rgba(40, 40, 44, 0.94);
|
|
188
|
+
color: #fff;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
line-height: 1.3;
|
|
191
|
+
text-align: center;
|
|
192
|
+
opacity: 0;
|
|
193
|
+
transform: translateY(8px);
|
|
194
|
+
transition: opacity 0.18s ease, transform 0.18s ease;
|
|
195
|
+
}
|
|
196
|
+
.lc-toast.lc-on { opacity: 1; transform: none; }
|
|
197
|
+
}
|
|
198
|
+
`,Uo=e=>{const t=e.defaultView??window;for(const u of Do)try{t.CSS.registerProperty({name:u,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=Bo,e.head.appendChild(n);const o=n.sheet,a=(u,d)=>{const v=u.insertRule(d,u.cssRules.length);return u.cssRules[v]},i=(u,d)=>{const v=u.cssRules;for(let p=v.length-1;p>=0;p--)if(v[p]===d){u.deleteRule(p);return}},r=new Map,c=(u,d)=>{const v=d===void 0?u:`${u}.${d}`;let p=r.get(v);return p||(p=d===void 0?a(o,`@layer ${u} {}`):a(c(u),`@layer ${d} {}`),r.set(v,p)),p};for(const u of Tn)u!=="lc-base"&&c(u);return{insert(u,d,v){const p=c(u,v),f=a(p,d);return{remove:()=>i(p,f)}},own(u){const d=c("lc-own"),v=a(d,`${u} {}`);return{set:(p,f)=>v.style.setProperty(p,f),unset:p=>{v.style.removeProperty(p)},remove:()=>i(d,v)}},destroy(){n.remove()}}},pt="lc-i";let Wo=1;const rt=new Map,kn=e=>{let t=rt.get(e);return t||rt.set(e,t=`lc-c${rt.size+1}`),t},Ho=(e,t)=>{const n=`{${t.text}}`,o=a=>`${a} .${e}, .${e}${a}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${o(`.${pt}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${o(`.${pt}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${o(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${_n} (orientation: ${t.name}) { .${e} ${n} }`};default:{const a=kn(t.name);return{layer:"lc-class",sub:a,text:`${o(`.${a}`)} ${n}`}}}},zo=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),Vo=256,Go=e=>{const t=new Map,n=new Set,o=()=>{let a=n.size>>1;for(const i of n){if(a--<=0)break;for(const r of i.rules)r.remove();n.delete(i),t.delete(i.key)}};return{acquire(a){const i=zo(a);let r=t.get(i);if(r)return r.refs===0&&n.delete(r),r.refs++,r;const c=`lc-s${Wo++}`,u=[],d=a.transition?`${a.base?";":""}transition:${a.transition}`:"";u.push(e.insert("lc-bag",`.${c} {${a.base}${d}}`));for(const v of a.blocks){const p=Ho(c,v);u.push(e.insert(p.layer,p.text,p.sub))}return t.set(i,r={name:c,key:i,refs:1,rules:u}),r},release(a){--a.refs>0||(n.add(a),n.size>Vo&&o())},count:()=>({live:t.size-n.size,idle:n.size})}},jo=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),Vt=new Set([...oo,"easing"]),Ko=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),Yo=(e,t,n,o)=>{const a=new Set;let i=!1;const r=new Set,c=b=>{r.has(b)||(r.add(b),o(`style: "${b}" is not a style property — ignored`))};let u=null,d=null;const v=b=>{b.style.dirty=!0,a.add(b),!i&&(i=!0,queueMicrotask(s))},p=b=>{const y=b.style,T=Ve(y.own,n,c);if(!(T.size===0&&!y.rule)){y.rule||(y.rule=e.own(`.lc-n${b.id}`),b.el.classList.add(`lc-n${b.id}`));for(const _ of y.applied.keys())T.has(_)||y.rule.unset(_);for(const[_,C]of T)y.applied.get(_)!==C&&y.rule.set(_,C);y.applied=T}},f=(b,y)=>{const T=new Map;for(const[_,C]of b){if(!(C.duration>0))continue;const h=`${C.duration}ms ${Fo(C.easing)} ${C.delay}ms`;for(const L of y.get(_).keys())L.startsWith("--")||T.set(L,`${L} ${h}`)}return[...T.values()].join(", ")},E=b=>{const y=b.style;y.dirty=!1;const T=Dt(Ve(y.base,n,c)),_=new Map,C=[];for(const[L,S]of y.blocks){const w=Ve(S.props,n,c);_.set(L,w),w.size>0&&C.push({name:L,text:Dt(w)})}const h=y.cls;T===""&&C.length===0?y.cls=null:y.cls=t.acquire({base:T,blocks:C,transition:f(y.blocks,_)}),h!==y.cls&&(h&&b.el.classList.remove(h.name),y.cls&&b.el.classList.add(y.cls.name)),h&&t.release(h),u==null||u(b)};function s(){if(i=!1,a.size===0)return;const b=[...a];a.clear();for(const y of b)y.style.dirty&&E(y)}const l=(b,y,T)=>{if(T==null){b.blocks.delete(y);return}if(!Ko(T))return;let _=b.blocks.get(y);_||b.blocks.set(y,_={props:new Map,duration:0,delay:0,easing:void 0});for(const C of Object.keys(T)){const h=T[C];if(C==="duration"){_.duration=Number(h)||0;continue}if(C==="delay"){_.delay=Number(h)||0;continue}if(C==="easing"){_.easing=h;continue}if(Vt.has(C)||C[0]==="$")continue;const L=ce(C);_.props.delete(L),h!=null&&_.props.set(L,h)}};return{flush:s,set onChange(b){u=b},set onWrite(b){d=b},merge(b,y){const T=b.style;let _=!1;for(const C of Object.keys(y)){const h=y[C];if(C[0]==="$"){l(T,C.slice(1),h);continue}if(Vt.has(C))continue;const L=ce(C);T.base.delete(L),h!=null&&T.base.set(L,h),T.own.delete(L)&&(_=!0),d==null||d(b,L)}_&&p(b),v(b)},set(b,y,T){const _=b.style;if(y[0]==="$"){l(_,y.slice(1),T),v(b);return}const C=ce(y);if(!ko(C)){c(C);return}d==null||d(b,C),T==null?(_.own.delete(C),_.base.delete(C)&&v(b)):_.own.set(C,T),p(b),(vn(C)||C==="tintColor")&&(u==null||u(b))},setClass(b,y,T){b.el.classList.toggle(kn(y),T)},value(b,y){const T=b.style;return T.own.has(y)?T.own.get(y):T.base.get(y)},owns(b,y){return b.style.own.has(y)||b.style.base.has(y)},names(b,y){const T=b.style;if(T.own.has(y)||T.base.has(y))return!0;for(const _ of T.blocks.values())if(_.props.has(y))return!0;return!1},drop(b){const y=b.style;a.delete(b),y.cls&&(t.release(y.cls),y.cls=null),y.rule&&(y.rule.remove(),y.rule=null)}}},Xo={button:"button",input:"input",textarea:"textarea",image:"img"},qo=(e,t)=>{const n=e.createElement(Xo[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const o=n;o.alt="",o.decoding="async",o.draggable=!1}return n},Jo=(e,t,n)=>({id:t,type:n,el:qo(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:jo(),strings:new Map}),Rn=Symbol("lecodes.node"),Ee=e=>e==null?void 0:e[Rn],xn=e=>{e.el[Rn]=e,e.el.setAttribute("data-node",String(e.id))},Ge=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const o=Ee(n);o&&o.parent===e&&t.push(o)}return t},ot=(e,t=",")=>{const n=[];let o=0,a="";for(const i of e){if(i==="("&&o++,i===")"&&o--,i===t&&o===0){n.push(a.trim()),a="";continue}a+=i}return a.trim()!==""&&n.push(a.trim()),n},Gt={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to right top":45,"to bottom right":135,"to right bottom":135,"to bottom left":225,"to left bottom":225,"to top left":315,"to left top":315},Qo=e=>{if(e in Gt)return Gt[e];const t=/^(-?[\d.]+)(deg|rad|turn|grad)$/.exec(e);if(!t)return null;const n=parseFloat(t[1]);return t[2]==="deg"?n:t[2]==="rad"?n*180/Math.PI:t[2]==="turn"?n*360:n*.9},Zo=(e,t)=>{const n=[];for(const o of ot(e.trim())){const a=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(o);if(!a)return null;const i=a[1],r=ot(a[2]);let c=i==="linear"?180:0;if(r.length>0){const d=r[0],v=i==="linear"?Qo(d):null;v!==null?(c=v,r.shift()):i==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(d)&&r.shift()}const u=[];for(const d of r){const v=ot(d," "),p=v[v.length-1],f=v.length>1&&/^-?[\d.]+%$/.test(p),E=f?v.slice(0,-1).join(" "):d;u.push({color:t(E)??"#00000000",position:f?parseFloat(p)/100:null})}if(u.length===0)return null;u[0].position===null&&(u[0].position=0),u[u.length-1].position===null&&(u[u.length-1].position=1);for(let d=1;d<u.length-1;d++){if(u[d].position!==null)continue;let v=d;for(;u[v].position===null;)v++;const p=u[d-1].position,f=u[v].position;for(let E=d;E<v;E++)u[E].position=p+(f-p)*(E-d+1)/(v-d+1);d=v}n.push({type:i,angle:c,stops:u.map(d=>({color:d.color,position:d.position}))})}return n.length>0?n:null},es=Object.keys(Ye).filter(e=>Ye[e]!=="layout"),ae=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),jt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${ae(+t[1])}${ae(+t[2])}${ae(+t[3])}${ae(o*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${ae(+n[1]*255)}${ae(+n[2]*255)}${ae(+n[3]*255)}${ae((n[4]===void 0?1:+n[4])*255)}`:null},ts=e=>{if(e==="none")return[1,0,0,0,1,0,0,0,1];const t=/^matrix\(([^)]+)\)$/.exec(e);if(!t)return null;const[n,o,a,i,r,c]=t[1].split(",").map(u=>parseFloat(u));return[n,o,0,a,i,0,r,c,1]},Kt={pointerEvents:{auto:"all"},overflow:{auto:"scroll"},display:{"-webkit-box":"flex",block:"flex"},showScrollbar:{none:"0",thin:"1",auto:"1"},overscrollMode:{auto:"default",contain:"absorb"},textAlign:{"-webkit-auto":"start"}},ns=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let o=null;const a=d=>{o||(o=t.createElement("span"),o.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),o.isConnected||e.root.appendChild(o),o.style.color="",o.style.color=d;const v=o.style.color===""?null:jt(n.getComputedStyle(o).color);return o.remove(),v},i=(d,v,p,f)=>{var l,b;if(vn(v)){const y=e.value(d,v);return y==null?null:p==="num"?Number(y===!0?1:y===!1?0:y):String(y)}const E=ft(v);if(E===null)return null;const s=f.getPropertyValue(E).trim();if(s===""&&!d.el.isConnected)return r(d,v,p);if(s==="")return null;switch(p){case"color":return E.startsWith("--")?a(s):jt(s);case"len":{const y=parseFloat(s);return Number.isFinite(y)?y:v==="lineHeight"?parseFloat(f.fontSize)*1.2:null}case"num":{if(v==="lineClamp")return s==="none"?0:parseFloat(s)||0;const y=parseFloat(((l=Kt[v])==null?void 0:l[s])??s);return Number.isFinite(y)?y:null}case"enum":return((b=Kt[v])==null?void 0:b[s])??s;default:return v==="backgroundGradient"?s==="none"?null:Zo(s,a):v==="transform"?ts(s):v==="transformOrigin"?null:v==="fontFamily"?s.split(",")[0].trim().replace(/^["']|["']$/g,""):v==="backgroundImage"&&s==="none"?"":s}},r=(d,v,p)=>{const f=e.value(d,v)??ro[v];if(f==null)return null;if(v==="transform")return f==="identity"||f==="none"?[1,0,0,0,1,0,0,0,1]:null;if(p==="color")return typeof f=="number"?`#${(f>>>0).toString(16).padStart(8,"0")}`:a(String(f));if(p==="len"||p==="num"){const E=typeof f=="number"?f:parseFloat(String(f));return Number.isFinite(E)?E:null}return String(f)},c=d=>{const v=n.getComputedStyle(d.el),p=[],f=[],E={};for(const s of es){const l=e.owns(d,s);l&&p.push(s);const b=i(d,s,Ye[s],v);if(no.includes(s)&&!l&&(b===null||b==="none")){E[s]=null;continue}f.push(s),E[s]=b}return{present:f,dirty:[],own:p,...E}},u=d=>{const v=d.el,p={id:d.id,type:d.type},f=d.strings.get("name");f&&(p.name=f);const E=d.strings.get("text");return d.type==="text"&&E&&(p.text=E),(d.type==="input"||d.type==="textarea")&&(p.value=v.value),p.flags=d.flags,p.layout=[v.offsetLeft,v.offsetTop,v.offsetWidth,v.offsetHeight],p.paint=c(d),p.children=Ge(d).map(u),p};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(d=>({kind:d.kind,node:u(d.node)}))})},paint(d){return d?(e.flush(),JSON.stringify(c(d))):"null"}}},Yt=10,rs=500,os=e=>{const{root:t,emit:n}=e,o=t.ownerDocument,a=o.defaultView??window,i=x=>{const k=t.getBoundingClientRect(),I=pn(t)||1;return[(x.clientX-k.left)/I,(x.clientY-k.top)/I]},r=(x,k)=>{for(let I=x instanceof Element?x:null;I&&I!==t;I=I.parentElement){if(e.boundary(I))return null;const $=Ee(I);if($&&($.flags&k)!==0)return $}return null},c=new Map;let u=!1,d=null;const v=(x,k)=>{const I=typeof k=="number"?k:0;(I&Mt)!==0&&(x.tracked=!0,x.wantsMove=(I&Nt)!==0,x.claim=I&Xr)},p=x=>{a.clearTimeout(x.timer),c.delete(x.pointerId)},f=x=>{if(x.pointerType==="mouse"&&x.button!==0)return;const k=r(x.target,We),[I,$]=i(x);d=[I,$],u=!1;const P={pointerId:x.pointerId,node:k,startX:I,startY:$,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};c.set(x.pointerId,P),k&&(v(P,n(k.id,vr,x.pointerId,I,$)),(k.flags&Br)!==0&&(P.timer=a.setTimeout(()=>{if(c.get(P.pointerId)!==P||P.moved)return;const m=n(k.id,wr,P.pointerId,P.startX,P.startY),g=typeof m=="number"?m:0;(g&qr)!==0&&(P.handled=!0),v(P,g)},rs)))},E=x=>{const k=c.get(x.pointerId);if(k){const[I,$]=i(x);!k.moved&&Math.hypot(I-k.startX,$-k.startY)>Yt&&(k.moved=!0,a.clearTimeout(k.timer)),k.tracked&&k.wantsMove&&n(0,Sr,x.pointerId,I,$,I-k.startX,$-k.startY)}x.pointerType==="mouse"&&S(x)},s=x=>{const k=c.get(x.pointerId);if(!k)return;const[I,$]=i(x);k.tracked&&n(0,Tr,x.pointerId,I,$,I-k.startX,$-k.startY),(k.moved||k.handled)&&(u=!0),p(k)},l=x=>{const k=c.get(x.pointerId);k&&(k.tracked&&n(0,kt,x.pointerId),u=!0,p(k))},b=x=>{if(x.cancelable){for(const k of c.values())if(k.tracked&&k.claim!==0){x.preventDefault();return}}},y=x=>{if(u){u=!1;return}const k=r(x.target,We);if(!k||(k.flags&Dr)===0)return;let I,$;if(x.detail===0&&x.clientX===0&&x.clientY===0){const P=k.el.getBoundingClientRect();[I,$]=i({clientX:P.left+P.width/2,clientY:P.top+P.height/2})}else if([I,$]=i(x),d&&Math.hypot(I-d[0],$-d[1])>Yt)return;n(k.id,Er,x.pointerId??0,I,$)};let T=null,_=!1,C=!1,h=[0,0];const L=(x,k)=>{T&&_&&(x===Ct?n(0,x):n(0,x,k[0],k[1],k[0]-h[0],k[1]-h[1])),T=null,_=!1,C=!1};function S(x){const k=i(x),I=t.contains(x.target)?r(x.target,We):null;if(I!==T){if(L($t,k),T=I,I&&(I.flags&Yr)!==0){h=k;const $=n(I.id,Ir,k[0],k[1]),P=typeof $=="number"?$:0;_=(P&Mt)!==0,C=(P&Nt)!==0}return}T&&_&&C&&n(0,Fr,k[0],k[1],k[0]-h[0],k[1]-h[1])}const w=x=>{x.pointerType==="mouse"&&L($t,i(x))},O=x=>{const k=Ee(x instanceof Element?x:null);return k&&(k.type==="input"||k.type==="textarea")?k:null},F=x=>{const k=O(x.target);k&&(k.flags&Hr)!==0&&n(k.id,xr,k.el.value)},D=x=>{const k=O(x.target);k&&(k.flags&zr)!==0&&n(k.id,Lr)},B=x=>{const k=O(x.target);k&&(k.flags&Vr)!==0&&n(k.id,Ar)},H=x=>{if(x.key!=="Enter"||x.isComposing)return;const k=O(x.target);if(!k||k.type!=="input")return;x.preventDefault();const I=k.el;(k.flags&Gr)!==0&&n(k.id,$r,I.value),e.value(k,"enterKey")!=="next"&&o.activeElement===I&&I.blur()},W=x=>{const k=a.getComputedStyle(x);return k.overflowX!=="hidden"&&k.overflowY==="hidden"},G=x=>{const k=Ee(x.target instanceof Element?x.target:null);!k||(k.flags&Ur)===0||n(k.id,_r,W(k.el)?k.el.scrollLeft:k.el.scrollTop)},X=x=>{const k=Ee(x.target instanceof Element?x.target:null);k&&(k.flags&Wr)!==0&&n(k.id,kr)};return t.addEventListener("pointerdown",f),t.addEventListener("click",y),t.addEventListener("pointerleave",w),t.addEventListener("touchmove",b,{passive:!1}),t.addEventListener("input",F),t.addEventListener("focusin",D),t.addEventListener("focusout",B),t.addEventListener("keydown",H),t.addEventListener("scroll",G,!0),t.addEventListener("scrollend",X,!0),o.addEventListener("pointermove",E),o.addEventListener("pointerup",s),o.addEventListener("pointercancel",l),{isPressed(x){for(const k of c.values())if(k.node===x)return!0;return!1},isHovered:x=>T===x,forget(x){for(const k of[...c.values()])k.node===x&&(k.tracked&&n(0,kt,k.pointerId),p(k));T===x&&L(Ct,[0,0])},destroy(){for(const x of c.values())a.clearTimeout(x.timer);c.clear(),t.removeEventListener("pointerdown",f),t.removeEventListener("click",y),t.removeEventListener("pointerleave",w),t.removeEventListener("touchmove",b),t.removeEventListener("input",F),t.removeEventListener("focusin",D),t.removeEventListener("focusout",B),t.removeEventListener("keydown",H),t.removeEventListener("scroll",G,!0),t.removeEventListener("scrollend",X,!0),o.removeEventListener("pointermove",E),o.removeEventListener("pointerup",s),o.removeEventListener("pointercancel",l)}}};function ss(e){let t=e.trim();/\sxmlns\s*=/.test(t)||(t=t.replace(/<svg\b/,'<svg xmlns="http://www.w3.org/2000/svg"'));const n=new TextEncoder().encode(t);let o="";for(const a of n)o+=String.fromCharCode(a);return`data:image/svg+xml;base64,${btoa(o)}`}function is(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const as=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,cs=e=>{const t=p=>p.image??(p.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=p=>p.src.startsWith("svg:")?p.src.slice(4):null;let o=!1;const a=p=>{const f=p.src,E=n(p);return E!==null?ss(E):f.startsWith("id:")?e.bufferUrl(Number(f.slice(3))):f.startsWith("canvas:")?(o||(o=!0,e.warn("an image of a Canvas is not built yet (docs/plans/web-lite-plan.md, phase 2) — shown empty")),""):f.startsWith("scene2d:")?"":f},i=(p,f)=>f.rect?"crop":n(f)!==null&&(f.srcTint!==null||e.hasTint(p))?"mask":"img",r=(p,f)=>{const E=p.el;if(E.tagName.toLowerCase()===f)return;const s=e.doc.createElement(f);if(s.className=E.className,f==="img"){const b=s;b.alt="",b.decoding="async",b.draggable=!1}const l=E.getAttribute("data-name");l!==null&&s.setAttribute("data-name",l),p.el=s,xn(p),E.replaceWith(s),e.swapped(p,E)},c=p=>{for(const f of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])p.style.removeProperty(f)},u=(p,f,E)=>{const[s,l,b,y]=f,[T,_]=E;p.style.setProperty("--lc-crop-size",`${T/b*100}% ${_/y*100}%`),p.style.setProperty("--lc-crop-pos",`${T===b?0:s/(T-b)*100}% ${_===y?0:l/(_-y)*100}%`)},d=new WeakMap,v=p=>{var C;const f=t(p),E=i(p,f);f.form=E,r(p,E==="img"?"img":"div");const s=p.el;s.classList.toggle("lc-image-mask",E==="mask"),s.classList.toggle("lc-image-crop",E==="crop"),c(s);const l=a(f);if(E==="img"){const h=s;l===""?h.removeAttribute("src"):h.getAttribute("src")!==l&&(h.src=l);return}if(s.style.setProperty("--lc-src",l===""?"none":as(l)),E==="mask"){f.srcTint!==null&&s.style.setProperty("--lc-src-tint",we(f.srcTint));const h=(C=is(n(f)??""))==null?void 0:C.trim().split(/[\s,]+/).map(Number),L=h==null?void 0:h[2],S=h==null?void 0:h[3];L&&S&&(s.style.setProperty("--lc-iw",`${L}px`),s.style.setProperty("--lc-ir",`${L} / ${S}`));return}const b=f.rect;s.style.setProperty("--lc-iw",`${b[2]}px`),s.style.setProperty("--lc-ih",`${b[3]}px`);const y=d.get(p);if(y&&y.url===l){u(s,b,y.size);return}if(l==="")return;const T=++f.probe,_=new Image;_.addEventListener("load",()=>{if(f.probe!==T||!f.rect)return;const h=[_.naturalWidth,_.naturalHeight];d.set(p,{url:l,size:h}),u(p.el,f.rect,h)},{once:!0}),_.src=l};return{setSrc(p,f){const E=t(p);E.src=f??"",E.srcTint=null,v(p)},setSrcTint(p,f){t(p).srcTint=f,v(p)},setSourceRect(p,f){const E=t(p),s=f==null?void 0:f.trim().split(/\s+/).map(Number),l=s&&s.length===4&&s.every(T=>Number.isFinite(T))&&s[2]>0&&s[3]>0?s:null,b=!!E.rect&&!!l&&E.form==="crop"&&E.rect[2]===l[2]&&E.rect[3]===l[3];E.rect=l;const y=d.get(p);if(b&&y){u(p.el,l,y.size);return}v(p)},restyle(p){const f=p.image;f&&i(p,f)!==f.form&&v(p)}}},ls=.5,us=64,Xt=48,fs=e=>{const{root:t,emit:n}=e,o=t.ownerDocument,a=o.defaultView??window,i=new Map;let r=null;const c=s=>{let l=i.get(s);if(!l||!l.isConnected){l=o.createElement("div"),l.className="lc-refresh",l.style.setProperty("--lc-refresh-color",a.getComputedStyle(s.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const b=s.el.parentElement;b&&(b.appendChild(l),l.style.top=`${s.el.offsetTop-36}px`,l.style.left=`${s.el.offsetLeft+s.el.offsetWidth/2}px`),i.set(s,l)}return l},u=(s,l,b)=>{const y=c(s);y.classList.toggle("lc-settling",b),y.style.transform=`translateY(${l}px) rotate(${l*3}deg)`,y.style.opacity=String(Math.min(1,l/Xt))},d=s=>{const l=i.get(s);l&&(l.classList.remove("lc-spinning"),u(s,0,!0),a.setTimeout(()=>{i.get(s)===l&&(l.remove(),i.delete(s))},220))},v=s=>{for(let l=s instanceof Element?s:null;l&&l!==t;l=l.parentElement){const b=Ee(l);if(b&&(b.flags&(nt|tt))!==0)return b}return null},p=s=>{if(r||s.touches.length!==1)return;const l=v(s.target);if(!l)return;const b=s.changedTouches[0];r={node:l,touch:b.identifier,startY:b.clientY,pulling:!1,distance:0}},f=s=>{if(!r)return;const l=[...s.changedTouches].find(y=>y.identifier===r.touch);if(!l)return;const b=l.clientY-r.startY;if(!r.pulling){if(r.node.el.scrollTop>0||b<=0){(b<0||r.node.el.scrollTop>0)&&(r.startY=l.clientY);return}r.pulling=!0}s.cancelable&&s.preventDefault(),r.distance=Math.max(0,b*ls),(r.node.flags&tt)!==0&&n(r.node.id,Rt,r.distance),(r.node.flags&nt)!==0&&u(r.node,r.distance,!1)},E=s=>{if(!r||![...s.changedTouches].some(_=>_.identifier===r.touch))return;const{node:l,pulling:b,distance:y}=r;if(r=null,!b||((l.flags&tt)!==0&&n(l.id,Rt,0),(l.flags&nt)===0))return;if(y<us||s.type==="touchcancel"){d(l);return}u(l,Xt,!0),c(l).classList.add("lc-spinning");const T=n(l.id,Rr);Promise.resolve(T).then(()=>d(l),()=>d(l))};return t.addEventListener("touchstart",p,{passive:!0}),t.addEventListener("touchmove",f,{passive:!1}),t.addEventListener("touchend",E),t.addEventListener("touchcancel",E),{forget(s){var l;(r==null?void 0:r.node)===s&&(r=null),(l=i.get(s))==null||l.remove(),i.delete(s)},destroy(){t.removeEventListener("touchstart",p),t.removeEventListener("touchmove",f),t.removeEventListener("touchend",E),t.removeEventListener("touchcancel",E);for(const s of i.values())s.remove();i.clear(),r=null}}},xe=0,be=-1,ds={run:(e,t,n,o)=>o(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},ps={[Jr]:"a 3D scene",[Qr]:"a 2D scene",[Zr]:"a native view",[Ke]:"a video"},ms=e=>{const t=e.transitions??ds;let n=null,o=[],a=[];const i=new Map,r=(S,w)=>`${S}:${w}`,c=new Set,u=S=>o.includes(S),d=S=>o.some(w=>w.node===S),v=S=>S&&S.kind===se?S.node:null,p=(S,w)=>{e.emit(S.kind===se||S.kind===Ke?S.id:0,w,S.kind,S.id)},f=(S,w,O,F)=>{let D=null;return(S===se||S===Ke)&&(D=e.node(w)??null,!D||S===se&&D.type!=="screen")?(e.warn(`navigation: ${w} is not a live ${S===se?"screen":"video"} node`),null):{kind:S,id:w,node:D,viewName:O,paramsJson:F||"{}",back:xe,retired:!1}},E=(S,w)=>{const O=v(S);if(!O){c.has(S.kind)||(c.add(S.kind),e.warn(`${ps[S.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(O,!0),O.el.classList.remove("lc-covered"),w||!e.root.firstChild?e.root.appendChild(O.el):e.root.insertBefore(O.el,e.root.firstChild)},s=S=>{const w=v(S);!w||S===n||n&&n.node===w||(d(w)?w.el.classList.add("lc-covered"):w.el.remove())},l=S=>{const w=v(S);w&&(n&&n.node===w||d(w)||(w.el.remove(),e.rootOwned(w,!1),e.emit(w.id,Pr)))},b=()=>{const S=a;a=[];for(const w of S)w.node&&t.holds(w.node)?a.push(w):l(w)},y=S=>{!S||S.retired||(S.retired=!0,a.push(S),e.post(b))},T=(S,w,O)=>{const F=O===be?xe:O;t.run(v(S),v(w),F,()=>{w&&s(w),a.length>0&&e.post(b)})},_=(S,w)=>{var D;const O=n;if(!S||O===S)return;t.settle(),O&&p(O,Lt),n=S;const F=!!v(S)&&!!v(O);E(S,!!v(S)&&(!F||t.enterOnTop(w))),p(S,Or),O&&!u(O)&&y(O),T(S,O,w),(D=e.changed)==null||D.call(e)},C=S=>{var O;t.settle();const w=n;w&&(p(w,Lt),n=null,u(w)||y(w),T(null,w,S),(O=e.changed)==null||O.call(e))},h=(S,w)=>{_(S,w),e.emit(0,Nr,S.kind,S.id)},L=S=>{const w=o.length;return S===-1?w-2:S<-1?Math.max(w-1+S,0):S===0?0:Math.min(S,w-1)};return{current:()=>n,stack:()=>o,setUrl(S,w,O){var D;O===null||O===""?i.delete(r(S,w)):i.set(r(S,w),O.startsWith("/")?O:`/${O}`),(n&&n.kind===S&&n.id===w||o.some(B=>B.kind===S&&B.id===w))&&((D=e.changed)==null||D.call(e))},address(){if(n){const w=i.get(r(n.kind,n.id));if(w!==void 0)return w}const S=n?o.lastIndexOf(n):o.length-1;for(let w=S<0?o.length-1:S;w>=0;w--){const O=i.get(r(o[w].kind,o[w].id));if(O!==void 0)return O}return null},forgetUrl(S,w){i.delete(r(S,w))},open(S,w,O,F,D){_(f(S,w,O,F),D)},close(S,w,O){!n||n.kind!==S||n.id!==w||C(O)},routerOpen(S,w,O,F){const D=f(S,w,O,F);if(!D)return;const B=o;o=[D];for(const H of B)H!==n&&y(H);_(D,xe)},routerPush(S,w,O,F,D,B){const H=f(S,w,O,F);H&&(H.back=B===be?xe:B,o.push(H),h(H,D))},routerReplace(S,w,O,F,D,B){const H=f(S,w,O,F);if(!H)return;const W=o[o.length-1];if(!W){H.back=B===be?xe:B,o.push(H),h(H,D);return}H.back=B===be?W.back:B,o[o.length-1]=H,h(H,D),y(W)},routerPop(S,w){if(o.length<=1)return!1;const O=L(S);if(O<0||O>=o.length)return!1;const F=w===be?o[o.length-1].back:w,D=o.splice(O+1);h(o[o.length-1],F);for(const B of D)y(B);return D.length>0},routerHide(S){C(S)},routerRestore(S){const w=o[o.length-1];w&&_(w,S)},reset(){var S;t.settle();for(const w of[n,...o,...a])(S=w==null?void 0:w.node)==null||S.el.remove();n=null,o=[],a=[],i.clear()}}},hs=250,gs="cubic-bezier(0.2, 0.8, 0.2, 1)",ys=6,bs=e=>{const{root:t}=e,n=t.ownerDocument,o=n.defaultView??window,a=new Map,i=f=>{var s;const E=e.value(f.node,"overlayColor");if(E==null){(s=f.scrim)==null||s.remove(),f.scrim=null,f.frame.classList.remove("lc-scrimmed");return}f.scrim||(f.scrim=n.createElement("div"),f.scrim.className="lc-scrim",f.scrim.addEventListener("click",()=>{(f.node.flags&jr)!==0&&e.emit(f.node.id,Cr)}),f.frame.insertBefore(f.scrim,f.frame.firstChild),f.frame.classList.add("lc-scrimmed")),f.scrim.style.backgroundColor=we(E)},r=f=>{const E=e.value(f,"sheetDetents");if(E==null||E==="")return null;const s=String(E).split(",").map(Number).filter(l=>Number.isFinite(l)&&l>0).sort((l,b)=>l-b);return s.length>0?s:null},c=(f,E)=>{const s=f.sheet,l=f.node.el.offsetHeight;if(E<0)return l;const b=s.detents[s.detents.length-1],y=s.detents[Math.max(0,Math.min(E,s.detents.length-1))];return l*(1-y/b)},u=(f,E,s)=>{const l=f.sheet.holder;l.style.transition=s?`transform ${hs}ms ${gs}`:"none",l.style.transform=`translateY(${Math.max(0,E)}px)`},d=(f,E)=>{const s=r(f.node);if(!s||!f.sheet)return;const l=f.sheet;l.detents=s;const b=e.value(f.node,"sheetDismissible");l.dismissible=b==null||Number(b)>.5||b===!0;const y=Number(e.value(f.node,"sheetDetent")??0);if(E){u(f,c(f,-1),!1),l.holder.offsetHeight,l.detent=y,u(f,c(f,y),!0);return}y!==l.detent&&(l.detent=y,u(f,c(f,y),!0))},v=f=>{const E=f.node.el;E.addEventListener("pointerdown",s=>{const l=f.sheet;if(!l||s.pointerType==="mouse"&&s.button!==0)return;for(let h=s.target instanceof Element?s.target:null;h&&h!==E;h=h.parentElement)if(h.scrollTop>0)return;const b=c(f,l.detent);let y=!1,T=b;const _=h=>{if(h.pointerId!==s.pointerId)return;const L=h.clientY-s.clientY;if(!y){if(Math.abs(L)<ys||Math.abs(L)<Math.abs(h.clientX-s.clientX))return;y=!0}T=Math.max(0,b+L),u(f,T,!1)},C=h=>{if(h.pointerId!==s.pointerId||(n.removeEventListener("pointermove",_),n.removeEventListener("pointerup",C),n.removeEventListener("pointercancel",C),!y||!f.sheet))return;let L=0,S=1/0;for(let D=0;D<l.detents.length;D++){const B=Math.abs(c(f,D)-T);B<S&&(S=B,L=D)}const w=c(f,0),O=E.offsetHeight;if(l.dismissible&&T>w+(O-w)/2){u(f,O,!0),(f.node.flags&Ot)!==0&&e.emit(f.node.id,xt,-1);return}l.detent=L,u(f,c(f,L),!0),(f.node.flags&Ot)!==0&&e.emit(f.node.id,xt,L)};n.addEventListener("pointermove",_),n.addEventListener("pointerup",C),n.addEventListener("pointercancel",C)})};let p=null;return{show(f,E,s){if(a.has(f))return;e.flush();const l=n.createElement("div");l.className="lc-widget-frame";const b={node:f,frame:l,scrim:null,sheet:null};if(r(f)){const T=n.createElement("div");T.className="lc-sheet",T.appendChild(f.el),l.appendChild(T),b.sheet={holder:T,detents:[1],detent:-1,dismissible:!0},v(b)}else l.appendChild(f.el);a.set(f,b),e.rootOwned(f,!0),i(b);const y=E===se?e.node(s):void 0;(E!==He&&y?y.el:t).appendChild(l),b.sheet&&d(b,!0)},hide(f){const E=a.get(f);E&&(a.delete(f),f.el.remove(),E.frame.remove(),e.rootOwned(f,!1))},overlay(f,E){const s=a.get(f);s&&(E===void 0?i(s):s.scrim&&(s.scrim.style.backgroundColor=we(E)))},restyle(f){const E=a.get(f);E&&(i(E),E.sheet&&d(E,!1))},forget(f){const E=a.get(f);E&&(a.delete(f),E.frame.remove())},shown:()=>[...a.keys()],backTargets:()=>[...a.keys()].reverse().filter(f=>(f.flags&Kr)!==0),isFrame:f=>f.classList.contains("lc-widget-frame"),toast(f,E){(!p||!p.isConnected)&&(p=n.createElement("div"),p.className="lc-toasts",t.appendChild(p));const s=n.createElement("div");s.className="lc-toast",s.setAttribute("role","status"),s.textContent=f,p.appendChild(s),s.offsetHeight,s.classList.add("lc-on"),o.setTimeout(()=>{s.classList.remove("lc-on"),o.setTimeout(()=>s.remove(),200)},Math.max(500,E))},destroy(){for(const f of a.values())f.frame.remove();a.clear(),p==null||p.remove(),p=null}}};var vs=(async function(e={}){var t,n=e,o,a,i=new Promise((R,N)=>{o=R,a=N}),r=(R,N)=>{throw N},c=import.meta.url,u="";function d(R){return n.locateFile?n.locateFile(R,u):u+R}var v;{try{u=new URL(".",c).href}catch{}v=async R=>{var N=await fetch(R,{credentials:"same-origin"});if(N.ok)return N.arrayBuffer();throw new Error(N.status+" : "+N.url)}}console.log.bind(console);var p=console.error.bind(console),f,E,s=!1,l,b;function y(){var R=E.buffer;n.HEAPU8=b=new Uint8Array(R),n.HEAP32=new Int32Array(R),n.HEAPU32=new Uint32Array(R),n.HEAPF32=new Float32Array(R),new BigInt64Array(R),new BigUint64Array(R)}function T(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)g(n.preRun.shift());I(m)}function _(){z.g()}function C(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)P(n.postRun.shift());I($)}var h=0,L=null;function S(R){var N;h++,(N=n.monitorRunDependencies)==null||N.call(n,h)}function w(R){var U;if(h--,(U=n.monitorRunDependencies)==null||U.call(n,h),h==0&&L){var N=L;L=null,N()}}function O(R){var U;(U=n.onAbort)==null||U.call(n,R),R="Aborted("+R+")",p(R),s=!0,R+=". Build with -sASSERTIONS for more info.";var N=new WebAssembly.RuntimeError(R);throw a(N),N}var F;function D(){return n.locateFile?d("creatorTween.wasm"):new URL(""+new URL("assets/creatorTween-PF8B6T8V.wasm",import.meta.url).href,import.meta.url).href}function B(R){if(R==F&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}async function H(R){if(!f)try{var N=await v(R);return new Uint8Array(N)}catch{}return B(R)}async function W(R,N){try{var U=await H(R),V=await WebAssembly.instantiate(U,N);return V}catch(Y){p(`failed to asynchronously prepare wasm: ${Y}`),O(Y)}}async function G(R,N,U){if(!R&&typeof WebAssembly.instantiateStreaming=="function")try{var V=fetch(N,{credentials:"same-origin"}),Y=await WebAssembly.instantiateStreaming(V,U);return Y}catch(K){p(`wasm streaming compile failed: ${K}`),p("falling back to ArrayBuffer instantiation")}return W(N,U)}function X(){return{a:nr}}async function x(){function R(K,ke){return z=K.exports,E=z.f,y(),he=z.F,w(),z}S();function N(K){return R(K.instance)}var U=X();if(n.instantiateWasm)return new Promise((K,ke)=>{n.instantiateWasm(U,(sr,xi)=>{K(R(sr))})});F??(F=D());try{var V=await G(f,F,U),Y=N(V);return Y}catch(K){return a(K),Promise.reject(K)}}class k{constructor(N){Pe(this,"name","ExitStatus");this.message=`Program terminated with exit(${N})`,this.status=N}}var I=R=>{for(;R.length>0;)R.shift()(n)},$=[],P=R=>$.push(R),m=[],g=R=>m.push(R),A=!0,M=()=>O(""),j=0,Q=()=>{A=!1,j=0},J={},ue=R=>{if(R instanceof k||R=="unwind")return l;r(1,R)},Te=()=>A||j>0,q=R=>{var N;l=R,Te()||((N=n.onExit)==null||N.call(n,R),s=!0),r(R,new k(R))},_e=(R,N)=>{l=R,q(R)},pe=_e,me=()=>{if(!Te())try{pe(l)}catch(R){ue(R)}},Wn=R=>{if(!s)try{R(),me()}catch(N){ue(N)}},Hn=()=>performance.now(),zn=(R,N)=>{if(J[R]&&(clearTimeout(J[R].id),delete J[R]),!N)return 0;var U=setTimeout(()=>{delete J[R],Wn(()=>rr(R,Hn()))},N);return J[R]={id:U,timeout_ms:N},0},Vn=()=>2147483648,Gn=(R,N)=>Math.ceil(R/N)*N,jn=R=>{var N=E.buffer,U=(R-N.byteLength+65535)/65536|0;try{return E.grow(U),y(),1}catch{}},Kn=R=>{var N=b.length;R>>>=0;var U=Vn();if(R>U)return!1;for(var V=1;V<=4;V*=2){var Y=N*(1+.2/V);Y=Math.min(Y,R+100663296);var K=Math.min(U,Gn(Math.max(R,Y),65536)),ke=jn(K);if(ke)return!0}return!1},wt=(R,N)=>{R<128?N.push(R):N.push(R%128|128,R>>7)},Yn=R=>{for(var N={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},U={parameters:[],results:R[0]=="v"?[]:[N[R[0]]]},V=1;V<R.length;++V)U.parameters.push(N[R[V]]);return U},Xn=(R,N)=>{var U=R.slice(0,1),V=R.slice(1),Y={i:127,p:127,j:126,f:125,d:124,e:111};N.push(96),wt(V.length,N);for(var K of V)N.push(Y[K]);U=="v"?N.push(0):N.push(1,Y[U])},qn=(R,N)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Yn(N),R);var U=[1];Xn(N,U);var V=[0,97,115,109,1,0,0,0,1];wt(U.length,V),V.push(...U),V.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var Y=new WebAssembly.Module(new Uint8Array(V)),K=new WebAssembly.Instance(Y,{e:{f:R}}),ke=K.exports.f;return ke},he,St=R=>he.get(R),Jn=(R,N)=>{if(fe)for(var U=R;U<R+N;U++){var V=St(U);V&&fe.set(V,U)}},fe,Qn=R=>(fe||(fe=new WeakMap,Jn(0,he.length)),fe.get(R)||0),Je=[],Zn=()=>{if(Je.length)return Je.pop();try{he.grow(1)}catch(R){throw R instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":R}return he.length-1},Qe=(R,N)=>he.set(R,N),er=(R,N)=>{var U=Qn(R);if(U)return U;var V=Zn();try{Qe(V,R)}catch(K){if(!(K instanceof TypeError))throw K;var Y=qn(R,N);Qe(V,Y)}return fe.set(R,V),V},tr=R=>{fe.delete(St(R)),Qe(R,null),Je.push(R)};n.noExitRuntime&&(A=n.noExitRuntime),n.print&&n.print,n.printErr&&(p=n.printErr),n.wasmBinary&&(f=n.wasmBinary),n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.addFunction=er,n.removeFunction=tr;var nr={e:M,b:Q,c:zn,d:Kn,a:q},z=await x();z.g,n._ctweenSetHost=z.h,n._ctweenBind=z.i,n._ctweenCreate=z.j,n._ctweenExists=z.k,n._ctweenPlay=z.l,n._ctweenPause=z.m,n._ctweenResume=z.n,n._ctweenCancel=z.o,n._ctweenFinish=z.p,n._ctweenSeek=z.q,n._ctweenSetRate=z.r,n._ctweenGetTime=z.s,n._ctweenGetElapsed=z.t,n._ctweenIsPlaying=z.u,n._ctweenCancelTarget=z.v,n._ctweenTick=z.w,n._ctweenPollEvents=z.x,n._ctweenCount=z.y,n._ctweenParseEasing=z.z,n._ctweenCurrentValue=z.A,n._ctweenSampleTrack=z.B,n._ctweenReset=z.C,n._ctweenEaseNamed=z.D;var rr=z.E;n._malloc=z.G,n._free=z.H;function Ze(){if(h>0){L=Ze;return}if(T(),h>0){L=Ze;return}function R(){var N;n.calledRun=!0,!s&&(_(),o(n),(N=n.onRuntimeInitialized)==null||N.call(n),C())}n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),R()},1)):R()}function or(){if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()()}return or(),Ze(),t=i,t});const Ln=0,An=1,$n=2,Cn=3,On=4,Es=8,de=0,qt=6,ws=1,Ss=new TextDecoder,Ts=new TextEncoder,_s=async e=>{const t=await vs({locateFile:()=>e}),n=s=>{if(s===0)return null;const l=t.HEAPU8;let b=s;for(;l[b]!==0;)b++;return Ss.decode(l.subarray(s,b))},o=s=>{const l=Ts.encode(s),b=t._malloc(l.length+1);return t.HEAPU8.set(l,b),t.HEAPU8[b+l.length]=0,b},a=s=>{const l=t._malloc(Math.max(1,s.length)*4);return t.HEAPF32.set(s,l>>2),l},i=s=>{const l=s.map(o),b=t._malloc(Math.max(1,l.length)*4);for(let y=0;y<l.length;y++)t.HEAPU32[(b>>2)+y]=l[y];return{table:b,free(){for(const y of l)t._free(y);t._free(b)}}},r=s=>{const l=t.HEAPU32,b=t.HEAP32,y=s>>2,T=b[y+7],_=l[y+6],C=[];if(_!==0)for(let h=0;h<T;h++)C.push(t.HEAPF32[(_>>2)+h]);return{animation:l[y],domain:b[y+1],target:l[y+2],prop:n(l[y+3])??"",kind:b[y+4],sig:n(l[y+5]),lanes:C,str:n(l[y+8])}};let c=null,u=s=>t.HEAP32[(s>>2)+7];const d=t._malloc(32),v=[0,t.addFunction((s,l)=>{c==null||c.write(r(l))},"vii"),t.addFunction((s,l,b)=>{const y=u(l),T=(c==null?void 0:c.read(r(l),y))??null;if(!T||T.length<y)return 0;for(let _=0;_<y;_++)t.HEAPF32[(b>>2)+_]=T[_];return 1},"iiii"),t.addFunction((s,l)=>{c==null||c.commit(r(l))},"vii"),t.addFunction((s,l,b,y,T,_)=>{const C=(c==null?void 0:c.resolveColor(l,b,n(y)??"",n(T)??""))??null;if(!C)return 0;for(let h=0;h<4;h++)t.HEAPF32[(_>>2)+h]=C[h];return 1},"iiiiiii"),t.addFunction((s,l,b)=>{const y=(c==null?void 0:c.resolveTransform(n(l)??""))??null;if(!y)return 0;for(let T=0;T<5;T++)t.HEAPF32[(b>>2)+T]=y[T];return 1},"iiii"),0,0];for(let s=0;s<v.length;s++)t.HEAPU32[(d>>2)+s]=v[s];t._ctweenSetHost(d);let p=null;const f=t.addFunction((s,l,b)=>{p==null||p(l,b)},"viii"),E=t._malloc(768);return{setHost(s){c=s},create(s,l){const b=a(s),y=i(l),T=t._ctweenCreate(b,s.length,y.table,l.length);return t._free(b),y.free(),T},bind(s,l,b){const y=a(s),T=t._malloc(Math.max(1,l.length)*4);for(let L=0;L<l.length;L++)t.HEAPU32[(T>>2)+L]=l[L];const _=t._malloc(Math.max(1,s.length)*4);p=b;const C=t._ctweenBind(y,s.length,T,l.length,_,f,0);p=null;const h=C>0?t.HEAPF32.slice(_>>2,(_>>2)+C):null;return t._free(y),t._free(T),t._free(_),h},valid(s,l){const b=a(s),y=t._ctweenBind(b,s.length,0,l,0,0,0);return t._free(b),y!==0},exists:s=>t._ctweenExists(s)!==0,play:s=>t._ctweenPlay(s),pause:s=>t._ctweenPause(s),resume:s=>t._ctweenResume(s),cancel:s=>t._ctweenCancel(s),finish:s=>t._ctweenFinish(s),seek:(s,l)=>t._ctweenSeek(s,l),setRate:(s,l)=>t._ctweenSetRate(s,l),time:s=>t._ctweenGetTime(s),elapsed:s=>t._ctweenGetElapsed(s),isPlaying:s=>t._ctweenIsPlaying(s)!==0,cancelTarget:(s,l)=>t._ctweenCancelTarget(s,l),tick:(s,l)=>t._ctweenTick(s,l),count:()=>t._ctweenCount(),reset:()=>t._ctweenReset(),current(s,l,b,y,T){const _=o(b),C=t._malloc(Math.max(1,T)*4),L=t._ctweenCurrentValue(s,l,_,y,C,T)!==0?Array.from(t.HEAPF32.subarray(C>>2,(C>>2)+T)):null;return t._free(_),t._free(C),L},poll(){const s=[];for(;;){const l=t._ctweenPollEvents(E,64);for(let b=0;b<l;b++){const y=(E>>2)+b*3;s.push({id:t.HEAPU32[y],kind:t.HEAP32[y+1],index:t.HEAP32[y+2]})}if(l<64)break}return s}}},vt={translate:{args:2,unit:"px"},translateX:{args:1,unit:"px"},translateY:{args:1,unit:"px"},"translate%":{args:2,unit:"%"},"translateX%":{args:1,unit:"%"},"translateY%":{args:1,unit:"%"},rotate:{args:1,unit:"deg"},skewX:{args:1,unit:"deg"},skewY:{args:1,unit:"deg"},scale:{args:2,unit:""},scaleX:{args:1,unit:""},scaleY:{args:1,unit:""}},oe=e=>Math.round(e*1e4)/1e4,ks=(e,t)=>{const n=[];let o=0;for(const a of e.split(",").filter(Boolean)){const i=vt[a];if(!i)continue;const r=t.slice(o,o+i.args).map(c=>`${oe(c)}${i.unit}`);o+=i.args,n.push(`${a.replace("%","")}(${r.join(", ")})`)}return n.length>0?n.join(" "):"none"},Rs=(e,t)=>{const n=t.split(",").filter(Boolean),o=[],a=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let i=0;for(let r=a.exec(e);r;r=a.exec(e),i++){const c=n[i];if(!c||c.replace("%","")!==r[1])return null;const u=vt[c],d=r[2].split(",").map(v=>parseFloat(v));if(d.some(v=>!Number.isFinite(v)))return null;for(;d.length<u.args;)d.push(r[1]==="translate"?0:d[0]);o.push(...d.slice(0,u.args))}return i===n.length?o:null},xs=e=>{const t=[];for(const n of e.split(",").filter(Boolean)){const o=vt[n];if(o)for(let a=0;a<o.args;a++)t.push(n.startsWith("scale")?1:0)}return t},Jt=e=>{if(e==="none"||e==="")return[0,0,0,1,1];const t=/^matrix\(([^)]+)\)$/.exec(e.trim());if(!t)return null;const[n,o,a,i,r,c]=t[1].split(",").map(u=>parseFloat(u));return[r,c,Math.atan2(o,n),Math.hypot(n,o),Math.hypot(a,i)]},Qt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return[+t[1]/255,+t[2]/255,+t[3]/255,o]}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?[+n[1],+n[2],+n[3],n[4]===void 0?1:+n[4]]:null},Zt=e=>{switch(e.kind){case Ln:return oe(e.lanes[0]??0);case An:return`${oe(e.lanes[0]??0)}${e.sig??""}`;case $n:{const[t=0,n=0,o=0,a=1]=e.lanes,i=r=>Math.max(0,Math.min(255,Math.round(r*255)));return`rgba(${i(t)}, ${i(n)}, ${i(o)}, ${oe(Math.max(0,Math.min(1,a)))})`}case Cn:return ks(e.sig??"",e.lanes);case On:{const[t=0,n=0,o=0,a=1,i=1]=e.lanes;return`translate(${oe(t)}px, ${oe(n)}px) rotate(${oe(o)}rad) scale(${oe(a)}, ${oe(i)})`}default:return e.str}},st=new Set(["text","src","value"]),Ls=e=>{const t=e.root.ownerDocument.defaultView??window,n=new Map,o=(r,c)=>{var v;const u=n.get(r.id),d=u==null?void 0:u.get(c);if(!(!u||!d)){for(const p of d)r.el.style.removeProperty(p);u.delete(c),u.size===0&&n.delete(r.id),(v=e.wrote)==null||v.call(e,r,c,void 0)}},a=(r,c,u)=>{var p;const d=Ve([[c,u]],e.ctx);let v=n.get(r.id);v||n.set(r.id,v=new Map),v.set(c,[...d.keys()]);for(const[f,E]of d)r.el.style.setProperty(f,E);(p=e.wrote)==null||p.call(e,r,c,u)},i=(r,c,u)=>{var f;const d=(f=n.get(r.id))==null?void 0:f.get(c),v=d!=null&&d.includes(u)?r.el.style.getPropertyValue(u):"";v!==""&&r.el.style.removeProperty(u),e.flush();const p=t.getComputedStyle(r.el).getPropertyValue(u).trim();return v!==""&&r.el.style.setProperty(u,v),p};return{write(r){const c=e.node(r.target);if(c){if(st.has(r.prop)){r.str!==null&&e.setString(c.id,r.prop,r.str);return}a(c,ce(r.prop),Zt(r))}},read(r,c){const u=e.node(r.target);if(!u||st.has(r.prop)||r.kind===Es)return null;const d=ce(r.prop),v=ft(d);if(v===null)return null;const p=i(u,d,v);switch(r.kind){case Ln:{const f=parseFloat(p);return Number.isFinite(f)?[f]:p==="none"||p==="auto"||p==="normal"?[0]:null}case An:{const f=parseFloat(p);return r.sig==="px"&&Number.isFinite(f)?[f]:null}case $n:return Qt(p);case On:return Jt(p);case Cn:{const f=r.sig??"",E=e.value(u,"transform"),s=p==="none"||E===void 0||E===null?xs(f):Rs(String(E),f);return s&&s.length===c?s:null}default:return null}},commit(r){const c=e.node(r.target);if(!c||st.has(r.prop))return;const u=ce(r.prop);o(c,u),e.setStyle(c,u,Zt(r))},resolveColor(r,c,u){const d=e.node(r),v=ft(ce(c));if(!d||v===null)return null;const p=e.root.ownerDocument.createElement("span");p.style.cssText="position:absolute;visibility:hidden;pointer-events:none",d.el.appendChild(p),p.style.color=u;const E=p.style.color!==""?Qt(t.getComputedStyle(p).color):null;return p.remove(),E},resolveTransform(r){const c=e.root.ownerDocument.createElement("span");c.style.cssText="position:absolute;visibility:hidden;pointer-events:none;display:block",e.root.appendChild(c),c.style.transform=r;const u=c.style.transform===""&&r.trim()!==""&&r.trim()!=="none"?null:Jt(t.getComputedStyle(c).transform);return c.remove(),u},restore(r,c){o(r,ce(c))},styled(r,c){o(r,c)},forget(r){n.delete(r.id)}}},As=0,$s=1,Cs=2,Os=3,Ms=1,Ns=65,Ps=100,Is=(e,t)=>{const{win:n,ui:o}=t;let a=[];e.setHost({write(h){h.domain===de?o.write(h):h.domain===qt&&a.push({id:h.animation,slot:h.target-1,lanes:h.lanes})},read:(h,L)=>h.domain!==de?null:e.current(de,h.target,h.prop,h.kind,L)??o.read(h,L),commit(h){h.domain===de&&o.commit(h)},resolveColor:(h,L,S,w)=>h===de?o.resolveColor(L,S,w):null,resolveTransform:h=>o.resolveTransform(h)});const i=()=>{if(a.length===0)return;const h=a;a=[];const L=t.callback();if(L)for(const S of h)L(S.id,2,S.slot,...S.lanes)},r=[],c=new Set;let u=0,d=0;const v=h=>{const L=r.indexOf(h);if(!(L<0)){r.splice(L,1),c.delete(h.animation);for(const[S,w]of h.moved)o.restore(S,w);h.onEnd()}},p=()=>{i();const h=t.callback();for(const L of e.poll())c.has(L.id)||(h==null||h(L.id,L.kind,L.index),L.kind===ws&&l.delete(L.id))},f=h=>{u=0;const L=Math.min(Ps,Math.max(0,h-d));d=h,e.tick(L,L);for(const S of[...r])r.includes(S)&&(S.started?e.exists(S.animation)||v(S):(S.started=!0,e.play(S.animation)));p(),E()};function E(){u===0&&(e.count()===0&&r.length===0||((d===0||e.count()===0)&&(d=n.performance.now()),u=n.requestAnimationFrame(f)))}const s=()=>{u===0&&(d=n.performance.now()),p(),E()},l=new Set,b=new FinalizationRegistry(h=>{!e.exists(h)||e.isPlaying(h)||e.cancel(h)}),y=(h,L)=>{if(h.length<10)return!1;const S=h[7],w=h[8],O=h[9];let F=10+w+O*Ns;for(let D=0;D<S;D++){if(F+10>h.length)return!1;const B=h[F],H=L[h[F+1]],W=typeof H=="number"?H:0;h[F+1]=B===de?t.node(W)?W:0:B===qt?W:0,F+=10+h[F+8]*(7+h[F+4])}return F===h.length},T=new Map;let _=1;const C={run(h,L,S,w){C.settle();const O=T.get(S);if(!O||!h&&!L){w();return}const F=!!h&&!!L,D=F?As:Cs,B=F?$s:Os,H=O.roles.map(x=>x===D?h:x===B?L:null),W=[],G=e.bind(O.data,H.map(x=>(x==null?void 0:x.id)??0),(x,k)=>{const I=H[x],$=O.strings[k];I&&$!==void 0&&W.push([I,$])}),X=G?e.create(G,O.strings):0;if(X===0){w();return}c.add(X),r.push({animation:X,leaving:L,started:!1,moved:W,onEnd:w}),e.seek(X,0),s()},settle(){const h=r[0];h&&(e.cancel(h.animation),v(h))},enterOnTop:h=>{var L;return((L=T.get(h))==null?void 0:L.enterOnTop)??!0},holds:h=>r.some(L=>L.leaving===h)};return{transitions:C,define(h,L,S,w){const O=Float32Array.from(h);if(!e.valid(O,S.length))return 0;const F=_++;return T.set(F,{data:O,strings:L.slice(),roles:S.slice(),enterOnTop:(w&Ms)!==0}),F},create(h,L,S){const w=Float32Array.from(h);if(!y(w,S))return null;const O=e.create(w,L);if(O===0)return null;const F={id:O};return b.register(F,O),F},control(h,L){switch(L){case 0:e.play(h),l.add(h);break;case 1:e.pause(h);break;case 2:e.resume(h);break;case 3:e.cancel(h),l.delete(h);break;case 4:e.finish(h);break}s()},seek(h,L){e.seek(h,L),s()},setRate(h,L){e.setRate(h,L)},time:h=>e.time(h),elapsed:h=>e.elapsed(h),forget(h){e.cancelTarget(de,h.id),o.forget(h);for(const L of r)L.leaving===h&&(L.leaving=null),L.moved=L.moved.filter(([S])=>S!==h)},count:()=>e.count(),destroy(){u!==0&&n.cancelAnimationFrame(u),u=0,r.length=0,c.clear(),l.clear(),T.clear(),a=[],e.reset(),e.setHost(null)}}},Fs={isViewSupported:"phase 2",viewVersion:"phase 2",viewCall:"phase 2",pagerSetContent:"phase 2",pagerSelect:"phase 2",pagerPush:"phase 2",pagerPop:"phase 2",pagerPopToRoot:"phase 2",pagerReplace:"phase 2",vlistInit:"phase 2",vlistSetKeys:"phase 2",vlistInsertKeys:"phase 2",vlistRemoveKeys:"phase 2",vlistInvalidate:"phase 2",vlistMount:"phase 2",vlistScrollTo:"phase 2",vlistScrollToKey:"phase 2",vlistScrollToEnd:"phase 2",tweenCreate:"no tween engine was given to this tree"},Ds=e=>{const t=e.root,n=t.ownerDocument,o=n.defaultView??window,a=new Set,i=m=>console.warn(`[web-lite] ${m}`),r=m=>{if(a.has(m))return;a.add(m);const g=Fs[m]??"";i(/^(step|phase)/.test(g)?`${m} is not built yet (docs/plans/web-lite-plan.md, ${g})`:`${m}: ${g}`)};let c=[],u=!1;const d=m=>{c.push(m),!u&&(u=!0,queueMicrotask(()=>{u=!1;const g=c;c=[];for(const A of g)A()}))};let v=null;const p=(m,g,...A)=>{if(v)try{return v(m,g,...A)}catch(M){o.setTimeout(()=>{throw M},0);return}};t.classList.add("lc-root");const f=e.sink??Uo(n),E=Go(f),s=Yo(f,E,{bufferUrl:e.bufferUrl},i),l=new Map;let b=1;const y=new ResizeObserver(m=>{for(const g of m){const A=g.target,M=l.get(Number(A.getAttribute("data-node")));!M||M.el!==A||!(M.flags&ge)||p(M.id,br,A.offsetLeft,A.offsetTop,A.offsetWidth,A.offsetHeight)}}),T=cs({doc:n,bufferUrl:e.bufferUrl,hasTint:m=>s.names(m,"tintColor"),swapped:(m,g)=>{y.unobserve(g),m.flags&ge&&y.observe(m.el)},warn:i});s.onChange=m=>{const g=m;eo(g,A=>s.value(g,A)),g.type==="image"&&T.restyle(g),g.type==="widget"&&G.restyle(g)};const _=os({root:t,emit:p,value:(m,g)=>s.value(m,g),boundary:m=>G.isFrame(m)}),C=fs({root:t,emit:p}),h=new ResizeObserver(()=>{p(0,Mr,t.clientWidth,t.clientHeight)});h.observe(t);let L=null;const S=e.tween?Ls({root:t,ctx:{bufferUrl:e.bufferUrl},node:m=>l.get(m),value:(m,g)=>s.value(m,g),setStyle:(m,g,A)=>s.set(m,g,A),setString:(m,g,A)=>P.setString(m,g,A),wrote:(m,g,A)=>{g==="overlayColor"&&m.type==="widget"&&G.overlay(m,A)},flush:()=>s.flush()}):null,w=e.tween&&S?Is(e.tween,{win:o,ui:S,node:m=>l.get(m),callback:()=>L}):null;s.onWrite=(m,g)=>S==null?void 0:S.styled(m,g);const O=m=>m.parent===null&&!m.rooted,F=(m,g,A=!0)=>{for(const M of Ge(m))F(M,g,!1);A||g.push(m.id),_.forget(m),C.forget(m),W.forgetUrl(se,m.id),w==null||w.forget(m),G.forget(m),s.drop(m),y.unobserve(m.el),B.unregister(m.token),l.delete(m.id),m.parent=null,m.held=!1,A&&m.el.remove()},D=m=>{if(!l.has(m.id)||m.held||!O(m))return;const g=[];F(m,g),g.length>0&&p(0,At,g)},B=new FinalizationRegistry(m=>{const g=l.get(m);g&&(g.held=!1,O(g)&&d(()=>D(g)))}),H=m=>{m.held||d(()=>D(m))},W=ms({root:t,emit:p,post:d,warn:i,node:m=>l.get(m),rootOwned:(m,g)=>{m.rooted=g,g||H(m)},changed:e.onNavigation,transitions:e.transitions??(w==null?void 0:w.transitions)}),G=bs({root:t,emit:p,node:m=>l.get(m),value:(m,g)=>s.value(m,g),rootOwned:(m,g)=>{m.rooted=g,g||H(m)},flush:()=>s.flush()}),X=()=>{for(const g of G.backTargets())if(p(g.id,Ie,He,0)===!0)return"widget";const m=W.current();if(m){const g=m.kind===se||m.kind===Ke?m.id:0;if(p(g,Ie,m.kind,m.id)===!0)return"destination"}return W.routerPop(-1,be)?"router":p(0,Ie,He,0)===!0?"app":"none"},x=m=>{if(!(m.key!=="Escape"||m.defaultPrevented)){for(const g of G.backTargets())if(p(g.id,Ie,He,0)===!0){m.preventDefault();return}}};n.addEventListener("keydown",x);const k=ns({root:t,roots:()=>{const m=W.current();return[...m!=null&&m.node&&m.kind===se?[{kind:"screen",node:m.node}]:[],...G.shown().map(A=>({kind:"widget",node:A}))]},value:(m,g)=>s.value(m,g),owns:(m,g)=>s.owns(m,g),flush:()=>s.flush()});let I=0;const $=m=>{if(!m.isConnected)return null;s.flush();const g=pn(t)||1,A=t.getBoundingClientRect(),M=m.getBoundingClientRect();return M.width===0&&M.height===0&&m.offsetParent===null?null:[(M.left-A.left)/g,(M.top-A.top)/g,M.width/g,M.height/g]},P={create(m){const g=Jo(n,b++,m);xn(g),l.set(g.id,g);const A={id:g.id};return B.register(A,g.id,g.token),A},destroy(m){const g=l.get(m);if(!g)return;if(!O(g)){console.error(`[web-lite] destroy: node ${m} is attached — remove / hide / close it first`);return}g.held=!1;const A=[];F(g,A),A.length>0&&p(0,At,A)},insert(m,g,A){var ue;const M=l.get(m),j=l.get(g);if(!M||!j||j===M)return;if(!O(j)){i(`insert: node ${g} is not a root — remove it from where it is first`);return}const Q=Ge(M),J=Math.max(0,Math.min(A,Q.length));j.parent=M,M.el.insertBefore(j.el,((ue=Q[J])==null?void 0:ue.el)??null)},remove(m,g){const A=l.get(m),M=l.get(g);!A||!M||M.parent!==A||(M.parent=null,M.el.remove(),H(M))},parent:m=>{var g,A;return((A=(g=l.get(m))==null?void 0:g.parent)==null?void 0:A.id)??0},children(m){const g=l.get(m);return g?Ge(g).map(A=>A.id):[]},setString(m,g,A){const M=l.get(m);if(M)switch(A===null?M.strings.delete(g):M.strings.set(g,A),g){case"text":M.type==="text"&&(M.el.textContent=A??"");return;case"name":A===null?M.el.removeAttribute("data-name"):M.el.setAttribute("data-name",A);return;case"src":M.type==="image"&&T.setSrc(M,A);return;case"srcTintColor":M.type==="image"&&T.setSrcTint(M,A);return;case"sourceRect":M.type==="image"&&T.setSourceRect(M,A);return;case"value":if(M.type==="input"||M.type==="textarea"){const j=M.el;j.value!==(A??"")&&(j.value=A??"")}return;case"focus":A==="1"?M.el.focus({preventScroll:!0}):M.el.blur();return}},setInt(m,g,A){var M;(M=l.get(m))==null||M.strings.set(g,String(A))},setFlags(m,g){const A=l.get(m);if(!A)return;const M=A.flags;A.flags=g,A.el.classList.toggle(pt,(g&We)!==0),g&ge&&!(M&ge)?y.observe(A.el):!(g&ge)&&M&ge&&y.unobserve(A.el)},getTextValue(m){const g=l.get(m);return g&&(g.type==="input"||g.type==="textarea")?g.el.value:""},setStyle(m,g,A){const M=l.get(m);M&&s.set(M,g,A)},mergeStyle(m,g){const A=l.get(m);A&&s.merge(A,g)},setClass(m,g,A){const M=l.get(m);M&&s.setClass(M,g,A)},setTheme(m){for(const g of Object.keys(m)){const A=m[g];A==null?t.style.removeProperty(`--${g}`):t.style.setProperty(`--${g}`,typeof A=="number"?ie(A):Ce(A))}},defineTransition(m,g,A,M){return w?w.define(m,g,A,M):++I},open:W.open,close:W.close,routerOpen:(m,g,A,M)=>W.routerOpen(m,g,A,M),routerPush:W.routerPush,routerReplace:W.routerReplace,routerPop:(m,g)=>{W.routerPop(m,g)},routerHide:W.routerHide,routerRestore:W.routerRestore,setDestUrl:W.setUrl,isViewSupported:()=>(r("isViewSupported"),!1),viewVersion:()=>0,viewCall:(m,g,A,M,j)=>{r("viewCall"),j("native views are not built yet")},showWidget(m,g,A){const M=l.get(m);M&&G.show(M,g,A)},hideWidget(m){const g=l.get(m);g&&G.hide(g)},pagerSetContent:()=>r("pagerSetContent"),pagerSelect:()=>r("pagerSelect"),pagerPush:()=>r("pagerPush"),pagerPop:()=>r("pagerPop"),pagerPopToRoot:()=>r("pagerPopToRoot"),pagerReplace:()=>r("pagerReplace"),vlistInit:()=>r("vlistInit"),vlistSetKeys:()=>r("vlistSetKeys"),vlistInsertKeys:()=>r("vlistInsertKeys"),vlistRemoveKeys:()=>r("vlistRemoveKeys"),vlistInvalidate:()=>r("vlistInvalidate"),vlistMount:()=>r("vlistMount"),vlistScrollTo:()=>r("vlistScrollTo"),vlistScrollToKey:()=>r("vlistScrollToKey"),vlistScrollToEnd:()=>r("vlistScrollToEnd"),registerFont(m,g,A,M,j,Q){try{const J=new o.FontFace(m,`url("${g}")`,{weight:String(A),style:M===2?"italic":"normal"});n.fonts.add(J),J.load().then(()=>j(),()=>Q())}catch{Q()}},fontFormat:"woff2",toast:(m,g)=>G.toast(m,g),isButtonPressed(m){const g=l.get(m);return!!g&&_.isPressed(g)},isHovered(m){const g=l.get(m);return!!g&&_.isHovered(g)},getBoundingClientRect(m){const g=l.get(m);return g?$(g.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>k.dump(),debugPaint:m=>k.paint(l.get(m)),tweenCreate(m,g,A){return w?w.create(m,g,A):(r("tweenCreate"),null)},tweenControl:(m,g)=>w==null?void 0:w.control(m,g),tweenSeek:(m,g)=>w==null?void 0:w.seek(m,g),tweenSetRate:(m,g)=>w==null?void 0:w.setRate(m,g),tweenGetTime:m=>(w==null?void 0:w.time(m))??0,tweenGetElapsed:m=>(w==null?void 0:w.elapsed(m))??0,registerTweenEvent(m){L=m},setEmitter(m){v=m}};return{bridge:P,presentation:W,back:X,setSafeArea(m,g=[]){for(const A of["top","right","bottom","left"])t.style.setProperty(`--safe-${A}`,`${m[A]}px`),g.includes(A)?t.style.setProperty(`--safe-${A}-bar`,`${m[A]}px`):t.style.removeProperty(`--safe-${A}-bar`)},flush:()=>s.flush(),stats:()=>({nodes:l.size,classes:E.count(),tweens:(w==null?void 0:w.count())??0}),destroy(){v=null,W.reset(),w==null||w.destroy(),G.destroy(),n.removeEventListener("keydown",x),_.destroy(),C.destroy(),h.disconnect(),y.disconnect();for(const m of l.values())B.unregister(m.token),m.el.remove();l.clear(),e.sink||f.destroy(),t.classList.remove("lc-root");for(const m of Array.from(t.style))m.startsWith("--")&&t.style.removeProperty(m)}}},Bs=""+new URL("assets/creatorTween-PF8B6T8V.wasm",import.meta.url).href,Us=()=>_s(new URL(Bs,import.meta.url).href),le=[null],Et=new TextDecoder("utf-8"),Ws=e=>JSON.parse(Et.decode(Me(e))),Mn=e=>Et.decode(Me(e)),Hs=e=>new Uint8Array(Me(e)).slice(),zs=(e,t,n)=>Et.decode(Me(e).slice(t,n)),Vs=e=>{const t=new Blob([le[e]]);return URL.createObjectURL(t)},Nn=e=>new Blob([le[e]]),Me=e=>le[e],en=e=>{le[e]=null},mt=e=>(le.push(e),le.length-1),Gs=new Map,tn=new Map,js=e=>{const t=tn.get(e);if(t!==void 0)return t;const n=Gs.get(e);if(!n)return-1;le.push(n);const o=le.length-1;return tn.set(e,o),o},Ks=e=>{let t=null,n=null;const o=(u,d)=>{t==null||t(u,d)},a=()=>o(document.hidden?"pause":"resume"),i=()=>o("online"),r=()=>o("offline");return document.addEventListener("visibilitychange",a),window.addEventListener("online",i),window.addEventListener("offline",r),{bridge:{run(u,d,v,p){let f;try{f=Mn(u)}catch{d("run: no such buffer");return}e.rerun(f,p,d)},restart(u){e.rerun(void 0,u)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(u){t=u},setFreedEmitter(u){n=u},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(u){window.open(u,"_blank","noopener")},setOrientation(u){var p,f,E,s;const d=u==="landscape"||u==="portrait"?u:"auto";if(e.onOrientation){e.onOrientation(d);return}const v=typeof screen<"u"?screen.orientation:void 0;if(v)try{d==="auto"?(p=v.unlock)==null||p.call(v):(s=(E=(f=v.lock)==null?void 0:f.call(v,d))==null?void 0:E.catch)==null||s.call(E,()=>{})}catch{}}},emit:o,freed:(u,d)=>{n==null||n(u,d)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",a),window.removeEventListener("online",i),window.removeEventListener("offline",r)}}},Ys=(e,t,n,o)=>{try{const a=document.createElement("input");a.type="file",a.multiple=n,o&&(a.accept=o),a.onchange=async()=>{const{files:i}=a;if(n){const r=[];if(!i)return e([]);for(let c of i)r.push([mt(await c.arrayBuffer()),c.name,c.size]);e(r)}else{if(!i||i.length===0)return e(null);e([[mt(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!a.files||a.files.length===0)&&e(n?[]:null)},300)},{once:!0}),a.click()}catch(a){t(a)}},Xs=e=>({get platform(){return"web"},get language(){return e()},get pixelRatio(){return window.devicePixelRatio||1},vibrate(){var t;try{(t=navigator.vibrate)==null||t.call(navigator,30)}catch{}},clipboardWrite(t){var n;(n=navigator.clipboard)==null||n.writeText(t).catch(()=>{})},clipboardRead(t,n){const o=navigator.clipboard;if(!(o!=null&&o.readText)){n("Clipboard is not available");return}o.readText().then(t,a=>n(a instanceof Error?a.message:"Clipboard read failed"))},share(t,n){var c;const o=Nn(t),a=new File([o],"image.png",{type:"image/png"});if((c=navigator.canShare)!=null&&c.call(navigator,{files:[a]})){navigator.share({files:[a],text:n}).catch(()=>{});return}const i=URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=a.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)},openFilePicker:(t,n,o,a)=>Ys(t,n,o,a??void 0),requestCamera(t){t()}}),qs=e=>{const t=e==null?void 0:e._h;return typeof e=="object"&&e!==null&&typeof(t==null?void 0:t.id)=="number"?t.id:null},Js=e=>{if(e==null)return;if(typeof e=="string")return e;const t=e._entries;if(!Array.isArray(t))throw new Error("fetch: the body is a string or a FormData");const n=new FormData;for(const[o,a,i]of t){const r=qs(a);r!==null?n.append(o,Nn(r),i):n.append(o,String(a))}return n},Qs=()=>{const e=new Set,t=new FinalizationRegistry(i=>{e.delete(i)&&en(i)}),n=i=>{const r={id:i};return e.add(i),t.register(r,i),r};let o=!1;return{bridge:{fetch(i,r,c,u,d){const v=typeof(r==null?void 0:r.onProgress)=="function"?r.onProgress:d;if(i.startsWith("id:")){const p=Number(i.slice(3));c({id:p},Me(p)?200:404);return}(async()=>{var p;try{const f=await fetch(i,{method:r==null?void 0:r.method,headers:r==null?void 0:r.headers,body:Js(r==null?void 0:r.body),mode:"cors",credentials:"omit"}),E=v?(p=f.body)==null?void 0:p.getReader():void 0;let s;if(!E)s=await f.arrayBuffer();else{const l=Number(f.headers.get("content-length"))||void 0,b=[];let y=0;for(;;){const{done:C,value:h}=await E.read();if(C)break;h&&(b.push(h),y+=h.length,o||v({loaded:y,total:l}))}const T=new Uint8Array(y);let _=0;for(const C of b)T.set(C,_),_+=C.length;s=T.buffer}if(o)return;c(n(mt(s)),f.status)}catch(f){o||u(f instanceof Error?f:String(f))}})()},local:i=>js(i),toJson:i=>Ws(i),slice:(i,r,c)=>zs(i,r,c),toText:i=>Mn(i),toBytes:i=>Hs(i)},live:()=>e.size,dispose(){o=!0;for(const i of e)en(i);e.clear()}}},nn=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],it=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],Ue=4,at=16,rn=16,Zs=.5,ei=e=>{const t=new Set;let n=null;const o=($,P,m=-1,g=0)=>{n==null||n($,P,m,g)},a=$=>{if(!$.code)return;const P=t.has($.code);t.add($.code),o(0,$.code,-1,P||$.repeat?1:0)},i=$=>{$.code&&t.delete($.code)&&o(1,$.code)},r=()=>{for(const $ of[...t])$.startsWith("Gamepad")||(t.delete($),o(1,$))},{root:c}=e;let u=0,d=0,v=0,p=0,f=0,E=0,s=0,l=0,b=0,y=0;const T=$=>{if($.pointerType&&$.pointerType!=="mouse")return;const P=c.getBoundingClientRect();u=$.clientX-P.left,d=$.clientY-P.top,v+=$.movementX||0,p+=$.movementY||0},_=$=>{const P=nn[$.button];P&&(t.add(P),o(0,P))},C=$=>{const P=nn[$.button];P&&t.delete(P)&&o(1,P)},h=$=>{const P=$.deltaMode===0?.01:1;f+=$.deltaX*P,E+=$.deltaY*P},L=$=>{document.pointerLockElement===c&&$.preventDefault()},S=[],w=[],O=[],F=()=>{var P,m;const $=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let g=0;g<Ue;g++){const A=$[g]??null,M=!!A&&A.connected;if(M!==!!S[g]){if(S[g]=M,!M){for(const q of it)t.delete(q+"@"+g)&&(o(1,q,g),D(q));O[g]=[],w[g]=[0,0,0,0,0,0]}o(M?2:3,"",g)}if(!A||!M)continue;const j=A.axes,Q=A.buttons,J=((P=Q[6])==null?void 0:P.value)??0,ue=((m=Q[7])==null?void 0:m.value)??0;w[g]=[j[0]??0,j[1]??0,j[2]??0,j[3]??0,J,ue];const Te=O[g]??(O[g]=[]);for(let q=0;q<it.length;q++){const _e=Q[q],pe=!!_e&&(_e.pressed||_e.value>Zs);if(pe===!!Te[q])continue;Te[q]=pe;const me=it[q];pe?t.add(me+"@"+g):t.delete(me+"@"+g),D(me),o(pe?0:1,me,g)}}},D=$=>{let P=!1;for(let m=0;m<Ue&&!P;m++)t.has($+"@"+m)&&(P=!0);P?t.add($):t.delete($)};let B=0;const H=()=>{s=v,l=p,b=f,y=E,v=p=f=E=0,F(),B=requestAnimationFrame(H)},W=e.windows.filter(($,P,m)=>$&&m.indexOf($)===P);for(const $ of W)e.keyboard!==!1&&($.addEventListener("keydown",a),$.addEventListener("keyup",i)),$.addEventListener("blur",r);return c.addEventListener("pointermove",T,!0),c.addEventListener("mousedown",_,!0),window.addEventListener("mouseup",C,!0),c.addEventListener("wheel",h,{passive:!0,capture:!0}),c.addEventListener("contextmenu",L,!0),typeof requestAnimationFrame=="function"&&(B=requestAnimationFrame(H)),{inputKey:($,P)=>P>=0&&$.startsWith("Gamepad")?t.has($+"@"+P):t.has($),inputRead:$=>{var P;switch($){case 0:return u;case 1:return d;case 2:return s;case 3:return l;case 4:return b;case 5:return y;case 6:return document.pointerLockElement===c?1:0;case 7:{let m=0;for(let g=0;g<Ue;g++)S[g]&&m++;return m}}if($>=at){const m=Math.floor(($-at)/rn),g=($-at)%rn;return m>=Ue||!S[m]?0:g===0?1:((P=w[m])==null?void 0:P[g-1])??0}return 0},inputSetPointerLock:$=>{if(!$)return document.pointerLockElement===c&&document.exitPointerLock(),!0;if(document.pointerLockElement===c)return!0;if(typeof c.requestPointerLock!="function")return!1;try{const P=c.requestPointerLock({unadjustedMovement:!0});return P&&typeof P.catch=="function"&&P.catch(()=>{try{c.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:$=>{n=$},dispose:()=>{for(const $ of W)$.removeEventListener("keydown",a),$.removeEventListener("keyup",i),$.removeEventListener("blur",r);c.removeEventListener("pointermove",T,!0),c.removeEventListener("mousedown",_,!0),window.removeEventListener("mouseup",C,!0),c.removeEventListener("wheel",h,!0),c.removeEventListener("contextmenu",L,!0),B&&cancelAnimationFrame(B),document.pointerLockElement===c&&document.exitPointerLock(),t.clear(),n=null}}},ti=e=>{const t=e.ownerDocument.defaultView??window,n=ei({windows:[t],root:e}),o=t.visualViewport,a=()=>o?Math.max(0,Math.round(t.innerHeight-o.height-o.offsetTop)):0;let i=null,r=0;const c=()=>{const d=a();d!==r&&(r=d,i==null||i(d,0))};return o==null||o.addEventListener("resize",c),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(d){n.registerInputEvent(d)},keyboardHeight:a,registerKeyboardEvent(d){i=d}},dispose(){i=null,o==null||o.removeEventListener("resize",c),n.dispose()}}},ee=[null],Ne=[!1],Pn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),Ne[t]&&(e.currentTime=0,e.play())})},ni=(e,t)=>{const n=document.createElement("video");document.body.appendChild(n),n.crossOrigin="anonymous",n.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",n.src=e,n.playsInline=!0,n.controls=!1;const o=ee.length;return ee.push(n),Ne.push(!1),Pn(n,o,t),o},ri=(e,t)=>{const n=document.createElement("audio");document.body.appendChild(n),n.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",n.src=e;const o=ee.length;return ee.push(n),Ne.push(!1),Pn(n,o,t),o},oi=(e,t)=>{const n=ee[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},si=(e,t)=>{const n=ee[e];n&&(t?n.play():n.pause())},ii=(e,t)=>{Ne[e]=t},ai=e=>{var t;return((t=ee[e])==null?void 0:t.currentTime)??0},ci=(e,t)=>{const n=ee[e];n&&(n.currentTime=t)},li=e=>{var n;const t=((n=ee[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},ui=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},fi=e=>{const t=ee[e];t&&(ui(t),ee[e]=null,Ne[e]=!1)},di=()=>{const e=new Map;let t=null;const n=r=>{e.delete(r)&&fi(r)},o=new FinalizationRegistry(r=>{const c=e.get(r);c&&(c.held=!1,c.playing||n(r))}),a=(r,c)=>{let u=-1;if(u=r(c,()=>{const p=e.get(u);p&&(t==null||t(u),!p.loop&&(p.playing=!1,p.held||n(u)))}),u<0)return null;e.set(u,{held:!0,playing:!1,loop:!1});const v={id:u};return o.register(v,u),v};return{bridge:{createAudio:r=>a(ri,r),createVideo:r=>a(ni,r),setVolume:oi,setLoop(r,c){const u=e.get(r);u&&(u.loop=c),ii(r,c)},setPlaying(r,c){const u=e.get(r);u&&(u.playing=c,si(r,c),!c&&!u.held&&n(r))},time:ai,setTime:ci,duration:li,setEmitter(r){t=r}},live:()=>e.size,dispose(){t=null;for(const r of[...e.keys()])n(r)}}},pi=()=>{const e=[];return{bridge:{open(n,o){const a=e.length;let i;try{i=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>o("error")),a}return i.addEventListener("open",()=>o("open")),i.addEventListener("message",r=>o("message",r.data)),i.addEventListener("close",r=>{e[a]=null,o("close",r.code)}),i.addEventListener("error",()=>o("error")),e.push(i),a},send(n,o){const a=e[n];a&&a.readyState===WebSocket.OPEN&&a.send(o)},close(n){var o;(o=e[n])==null||o.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},mi=e=>{let t="default",n=null,o=!1;const a=()=>`lecodes:${e}:${t}`,i=()=>{if(n)return n;n={};try{const d=window.localStorage.getItem(a()),v=d?JSON.parse(d):null;if(v&&typeof v=="object")for(const[p,f]of Object.entries(v))typeof f=="string"&&(n[p]=f)}catch{}return n},r=()=>{if(o=!1,!!n)try{window.localStorage.setItem(a(),JSON.stringify(n))}catch{}},c=()=>{o||(o=!0,queueMicrotask(r))};return{bridge:{get:d=>i()[d]??null,set(d,v){i()[d]=String(v),c()},remove(d){delete i()[d],c()},select(d){o&&r(),t=d,n=null}},dispose(){o&&r()}}},on="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",In={};for(let e=0;e<on.length;e++)In[on[e]]=e;const hi=e=>{const t=[];let n=0,o=0;for(const a of e){const i=In[a];if(i===void 0)break;const r=i&32;if(o+=(i&31)<<n,r)n+=5;else{const c=o&1;o>>=1,t.push(c?-o:o),o=0,n=0}}return t};class gi{constructor(t){Pe(this,"sources");Pe(this,"lines");this.sources=t.sources,this.lines=[];let n=0,o=0,a=0;for(const i of t.mappings.split(";")){const r=[];let c=0;if(i)for(const u of i.split(",")){const d=hi(u);d.length!==0&&(c+=d[0],d.length>=4&&(n+=d[1],o+=d[2],a+=d[3],r.push([c,n,o,a])))}this.lines.push(r)}}originalPositionFor(t,n){const o=this.lines[t-1];if(!o||o.length===0)return null;let a=null;for(const r of o)if(r[0]<=n)a=r;else break;a??(a=o[0]);const i=this.sources[a[1]];return i===void 0?null:{source:i,line:a[2]+1,column:a[3]}}}const yi=e=>{const t=e.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const n=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new gi(JSON.parse(n))}catch{return null}};let ye=null;const bi=()=>{if(ye!==null)return ye;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return ye=n?parseInt(n[1],10)-1:2,ye}return ye=2,ye},sn=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",o=bi(),a=[];for(const i of n.split(`
|
|
199
|
+
`)){const r=i.match(/<anonymous>:(\d+):(\d+)/);if(!r)continue;const c=parseInt(r[1],10)-o,u=parseInt(r[2],10)-1;if(c<1)continue;const d=t.originalPositionFor(c,u<0?0:u);if(!d)continue;const v=i.match(/at\s+([^\s(]+)\s*\(/);a.push({fn:v?v[1]:null,source:d.source,line:d.line,column:d.column})}return a},vi=e=>{const t=[],n=(r,c,u)=>{var p;const d=c instanceof Error?c.message:String(c),v=u[0];console.error(v?`[lecodes] ${d}
|
|
200
|
+
at ${v.source}:${v.line}:${v.column}${v.fn?` (${v.fn})`:""}`:`[lecodes] ${d}`),(p=r.onError)==null||p.call(r,{message:d,frames:u,stack:c instanceof Error?c.stack:void 0})},o=r=>{for(let c=t.length-1;c>=0;c--){const u=t[c];if(!u.sourceMap)continue;const d=sn(r,u.sourceMap);if(d.length>0)return n(u,r,d),!0}return!1},a=r=>{o(r.error??r.message)},i=r=>{o(r.reason)};return e.addEventListener("error",a),e.addEventListener("unhandledrejection",i),{track(r,c){const u={sourceMap:yi(r),onError:c};return t.push(u),{thrown(d){n(u,d,u.sourceMap?sn(d,u.sourceMap):[])},drop(){const d=t.indexOf(u);d>=0&&t.splice(d,1)}}},dispose(){e.removeEventListener("error",a),e.removeEventListener("unhandledrejection",i),t.length=0}}},an=e=>typeof e=="object"&&e!==null&&e.lecodes===!0&&typeof e.level=="number",ht=(e,t={})=>{let n;if((t.mode??"hash")==="hash")n=e.hash.replace(/^#/,"");else{const o=t.base??"/";n=(e.pathname.startsWith(o)?e.pathname.slice(o.length-1):e.pathname).replace(/\/index\.html$/,"/")+e.search}return n===""||n==="/"?null:n.startsWith("/")?n:`/${n}`},Ei=(e,t,n={})=>{if((n.mode??"hash")==="hash")return`${t.pathname}${t.search}${e===null?"":`#${e}`}`;const o=n.base??"/";return e===null?o:o.replace(/\/$/,"")+e},wi=(e,t,n={})=>{const o=e.history,a=e.location;let i=0,r=!1,c=0,u=!1;const d=(E,s)=>{const l={lecodes:!0,level:s},b=Ei(t.address(),a,n);E==="push"?o.pushState(l,"",b):o.replaceState(l,"",b)},v=E=>{E!==0&&(c++,o.go(E))},p=()=>{if(c>0){u=!0;return}const E=t.level();if(r){i=E,d("replace",E);return}if(E>i){for(let s=i+1;s<=E;s++)d("push",s);i=E}else if(E<i){const s=E-i;i=E,v(s)}else d("replace",E)},f=E=>{if(c>0){if(c--,c>0)return;u?(u=!1,p()):d("replace",i);return}const s=E.state;if(!an(s)){const T=ht(a,n);o.replaceState({lecodes:!0,level:i},"",a.href),T!==null&&t.link(T);return}const l=s.level,b=i;r=!0;try{if(l<b)for(;t.level()>l;){const T=t.level();if(t.back(),t.level()>=T)break}else if(l>b){const T=ht(a,n);T!==null&&t.link(T)}}finally{r=!1}const y=Math.max(0,t.level());if(i=l,y===l){d("replace",l);return}if(l>b&&y>b){i=y,d("replace",y);return}i=y,v(y-l)};return e.addEventListener("popstate",f),an(o.state)?i=o.state.level:o.replaceState({lecodes:!0,level:0},"",a.href),{sync:p,reset(){const E=-i;i=0,v(E)},destroy(){e.removeEventListener("popstate",f)}}},Si=.1,Ti=e=>{const t=new Set,n=new Set,o=new Map;let a=1,i=0,r=0;const c=u=>{i=0;const d=Math.min(Si,Math.max(0,(u-r)/1e3));r=u;for(const v of[...o.values()])v(d);o.size>0&&(i=e.requestAnimationFrame(c))};return{globals:{setTimeout(u,d,...v){const p=e.setTimeout(()=>{t.delete(p),u(...v)},d);return t.add(p),p},clearTimeout(u){t.delete(u),e.clearTimeout(u)},setInterval(u,d,...v){const p=e.setInterval(()=>u(...v),d);return n.add(p),p},clearInterval(u){n.delete(u),e.clearInterval(u)},setLoop(u){const d=a++;return o.set(d,u),i===0&&(r=e.performance.now(),i=e.requestAnimationFrame(c)),d},clearLoop(u){o.delete(u)}},dispose(){for(const u of t)e.clearTimeout(u);for(const u of n)e.clearInterval(u);t.clear(),n.clear(),o.clear(),i!==0&&e.cancelAnimationFrame(i),i=0}}},_i=["_creator","_creator2d","_creatorNav","_creatorNet","_creatorAudio","_creatorCanvas","_creatorFiles","_creatorService"],cn=new Map,ki=e=>{let t=cn.get(e);return t||cn.set(e,t=Vs(e)),t},Ri=(e,t={})=>{const n=e.ownerDocument,o=n.defaultView??window,a=vi(o),i=t.language??(()=>(navigator.language||"en").slice(0,2));let r=null,c=null;const u=()=>c??(c=Us().catch(_=>(console.warn(`[web-lite] the tween engine did not load: ${_ instanceof Error?_.message:_}`),null)));let d=t.launchRoute!==void 0?t.launchRoute:t.history?ht(o.location,t.history):null,v=t.safeArea??null,p=0;const f=n.createElement("div");f.style.cssText="position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);";const E=()=>{f.isConnected||n.body.appendChild(f);const _=o.getComputedStyle(f),C=h=>Math.round(parseFloat(h)||0);return{top:C(_.paddingTop),right:C(_.paddingRight),bottom:C(_.paddingBottom),left:C(_.paddingLeft)}},s=()=>{const _=v??E();r==null||r.tree.setSafeArea(_,_.bars??[])};o.addEventListener("resize",s);const l=t.history?wi(o,{level:()=>Math.max(0,((r==null?void 0:r.tree.presentation.stack().length)??0)-1),address:()=>(r==null?void 0:r.tree.presentation.address())??null,back:()=>{r==null||r.tree.back()},link:_=>{d=_,r==null||r.emitApp("url",_)}},t.history):null,b=()=>{r==null||r.dispose(),r=null},y=(_,C,h)=>{const L=Ds({root:e,bufferUrl:ki,tween:h??void 0,onNavigation:()=>{var x;l==null||l.sync(),(x=t.onNavigation)==null||x.call(t,L)}}),S=Ti(o),w=Qs(),O=mi(t.project??"app"),F=pi(),D=ti(e),B=di(),H=a.track(_,C.onError),W=Ks({launchUrl:()=>d,rerun:(x,k,I)=>{k!==void 0&&(d=k);const $=x??_;o.setTimeout(()=>{T($,C).catch(P=>I==null?void 0:I(P instanceof Error?P.message:String(P)))},0)},stats:()=>JSON.stringify({live:{tree:L.stats().nodes,fetch:w.live(),media:B.live(),tween:L.stats().tweens},pending:0}),onOrientation:t.onOrientation}),G={_creatorTree:L.bridge,_creatorApp:W.bridge,_creatorDevice:Xs(i),_creatorFetch:w.bridge,_creatorStorage:O.bridge,_creatorSocket:F.bridge,_creatorInput:D.bridge,_creatorMedia:B.bridge,...S.globals};for(const x of _i)G[x]=void 0;r={code:_,tree:L,emitApp:W.emit,dispose(){H.drop(),S.dispose(),F.dispose(),B.dispose(),D.dispose(),O.dispose(),w.dispose(),W.dispose(),L.destroy()}},s();const X=Object.keys(G);try{new Function(...X,_)(...X.map(x=>G[x]))}catch(x){H.thrown(x)}};async function T(_,C={}){const h=yr(_);if(!fr(h.sdk,Tt))throw new Error(`This app was built with LeCodes SDK ${h.sdk??"older than 2.0"}; this host runs SDK ${Tt}. It needs a new build.`);(h.gl==="on"||h.is2d)&&console.warn(`[web-lite] this app uses ${h.is2d?"2D":"3D"} scenes, which Web Lite does not show yet (docs/plans/web-lite-plan.md): its UI runs, a scene's calls fail`);const L=++p;r&&(l==null||l.reset()),b();const[S]=await Promise.all([u(),mr(void 0,n),gr(h.bootFonts,n)]);L===p&&y(_,C,S)}return{run:T,restart(_){return r?(_!==void 0&&(d=_),T(r.code)):Promise.resolve()},tree:()=>(r==null?void 0:r.tree)??null,setSafeArea(_){v=_,s()},openRoute(_){d=_,r==null||r.emitApp("url",_)},emitAppEvent(_,C){r==null||r.emitApp(_,C)},destroy(){p++,b(),o.removeEventListener("resize",s),l==null||l.destroy(),f.remove(),a.dispose()}}},je=document.getElementById("app"),ln=document.getElementById("error"),Se=new URLSearchParams(location.search),Fn=e=>{ln&&(ln.textContent=e)},un=Se.has("dev")?new URL(Se.get("dev")||"..",location.href).href.replace(/\/$/,""):null,fn=e=>{const t=e.frames[0];return t?`${e.message}
|
|
201
|
+
at ${t.source}:${t.line}:${t.column}${t.fn?` (${t.fn})`:""}`:e.message},Dn=e=>{Fn(fn(e)),Z==null||Z.error(fn(e))},Bn=e=>Dn({message:e instanceof Error?e.message:String(e),frames:[]}),Un=Ri(je,{history:{mode:je.dataset.urls==="path"?"path":"hash",base:je.dataset.base??"/"},project:Se.get("project")??location.pathname});Se.has("test")&&(window.lecodesTest={ready:!1,dump:()=>{var e;return((e=Un.tree())==null?void 0:e.bridge.debugDump())??'{"roots":[]}'},rect:e=>{const t=document.querySelector(`[data-node="${e}"]`);if(!t)return null;const n=t.getBoundingClientRect();return[n.left,n.top,n.width,n.height]}});let ct=!1,lt=null,gt=-1;const qe=async e=>{if(ct){lt=e;return}ct=!0,Fn("");try{const t=await fetch(e.src,{cache:"no-store"});if(!t.ok)throw new Error(t.status===503?"No successful compile yet — check the terminal.":`${e.src} → HTTP ${t.status}`);const n=await t.text();await Un.run(n,{onError:Dn});const o=window.lecodesTest;o&&(o.ready=!0),Z&&e.version!==void 0&&(gt=Z.versionOf(t,e.version),Z.ran(gt))}catch(t){Bn(t)}finally{ct=!1;const t=lt;lt=null,t&&qe(t)}},Z=un?lr(un,e=>{e!==gt&&qe({src:Z.bundleUrl(e),version:e})}):null;if(Z)for(const e of["log","info","warn","error"]){const t=console[e].bind(console);console[e]=(...n)=>{t(...n),Z.log(e,n)}}if(Z)qe({src:Z.bundleUrl(0),version:0});else{const e=ur(Se.get("src")??je.dataset.src??"app.js",document.baseURI);e?qe({src:e}):Bn(`The page runs bundles of its own origin only: ${Se.get("src")}`)}
|
|
@@ -278,7 +278,7 @@ export const startCommentSync = (ctx: DesignContext, designServer: DesignServer)
|
|
|
278
278
|
// An older lecodes-design has no mirror to drive. The board still works off the files, so losing
|
|
279
279
|
// the sync is not a reason to refuse to serve.
|
|
280
280
|
if (typeof designServer.mirrorThreads !== "function") {
|
|
281
|
-
note("Comment sync needs a newer lecodes-design (
|
|
281
|
+
note("Comment sync needs a newer lecodes-design (run: lecodes update) — serving without it.")
|
|
282
282
|
return null
|
|
283
283
|
}
|
|
284
284
|
let failures = 0
|
|
@@ -67,7 +67,7 @@ export const loadDesignServer = async (ctx: DesignContext, needs: (keyof DesignS
|
|
|
67
67
|
const missing = needs.filter((name) => typeof mod[name] !== "function")
|
|
68
68
|
if (missing.length) {
|
|
69
69
|
throw new CliError(
|
|
70
|
-
`This needs a newer lecodes-design — the installed one has no \`${missing[0]}\`. Run:
|
|
70
|
+
`This needs a newer lecodes-design — the installed one has no \`${missing[0]}\`. Run: lecodes update`)
|
|
71
71
|
}
|
|
72
72
|
return mod
|
|
73
73
|
}
|
|
@@ -104,7 +104,7 @@ const serve = async (flags: FlagValues<typeof serveFlags>): Promise<void> => {
|
|
|
104
104
|
|
|
105
105
|
log(`${c.bold("LeCodes Design")} — ${ctx.name}`)
|
|
106
106
|
log(`Canvas: ${c.bold(server.url)}`)
|
|
107
|
-
log(`MCP: ${c.bold(server.url + "/mcp")}${renderer ? "" : c.dim(" (render_screen off —
|
|
107
|
+
log(`MCP: ${c.bold(server.url + "/mcp")}${renderer ? "" : c.dim(" (render_screen off — lecodes-headless is not installed: `lecodes render` installs it)")}`)
|
|
108
108
|
log(`Watching: ${ctx.dirName}/ (screens hot-reload on save; Ctrl+C to stop)`)
|
|
109
109
|
if (sync) log(`Comments: ${c.dim("in sync with the platform — replies and resolves go back automatically")}`)
|
|
110
110
|
if (!flags["no-open"]) openBrowser(server.url)
|