lecodes-cli 2.0.6 → 2.0.8

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.
@@ -1,5 +1,5 @@
1
1
  var Fn=Object.defineProperty;var Mn=(e,t,n)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>Mn(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const Pn=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)}},In=(e,t)=>{const n=o=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(o),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let r=-1;const s=async()=>{try{const{v:o}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof o=="number"&&t(o)}catch{}setTimeout(s,2500)};setTimeout(s,2500);const i=()=>{let o;try{o=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}o.onopen=()=>o.send(JSON.stringify({type:"hello",v:r})),o.onmessage=f=>{let l={};try{l=JSON.parse(String(f.data))}catch{return}l.type==="reload"&&typeof l.v=="number"&&t(l.v)},o.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:o=>`${e}/bundle.js?t=web&v=${o}`,versionOf(o,f){const l=Number(o.headers.get("x-lecodes-v"));return o.headers.has("x-lecodes-v")&&Number.isFinite(l)?l:f},ran(o){r=o},log:(o,f)=>n({type:"log",level:o,text:f.map(Pn).join(" ")}),error:o=>n({type:"error",text:o})}},Dn=(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}},Bn="modulepreload",Vn=function(e,t){return new URL(e,t).href},bt={},re=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(b){return Promise.all(b.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const f=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(b=>{if(b=Vn(b,r),b in bt)return;bt[b]=!0;const E=b.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(!!r)for(let p=f.length-1;p>=0;p--){const h=f[p];if(h.href===b&&(!E||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${g}`))return;const a=document.createElement("link");if(a.rel=E?"stylesheet":Bn,E||(a.as="script"),a.crossOrigin="",a.href=b,d&&a.setAttribute("nonce",d),document.head.appendChild(a),E)return new Promise((p,h)=>{a.addEventListener("load",p),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${b}`)))})}))}function i(o){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=o,window.dispatchEvent(f),!f.defaultPrevented)throw o}return s.then(o=>{for(const f of o||[])f.status==="rejected"&&i(f.reason);return t().catch(i)})},yt="2.0.6",He=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},zn=(e,t)=>He(e)!==null&&He(e)===He(t),Wn=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const r=[];for(const s of n[1].split(";")){const i=s.indexOf("=");if(i===-1)continue;const o=/^(.+)@(\d+)(i?)$/.exec(s.slice(0,i));o&&r.push({family:o[1],weight:parseInt(o[2],10),italic:o[3]==="i",url:s.slice(i+1).replace("{fmt}",t)})}return r},Gn=async(e,t,n=2e3)=>{const r=t??(typeof document>"u"?void 0:document);if(!(r!=null&&r.fonts)||e.length===0)return;const s=[];for(const i of e)try{const o=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});r.fonts.add(o),s.push(o.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(s),new Promise(i=>setTimeout(i,n))])},jn=e=>{var l,d,b,E;const t=e.slice(0,2e3),n=new Set,r=t.match(/\/\/ preload: (.+)/);if(r)for(const g of r[1].split(";"))n.add(g);const s=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((l=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:l[1])??null,o=((b=(d=t.match(/^\/\/ name: (.+)$/m))==null?void 0:d[1])==null?void 0:b.trim())??null,f=new Set((((E=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:E[1])??"").split(";").map(g=>g.trim()).filter(Boolean));return{sdk:i,name:o,preloads:n,gl:s,is2d:t.includes("// 2d: enable"),plugins:f,bootFonts:Wn(t)}},Hn=1,Kn=2,Yn=3,qn=4,Xn=5,Jn=6,Et=7,Qn=8,vt=9,Zn=10,er=11,tr=12,nr=13,rr=14,or=15,sr=16,wt=17,ir=18,ar=19,xe=20,ri=21,oi=22,si=23,ii=24,ai=25,cr=26,lr=27,ur=28,fr=29,St=30,_t=31,dr=32,pr=33,Tt=34,kt=35,Oe=1,mr=2,hr=4,le=8,gr=16,Ke=32,br=64,Ye=128,yr=256,Er=512,vr=1024,wr=2048,Sr=4096,Lt=8192,ci=16384,_r=32768,Tr=1<<18,kr=255,xt=256,Rt=512,Lr=1024,Y=0,xr=1,Rr=2,Cr=3,Me=4,Ue=255,sn=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},Ct={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"}},At=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,Z=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},Ar=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,r=t("placeholder");if(Z(n,"placeholder",r==null?null:String(r)),e.type==="input"){const f=Ct[String(t("type")??"text")]??Ct.text,l=n;l.type!==f.type&&(l.type=f.type),Z(n,"inputmode",f.mode??null);const d=t("enterKey");Z(n,"enterkeyhint",d==null?null:String(d))}const s=t("autocapitalize");Z(n,"autocapitalize",s==null?null:String(s));const i=t("autocorrect");i==null?(Z(n,"autocorrect",null),Z(n,"spellcheck",null)):(Z(n,"autocorrect",At(i,!0)?"on":"off"),Z(n,"spellcheck",At(i,!0)?"true":"false"));const o=Number(t("maxLength")??0);Z(n,"maxlength",o>0?String(Math.round(o)):null)},Pe={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"},$r={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"},Or=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],Ur={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},Nr=["duration","delay","layer","commit","loop","loopMode","name"];function an(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 r="";for(const s of n)r+=String.fromCharCode(s);return`data:image/svg+xml;base64,${btoa(r)}`}function Fr(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const Mr=/\b(?:calc|min|max|clamp)\(/,Pr=e=>{if(!Mr.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let s=0;const i=n;for(;n<e.length;n++)if(e[n]==="(")s++;else if(e[n]===")"&&--s===0)break;t+=e.slice(i,Math.min(n+1,e.length));continue}const r=e[n];if(r==="+"||r==="-"){const s=t[t.length-1]??"";if(!(r==="-"&&(s==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(s)){for(t=t.trimEnd()+" "+r+" ";e[n+1]===" ";)n++;continue}}t+=r}return t.replace(/\d*\.\d+|\d+/g,(n,r,s)=>{const i=s.slice(0,r).trimEnd(),o=s.slice(r+n.length).trimStart();return/[\w.%]$/.test(i)||/^[\w.%]/.test(o)||/[*/]$/.test(i)||/^[*/]/.test(o)?n:n+"px"})},Ir={top:"12px",bottom:"4px",left:"16px",right:"16px"},cn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${Ir[e]})))`,Dr={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Te=e=>Pr(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>cn(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,r)=>n+Dr[r]),ft=/^-?\d*\.?\d+$/,ee=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return ft.test(t)?t+"px":Te(t)},ke=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},Br=/^(rotate|skew)/,Vr=/^translate/,zr=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,r,s)=>{const i=Vr.test(r)?"px":Br.test(r)?"deg":null;return i===null?n:`${r}(${s.split(",").map(o=>{const f=o.trim();return ft.test(f)?f+i:Te(f)}).join(", ")})`})},ln=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>ft.test(t)?t+"px":Te(t)).join(" "),J=0,Q=1,ve=2,Ne=["top","right","bottom","left"],Wr=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?cn(t):ee(e),st=(e,t)=>{const n=(s,i)=>({rank:i,to:o=>s.map(f=>[t(f),Wr(o,f)])}),r=s=>({rank:Q,to:i=>[[t(s),ee(i)]]});return{[e]:n(Ne,J),[`${e}Horizontal`]:n(["left","right"],Q),[`${e}Vertical`]:n(["top","bottom"],Q),[`${e}Start`]:r("inline-start"),[`${e}End`]:r("inline-end"),[`${e}Top`]:n(["top"],ve),[`${e}Right`]:n(["right"],ve),[`${e}Bottom`]:n(["bottom"],ve),[`${e}Left`]:n(["left"],ve)}},Gr=()=>{const e=st("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},dt=e=>{const t=[];let n=0,r="";for(const s of e.trim()){if(s==="("&&n++,s===")"&&n--,/\s/.test(s)&&n===0){r&&t.push(r),r="";continue}r+=s}return r&&t.push(r),t},jr=new Set(["none","solid","dashed","dotted","double","hidden"]),Hr=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,ye=(e,t)=>({rank:t,to:n=>{let r=null,s=null,i=null;if(typeof n=="number")r=n+"px";else for(const f of dt(String(n)))jr.has(f)?i=f:Hr.test(f)?r=ee(f):s=ke(f);const o=[];for(const f of e)o.push([`border-${f}-width`,r??(s?"1px":"0px")]),o.push([`border-${f}-color`,s??"transparent"]),i&&o.push([`border-${f}-style`,i]);return o}}),Kr=e=>{const t=String(e).trim(),n=(i,o,f)=>[["flex-grow",i],["flex-shrink",o],["flex-basis",f]];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 r=dt(t),s=i=>i!==void 0&&/^-?\d*\.?\d+$/.test(i);return s(r[0])?r.length===1?n(r[0],"1","0%"):s(r[1])?n(r[0],r[1],r[2]!==void 0?ee(r[2]):"0%"):n(r[0],"1",ee(r[1])):n("1","1",ee(r[0]??"auto"))},un=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},Yr=e=>e.replace(/<svg\b[^>]*>/,t=>t.replace(/\spreserveAspectRatio\s*=\s*("[^"]*"|'[^']*')/,"").replace(/^<svg\b/,'<svg preserveAspectRatio="none"')),fn=(e,t)=>{if(un(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)))}")`:n.startsWith("svg:")?`url("${an(Yr(n.slice(4)))}")`:`url("${n.replace(/["\\\n]/g,r=>"\\"+r)}")`},qr=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,dn=e=>{const t=String(e??"").trim();return t===""?"none":Te(t)},Xr=(e,t)=>{const n=typeof e=="string"&&qr.test(e),r=un(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?dn(e):"none"],["--lc-bg-img",r?fn(e,t):"none"],["background-color",n||r?"transparent":ke(e)]]},Jr=e=>{const t=typeof e=="number"?[e+"px"]:dt(String(e)).map(o=>ln(o)),[n,r=n,s=n,i=r]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",r??"0px"],["border-bottom-right-radius",s??"0px"],["border-bottom-left-radius",i??"0px"]]},Qr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),Zr=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||Qr.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},eo=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",to=e=>t=>e[String(t)]??String(t),Le={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:J},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...st("padding",e=>`padding-${e}`),...st("margin",e=>`margin-${e}`),inset:{css:Ne,as:"len",rank:J},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:Q},end:{css:"inset-inline-end",as:"len",rank:Q},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:J,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:Q},...Gr(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:Ne.map(e=>`border-${e}-color`),rank:J},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",fn(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",dn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"],["background-position","0 0"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"],["background-position","center"]]},borderRadius:{to:Jr,rank:J},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",zr(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",Zr(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":ee(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:J,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",eo(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",to({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:Xr,rank:J},border:ye(Ne,J),borderTop:ye(["top"],Q),borderRight:ye(["right"],Q),borderBottom:ye(["bottom"],Q),borderLeft:ye(["left"],Q),flex:{to:Kr,rank:J}},qe=e=>$r[e]??e,no=e=>e in Le,pn=e=>{const t=Le[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"},oo=e=>{const t=Le[e];return t&&"css"in t&&typeof t.css=="string"?t.css:ro[e]??null},so={len:ee,lens:ln,num:e=>String(e),raw:e=>String(e),color:ke},io={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},$t=e=>{const t=Le[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:ve},Xe=(e,t,n)=>{const r=[...e].filter(([,i])=>i!=null);r.sort((i,o)=>$t(i[0])-$t(o[0]));const s=new Map;for(const[i,o]of r){const f=Le[i];if(!f){n==null||n(i);continue}if("attr"in f||"none"in f)continue;if("to"in f){for(const[b,E]of f.to(o,t))s.set(b,E);continue}const l=so[f.as??io[Pe[i]??"layout"]],d=l(o);if(typeof f.css=="string")s.set(f.css,d);else for(const b of f.css)s.set(b,d)}return s},Ot=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),mn=0,hn=1,Se=2,_e=3,gn=4,de=65,Ie=1.70158,Re=Ie*1.525,Ut=Ie+1,Nt=2*Math.PI/3,Ft=2*Math.PI/4.5,Ce=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,it=[["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=>Ut*e*e*e-Ie*e*e],["outBack",e=>1+Ut*(e-1)**3+Ie*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((Re+1)*2*e-Re)/2:((2*e-2)**2*((Re+1)*(e*2-2)+Re)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Nt)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Nt)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Ft))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Ft)/2+1],["inBounce",e=>1-Ce(1-e)],["outBounce",Ce],["inOutBounce",e=>e<.5?(1-Ce(1-2*e))/2:(1+Ce(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"},co=e=>{const t=ao[e]??e;for(let n=0;n<it.length;n++)if(it[n][0]===t)return n;return-1},lo=[.25,.1,.25,1],Ae={kind:mn,p:[0,0,0,0]},uo=e=>{const t=new Float32Array(de);for(let n=0;n<de;n++)t[n]=e(n/(de-1));return t[0]=0,t[de-1]=1,t},fo=e=>{if(e===void 0)return Ae;if(typeof e=="function")return{kind:gn,p:[0,0,0,0],table:uo(e)};if(Array.isArray(e)){const[s,i,o,f]=e;return{kind:Se,p:[s,i,o,f]}}const t=e.trim();if(t==="linear")return Ae;if(t==="ease")return{kind:Se,p:lo};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:Se,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const r=co(t);return r===0?Ae:r>0?{kind:hn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Ae)},po=(e,t,n,r,s)=>{const i=1-3*r+3*t,o=3*r-6*t,f=3*t,l=1-3*s+3*n,d=3*s-6*n,b=3*n;let E=e;for(let g=0;g<8;g++){const m=((i*E+o)*E+f)*E-e,a=(3*i*E+2*o)*E+f;if(Math.abs(m)<1e-6||Math.abs(a)<1e-6)break;E-=m/a}return E=Math.min(1,Math.max(0,E)),((l*E+d)*E+b)*E},mo=(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 hn:return it[e.p[0]][1](t);case Se:return po(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 gn:{const n=e.table,r=t*(de-1),s=Math.floor(r),i=n[s],o=n[Math.min(s+1,de-1)];return i+(o-i)*(r-s)}default:return t}},Mt=24,Pt=e=>String(Math.round(e*1e4)/1e4),ho="cubic-bezier(0.3333, 0, 0.6667, 1)",go=e=>{switch(e.kind){case mn:return"linear";case Se:return`cubic-bezier(${e.p.map(Pt).join(", ")})`;case _e:return`steps(${e.p[0]}, ${e.p[1]===1?"jump-start":"jump-end"})`}const t=[];for(let n=0;n<=Mt;n++)t.push(Pt(mo(e,n/Mt)));return`linear(${t.join(", ")})`},bo=e=>e===void 0||e==="smoothstep"?ho:go(fo(e)),bn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],yo=["--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"],yn="lc-app",Eo=`
2
+ ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},In=(e,t)=>{const n=o=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(o),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let r=-1;const s=async()=>{try{const{v:o}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof o=="number"&&t(o)}catch{}setTimeout(s,2500)};setTimeout(s,2500);const i=()=>{let o;try{o=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}o.onopen=()=>o.send(JSON.stringify({type:"hello",v:r})),o.onmessage=f=>{let l={};try{l=JSON.parse(String(f.data))}catch{return}l.type==="reload"&&typeof l.v=="number"&&t(l.v)},o.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:o=>`${e}/bundle.js?t=web&v=${o}`,versionOf(o,f){const l=Number(o.headers.get("x-lecodes-v"));return o.headers.has("x-lecodes-v")&&Number.isFinite(l)?l:f},ran(o){r=o},log:(o,f)=>n({type:"log",level:o,text:f.map(Pn).join(" ")}),error:o=>n({type:"error",text:o})}},Dn=(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}},Bn="modulepreload",Vn=function(e,t){return new URL(e,t).href},bt={},re=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(b){return Promise.all(b.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const f=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(b=>{if(b=Vn(b,r),b in bt)return;bt[b]=!0;const E=b.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(!!r)for(let p=f.length-1;p>=0;p--){const h=f[p];if(h.href===b&&(!E||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${g}`))return;const a=document.createElement("link");if(a.rel=E?"stylesheet":Bn,E||(a.as="script"),a.crossOrigin="",a.href=b,d&&a.setAttribute("nonce",d),document.head.appendChild(a),E)return new Promise((p,h)=>{a.addEventListener("load",p),a.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${b}`)))})}))}function i(o){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=o,window.dispatchEvent(f),!f.defaultPrevented)throw o}return s.then(o=>{for(const f of o||[])f.status==="rejected"&&i(f.reason);return t().catch(i)})},yt="2.0.8",He=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},zn=(e,t)=>He(e)!==null&&He(e)===He(t),Wn=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const r=[];for(const s of n[1].split(";")){const i=s.indexOf("=");if(i===-1)continue;const o=/^(.+)@(\d+)(i?)$/.exec(s.slice(0,i));o&&r.push({family:o[1],weight:parseInt(o[2],10),italic:o[3]==="i",url:s.slice(i+1).replace("{fmt}",t)})}return r},Gn=async(e,t,n=2e3)=>{const r=t??(typeof document>"u"?void 0:document);if(!(r!=null&&r.fonts)||e.length===0)return;const s=[];for(const i of e)try{const o=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});r.fonts.add(o),s.push(o.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(s),new Promise(i=>setTimeout(i,n))])},jn=e=>{var l,d,b,E;const t=e.slice(0,2e3),n=new Set,r=t.match(/\/\/ preload: (.+)/);if(r)for(const g of r[1].split(";"))n.add(g);const s=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((l=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:l[1])??null,o=((b=(d=t.match(/^\/\/ name: (.+)$/m))==null?void 0:d[1])==null?void 0:b.trim())??null,f=new Set((((E=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:E[1])??"").split(";").map(g=>g.trim()).filter(Boolean));return{sdk:i,name:o,preloads:n,gl:s,is2d:t.includes("// 2d: enable"),plugins:f,bootFonts:Wn(t)}},Hn=1,Kn=2,Yn=3,qn=4,Xn=5,Jn=6,Et=7,Qn=8,vt=9,Zn=10,er=11,tr=12,nr=13,rr=14,or=15,sr=16,wt=17,ir=18,ar=19,xe=20,ri=21,oi=22,si=23,ii=24,ai=25,cr=26,lr=27,ur=28,fr=29,St=30,_t=31,dr=32,pr=33,Tt=34,kt=35,Oe=1,mr=2,hr=4,le=8,gr=16,Ke=32,br=64,Ye=128,yr=256,Er=512,vr=1024,wr=2048,Sr=4096,Lt=8192,ci=16384,_r=32768,Tr=1<<18,kr=255,xt=256,Rt=512,Lr=1024,Y=0,xr=1,Rr=2,Cr=3,Me=4,Ue=255,sn=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},Ct={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"}},At=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,Z=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},Ar=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,r=t("placeholder");if(Z(n,"placeholder",r==null?null:String(r)),e.type==="input"){const f=Ct[String(t("type")??"text")]??Ct.text,l=n;l.type!==f.type&&(l.type=f.type),Z(n,"inputmode",f.mode??null);const d=t("enterKey");Z(n,"enterkeyhint",d==null?null:String(d))}const s=t("autocapitalize");Z(n,"autocapitalize",s==null?null:String(s));const i=t("autocorrect");i==null?(Z(n,"autocorrect",null),Z(n,"spellcheck",null)):(Z(n,"autocorrect",At(i,!0)?"on":"off"),Z(n,"spellcheck",At(i,!0)?"true":"false"));const o=Number(t("maxLength")??0);Z(n,"maxlength",o>0?String(Math.round(o)):null)},Pe={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"},$r={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"},Or=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],Ur={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},Nr=["duration","delay","layer","commit","loop","loopMode","name"];function an(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 r="";for(const s of n)r+=String.fromCharCode(s);return`data:image/svg+xml;base64,${btoa(r)}`}function Fr(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const Mr=/\b(?:calc|min|max|clamp)\(/,Pr=e=>{if(!Mr.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let s=0;const i=n;for(;n<e.length;n++)if(e[n]==="(")s++;else if(e[n]===")"&&--s===0)break;t+=e.slice(i,Math.min(n+1,e.length));continue}const r=e[n];if(r==="+"||r==="-"){const s=t[t.length-1]??"";if(!(r==="-"&&(s==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(s)){for(t=t.trimEnd()+" "+r+" ";e[n+1]===" ";)n++;continue}}t+=r}return t.replace(/\d*\.\d+|\d+/g,(n,r,s)=>{const i=s.slice(0,r).trimEnd(),o=s.slice(r+n.length).trimStart();return/[\w.%]$/.test(i)||/^[\w.%]/.test(o)||/[*/]$/.test(i)||/^[*/]/.test(o)?n:n+"px"})},Ir={top:"12px",bottom:"4px",left:"16px",right:"16px"},cn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${Ir[e]})))`,Dr={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Te=e=>Pr(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>cn(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,r)=>n+Dr[r]),ft=/^-?\d*\.?\d+$/,ee=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return ft.test(t)?t+"px":Te(t)},ke=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},Br=/^(rotate|skew)/,Vr=/^translate/,zr=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,r,s)=>{const i=Vr.test(r)?"px":Br.test(r)?"deg":null;return i===null?n:`${r}(${s.split(",").map(o=>{const f=o.trim();return ft.test(f)?f+i:Te(f)}).join(", ")})`})},ln=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>ft.test(t)?t+"px":Te(t)).join(" "),J=0,Q=1,ve=2,Ne=["top","right","bottom","left"],Wr=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?cn(t):ee(e),st=(e,t)=>{const n=(s,i)=>({rank:i,to:o=>s.map(f=>[t(f),Wr(o,f)])}),r=s=>({rank:Q,to:i=>[[t(s),ee(i)]]});return{[e]:n(Ne,J),[`${e}Horizontal`]:n(["left","right"],Q),[`${e}Vertical`]:n(["top","bottom"],Q),[`${e}Start`]:r("inline-start"),[`${e}End`]:r("inline-end"),[`${e}Top`]:n(["top"],ve),[`${e}Right`]:n(["right"],ve),[`${e}Bottom`]:n(["bottom"],ve),[`${e}Left`]:n(["left"],ve)}},Gr=()=>{const e=st("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},dt=e=>{const t=[];let n=0,r="";for(const s of e.trim()){if(s==="("&&n++,s===")"&&n--,/\s/.test(s)&&n===0){r&&t.push(r),r="";continue}r+=s}return r&&t.push(r),t},jr=new Set(["none","solid","dashed","dotted","double","hidden"]),Hr=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,ye=(e,t)=>({rank:t,to:n=>{let r=null,s=null,i=null;if(typeof n=="number")r=n+"px";else for(const f of dt(String(n)))jr.has(f)?i=f:Hr.test(f)?r=ee(f):s=ke(f);const o=[];for(const f of e)o.push([`border-${f}-width`,r??(s?"1px":"0px")]),o.push([`border-${f}-color`,s??"transparent"]),i&&o.push([`border-${f}-style`,i]);return o}}),Kr=e=>{const t=String(e).trim(),n=(i,o,f)=>[["flex-grow",i],["flex-shrink",o],["flex-basis",f]];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 r=dt(t),s=i=>i!==void 0&&/^-?\d*\.?\d+$/.test(i);return s(r[0])?r.length===1?n(r[0],"1","0%"):s(r[1])?n(r[0],r[1],r[2]!==void 0?ee(r[2]):"0%"):n(r[0],"1",ee(r[1])):n("1","1",ee(r[0]??"auto"))},un=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},Yr=e=>e.replace(/<svg\b[^>]*>/,t=>t.replace(/\spreserveAspectRatio\s*=\s*("[^"]*"|'[^']*')/,"").replace(/^<svg\b/,'<svg preserveAspectRatio="none"')),fn=(e,t)=>{if(un(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)))}")`:n.startsWith("svg:")?`url("${an(Yr(n.slice(4)))}")`:`url("${n.replace(/["\\\n]/g,r=>"\\"+r)}")`},qr=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,dn=e=>{const t=String(e??"").trim();return t===""?"none":Te(t)},Xr=(e,t)=>{const n=typeof e=="string"&&qr.test(e),r=un(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?dn(e):"none"],["--lc-bg-img",r?fn(e,t):"none"],["background-color",n||r?"transparent":ke(e)]]},Jr=e=>{const t=typeof e=="number"?[e+"px"]:dt(String(e)).map(o=>ln(o)),[n,r=n,s=n,i=r]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",r??"0px"],["border-bottom-right-radius",s??"0px"],["border-bottom-left-radius",i??"0px"]]},Qr=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),Zr=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||Qr.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},eo=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",to=e=>t=>e[String(t)]??String(t),Le={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:J},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...st("padding",e=>`padding-${e}`),...st("margin",e=>`margin-${e}`),inset:{css:Ne,as:"len",rank:J},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:Q},end:{css:"inset-inline-end",as:"len",rank:Q},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:J,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:Q},...Gr(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:Ne.map(e=>`border-${e}-color`),rank:J},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",fn(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",dn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"],["background-position","0 0"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"],["background-position","center"]]},borderRadius:{to:Jr,rank:J},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",zr(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",Zr(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":ee(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:J,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",eo(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",to({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:Xr,rank:J},border:ye(Ne,J),borderTop:ye(["top"],Q),borderRight:ye(["right"],Q),borderBottom:ye(["bottom"],Q),borderLeft:ye(["left"],Q),flex:{to:Kr,rank:J}},qe=e=>$r[e]??e,no=e=>e in Le,pn=e=>{const t=Le[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"},oo=e=>{const t=Le[e];return t&&"css"in t&&typeof t.css=="string"?t.css:ro[e]??null},so={len:ee,lens:ln,num:e=>String(e),raw:e=>String(e),color:ke},io={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},$t=e=>{const t=Le[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:ve},Xe=(e,t,n)=>{const r=[...e].filter(([,i])=>i!=null);r.sort((i,o)=>$t(i[0])-$t(o[0]));const s=new Map;for(const[i,o]of r){const f=Le[i];if(!f){n==null||n(i);continue}if("attr"in f||"none"in f)continue;if("to"in f){for(const[b,E]of f.to(o,t))s.set(b,E);continue}const l=so[f.as??io[Pe[i]??"layout"]],d=l(o);if(typeof f.css=="string")s.set(f.css,d);else for(const b of f.css)s.set(b,d)}return s},Ot=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),mn=0,hn=1,Se=2,_e=3,gn=4,de=65,Ie=1.70158,Re=Ie*1.525,Ut=Ie+1,Nt=2*Math.PI/3,Ft=2*Math.PI/4.5,Ce=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,it=[["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=>Ut*e*e*e-Ie*e*e],["outBack",e=>1+Ut*(e-1)**3+Ie*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((Re+1)*2*e-Re)/2:((2*e-2)**2*((Re+1)*(e*2-2)+Re)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Nt)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Nt)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Ft))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Ft)/2+1],["inBounce",e=>1-Ce(1-e)],["outBounce",Ce],["inOutBounce",e=>e<.5?(1-Ce(1-2*e))/2:(1+Ce(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"},co=e=>{const t=ao[e]??e;for(let n=0;n<it.length;n++)if(it[n][0]===t)return n;return-1},lo=[.25,.1,.25,1],Ae={kind:mn,p:[0,0,0,0]},uo=e=>{const t=new Float32Array(de);for(let n=0;n<de;n++)t[n]=e(n/(de-1));return t[0]=0,t[de-1]=1,t},fo=e=>{if(e===void 0)return Ae;if(typeof e=="function")return{kind:gn,p:[0,0,0,0],table:uo(e)};if(Array.isArray(e)){const[s,i,o,f]=e;return{kind:Se,p:[s,i,o,f]}}const t=e.trim();if(t==="linear")return Ae;if(t==="ease")return{kind:Se,p:lo};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:Se,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const r=co(t);return r===0?Ae:r>0?{kind:hn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Ae)},po=(e,t,n,r,s)=>{const i=1-3*r+3*t,o=3*r-6*t,f=3*t,l=1-3*s+3*n,d=3*s-6*n,b=3*n;let E=e;for(let g=0;g<8;g++){const m=((i*E+o)*E+f)*E-e,a=(3*i*E+2*o)*E+f;if(Math.abs(m)<1e-6||Math.abs(a)<1e-6)break;E-=m/a}return E=Math.min(1,Math.max(0,E)),((l*E+d)*E+b)*E},mo=(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 hn:return it[e.p[0]][1](t);case Se:return po(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 gn:{const n=e.table,r=t*(de-1),s=Math.floor(r),i=n[s],o=n[Math.min(s+1,de-1)];return i+(o-i)*(r-s)}default:return t}},Mt=24,Pt=e=>String(Math.round(e*1e4)/1e4),ho="cubic-bezier(0.3333, 0, 0.6667, 1)",go=e=>{switch(e.kind){case mn:return"linear";case Se:return`cubic-bezier(${e.p.map(Pt).join(", ")})`;case _e:return`steps(${e.p[0]}, ${e.p[1]===1?"jump-start":"jump-end"})`}const t=[];for(let n=0;n<=Mt;n++)t.push(Pt(mo(e,n/Mt)));return`linear(${t.join(", ")})`},bo=e=>e===void 0||e==="smoothstep"?ho:go(fo(e)),bn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],yo=["--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"],yn="lc-app",Eo=`
3
3
  @layer ${bn.join(", ")};
4
4
 
5
5
  @layer lc-base {
@@ -271,7 +271,7 @@ ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},In=(
271
271
  }
272
272
  .lc-toast.lc-on { opacity: 1; transform: none; }
273
273
  }
274
- `,vo=e=>{const t=e.defaultView??window;try{t.CSS.registerProperty({name:"--lc-dim",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}for(const l of yo)try{t.CSS.registerProperty({name:l,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=Eo,e.head.appendChild(n);const r=n.sheet,s=(l,d)=>{const b=l.insertRule(d,l.cssRules.length);return l.cssRules[b]},i=(l,d)=>{const b=l.cssRules;for(let E=b.length-1;E>=0;E--)if(b[E]===d){l.deleteRule(E);return}},o=new Map,f=(l,d)=>{const b=d===void 0?l:`${l}.${d}`;let E=o.get(b);return E||(E=d===void 0?s(r,`@layer ${l} {}`):s(f(l),`@layer ${d} {}`),o.set(b,E)),E};for(const l of bn)l!=="lc-base"&&f(l);return{insert(l,d,b){const E=f(l,b),g=s(E,d);return{remove:()=>i(E,g)}},own(l){const d=f("lc-own"),b=s(d,`${l} {}`);return{set:(E,g)=>b.style.setProperty(E,g),unset:E=>{b.style.removeProperty(E)},remove:()=>i(d,b)}},destroy(){n.remove()}}},at="lc-i";let wo=1;const Je=new Map,En=e=>{let t=Je.get(e);return t||Je.set(e,t=`lc-c${Je.size+1}`),t},So=(e,t)=>{const n=`{${t.text}}`,r=s=>`${s} .${e}, .${e}${s}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${r(`.${at}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${r(`.${at}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${r(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${yn} (orientation: ${t.name}) { .${e} ${n} }`};default:{const s=En(t.name);return{layer:"lc-class",sub:s,text:`${r(`.${s}`)} ${n}`}}}},_o=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),To=256,ko=e=>{const t=new Map,n=new Set,r=()=>{let s=n.size>>1;for(const i of n){if(s--<=0)break;for(const o of i.rules)o.remove();n.delete(i),t.delete(i.key)}};return{acquire(s){const i=_o(s);let o=t.get(i);if(o)return o.refs===0&&n.delete(o),o.refs++,o;const f=`lc-s${wo++}`,l=[],d=s.transition?`${s.base?";":""}transition:${s.transition}`:"";l.push(e.insert("lc-bag",`.${f} {${s.base}${d}}`));for(const b of s.blocks){const E=So(f,b);l.push(e.insert(E.layer,E.text,E.sub))}return t.set(i,o={name:f,key:i,refs:1,rules:l}),o},release(s){--s.refs>0||(n.add(s),n.size>To&&r())},count:()=>({live:t.size-n.size,idle:n.size})}},Lo=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),It=new Set([...Nr,"easing"]),xo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),Ro=(e,t,n,r)=>{const s=new Set;let i=!1;const o=new Set,f=h=>{o.has(h)||(o.add(h),r(`style: "${h}" is not a style property — ignored`))};let l=null,d=null;const b=h=>{h.style.dirty=!0,s.add(h),!i&&(i=!0,queueMicrotask(a))},E=h=>{const y=h.style,R=Xe(y.own,n,f);if(!(R.size===0&&!y.rule)){y.rule||(y.rule=e.own(`.lc-n${h.id}`),h.el.classList.add(`lc-n${h.id}`));for(const O of y.applied.keys())R.has(O)||y.rule.unset(O);for(const[O,A]of R)y.applied.get(O)!==A&&y.rule.set(O,A);y.applied=R}},g=(h,y)=>{const R=new Map;for(const[O,A]of h){if(!(A.duration>0))continue;const k=`${A.duration}ms ${bo(A.easing)} ${A.delay}ms`;for(const U of y.get(O).keys())U.startsWith("--")||R.set(U,`${U} ${k}`)}return[...R.values()].join(", ")},m=h=>{const y=h.style;y.dirty=!1;const R=Ot(Xe(y.base,n,f)),O=new Map,A=[];for(const[U,N]of y.blocks){const v=Xe(N.props,n,f);O.set(U,v),v.size>0&&A.push({name:U,text:Ot(v)})}const k=y.cls;R===""&&A.length===0?y.cls=null:y.cls=t.acquire({base:R,blocks:A,transition:g(y.blocks,O)}),k!==y.cls&&(k&&h.el.classList.remove(k.name),y.cls&&h.el.classList.add(y.cls.name)),k&&t.release(k),l==null||l(h)};function a(){if(i=!1,s.size===0)return;const h=[...s];s.clear();for(const y of h)y.style.dirty&&m(y)}const p=(h,y,R)=>{if(R==null){h.blocks.delete(y);return}if(!xo(R))return;let O=h.blocks.get(y);O||h.blocks.set(y,O={props:new Map,duration:0,delay:0,easing:void 0});for(const A of Object.keys(R)){const k=R[A];if(A==="duration"){O.duration=Number(k)||0;continue}if(A==="delay"){O.delay=Number(k)||0;continue}if(A==="easing"){O.easing=k;continue}if(It.has(A)||A[0]==="$")continue;const U=qe(A);O.props.delete(U),k!=null&&O.props.set(U,k)}};return{flush:a,set onChange(h){l=h},set onWrite(h){d=h},merge(h,y){const R=h.style;let O=!1;for(const A of Object.keys(y)){const k=y[A];if(A[0]==="$"){p(R,A.slice(1),k);continue}if(It.has(A))continue;const U=qe(A);R.base.delete(U),k!=null&&R.base.set(U,k),R.own.delete(U)&&(O=!0),d==null||d(h,U)}O&&E(h),b(h)},set(h,y,R){const O=h.style;if(y[0]==="$"){p(O,y.slice(1),R),b(h);return}const A=qe(y);if(!no(A)){f(A);return}d==null||d(h,A),R==null?(O.own.delete(A),O.base.delete(A)&&b(h)):O.own.set(A,R),E(h),(pn(A)||A==="tintColor")&&(l==null||l(h))},setClass(h,y,R){h.el.classList.toggle(En(y),R)},value(h,y){const R=h.style;return R.own.has(y)?R.own.get(y):R.base.get(y)},owns(h,y){return h.style.own.has(y)||h.style.base.has(y)},names(h,y){const R=h.style;if(R.own.has(y)||R.base.has(y))return!0;for(const O of R.blocks.values())if(O.props.has(y))return!0;return!1},drop(h){const y=h.style;s.delete(h),y.cls&&(t.release(y.cls),y.cls=null),y.rule&&(y.rule.remove(),y.rule=null)}}},Co={button:"button",input:"input",textarea:"textarea",image:"img"},Ao=(e,t)=>{const n=e.createElement(Co[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const r=n;r.alt="",r.decoding="async",r.draggable=!1}return n},$o=(e,t,n)=>({id:t,type:n,el:Ao(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:Lo(),strings:new Map}),vn=Symbol("lecodes.node"),pe=e=>e==null?void 0:e[vn],wn=e=>{e.el[vn]=e,e.el.setAttribute("data-node",String(e.id))},Fe=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const r=pe(n);r&&r.parent===e&&t.push(r)}return t},Qe=(e,t=",")=>{const n=[];let r=0,s="";for(const i of e){if(i==="("&&r++,i===")"&&r--,i===t&&r===0){n.push(s.trim()),s="";continue}s+=i}return s.trim()!==""&&n.push(s.trim()),n},Dt={"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},Oo=e=>{if(e in Dt)return Dt[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},Uo=(e,t)=>{const n=[];for(const r of Qe(e.trim())){const s=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(r);if(!s)return null;const i=s[1],o=Qe(s[2]);let f=i==="linear"?180:0;if(o.length>0){const d=o[0],b=i==="linear"?Oo(d):null;b!==null?(f=b,o.shift()):i==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(d)&&o.shift()}const l=[];for(const d of o){const b=Qe(d," "),E=b[b.length-1],g=b.length>1&&/^-?[\d.]+%$/.test(E),m=g?b.slice(0,-1).join(" "):d;l.push({color:t(m)??"#00000000",position:g?parseFloat(E)/100:null})}if(l.length===0)return null;l[0].position===null&&(l[0].position=0),l[l.length-1].position===null&&(l[l.length-1].position=1);for(let d=1;d<l.length-1;d++){if(l[d].position!==null)continue;let b=d;for(;l[b].position===null;)b++;const E=l[d-1].position,g=l[b].position;for(let m=d;m<b;m++)l[m].position=E+(g-E)*(m-d+1)/(b-d+1);d=b}n.push({type:i,angle:f,stops:l.map(d=>({color:d.color,position:d.position}))})}return n.length>0?n:null},No=Object.keys(Pe).filter(e=>Pe[e]!=="layout"),ne=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),Bt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const r=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${ne(+t[1])}${ne(+t[2])}${ne(+t[3])}${ne(r*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${ne(+n[1]*255)}${ne(+n[2]*255)}${ne(+n[3]*255)}${ne((n[4]===void 0?1:+n[4])*255)}`:null},Fo=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,r,s,i,o,f]=t[1].split(",").map(l=>parseFloat(l));return[n,r,0,s,i,0,o,f,1]},Vt={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"}},Mo=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let r=null;const s=d=>{r||(r=t.createElement("span"),r.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),r.isConnected||e.root.appendChild(r),r.style.color="",r.style.color=d;const b=r.style.color===""?null:Bt(n.getComputedStyle(r).color);return r.remove(),b},i=(d,b,E,g)=>{var p,h;if(pn(b)){const y=e.value(d,b);return y==null?null:E==="num"?Number(y===!0?1:y===!1?0:y):String(y)}const m=oo(b);if(m===null)return null;const a=g.getPropertyValue(m).trim();if(a===""&&!d.el.isConnected)return o(d,b,E);if(a==="")return null;switch(E){case"color":return m.startsWith("--")?s(a):Bt(a);case"len":{const y=parseFloat(a);return Number.isFinite(y)?y:b==="lineHeight"?parseFloat(g.fontSize)*1.2:null}case"num":{if(b==="lineClamp")return a==="none"?0:parseFloat(a)||0;const y=parseFloat(((p=Vt[b])==null?void 0:p[a])??a);return Number.isFinite(y)?y:null}case"enum":return((h=Vt[b])==null?void 0:h[a])??a;default:return b==="backgroundGradient"?a==="none"?null:Uo(a,s):b==="transform"?Fo(a):b==="transformOrigin"?null:b==="fontFamily"?a.split(",")[0].trim().replace(/^["']|["']$/g,""):b==="backgroundImage"&&a==="none"?"":a}},o=(d,b,E)=>{const g=e.value(d,b)??Ur[b];if(g==null)return null;if(b==="transform")return g==="identity"||g==="none"?[1,0,0,0,1,0,0,0,1]:null;if(E==="color")return typeof g=="number"?`#${(g>>>0).toString(16).padStart(8,"0")}`:s(String(g));if(E==="len"||E==="num"){const m=typeof g=="number"?g:parseFloat(String(g));return Number.isFinite(m)?m:null}return String(g)},f=d=>{const b=n.getComputedStyle(d.el),E=[],g=[],m={};for(const a of No){const p=e.owns(d,a);p&&E.push(a);const h=i(d,a,Pe[a],b);if(Or.includes(a)&&!p&&(h===null||h==="none")){m[a]=null;continue}g.push(a),m[a]=h}return{present:g,dirty:[],own:E,...m}},l=d=>{const b=d.el,E={id:d.id,type:d.type},g=d.strings.get("name");g&&(E.name=g);const m=d.strings.get("text");return d.type==="text"&&m&&(E.text=m),(d.type==="input"||d.type==="textarea")&&(E.value=b.value),E.flags=d.flags,E.layout=[b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight],E.paint=f(d),e.extend(d,E,l),E.children=e.held(d)?[]:Fe(d).map(l),E};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(d=>({kind:d.kind,node:l(d.node)}))})},paint(d){return d?(e.flush(),JSON.stringify(f(d))):"null"}}},Ze=10,Po=500,Io=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,s=r.defaultView??window,i=L=>{const T=t.getBoundingClientRect(),F=sn(t)||1;return[(L.clientX-T.left)/F,(L.clientY-T.top)/F]},o=(L,T)=>{for(let F=L instanceof Element?L:null;F&&F!==t;F=F.parentElement){if(e.boundary(F))return null;const C=pe(F);if(C&&(C.flags&T)!==0)return C}return null},f=new Map;let l=!1,d=null;const b=(L,T)=>{const F=typeof T=="number"?T:0;(F&xt)!==0&&(L.tracked=!0,L.wantsMove=(F&Rt)!==0,L.claim=F&kr)},E=L=>{s.clearTimeout(L.timer),f.delete(L.pointerId)},g=L=>{if(L.pointerType==="mouse"&&L.button!==0)return;const T=o(L.target,Oe),[F,C]=i(L);d=[F,C],l=!1;const $={pointerId:L.pointerId,node:T,startX:F,startY:C,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};if(f.set(L.pointerId,$),!T){const I=L.target instanceof Element?e.hit(L.target,F,C):null;I!==null&&b($,n(0,ur,L.pointerId,F,C,I));return}b($,n(T.id,Kn,L.pointerId,F,C)),(T.flags&hr)!==0&&($.timer=s.setTimeout(()=>{if(f.get($.pointerId)!==$||$.moved)return;const I=n(T.id,qn,$.pointerId,$.startX,$.startY),P=typeof I=="number"?I:0;(P&Lr)!==0&&($.handled=!0),b($,P)},Po))},m=L=>{const T=f.get(L.pointerId);if(T){const[F,C]=i(L);!T.moved&&Math.hypot(F-T.startX,C-T.startY)>Ze&&(T.moved=!0,s.clearTimeout(T.timer)),T.tracked&&T.wantsMove&&n(0,Xn,L.pointerId,F,C,F-T.startX,C-T.startY)}L.pointerType==="mouse"&&N(L)},a=L=>{const T=f.get(L.pointerId);if(!T)return;const[F,C]=i(L);T.tracked&&n(0,Jn,L.pointerId,F,C,F-T.startX,C-T.startY),(T.moved||T.handled)&&(l=!0),E(T)},p=L=>{const T=f.get(L.pointerId);T&&(T.tracked&&n(0,Et,L.pointerId),l=!0,E(T))},h=L=>{if(L.cancelable){for(const T of f.values())if(T.tracked&&T.claim!==0){L.preventDefault();return}}},y=L=>{if(l){l=!1;return}const T=o(L.target,Oe);if(!T&&L.target instanceof Element){const[$,I]=i(L);if(d&&Math.hypot($-d[0],I-d[1])>Ze)return;const P=e.hit(L.target,$,I);P!==null&&n(0,fr,L.pointerId??0,$,I,P);return}if(!T||(T.flags&mr)===0)return;let F,C;if(L.detail===0&&L.clientX===0&&L.clientY===0){const $=T.el.getBoundingClientRect();[F,C]=i({clientX:$.left+$.width/2,clientY:$.top+$.height/2})}else if([F,C]=i(L),d&&Math.hypot(F-d[0],C-d[1])>Ze)return;n(T.id,Yn,L.pointerId??0,F,C)};let R=null,O=!1,A=!1,k=[0,0];const U=(L,T)=>{R&&O&&(L===kt?n(0,L):n(0,L,T[0],T[1],T[0]-k[0],T[1]-k[1])),R=null,O=!1,A=!1};function N(L){const T=i(L),F=t.contains(L.target)?o(L.target,Oe):null;if(F!==R){if(U(Tt,T),R=F,F&&(F.flags&Tr)!==0){k=T;const C=n(F.id,dr,T[0],T[1]),$=typeof C=="number"?C:0;O=($&xt)!==0,A=($&Rt)!==0}return}R&&O&&A&&n(0,pr,T[0],T[1],T[0]-k[0],T[1]-k[1])}const v=L=>{L.pointerType==="mouse"&&U(Tt,i(L))},S=L=>{const T=pe(L instanceof Element?L:null);return T&&(T.type==="input"||T.type==="textarea")?T:null},x=L=>{const T=S(L.target);T&&(T.flags&yr)!==0&&n(T.id,tr,T.el.value)},D=L=>{const T=S(L.target);T&&(T.flags&Er)!==0&&n(T.id,nr)},M=L=>{const T=S(L.target);T&&(T.flags&vr)!==0&&n(T.id,rr)},B=L=>{if(L.key!=="Enter"||L.isComposing)return;const T=S(L.target);if(!T||T.type!=="input")return;L.preventDefault();const F=T.el;(T.flags&wr)!==0&&n(T.id,or,F.value),e.value(T,"enterKey")!=="next"&&r.activeElement===F&&F.blur()},z=L=>{const T=s.getComputedStyle(L);return T.overflowX!=="hidden"&&T.overflowY==="hidden"},H=L=>{const T=pe(L.target instanceof Element?L.target:null);!T||(T.flags&gr)===0||n(T.id,Qn,z(T.el)?T.el.scrollLeft:T.el.scrollTop)},X=L=>{const T=pe(L.target instanceof Element?L.target:null);T&&(T.flags&br)!==0&&n(T.id,Zn)};return t.addEventListener("pointerdown",g),t.addEventListener("click",y),t.addEventListener("pointerleave",v),t.addEventListener("touchmove",h,{passive:!1}),t.addEventListener("input",x),t.addEventListener("focusin",D),t.addEventListener("focusout",M),t.addEventListener("keydown",B),t.addEventListener("scroll",H,!0),t.addEventListener("scrollend",X,!0),r.addEventListener("pointermove",m),r.addEventListener("pointerup",a),r.addEventListener("pointercancel",p),{isPressed(L){for(const T of f.values())if(T.node===L)return!0;return!1},isHovered:L=>R===L,forget(L){for(const T of[...f.values()])T.node===L&&(T.tracked&&n(0,Et,T.pointerId),E(T));R===L&&U(kt,[0,0])},destroy(){for(const L of f.values())s.clearTimeout(L.timer);f.clear(),t.removeEventListener("pointerdown",g),t.removeEventListener("click",y),t.removeEventListener("pointerleave",v),t.removeEventListener("touchmove",h),t.removeEventListener("input",x),t.removeEventListener("focusin",D),t.removeEventListener("focusout",M),t.removeEventListener("keydown",B),t.removeEventListener("scroll",H,!0),t.removeEventListener("scrollend",X,!0),r.removeEventListener("pointermove",m),r.removeEventListener("pointerup",a),r.removeEventListener("pointercancel",p)}}},Do=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,Bo=e=>{const t=m=>m.image??(m.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=m=>m.src.startsWith("svg:")?m.src.slice(4):null,r=new Map,s=(m,a)=>{const p=r.get(a);p!=null&&p.delete(m)&&p.size===0&&r.delete(a)},i=m=>{const a=m.src,p=n(m);return p!==null?an(p):a.startsWith("id:")?e.bufferUrl(Number(a.slice(3))):a.startsWith("canvas:")||a.startsWith("scene2d:")?"":a},o=(m,a)=>a.src.startsWith("canvas:")?"canvas":a.rect?"crop":n(a)!==null&&(a.srcTint!==null||e.hasTint(m))?"mask":"img",f=(m,a)=>{const p=m.el;if(p.tagName.toLowerCase()===a)return;const h=e.doc.createElement(a);if(h.className=p.className,a==="img"){const R=h;R.alt="",R.decoding="async",R.draggable=!1}const y=p.getAttribute("data-name");y!==null&&h.setAttribute("data-name",y),m.el=h,wn(m),p.replaceWith(h),e.swapped(m,p)},l=m=>{for(const a of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])m.style.removeProperty(a)},d=(m,a,p)=>{const[h,y,R,O]=a,[A,k]=p;m.style.setProperty("--lc-crop-size",`${A/R*100}% ${k/O*100}%`),m.style.setProperty("--lc-crop-pos",`${A===R?0:h/(A-R)*100}% ${k===O?0:y/(k-O)*100}%`)},b=new WeakMap,E=(m,a)=>{const p=m.el,h=e.drawable(a);if(!h){p.width=0,p.height=0;return}p.width!==h.pixelWidth&&(p.width=h.pixelWidth),p.height!==h.pixelHeight&&(p.height=h.pixelHeight);const y=p.getContext("2d");y&&(y.clearRect(0,0,p.width,p.height),p.width>0&&p.height>0&&y.drawImage(h.image,0,0),p.style.setProperty("--lc-iw",`${h.width}px`),h.height>0&&p.style.setProperty("--lc-ir",`${h.width} / ${h.height}`))},g=m=>{var U;const a=t(m),p=o(m,a);a.form=p,f(m,p==="img"?"img":p==="canvas"?"canvas":"div");const h=m.el;if(h.classList.toggle("lc-image-mask",p==="mask"),h.classList.toggle("lc-image-crop",p==="crop"),h.classList.toggle("lc-image-canvas",p==="canvas"),l(h),p==="canvas"){E(m,a.src);return}const y=i(a);if(p==="img"){const N=h;y===""?N.removeAttribute("src"):N.getAttribute("src")!==y&&(N.src=y);return}if(h.style.setProperty("--lc-src",y===""?"none":Do(y)),p==="mask"){a.srcTint!==null&&h.style.setProperty("--lc-src-tint",ke(a.srcTint));const N=(U=Fr(n(a)??""))==null?void 0:U.trim().split(/[\s,]+/).map(Number),v=N==null?void 0:N[2],S=N==null?void 0:N[3];v&&S&&(h.style.setProperty("--lc-iw",`${v}px`),h.style.setProperty("--lc-ir",`${v} / ${S}`));return}const R=a.rect;h.style.setProperty("--lc-iw",`${R[2]}px`),h.style.setProperty("--lc-ih",`${R[3]}px`);const O=b.get(m);if(O&&O.url===y){d(h,R,O.size);return}if(y==="")return;const A=++a.probe,k=new Image;k.addEventListener("load",()=>{if(a.probe!==A||!a.rect)return;const N=[k.naturalWidth,k.naturalHeight];b.set(m,{url:y,size:N}),d(m.el,a.rect,N)},{once:!0}),k.src=y};return{setSrc(m,a){const p=t(m);if(p.src.startsWith("canvas:")&&s(m,p.src),p.src=a??"",p.srcTint=null,p.src.startsWith("canvas:")){let h=r.get(p.src);h||r.set(p.src,h=new Set),h.add(m)}g(m)},setSrcTint(m,a){t(m).srcTint=a,g(m)},setSourceRect(m,a){const p=t(m),h=a==null?void 0:a.trim().split(/\s+/).map(Number),y=h&&h.length===4&&h.every(A=>Number.isFinite(A))&&h[2]>0&&h[3]>0?h:null,R=!!p.rect&&!!y&&p.form==="crop"&&p.rect[2]===y[2]&&p.rect[3]===y[3];p.rect=y;const O=b.get(m);if(R&&O){d(m.el,y,O.size);return}g(m)},sourceChanged(m){var a;for(const p of r.get(m)??[])((a=p.image)==null?void 0:a.form)==="canvas"&&E(p,m)},forget(m){var a;(a=m.image)!=null&&a.src.startsWith("canvas:")&&s(m,m.image.src)},restyle(m){const a=m.image;a&&o(m,a)!==a.form&&g(m)}}},Vo=.5,zo=64,zt=48,Wo=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,s=r.defaultView??window,i=new Map;let o=null;const f=a=>{let p=i.get(a);if(!p||!p.isConnected){p=r.createElement("div"),p.className="lc-refresh",p.style.setProperty("--lc-refresh-color",s.getComputedStyle(a.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const h=a.el.parentElement;h&&(h.appendChild(p),p.style.top=`${a.el.offsetTop-36}px`,p.style.left=`${a.el.offsetLeft+a.el.offsetWidth/2}px`),i.set(a,p)}return p},l=(a,p,h)=>{const y=f(a);y.classList.toggle("lc-settling",h),y.style.translate=`0 ${p}px`,y.style.transform=`rotate(${p*3}deg)`,y.style.opacity=String(Math.min(1,p/zt))},d=a=>{const p=i.get(a);p&&(p.classList.remove("lc-spinning"),l(a,0,!0),s.setTimeout(()=>{i.get(a)===p&&(p.remove(),i.delete(a))},220))},b=a=>{for(let p=a instanceof Element?a:null;p&&p!==t;p=p.parentElement){const h=pe(p);if(h&&(h.flags&(Ye|Ke))!==0)return h}return null},E=a=>{if(o||a.touches.length!==1)return;const p=b(a.target);if(!p)return;const h=a.changedTouches[0];o={node:p,touch:h.identifier,startY:h.clientY,pulling:!1,distance:0}},g=a=>{if(!o)return;const p=[...a.changedTouches].find(y=>y.identifier===o.touch);if(!p)return;const h=p.clientY-o.startY;if(!o.pulling){if(o.node.el.scrollTop>0||h<=0){(h<0||o.node.el.scrollTop>0)&&(o.startY=p.clientY);return}o.pulling=!0}a.cancelable&&a.preventDefault(),o.distance=Math.max(0,h*Vo),(o.node.flags&Ke)!==0&&n(o.node.id,vt,o.distance),(o.node.flags&Ye)!==0&&l(o.node,o.distance,!1)},m=a=>{if(!o||![...a.changedTouches].some(O=>O.identifier===o.touch))return;const{node:p,pulling:h,distance:y}=o;if(o=null,!h||((p.flags&Ke)!==0&&n(p.id,vt,0),(p.flags&Ye)===0))return;if(y<zo||a.type==="touchcancel"){d(p);return}l(p,zt,!0),f(p).classList.add("lc-spinning");const R=n(p.id,er);Promise.resolve(R).then(()=>d(p),()=>d(p))};return t.addEventListener("touchstart",E,{passive:!0}),t.addEventListener("touchmove",g,{passive:!1}),t.addEventListener("touchend",m),t.addEventListener("touchcancel",m),{forget(a){var p;(o==null?void 0:o.node)===a&&(o=null),(p=i.get(a))==null||p.remove(),i.delete(a)},destroy(){t.removeEventListener("touchstart",E),t.removeEventListener("touchmove",g),t.removeEventListener("touchend",m),t.removeEventListener("touchcancel",m);for(const a of i.values())a.remove();i.clear(),o=null}}},Wt=".lc-scrollable, .lc-vlist, .lc-pager-track, textarea.lc, input.lc",De=new WeakMap,pt=e=>{if(!e.isConnected)return;const t=[],n=r=>{(r.scrollLeft!==0||r.scrollTop!==0)&&t.push({el:r,left:r.scrollLeft,top:r.scrollTop})};e.matches(Wt)&&n(e);for(const r of e.querySelectorAll(Wt))n(r);t.length>0?De.set(e,t):De.delete(e)},Sn=e=>{const t=De.get(e);if(t){De.delete(e);for(const{el:n,left:r,top:s}of t)!n.isConnected||!e.contains(n)||(n.scrollLeft=r,n.scrollTop=s)}},ct=e=>{pt(e),e.remove()},_n=(e,t,n=null)=>{t.parentElement===e&&(n===null||t.nextElementSibling===n)||(t.isConnected&&pt(t),e.insertBefore(t,n),Sn(t))},Ee=0,fe=-1,Tn={run:(e,t,n,r)=>r(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},Go={[xr]:"a 3D scene",[Rr]:"a 2D scene",[Cr]:"a native view",[Me]:"a video"},jo=e=>{const t=e.transitions??Tn;let n=null,r=[],s=[];const i=new Map,o=(v,S)=>`${v}:${S}`,f=new Set,l=v=>r.includes(v),d=v=>r.some(S=>S.node===v),b=v=>v&&v.kind===Y?v.node:null,E=(v,S)=>{e.emit(v.kind===Y||v.kind===Me?v.id:0,S,v.kind,v.id)},g=(v,S,x,D)=>{let M=null;return(v===Y||v===Me)&&(M=e.node(S)??null,!M||v===Y&&M.type!=="screen")?(e.warn(`navigation: ${S} is not a live ${v===Y?"screen":"video"} node`),null):{kind:v,id:S,node:M,viewName:x,paramsJson:D||"{}",back:Ee,retired:!1}},m=(v,S)=>{var D;const x=b(v);if(!x){if((D=e.surface)!=null&&D.call(e,v,!0)){v.node&&e.rootOwned(v.node,!0);return}f.has(v.kind)||(f.add(v.kind),e.warn(`${Go[v.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(x,!0),x.el.classList.remove("lc-covered"),x.el.classList.toggle("lc-above",S),_n(e.root,x.el)},a=v=>{var x;const S=b(v);!S&&v!==n&&((x=e.surface)==null||x.call(e,v,!1)),!(!S||v===n)&&(n&&n.node===S||(S.el.classList.remove("lc-above"),d(S)?S.el.classList.add("lc-covered"):ct(S.el)))},p=v=>{const S=b(v);!S&&v.node&&!(n&&n.node===v.node)&&!d(v.node)&&(e.rootOwned(v.node,!1),v.node.parent===null&&e.emit(v.node.id,St)),S&&(n&&n.node===S||d(S)||(S.el.classList.remove("lc-above"),ct(S.el),e.rootOwned(S,!1),e.emit(S.id,St)))},h=()=>{const v=s;s=[];for(const S of v)S.node&&t.holds(S.node)?s.push(S):p(S)},y=v=>{!v||v.retired||(v.retired=!0,s.push(v),e.post(h))},R=(v,S,x)=>{const D=x===fe?Ee:x,M=b(v),B=b(S);M&&B&&B.el.classList.toggle("lc-above",!M.el.classList.contains("lc-above")),t.run(M,B,D,()=>{M==null||M.el.classList.remove("lc-above"),B==null||B.el.classList.remove("lc-above"),S&&a(S),s.length>0&&e.post(h)})},O=v=>{var S;v.kind===Y&&v.node&&((S=e.active)==null||S.call(e,v.node,!1)),E(v,ar)},A=(v,S)=>{var M,B;const x=n;if(!v||x===v)return;t.settle(),x&&O(x),n=v;const D=!!b(v)&&!!b(x);m(v,!!b(v)&&(!D||t.enterOnTop(S))),E(v,ir),v.kind===Y&&v.node&&((M=e.active)==null||M.call(e,v.node,!0)),x&&!l(x)&&y(x),R(v,x,S),(B=e.changed)==null||B.call(e)},k=v=>{var x;t.settle();const S=n;S&&(O(S),n=null,l(S)||y(S),R(null,S,v),(x=e.changed)==null||x.call(e))},U=(v,S)=>{A(v,S),e.emit(0,lr,v.kind,v.id)},N=v=>{const S=r.length;return v===-1?S-2:v<-1?Math.max(S-1+v,0):v===0?0:Math.min(v,S-1)};return{current:()=>n,stack:()=>r,setUrl(v,S,x){var M;x===null||x===""?i.delete(o(v,S)):i.set(o(v,S),x.startsWith("/")?x:`/${x}`),(n&&n.kind===v&&n.id===S||r.some(B=>B.kind===v&&B.id===S))&&((M=e.changed)==null||M.call(e))},address(){if(n){const S=i.get(o(n.kind,n.id));if(S!==void 0)return S}const v=n?r.lastIndexOf(n):r.length-1;for(let S=v<0?r.length-1:v;S>=0;S--){const x=i.get(o(r[S].kind,r[S].id));if(x!==void 0)return x}return null},forgetUrl(v,S){i.delete(o(v,S))},open(v,S,x,D,M){A(g(v,S,x,D),M)},close(v,S,x){!n||n.kind!==v||n.id!==S||k(x)},routerOpen(v,S,x,D){const M=g(v,S,x,D);if(!M)return;const B=r;r=[M];for(const z of B)z!==n&&y(z);A(M,Ee)},routerPush(v,S,x,D,M,B){const z=g(v,S,x,D);z&&(z.back=B===fe?Ee:B,r.push(z),U(z,M))},routerReplace(v,S,x,D,M,B){const z=g(v,S,x,D);if(!z)return;const H=r[r.length-1];if(!H){z.back=B===fe?Ee:B,r.push(z),U(z,M);return}z.back=B===fe?H.back:B,r[r.length-1]=z,U(z,M),y(H)},routerPop(v,S){if(r.length<=1)return!1;const x=N(v);if(x<0||x>=r.length)return!1;const D=S===fe?r[r.length-1].back:S,M=r.splice(x+1);U(r[r.length-1],D);for(const B of M)y(B);return M.length>0},routerHide(v){k(v)},routerRestore(v){const S=r[r.length-1];S&&A(S,v)},reset(){var v;t.settle();for(const S of[n,...r,...s])(v=S==null?void 0:S.node)==null||v.el.remove();n=null,r=[],s=[],i.clear()}}},Ho=250,Ko="cubic-bezier(0.2, 0.8, 0.2, 1)",Yo=6,qo=e=>{const{root:t}=e,n=t.ownerDocument,r=n.defaultView??window,s=new Map,i=g=>{var a;const m=e.value(g.node,"overlayColor");if(m==null){(a=g.scrim)==null||a.remove(),g.scrim=null,g.frame.classList.remove("lc-scrimmed");return}g.scrim||(g.scrim=n.createElement("div"),g.scrim.className="lc-scrim",g.scrim.addEventListener("click",()=>{(g.node.flags&Sr)!==0&&e.emit(g.node.id,sr)}),g.frame.insertBefore(g.scrim,g.frame.firstChild),g.frame.classList.add("lc-scrimmed")),g.scrim.style.backgroundColor=ke(m)},o=g=>{const m=e.value(g,"sheetDetents");if(m==null||m==="")return null;const a=String(m).split(",").map(Number).filter(p=>Number.isFinite(p)&&p>0).sort((p,h)=>p-h);return a.length>0?a:null},f=(g,m)=>{const a=g.sheet,p=g.node.el.offsetHeight;if(m<0)return p;const h=a.detents[a.detents.length-1],y=a.detents[Math.max(0,Math.min(m,a.detents.length-1))];return p*(1-y/h)},l=(g,m,a)=>{const p=g.sheet.holder;p.style.transition=a?`transform ${Ho}ms ${Ko}`:"none",p.style.transform=`translateY(${Math.max(0,m)}px)`},d=(g,m)=>{const a=o(g.node);if(!a||!g.sheet)return;const p=g.sheet;p.detents=a;const h=e.value(g.node,"sheetDismissible");p.dismissible=h==null||Number(h)>.5||h===!0;const y=Number(e.value(g.node,"sheetDetent")??0);if(m){l(g,f(g,-1),!1),p.holder.offsetHeight,p.detent=y,l(g,f(g,y),!0);return}y!==p.detent&&(p.detent=y,l(g,f(g,y),!0))},b=g=>{const m=g.node.el;m.addEventListener("pointerdown",a=>{const p=g.sheet;if(!p||a.pointerType==="mouse"&&a.button!==0)return;for(let k=a.target instanceof Element?a.target:null;k&&k!==m;k=k.parentElement)if(k.scrollTop>0)return;const h=f(g,p.detent);let y=!1,R=h;const O=k=>{if(k.pointerId!==a.pointerId)return;const U=k.clientY-a.clientY;if(!y){if(Math.abs(U)<Yo||Math.abs(U)<Math.abs(k.clientX-a.clientX))return;y=!0}R=Math.max(0,h+U),l(g,R,!1)},A=k=>{if(k.pointerId!==a.pointerId||(n.removeEventListener("pointermove",O),n.removeEventListener("pointerup",A),n.removeEventListener("pointercancel",A),!y||!g.sheet))return;let U=0,N=1/0;for(let D=0;D<p.detents.length;D++){const M=Math.abs(f(g,D)-R);M<N&&(N=M,U=D)}const v=f(g,0),S=m.offsetHeight;if(p.dismissible&&R>v+(S-v)/2){l(g,S,!0),(g.node.flags&Lt)!==0&&e.emit(g.node.id,wt,-1);return}p.detent=U,l(g,f(g,U),!0),(g.node.flags&Lt)!==0&&e.emit(g.node.id,wt,U)};n.addEventListener("pointermove",O),n.addEventListener("pointerup",A),n.addEventListener("pointercancel",A)})};let E=null;return{show(g,m,a){if(s.has(g))return;e.flush();const p=n.createElement("div");p.className="lc-widget-frame";const h={node:g,frame:p,scrim:null,sheet:null};if(o(g)){const R=n.createElement("div");R.className="lc-sheet",R.appendChild(g.el),p.appendChild(R),h.sheet={holder:R,detents:[1],detent:-1,dismissible:!0},b(h)}else p.appendChild(g.el);s.set(g,h),e.rootOwned(g,!0),i(h);const y=m===Y?e.node(a):void 0;(m!==Ue&&y?y.el:t).appendChild(p),Sn(g.el),h.sheet&&d(h,!0)},hide(g){const m=s.get(g);m&&(s.delete(g),pt(g.el),g.el.remove(),m.frame.remove(),e.rootOwned(g,!1))},scrim:g=>{var m;return((m=s.get(g))==null?void 0:m.scrim)??null},restyle(g){const m=s.get(g);m&&(i(m),m.sheet&&d(m,!1))},forget(g){const m=s.get(g);m&&(s.delete(g),m.frame.remove())},shown:()=>[...s.keys()],backTargets:()=>[...s.keys()].reverse().filter(g=>(g.flags&_r)!==0),isFrame:g=>g.classList.contains("lc-widget-frame"),toast(g,m){(!E||!E.isConnected)&&(E=n.createElement("div"),E.className="lc-toasts",t.appendChild(E));const a=n.createElement("div");a.className="lc-toast",a.setAttribute("role","status"),a.textContent=g,E.appendChild(a),a.offsetHeight,a.classList.add("lc-on"),r.setTimeout(()=>{a.classList.remove("lc-on"),r.setTimeout(()=>a.remove(),200)},Math.max(500,m))},destroy(){for(const g of s.values())g.frame.remove();s.clear(),E==null||E.remove(),E=null}}},Gt={pager:["pagerSetContent","pagerSelect","pagerPush","pagerPop","pagerPopToRoot","pagerReplace"],vlist:["vlistInit","vlistSetKeys","vlistInsertKeys","vlistRemoveKeys","vlistInvalidate","vlistMount","vlistScrollTo","vlistScrollToKey","vlistScrollToEnd"],plugins:["viewCall"],tween:["tweenCreate","tweenControl","tweenSeek","tweenSetRate","tweenGetTime","tweenGetElapsed","registerTweenEvent","defineTransition"]},Xo=e=>{const t=e.root,n=t.ownerDocument,r=(c,u,w)=>{for(const _ of Object.keys(u)){const V=u[_],W=V==null?null:typeof V=="number"?ee(V):Te(V);for(const ie of w?[`--${_}`,`--lc-app-${_}`]:[`--${_}`])W===null?c.style.removeProperty(ie):c.style.setProperty(ie,W)}},s=new Set,i=n.defaultView??window,o=new Set,f=c=>console.warn(`[web-lite] ${c}`),l=[],d=c=>{var u;for(const w of l){const _=(u=w.ownerOf)==null?void 0:u.call(w,c);if(_)return _}return null},b=c=>{var u;for(const w of l){const _=(u=w.roots)==null?void 0:u.call(w,c);if(_)return _}return null},E=(c,u)=>{var w;for(const _ of l)(w=_.rootActive)==null||w.call(_,c,u)},g=c=>{var u;for(const w of l)(u=w.subtreeMoved)==null||u.call(w,c)},m=()=>{for(const c of l)if(c.stage)return c.stage();return Tn};let a=null;const p=()=>a??(a=e.transitions??m()),h={run:(c,u,w,_)=>p().run(c,u,w,_),settle:()=>p().settle(),enterOnTop:c=>p().enterOnTop(c),holds:c=>p().holds(c)};let y=[],R=!1;const O=c=>{y.push(c),!R&&(R=!0,queueMicrotask(()=>{R=!1;const u=y;y=[];for(const w of u)w()}))};let A=null;const k=(c,u,...w)=>{if(A)try{return A(c,u,...w)}catch(_){i.setTimeout(()=>{throw _},0);return}},U=(c,u,...w)=>O(()=>{k(c,u,...w)});t.classList.add("lc-root");const N=e.sink??vo(n),v=ko(N),S=Ro(N,v,{bufferUrl:e.bufferUrl},f),x=new Map;let D=1;const M=new ResizeObserver(c=>{for(const u of c){const w=u.target,_=x.get(Number(w.getAttribute("data-node")));!_||_.el!==w||!(_.flags&le)||k(_.id,Hn,w.offsetLeft,w.offsetTop,w.offsetWidth,w.offsetHeight)}}),B=Bo({doc:n,bufferUrl:e.bufferUrl,drawable:c=>{var u;for(const w of l){const _=(u=w.drawable)==null?void 0:u.call(w,c);if(_)return _}return null},hasTint:c=>S.names(c,"tintColor"),swapped:(c,u)=>{M.unobserve(u),c.flags&le&&M.observe(c.el)},warn:f});S.onChange=c=>{const u=c;Ar(u,w=>S.value(u,w)),u.type==="image"&&B.restyle(u),u.type==="widget"&&P.restyle(u)};const z=Io({root:t,emit:k,value:(c,u)=>S.value(c,u),boundary:c=>P.isFrame(c)||l.some(u=>{var w;return((w=u.boundary)==null?void 0:w.call(u,c))===!0}),hit:(c,u,w)=>{var _;for(const V of l){const W=(_=V.hit)==null?void 0:_.call(V,c,u,w);if(W!=null)return W}return null}}),H=Wo({root:t,emit:k}),X=new ResizeObserver(()=>{k(0,cr,t.clientWidth,t.clientHeight)});X.observe(t),S.onWrite=(c,u)=>{var w;for(const _ of l)(w=_.styled)==null||w.call(_,c,u)};const L=c=>c.parent===null&&!c.rooted,T=(c,u,w=!0)=>{var _;for(const V of l)(_=V.forget)==null||_.call(V,c);for(const V of Fe(c))T(V,u,!1);w||u.push(c.id),z.forget(c),H.forget(c),B.forget(c),I.forgetUrl(Y,c.id),P.forget(c),S.drop(c),M.unobserve(c.el),C.unregister(c.token),x.delete(c.id),c.parent=null,c.held=!1,w&&c.el.remove()},F=c=>{if(!x.has(c.id)||c.held||!L(c))return;const u=[];T(c,u),u.length>0&&k(0,_t,u)},C=new FinalizationRegistry(c=>{const u=x.get(c);u&&(u.held=!1,L(u)&&O(()=>F(u)))}),$=c=>{c.held||O(()=>F(c))},I=jo({root:t,emit:U,post:O,warn:f,node:c=>x.get(c),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},changed:e.onNavigation,active:E,surface:(c,u)=>l.some(w=>{var _;return((_=w.destination)==null?void 0:_.call(w,c,u))===!0}),transitions:h}),P=qo({root:t,emit:k,node:c=>x.get(c),value:(c,u)=>S.value(c,u),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},flush:()=>S.flush()}),oe=()=>{var u;for(const w of P.backTargets())if(k(w.id,xe,Ue,0)===!0)return"widget";const c=I.current();if(c){const w=c.kind===Y||c.kind===Me?c.id:0;if(k(w,xe,c.kind,c.id)===!0)return"destination"}for(const w of l)if(((u=w.back)==null?void 0:u.call(w))===!0)return"feature";return I.routerPop(-1,fe)?"router":k(0,xe,Ue,0)===!0?"app":"none"},te=c=>{if(!(c.key!=="Escape"||c.defaultPrevented)){for(const u of P.backTargets())if(k(u.id,xe,Ue,0)===!0){c.preventDefault();return}}};n.addEventListener("keydown",te);const se=Mo({root:t,roots:()=>{const c=I.current();return[...c!=null&&c.node&&c.kind===Y?[{kind:"screen",node:c.node}]:[],...P.shown().map(w=>({kind:"widget",node:w}))]},held:c=>b(c),extend:(c,u,w)=>{var _;for(const V of l)(_=V.dump)==null||_.call(V,c,u,w)},value:(c,u)=>S.value(c,u),owns:(c,u)=>S.owns(c,u),flush:()=>S.flush()}),be=c=>{if(!c.isConnected)return null;S.flush();const u=sn(t)||1,w=t.getBoundingClientRect(),_=c.getBoundingClientRect();return _.width===0&&_.height===0&&c.offsetParent===null?null:[(_.left-w.left)/u,(_.top-w.top)/u,_.width/u,_.height/u]},We=()=>{const c={};for(const u of Object.keys(Gt))for(const w of Gt[u])c[w]=()=>(o.has(w)||(o.add(w),f(`${w}: this tree was made without the "${u}" feature`)),w==="tweenCreate"?null:0);return c},Ge={create(c){const u=$o(n,D++,c);wn(u),x.set(u.id,u);const w={id:u.id};return C.register(w,u.id,u.token),w},destroy(c){const u=x.get(c);if(!u)return;if(!L(u)){console.error(`[web-lite] destroy: node ${c} is attached — remove / hide / close it first`);return}u.held=!1;const w=[];T(u,w),w.length>0&&k(0,_t,w)},insert(c,u,w){var gt;const _=x.get(c),V=x.get(u);if(!_||!V||V===_)return;if(b(_)){f(`insert() on a ${_.type} — what it holds goes through its own calls`);return}if(!L(V)){f(`insert: node ${u} is not a root — remove it from where it is first`);return}const W=Fe(_),ie=Math.max(0,Math.min(w,W.length));V.parent=_,_n(_.el,V.el,((gt=W[ie])==null?void 0:gt.el)??null),g(V)},remove(c,u){const w=x.get(c),_=x.get(u);!w||!_||_.parent!==w||(_.parent=null,ct(_.el),g(_),$(_))},parent(c){var w,_;const u=x.get(c);return u?((w=u.parent)==null?void 0:w.id)??((_=d(u))==null?void 0:_.id)??0:0},children(c){const u=x.get(c);return u?(b(u)??Fe(u)).map(w=>w.id):[]},setString(c,u,w){var V;const _=x.get(c);if(_){w===null?_.strings.delete(u):_.strings.set(u,w);for(const W of l)(V=W.content)==null||V.call(W,_,u,w);switch(u){case"text":_.type==="text"&&(_.el.textContent=w??"");return;case"name":w===null?_.el.removeAttribute("data-name"):_.el.setAttribute("data-name",w);return;case"src":_.type==="image"&&B.setSrc(_,w);return;case"srcTintColor":_.type==="image"&&B.setSrcTint(_,w);return;case"sourceRect":_.type==="image"&&B.setSourceRect(_,w);return;case"value":if(_.type==="input"||_.type==="textarea"){const W=_.el;W.value!==(w??"")&&(W.value=w??"")}return;case"focus":w==="1"?_.el.focus({preventScroll:!0}):_.el.blur();return}}},setInt(c,u,w){var V;const _=x.get(c);if(_){_.strings.set(u,String(w));for(const W of l)(V=W.content)==null||V.call(W,_,u,w)}},setFlags(c,u){const w=x.get(c);if(!w)return;const _=w.flags;w.flags=u,w.el.classList.toggle(at,(u&Oe)!==0),u&le&&!(_&le)?M.observe(w.el):!(u&le)&&_&le&&M.unobserve(w.el)},getTextValue(c){const u=x.get(c);return u&&(u.type==="input"||u.type==="textarea")?u.el.value:""},setStyle(c,u,w){const _=x.get(c);_&&S.set(_,u,w)},mergeStyle(c,u){const w=x.get(c);w&&S.merge(w,u)},setClass(c,u,w){const _=x.get(c);_&&S.setClass(_,u,w)},setTheme(c){r(t,c,!0)},setNodeTheme(c,u){const w=x.get(c);if(w){r(w.el,u,!1);for(const _ of Object.keys(u))s.has(_)||!/^[A-Za-z0-9_-]+$/.test(_)||(s.add(_),N.insert("lc-base",`.lc-widget-frame { --${_}: var(--lc-app-${_}); }`));"text"in u&&w.el.toggleAttribute("data-theme-text",u.text!=null),"fontFamily"in u&&w.el.toggleAttribute("data-theme-font",u.fontFamily!=null)}},open:I.open,close:I.close,routerOpen:(c,u,w,_)=>I.routerOpen(c,u,w,_),routerPush:I.routerPush,routerReplace:I.routerReplace,routerPop:(c,u)=>{I.routerPop(c,u)},routerHide:I.routerHide,routerRestore:I.routerRestore,setDestUrl:I.setUrl,isViewSupported:()=>!1,viewVersion:()=>0,showWidget(c,u,w){const _=x.get(c);!_||P.shown().includes(_)||(P.show(_,u,w),E(_,!0))},hideWidget(c){const u=x.get(c);!u||!P.shown().includes(u)||(E(u,!1),P.hide(u))},registerFont(c,u,w,_,V,W){try{const ie=new i.FontFace(c,`url("${u}")`,{weight:String(w),style:_===2?"italic":"normal"});n.fonts.add(ie),ie.load().then(()=>V(),()=>W())}catch{W()}},fontFormat:"woff2",toast:(c,u)=>P.toast(c,u),isButtonPressed(c){const u=x.get(c);return!!u&&z.isPressed(u)},isHovered(c){const u=x.get(c);return!!u&&z.isHovered(u)},getBoundingClientRect(c){const u=x.get(c);return u?be(u.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>se.dump(),debugPaint:c=>se.paint(x.get(c)),setEmitter(c){A=c}},ae={...We(),...Ge},K={root:t,emit:k,emitLater:U,post:O,warn:f,node:c=>x.get(c),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},flush:()=>S.flush(),value:(c,u)=>S.value(c,u),setStyle:(c,u,w)=>S.set(c,u,w),setString:(c,u,w)=>ae.setString(c,u,w),style:{bufferUrl:e.bufferUrl},shown:c=>{var u;return((u=I.current())==null?void 0:u.node)===c||P.shown().includes(c)},scrim:c=>P.scrim(c),stage:m,sourceChanged:c=>B.sourceChanged(c),plugins:e.plugins??null},ce={};for(const c of e.features??[]){const u=c.install(K);l.push(u),Object.assign(ae,u.bridge),Object.assign(ce,u.globals)}return{bridge:ae,globals:ce,presentation:I,back:oe,setSafeArea(c,u=[]){for(const w of["top","right","bottom","left"])t.style.setProperty(`--safe-${w}`,`${c[w]}px`),u.includes(w)?t.style.setProperty(`--safe-${w}-bar`,`${c[w]}px`):t.style.removeProperty(`--safe-${w}-bar`)},flush:()=>S.flush(),stats:()=>Object.assign({nodes:x.size,classes:v.count(),tweens:0},...l.map(c=>{var u;return((u=c.stats)==null?void 0:u.call(c))??{}})),destroy(){var c;A=null,I.reset();for(const u of l)(c=u.destroy)==null||c.call(u);P.destroy(),n.removeEventListener("keydown",te),z.destroy(),H.destroy(),X.disconnect(),M.disconnect();for(const u of x.values())C.unregister(u.token),u.el.remove();x.clear(),e.sink||N.destroy(),t.classList.remove("lc-root");for(const u of Array.from(t.style))u.startsWith("--")&&t.style.removeProperty(u)}}},G=[null],mt=new TextDecoder("utf-8"),li=async(e,t,n,r)=>{var m;let s;if(t.body)if(typeof t.body=="object"&&Array.isArray(t.body._entries)){const a=new FormData;for(let[p,h,y]of t.body._entries)typeof h=="object"?a.append(p,new Blob([he(h._id)]),y):a.append(p,h);s=a}else typeof t.body=="string"?s=t.body:r(new Error("Invalid body"));const i=await fetch(e,{method:t.method,body:s,headers:t.headers,mode:"cors",credentials:"omit"}),o=typeof t.onProgress=="function"?t.onProgress:null;if(!o){const a=await i.arrayBuffer();G.push(a),n(G.length-1,i.status);return}const f=(m=i.body)==null?void 0:m.getReader();if(!f){const a=await i.arrayBuffer();G.push(a),n(G.length-1,i.status);return}const l=Number(i.headers.get("content-length"))||void 0;let d=0;const b=[];for(;;){const{done:a,value:p}=await f.read();if(a)break;p&&(b.push(p),d+=p.length,o({loaded:d,total:l}))}const E=new Uint8Array(d);let g=0;for(const a of b)E.set(a,g),g+=a.length;G.push(E.buffer),n(G.length-1,i.status)},Jo=e=>JSON.parse(mt.decode(he(e))),kn=e=>mt.decode(he(e)),Qo=e=>new Uint8Array(he(e)).slice(),Zo=(e,t,n)=>mt.decode(he(e).slice(t,n)),es=e=>{const t=new Blob([G[e]]);return URL.createObjectURL(t)},Ln=e=>new Blob([G[e]]),he=e=>G[e],jt=e=>{G[e]=null},Be=e=>(G.push(e),G.length-1),ht=new Map,ui=(e,t)=>{ht.set(e,t);const n=Ve.get(e);n!==void 0&&(G[n]=t)},fi=e=>ht.has(e),Ve=new Map,di=e=>{for(const[t,n]of Ve)if(n===e)return t},ts=e=>{const t=Ve.get(e);if(t!==void 0)return t;const n=ht.get(e);if(!n)return-1;G.push(n);const r=G.length-1;return Ve.set(e,r),r},ns=()=>{const e=new Map,t=new Map,n=new Set,r={registerView(s,i,o=1){e.set(s,{factory:i,version:o})},registerService(s,i,o=1){t.set(s,{factory:i,version:o})},putBuffer:Be};return{views:e,services:t,has:s=>n.has(s),register(s,i){if(!n.has(s)){n.add(s);try{i(r)}catch(o){console.warn(`[web-lite] the "${s}" plugin did not register: ${o instanceof Error?o.message:o}`)}}}}},Ht={pager:["pagerSetContent"],vlist:["vlistInit"],tween:["tweenCreate","defineTransition"],canvas:["_creatorCanvas."],video:["createVideo"],plugins:["viewCall","isViewSupported","_creatorService."]},rs={pager:()=>re(()=>import("./assets/pager-Db5BY7FB.js"),[],import.meta.url).then(e=>e.pager),vlist:()=>re(()=>import("./assets/vlist-DrV2Q7P5.js"),[],import.meta.url).then(e=>e.vlist),tween:()=>re(()=>import("./assets/tween-BnWYhJ7P.js"),[],import.meta.url).then(e=>e.tween),canvas:()=>re(()=>import("./assets/canvas-WxiusXCB.js"),[],import.meta.url).then(e=>e.canvas),video:()=>re(()=>import("./assets/video-BLj61nDx.js"),[],import.meta.url).then(e=>e.video),plugins:()=>re(()=>import("./assets/plugins-CuEPHbHL.js"),[],import.meta.url).then(e=>e.plugins)},xn=Object.keys(Ht).map(e=>({name:e,uses:Ht[e],load:rs[e]})),os=e=>xn.filter(t=>t.uses.some(n=>e.includes(n))).map(t=>t.name),ss=async e=>{const t=os(e);return(await Promise.all(xn.filter(r=>t.includes(r.name)).map(r=>r.load().catch(s=>(console.warn(`[web-lite] the "${r.name}" feature did not load: ${s instanceof Error?s.message:s}`),null))))).filter(r=>r!==null)},is=e=>{let t=null,n=null;const r=(l,d)=>{t==null||t(l,d)},s=()=>r(document.hidden?"pause":"resume"),i=()=>r("online"),o=()=>r("offline");return document.addEventListener("visibilitychange",s),window.addEventListener("online",i),window.addEventListener("offline",o),{bridge:{run(l,d,b,E){let g;try{g=kn(l)}catch{d("run: no such buffer");return}e.rerun(g,E,d)},restart(l){e.rerun(void 0,l)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(l){t=l},setFreedEmitter(l){n=l},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(l){window.open(l,"_blank","noopener")},setOrientation(l){var E,g,m,a;const d=l==="landscape"||l==="portrait"?l:"auto";if(e.onOrientation){e.onOrientation(d);return}const b=typeof screen<"u"?screen.orientation:void 0;if(b)try{d==="auto"?(E=b.unlock)==null||E.call(b):(a=(m=(g=b.lock)==null?void 0:g.call(b,d))==null?void 0:m.catch)==null||a.call(m,()=>{})}catch{}}},emit:r,freed:(l,d)=>{n==null||n(l,d)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",s),window.removeEventListener("online",i),window.removeEventListener("offline",o)}}},as=(e,t,n,r)=>{try{const s=document.createElement("input");s.type="file",s.multiple=n,r&&(s.accept=r),s.onchange=async()=>{const{files:i}=s;if(n){const o=[];if(!i)return e([]);for(let f of i)o.push([Be(await f.arrayBuffer()),f.name,f.size]);e(o)}else{if(!i||i.length===0)return e(null);e([[Be(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!s.files||s.files.length===0)&&e(n?[]:null)},300)},{once:!0}),s.click()}catch(s){t(s)}},cs=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 r=navigator.clipboard;if(!(r!=null&&r.readText)){n("Clipboard is not available");return}r.readText().then(t,s=>n(s instanceof Error?s.message:"Clipboard read failed"))},share(t,n){var f;const r=Ln(t),s=new File([r],"image.png",{type:"image/png"});if((f=navigator.canShare)!=null&&f.call(navigator,{files:[s]})){navigator.share({files:[s],text:n}).catch(()=>{});return}const i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=s.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i)},openFilePicker:(t,n,r,s)=>as(t,n,r,s??void 0),requestCamera(t){t()}}),ls=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},us=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[r,s,i]of t){const o=ls(s);o!==null?n.append(r,Ln(o),i):n.append(r,String(s))}return n},fs=()=>{const e=new Set,t=new FinalizationRegistry(i=>{e.delete(i)&&jt(i)}),n=i=>{const o={id:i};return e.add(i),t.register(o,i),o};let r=!1;return{bridge:{fetch(i,o,f,l,d){const b=typeof(o==null?void 0:o.onProgress)=="function"?o.onProgress:d;if(i.startsWith("id:")){const E=Number(i.slice(3));f({id:E},he(E)?200:404);return}(async()=>{var E;try{const g=await fetch(i,{method:o==null?void 0:o.method,headers:o==null?void 0:o.headers,body:us(o==null?void 0:o.body),mode:"cors",credentials:"omit"}),m=b?(E=g.body)==null?void 0:E.getReader():void 0;let a;if(!m)a=await g.arrayBuffer();else{const p=Number(g.headers.get("content-length"))||void 0,h=[];let y=0;for(;;){const{done:A,value:k}=await m.read();if(A)break;k&&(h.push(k),y+=k.length,r||b({loaded:y,total:p}))}const R=new Uint8Array(y);let O=0;for(const A of h)R.set(A,O),O+=A.length;a=R.buffer}if(r)return;f(n(Be(a)),g.status)}catch(g){r||l(g instanceof Error?g:String(g))}})()},local:i=>ts(i),toJson:i=>Jo(i),slice:(i,o,f)=>Zo(i,o,f),toText:i=>kn(i),toBytes:i=>Qo(i)},live:()=>e.size,dispose(){r=!0;for(const i of e)jt(i);e.clear()}}},Kt=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],et=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],$e=4,tt=16,Yt=16,ds=.5,ps=e=>{const t=new Set;let n=null;const r=(C,$,I=-1,P=0)=>{n==null||n(C,$,I,P)},s=C=>{if(!C.code)return;const $=t.has(C.code);t.add(C.code),r(0,C.code,-1,$||C.repeat?1:0)},i=C=>{C.code&&t.delete(C.code)&&r(1,C.code)},o=()=>{for(const C of[...t])C.startsWith("Gamepad")||(t.delete(C),r(1,C))},{root:f}=e;let l=0,d=0,b=0,E=0,g=0,m=0,a=0,p=0,h=0,y=0;const R=C=>{if(C.pointerType&&C.pointerType!=="mouse")return;const $=f.getBoundingClientRect();l=C.clientX-$.left,d=C.clientY-$.top,b+=C.movementX||0,E+=C.movementY||0},O=C=>{const $=Kt[C.button];$&&(t.add($),r(0,$))},A=C=>{const $=Kt[C.button];$&&t.delete($)&&r(1,$)},k=C=>{const $=C.deltaMode===0?.01:1;g+=C.deltaX*$,m+=C.deltaY*$},U=C=>{document.pointerLockElement===f&&C.preventDefault()},N=[],v=[],S=[],x=()=>{var $,I;const C=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let P=0;P<$e;P++){const oe=C[P]??null,te=!!oe&&oe.connected;if(te!==!!N[P]){if(N[P]=te,!te){for(const K of et)t.delete(K+"@"+P)&&(r(1,K,P),D(K));S[P]=[],v[P]=[0,0,0,0,0,0]}r(te?2:3,"",P)}if(!oe||!te)continue;const se=oe.axes,be=oe.buttons,We=(($=be[6])==null?void 0:$.value)??0,Ge=((I=be[7])==null?void 0:I.value)??0;v[P]=[se[0]??0,se[1]??0,se[2]??0,se[3]??0,We,Ge];const ae=S[P]??(S[P]=[]);for(let K=0;K<et.length;K++){const ce=be[K],c=!!ce&&(ce.pressed||ce.value>ds);if(c===!!ae[K])continue;ae[K]=c;const u=et[K];c?t.add(u+"@"+P):t.delete(u+"@"+P),D(u),r(c?0:1,u,P)}}},D=C=>{let $=!1;for(let I=0;I<$e&&!$;I++)t.has(C+"@"+I)&&($=!0);$?t.add(C):t.delete(C)};let M=0;const B=()=>{a=b,p=E,h=g,y=m,b=E=g=m=0,x(),M=requestAnimationFrame(B)},z=e.windows.filter((C,$,I)=>C&&I.indexOf(C)===$);for(const C of z)e.keyboard!==!1&&(C.addEventListener("keydown",s),C.addEventListener("keyup",i)),C.addEventListener("blur",o);return f.addEventListener("pointermove",R,!0),f.addEventListener("mousedown",O,!0),window.addEventListener("mouseup",A,!0),f.addEventListener("wheel",k,{passive:!0,capture:!0}),f.addEventListener("contextmenu",U,!0),typeof requestAnimationFrame=="function"&&(M=requestAnimationFrame(B)),{inputKey:(C,$)=>$>=0&&C.startsWith("Gamepad")?t.has(C+"@"+$):t.has(C),inputRead:C=>{var $;switch(C){case 0:return l;case 1:return d;case 2:return a;case 3:return p;case 4:return h;case 5:return y;case 6:return document.pointerLockElement===f?1:0;case 7:{let I=0;for(let P=0;P<$e;P++)N[P]&&I++;return I}}if(C>=tt){const I=Math.floor((C-tt)/Yt),P=(C-tt)%Yt;return I>=$e||!N[I]?0:P===0?1:(($=v[I])==null?void 0:$[P-1])??0}return 0},inputSetPointerLock:C=>{if(!C)return document.pointerLockElement===f&&document.exitPointerLock(),!0;if(document.pointerLockElement===f)return!0;if(typeof f.requestPointerLock!="function")return!1;try{const $=f.requestPointerLock({unadjustedMovement:!0});return $&&typeof $.catch=="function"&&$.catch(()=>{try{f.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:C=>{n=C},dispose:()=>{for(const C of z)C.removeEventListener("keydown",s),C.removeEventListener("keyup",i),C.removeEventListener("blur",o);f.removeEventListener("pointermove",R,!0),f.removeEventListener("mousedown",O,!0),window.removeEventListener("mouseup",A,!0),f.removeEventListener("wheel",k,!0),f.removeEventListener("contextmenu",U,!0),M&&cancelAnimationFrame(M),document.pointerLockElement===f&&document.exitPointerLock(),t.clear(),n=null}}},ms=e=>{const t=e.ownerDocument.defaultView??window,n=ps({windows:[t],root:e}),r=t.visualViewport,s=()=>r?Math.max(0,Math.round(t.innerHeight-r.height-r.offsetTop)):0;let i=null,o=0;const f=()=>{const d=s();d!==o&&(o=d,i==null||i(d,0))};return r==null||r.addEventListener("resize",f),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(d){n.registerInputEvent(d)},keyboardHeight:s,registerKeyboardEvent(d){i=d}},dispose(){i=null,r==null||r.removeEventListener("resize",f),n.dispose()}}},j=[null],ge=[!1],Rn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),ge[t]&&(e.currentTime=0,e.play())})},hs=(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 r=j.length;return j.push(n),ge.push(!1),Rn(n,r,t),r},gs=(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 r=j.length;return j.push(n),ge.push(!1),Rn(n,r,t),r},bs=(e,t)=>{const n=j[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},ys=(e,t)=>{const n=j[e];n&&(t?n.play():n.pause())},Es=(e,t)=>{ge[e]=t},vs=e=>{var t;return((t=j[e])==null?void 0:t.currentTime)??0},ws=(e,t)=>{const n=j[e];n&&(n.currentTime=t)},Ss=e=>{var n;const t=((n=j[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},pi=e=>j[e],Cn=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},_s=e=>{const t=j[e];t&&(Cn(t),j[e]=null,ge[e]=!1)},mi=()=>{for(let e of j)e&&Cn(e);j.length=1,ge.length=1},Ts=()=>{const e=new Map;let t=null;const n=o=>{e.delete(o)&&_s(o)},r=new FinalizationRegistry(o=>{const f=e.get(o);f&&(f.held=!1,f.playing||n(o))}),s=(o,f)=>{let l=-1;if(l=o(f,()=>{const E=e.get(l);E&&(t==null||t(l),!E.loop&&(E.playing=!1,E.held||n(l)))}),l<0)return null;e.set(l,{held:!0,playing:!1,loop:!1});const b={id:l};return r.register(b,l),b};return{bridge:{createAudio:o=>s(gs,o),createVideo:o=>s(hs,o),setVolume:bs,setLoop(o,f){const l=e.get(o);l&&(l.loop=f),Es(o,f)},setPlaying(o,f){const l=e.get(o);l&&(l.playing=f,ys(o,f),!f&&!l.held&&n(o))},time:vs,setTime:ws,duration:Ss,setEmitter(o){t=o}},live:()=>e.size,dispose(){t=null;for(const o of[...e.keys()])n(o)}}},ks=()=>{const e=[];return{bridge:{open(n,r){const s=e.length;let i;try{i=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>r("error")),s}return i.addEventListener("open",()=>r("open")),i.addEventListener("message",o=>r("message",o.data)),i.addEventListener("close",o=>{e[s]=null,r("close",o.code)}),i.addEventListener("error",()=>r("error")),e.push(i),s},send(n,r){const s=e[n];s&&s.readyState===WebSocket.OPEN&&s.send(r)},close(n){var r;(r=e[n])==null||r.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},Ls=e=>{let t="default",n=null,r=!1;const s=()=>`lecodes:${e}:${t}`,i=()=>{if(n)return n;n={};try{const d=window.localStorage.getItem(s()),b=d?JSON.parse(d):null;if(b&&typeof b=="object")for(const[E,g]of Object.entries(b))typeof g=="string"&&(n[E]=g)}catch{}return n},o=()=>{if(r=!1,!!n)try{window.localStorage.setItem(s(),JSON.stringify(n))}catch{}},f=()=>{r||(r=!0,queueMicrotask(o))};return{bridge:{get:d=>i()[d]??null,set(d,b){i()[d]=String(b),f()},remove(d){delete i()[d],f()},select(d){r&&o(),t=d,n=null}},dispose(){r&&o()}}},qt={scene3d:{uses:["_creator.createScene","_creator.createEntity"],module:"/web-lite/src/engines/scene3d.ts"},ar:{uses:["_creator.createARController"],module:"/web-lite/src/engines/ar.ts"},anim:{uses:["_creator.animator","_creator.getGlbClipSet","_creator.loadClips","_creator.createClipFromTracks"],module:"/creator-anim/dist/creatorAnim.js"},physics:{uses:["_creator.physicsBuild","_creator.physicsCreate","_creator.physicsConfigure","_creator.physicsRaycast","_creator.characterCreate","_creator.vehicleCreate","_creator.ragdollCreate"],module:"/creator-physics/dist/creatorPhysics.js"},particles:{uses:["_creator.createParticleSystem","_creator.createNoise"],module:"/creator-particles/dist/creatorParticles.js"}},xs=e=>{const t=Object.keys(qt).filter(n=>qt[n].uses.some(r=>e.includes(r)));return new Set(t)},Xt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An={};for(let e=0;e<Xt.length;e++)An[Xt[e]]=e;const Rs=e=>{const t=[];let n=0,r=0;for(const s of e){const i=An[s];if(i===void 0)break;const o=i&32;if(r+=(i&31)<<n,o)n+=5;else{const f=r&1;r>>=1,t.push(f?-r:r),r=0,n=0}}return t};class Cs{constructor(t){je(this,"sources");je(this,"lines");this.sources=t.sources,this.lines=[];let n=0,r=0,s=0;for(const i of t.mappings.split(";")){const o=[];let f=0;if(i)for(const l of i.split(",")){const d=Rs(l);d.length!==0&&(f+=d[0],d.length>=4&&(n+=d[1],r+=d[2],s+=d[3],o.push([f,n,r,s])))}this.lines.push(o)}}originalPositionFor(t,n){const r=this.lines[t-1];if(!r||r.length===0)return null;let s=null;for(const o of r)if(o[0]<=n)s=o;else break;s??(s=r[0]);const i=this.sources[s[1]];return i===void 0?null:{source:i,line:s[2]+1,column:s[3]}}}const As=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 Cs(JSON.parse(n))}catch{return null}};let ue=null;const $s=()=>{if(ue!==null)return ue;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return ue=n?parseInt(n[1],10)-1:2,ue}return ue=2,ue},Jt=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",r=$s(),s=[];for(const i of n.split(`
274
+ `,vo=e=>{const t=e.defaultView??window;try{t.CSS.registerProperty({name:"--lc-dim",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}for(const l of yo)try{t.CSS.registerProperty({name:l,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=Eo,e.head.appendChild(n);const r=n.sheet,s=(l,d)=>{const b=l.insertRule(d,l.cssRules.length);return l.cssRules[b]},i=(l,d)=>{const b=l.cssRules;for(let E=b.length-1;E>=0;E--)if(b[E]===d){l.deleteRule(E);return}},o=new Map,f=(l,d)=>{const b=d===void 0?l:`${l}.${d}`;let E=o.get(b);return E||(E=d===void 0?s(r,`@layer ${l} {}`):s(f(l),`@layer ${d} {}`),o.set(b,E)),E};for(const l of bn)l!=="lc-base"&&f(l);return{insert(l,d,b){const E=f(l,b),g=s(E,d);return{remove:()=>i(E,g)}},own(l){const d=f("lc-own"),b=s(d,`${l} {}`);return{set:(E,g)=>b.style.setProperty(E,g),unset:E=>{b.style.removeProperty(E)},remove:()=>i(d,b)}},destroy(){n.remove()}}},at="lc-i";let wo=1;const Je=new Map,En=e=>{let t=Je.get(e);return t||Je.set(e,t=`lc-c${Je.size+1}`),t},So=(e,t)=>{const n=`{${t.text}}`,r=s=>`${s} .${e}, .${e}${s}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${r(`.${at}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${r(`.${at}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${r(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${yn} (orientation: ${t.name}) { .${e} ${n} }`};default:{const s=En(t.name);return{layer:"lc-class",sub:s,text:`${r(`.${s}`)} ${n}`}}}},_o=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),To=256,ko=e=>{const t=new Map,n=new Set,r=()=>{let s=n.size>>1;for(const i of n){if(s--<=0)break;for(const o of i.rules)o.remove();n.delete(i),t.delete(i.key)}};return{acquire(s){const i=_o(s);let o=t.get(i);if(o)return o.refs===0&&n.delete(o),o.refs++,o;const f=`lc-s${wo++}`,l=[],d=s.transition?`${s.base?";":""}transition:${s.transition}`:"";l.push(e.insert("lc-bag",`.${f} {${s.base}${d}}`));for(const b of s.blocks){const E=So(f,b);l.push(e.insert(E.layer,E.text,E.sub))}return t.set(i,o={name:f,key:i,refs:1,rules:l}),o},release(s){--s.refs>0||(n.add(s),n.size>To&&r())},count:()=>({live:t.size-n.size,idle:n.size})}},Lo=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),It=new Set([...Nr,"easing"]),xo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),Ro=(e,t,n,r)=>{const s=new Set;let i=!1;const o=new Set,f=h=>{o.has(h)||(o.add(h),r(`style: "${h}" is not a style property — ignored`))};let l=null,d=null;const b=h=>{h.style.dirty=!0,s.add(h),!i&&(i=!0,queueMicrotask(a))},E=h=>{const y=h.style,R=Xe(y.own,n,f);if(!(R.size===0&&!y.rule)){y.rule||(y.rule=e.own(`.lc-n${h.id}`),h.el.classList.add(`lc-n${h.id}`));for(const O of y.applied.keys())R.has(O)||y.rule.unset(O);for(const[O,A]of R)y.applied.get(O)!==A&&y.rule.set(O,A);y.applied=R}},g=(h,y)=>{const R=new Map;for(const[O,A]of h){if(!(A.duration>0))continue;const k=`${A.duration}ms ${bo(A.easing)} ${A.delay}ms`;for(const U of y.get(O).keys())U.startsWith("--")||R.set(U,`${U} ${k}`)}return[...R.values()].join(", ")},m=h=>{const y=h.style;y.dirty=!1;const R=Ot(Xe(y.base,n,f)),O=new Map,A=[];for(const[U,N]of y.blocks){const v=Xe(N.props,n,f);O.set(U,v),v.size>0&&A.push({name:U,text:Ot(v)})}const k=y.cls;R===""&&A.length===0?y.cls=null:y.cls=t.acquire({base:R,blocks:A,transition:g(y.blocks,O)}),k!==y.cls&&(k&&h.el.classList.remove(k.name),y.cls&&h.el.classList.add(y.cls.name)),k&&t.release(k),l==null||l(h)};function a(){if(i=!1,s.size===0)return;const h=[...s];s.clear();for(const y of h)y.style.dirty&&m(y)}const p=(h,y,R)=>{if(R==null){h.blocks.delete(y);return}if(!xo(R))return;let O=h.blocks.get(y);O||h.blocks.set(y,O={props:new Map,duration:0,delay:0,easing:void 0});for(const A of Object.keys(R)){const k=R[A];if(A==="duration"){O.duration=Number(k)||0;continue}if(A==="delay"){O.delay=Number(k)||0;continue}if(A==="easing"){O.easing=k;continue}if(It.has(A)||A[0]==="$")continue;const U=qe(A);O.props.delete(U),k!=null&&O.props.set(U,k)}};return{flush:a,set onChange(h){l=h},set onWrite(h){d=h},merge(h,y){const R=h.style;let O=!1;for(const A of Object.keys(y)){const k=y[A];if(A[0]==="$"){p(R,A.slice(1),k);continue}if(It.has(A))continue;const U=qe(A);R.base.delete(U),k!=null&&R.base.set(U,k),R.own.delete(U)&&(O=!0),d==null||d(h,U)}O&&E(h),b(h)},set(h,y,R){const O=h.style;if(y[0]==="$"){p(O,y.slice(1),R),b(h);return}const A=qe(y);if(!no(A)){f(A);return}d==null||d(h,A),R==null?(O.own.delete(A),O.base.delete(A)&&b(h)):O.own.set(A,R),E(h),(pn(A)||A==="tintColor")&&(l==null||l(h))},setClass(h,y,R){h.el.classList.toggle(En(y),R)},value(h,y){const R=h.style;return R.own.has(y)?R.own.get(y):R.base.get(y)},owns(h,y){return h.style.own.has(y)||h.style.base.has(y)},names(h,y){const R=h.style;if(R.own.has(y)||R.base.has(y))return!0;for(const O of R.blocks.values())if(O.props.has(y))return!0;return!1},drop(h){const y=h.style;s.delete(h),y.cls&&(t.release(y.cls),y.cls=null),y.rule&&(y.rule.remove(),y.rule=null)}}},Co={button:"button",input:"input",textarea:"textarea",image:"img"},Ao=(e,t)=>{const n=e.createElement(Co[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const r=n;r.alt="",r.decoding="async",r.draggable=!1}return n},$o=(e,t,n)=>({id:t,type:n,el:Ao(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:Lo(),strings:new Map}),vn=Symbol("lecodes.node"),pe=e=>e==null?void 0:e[vn],wn=e=>{e.el[vn]=e,e.el.setAttribute("data-node",String(e.id))},Fe=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const r=pe(n);r&&r.parent===e&&t.push(r)}return t},Qe=(e,t=",")=>{const n=[];let r=0,s="";for(const i of e){if(i==="("&&r++,i===")"&&r--,i===t&&r===0){n.push(s.trim()),s="";continue}s+=i}return s.trim()!==""&&n.push(s.trim()),n},Dt={"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},Oo=e=>{if(e in Dt)return Dt[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},Uo=(e,t)=>{const n=[];for(const r of Qe(e.trim())){const s=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(r);if(!s)return null;const i=s[1],o=Qe(s[2]);let f=i==="linear"?180:0;if(o.length>0){const d=o[0],b=i==="linear"?Oo(d):null;b!==null?(f=b,o.shift()):i==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(d)&&o.shift()}const l=[];for(const d of o){const b=Qe(d," "),E=b[b.length-1],g=b.length>1&&/^-?[\d.]+%$/.test(E),m=g?b.slice(0,-1).join(" "):d;l.push({color:t(m)??"#00000000",position:g?parseFloat(E)/100:null})}if(l.length===0)return null;l[0].position===null&&(l[0].position=0),l[l.length-1].position===null&&(l[l.length-1].position=1);for(let d=1;d<l.length-1;d++){if(l[d].position!==null)continue;let b=d;for(;l[b].position===null;)b++;const E=l[d-1].position,g=l[b].position;for(let m=d;m<b;m++)l[m].position=E+(g-E)*(m-d+1)/(b-d+1);d=b}n.push({type:i,angle:f,stops:l.map(d=>({color:d.color,position:d.position}))})}return n.length>0?n:null},No=Object.keys(Pe).filter(e=>Pe[e]!=="layout"),ne=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),Bt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const r=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${ne(+t[1])}${ne(+t[2])}${ne(+t[3])}${ne(r*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${ne(+n[1]*255)}${ne(+n[2]*255)}${ne(+n[3]*255)}${ne((n[4]===void 0?1:+n[4])*255)}`:null},Fo=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,r,s,i,o,f]=t[1].split(",").map(l=>parseFloat(l));return[n,r,0,s,i,0,o,f,1]},Vt={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"}},Mo=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let r=null;const s=d=>{r||(r=t.createElement("span"),r.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),r.isConnected||e.root.appendChild(r),r.style.color="",r.style.color=d;const b=r.style.color===""?null:Bt(n.getComputedStyle(r).color);return r.remove(),b},i=(d,b,E,g)=>{var p,h;if(pn(b)){const y=e.value(d,b);return y==null?null:E==="num"?Number(y===!0?1:y===!1?0:y):String(y)}const m=oo(b);if(m===null)return null;const a=g.getPropertyValue(m).trim();if(a===""&&!d.el.isConnected)return o(d,b,E);if(a==="")return null;switch(E){case"color":return m.startsWith("--")?s(a):Bt(a);case"len":{const y=parseFloat(a);return Number.isFinite(y)?y:b==="lineHeight"?parseFloat(g.fontSize)*1.2:null}case"num":{if(b==="lineClamp")return a==="none"?0:parseFloat(a)||0;const y=parseFloat(((p=Vt[b])==null?void 0:p[a])??a);return Number.isFinite(y)?y:null}case"enum":return((h=Vt[b])==null?void 0:h[a])??a;default:return b==="backgroundGradient"?a==="none"?null:Uo(a,s):b==="transform"?Fo(a):b==="transformOrigin"?null:b==="fontFamily"?a.split(",")[0].trim().replace(/^["']|["']$/g,""):b==="backgroundImage"&&a==="none"?"":a}},o=(d,b,E)=>{const g=e.value(d,b)??Ur[b];if(g==null)return null;if(b==="transform")return g==="identity"||g==="none"?[1,0,0,0,1,0,0,0,1]:null;if(E==="color")return typeof g=="number"?`#${(g>>>0).toString(16).padStart(8,"0")}`:s(String(g));if(E==="len"||E==="num"){const m=typeof g=="number"?g:parseFloat(String(g));return Number.isFinite(m)?m:null}return String(g)},f=d=>{const b=n.getComputedStyle(d.el),E=[],g=[],m={};for(const a of No){const p=e.owns(d,a);p&&E.push(a);const h=i(d,a,Pe[a],b);if(Or.includes(a)&&!p&&(h===null||h==="none")){m[a]=null;continue}g.push(a),m[a]=h}return{present:g,dirty:[],own:E,...m}},l=d=>{const b=d.el,E={id:d.id,type:d.type},g=d.strings.get("name");g&&(E.name=g);const m=d.strings.get("text");return d.type==="text"&&m&&(E.text=m),(d.type==="input"||d.type==="textarea")&&(E.value=b.value),E.flags=d.flags,E.layout=[b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight],E.paint=f(d),e.extend(d,E,l),E.children=e.held(d)?[]:Fe(d).map(l),E};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(d=>({kind:d.kind,node:l(d.node)}))})},paint(d){return d?(e.flush(),JSON.stringify(f(d))):"null"}}},Ze=10,Po=500,Io=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,s=r.defaultView??window,i=L=>{const T=t.getBoundingClientRect(),F=sn(t)||1;return[(L.clientX-T.left)/F,(L.clientY-T.top)/F]},o=(L,T)=>{for(let F=L instanceof Element?L:null;F&&F!==t;F=F.parentElement){if(e.boundary(F))return null;const C=pe(F);if(C&&(C.flags&T)!==0)return C}return null},f=new Map;let l=!1,d=null;const b=(L,T)=>{const F=typeof T=="number"?T:0;(F&xt)!==0&&(L.tracked=!0,L.wantsMove=(F&Rt)!==0,L.claim=F&kr)},E=L=>{s.clearTimeout(L.timer),f.delete(L.pointerId)},g=L=>{if(L.pointerType==="mouse"&&L.button!==0)return;const T=o(L.target,Oe),[F,C]=i(L);d=[F,C],l=!1;const $={pointerId:L.pointerId,node:T,startX:F,startY:C,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};if(f.set(L.pointerId,$),!T){const I=L.target instanceof Element?e.hit(L.target,F,C):null;I!==null&&b($,n(0,ur,L.pointerId,F,C,I));return}b($,n(T.id,Kn,L.pointerId,F,C)),(T.flags&hr)!==0&&($.timer=s.setTimeout(()=>{if(f.get($.pointerId)!==$||$.moved)return;const I=n(T.id,qn,$.pointerId,$.startX,$.startY),P=typeof I=="number"?I:0;(P&Lr)!==0&&($.handled=!0),b($,P)},Po))},m=L=>{const T=f.get(L.pointerId);if(T){const[F,C]=i(L);!T.moved&&Math.hypot(F-T.startX,C-T.startY)>Ze&&(T.moved=!0,s.clearTimeout(T.timer)),T.tracked&&T.wantsMove&&n(0,Xn,L.pointerId,F,C,F-T.startX,C-T.startY)}L.pointerType==="mouse"&&N(L)},a=L=>{const T=f.get(L.pointerId);if(!T)return;const[F,C]=i(L);T.tracked&&n(0,Jn,L.pointerId,F,C,F-T.startX,C-T.startY),(T.moved||T.handled)&&(l=!0),E(T)},p=L=>{const T=f.get(L.pointerId);T&&(T.tracked&&n(0,Et,L.pointerId),l=!0,E(T))},h=L=>{if(L.cancelable){for(const T of f.values())if(T.tracked&&T.claim!==0){L.preventDefault();return}}},y=L=>{if(l){l=!1;return}const T=o(L.target,Oe);if(!T&&L.target instanceof Element){const[$,I]=i(L);if(d&&Math.hypot($-d[0],I-d[1])>Ze)return;const P=e.hit(L.target,$,I);P!==null&&n(0,fr,L.pointerId??0,$,I,P);return}if(!T||(T.flags&mr)===0)return;let F,C;if(L.detail===0&&L.clientX===0&&L.clientY===0){const $=T.el.getBoundingClientRect();[F,C]=i({clientX:$.left+$.width/2,clientY:$.top+$.height/2})}else if([F,C]=i(L),d&&Math.hypot(F-d[0],C-d[1])>Ze)return;n(T.id,Yn,L.pointerId??0,F,C)};let R=null,O=!1,A=!1,k=[0,0];const U=(L,T)=>{R&&O&&(L===kt?n(0,L):n(0,L,T[0],T[1],T[0]-k[0],T[1]-k[1])),R=null,O=!1,A=!1};function N(L){const T=i(L),F=t.contains(L.target)?o(L.target,Oe):null;if(F!==R){if(U(Tt,T),R=F,F&&(F.flags&Tr)!==0){k=T;const C=n(F.id,dr,T[0],T[1]),$=typeof C=="number"?C:0;O=($&xt)!==0,A=($&Rt)!==0}return}R&&O&&A&&n(0,pr,T[0],T[1],T[0]-k[0],T[1]-k[1])}const v=L=>{L.pointerType==="mouse"&&U(Tt,i(L))},S=L=>{const T=pe(L instanceof Element?L:null);return T&&(T.type==="input"||T.type==="textarea")?T:null},x=L=>{const T=S(L.target);T&&(T.flags&yr)!==0&&n(T.id,tr,T.el.value)},D=L=>{const T=S(L.target);T&&(T.flags&Er)!==0&&n(T.id,nr)},M=L=>{const T=S(L.target);T&&(T.flags&vr)!==0&&n(T.id,rr)},B=L=>{if(L.key!=="Enter"||L.isComposing)return;const T=S(L.target);if(!T||T.type!=="input")return;L.preventDefault();const F=T.el;(T.flags&wr)!==0&&n(T.id,or,F.value),e.value(T,"enterKey")!=="next"&&r.activeElement===F&&F.blur()},z=L=>{const T=s.getComputedStyle(L);return T.overflowX!=="hidden"&&T.overflowY==="hidden"},H=L=>{const T=pe(L.target instanceof Element?L.target:null);!T||(T.flags&gr)===0||n(T.id,Qn,z(T.el)?T.el.scrollLeft:T.el.scrollTop)},X=L=>{const T=pe(L.target instanceof Element?L.target:null);T&&(T.flags&br)!==0&&n(T.id,Zn)};return t.addEventListener("pointerdown",g),t.addEventListener("click",y),t.addEventListener("pointerleave",v),t.addEventListener("touchmove",h,{passive:!1}),t.addEventListener("input",x),t.addEventListener("focusin",D),t.addEventListener("focusout",M),t.addEventListener("keydown",B),t.addEventListener("scroll",H,!0),t.addEventListener("scrollend",X,!0),r.addEventListener("pointermove",m),r.addEventListener("pointerup",a),r.addEventListener("pointercancel",p),{isPressed(L){for(const T of f.values())if(T.node===L)return!0;return!1},isHovered:L=>R===L,forget(L){for(const T of[...f.values()])T.node===L&&(T.tracked&&n(0,Et,T.pointerId),E(T));R===L&&U(kt,[0,0])},destroy(){for(const L of f.values())s.clearTimeout(L.timer);f.clear(),t.removeEventListener("pointerdown",g),t.removeEventListener("click",y),t.removeEventListener("pointerleave",v),t.removeEventListener("touchmove",h),t.removeEventListener("input",x),t.removeEventListener("focusin",D),t.removeEventListener("focusout",M),t.removeEventListener("keydown",B),t.removeEventListener("scroll",H,!0),t.removeEventListener("scrollend",X,!0),r.removeEventListener("pointermove",m),r.removeEventListener("pointerup",a),r.removeEventListener("pointercancel",p)}}},Do=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,Bo=e=>{const t=m=>m.image??(m.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=m=>m.src.startsWith("svg:")?m.src.slice(4):null,r=new Map,s=(m,a)=>{const p=r.get(a);p!=null&&p.delete(m)&&p.size===0&&r.delete(a)},i=m=>{const a=m.src,p=n(m);return p!==null?an(p):a.startsWith("id:")?e.bufferUrl(Number(a.slice(3))):a.startsWith("canvas:")||a.startsWith("scene2d:")?"":a},o=(m,a)=>a.src.startsWith("canvas:")?"canvas":a.rect?"crop":n(a)!==null&&(a.srcTint!==null||e.hasTint(m))?"mask":"img",f=(m,a)=>{const p=m.el;if(p.tagName.toLowerCase()===a)return;const h=e.doc.createElement(a);if(h.className=p.className,a==="img"){const R=h;R.alt="",R.decoding="async",R.draggable=!1}const y=p.getAttribute("data-name");y!==null&&h.setAttribute("data-name",y),m.el=h,wn(m),p.replaceWith(h),e.swapped(m,p)},l=m=>{for(const a of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])m.style.removeProperty(a)},d=(m,a,p)=>{const[h,y,R,O]=a,[A,k]=p;m.style.setProperty("--lc-crop-size",`${A/R*100}% ${k/O*100}%`),m.style.setProperty("--lc-crop-pos",`${A===R?0:h/(A-R)*100}% ${k===O?0:y/(k-O)*100}%`)},b=new WeakMap,E=(m,a)=>{const p=m.el,h=e.drawable(a);if(!h){p.width=0,p.height=0;return}p.width!==h.pixelWidth&&(p.width=h.pixelWidth),p.height!==h.pixelHeight&&(p.height=h.pixelHeight);const y=p.getContext("2d");y&&(y.clearRect(0,0,p.width,p.height),p.width>0&&p.height>0&&y.drawImage(h.image,0,0),p.style.setProperty("--lc-iw",`${h.width}px`),h.height>0&&p.style.setProperty("--lc-ir",`${h.width} / ${h.height}`))},g=m=>{var U;const a=t(m),p=o(m,a);a.form=p,f(m,p==="img"?"img":p==="canvas"?"canvas":"div");const h=m.el;if(h.classList.toggle("lc-image-mask",p==="mask"),h.classList.toggle("lc-image-crop",p==="crop"),h.classList.toggle("lc-image-canvas",p==="canvas"),l(h),p==="canvas"){E(m,a.src);return}const y=i(a);if(p==="img"){const N=h;y===""?N.removeAttribute("src"):N.getAttribute("src")!==y&&(N.src=y);return}if(h.style.setProperty("--lc-src",y===""?"none":Do(y)),p==="mask"){a.srcTint!==null&&h.style.setProperty("--lc-src-tint",ke(a.srcTint));const N=(U=Fr(n(a)??""))==null?void 0:U.trim().split(/[\s,]+/).map(Number),v=N==null?void 0:N[2],S=N==null?void 0:N[3];v&&S&&(h.style.setProperty("--lc-iw",`${v}px`),h.style.setProperty("--lc-ir",`${v} / ${S}`));return}const R=a.rect;h.style.setProperty("--lc-iw",`${R[2]}px`),h.style.setProperty("--lc-ih",`${R[3]}px`);const O=b.get(m);if(O&&O.url===y){d(h,R,O.size);return}if(y==="")return;const A=++a.probe,k=new Image;k.addEventListener("load",()=>{if(a.probe!==A||!a.rect)return;const N=[k.naturalWidth,k.naturalHeight];b.set(m,{url:y,size:N}),d(m.el,a.rect,N)},{once:!0}),k.src=y};return{setSrc(m,a){const p=t(m);if(p.src.startsWith("canvas:")&&s(m,p.src),p.src=a??"",p.srcTint=null,p.src.startsWith("canvas:")){let h=r.get(p.src);h||r.set(p.src,h=new Set),h.add(m)}g(m)},setSrcTint(m,a){t(m).srcTint=a,g(m)},setSourceRect(m,a){const p=t(m),h=a==null?void 0:a.trim().split(/\s+/).map(Number),y=h&&h.length===4&&h.every(A=>Number.isFinite(A))&&h[2]>0&&h[3]>0?h:null,R=!!p.rect&&!!y&&p.form==="crop"&&p.rect[2]===y[2]&&p.rect[3]===y[3];p.rect=y;const O=b.get(m);if(R&&O){d(m.el,y,O.size);return}g(m)},sourceChanged(m){var a;for(const p of r.get(m)??[])((a=p.image)==null?void 0:a.form)==="canvas"&&E(p,m)},forget(m){var a;(a=m.image)!=null&&a.src.startsWith("canvas:")&&s(m,m.image.src)},restyle(m){const a=m.image;a&&o(m,a)!==a.form&&g(m)}}},Vo=.5,zo=64,zt=48,Wo=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,s=r.defaultView??window,i=new Map;let o=null;const f=a=>{let p=i.get(a);if(!p||!p.isConnected){p=r.createElement("div"),p.className="lc-refresh",p.style.setProperty("--lc-refresh-color",s.getComputedStyle(a.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const h=a.el.parentElement;h&&(h.appendChild(p),p.style.top=`${a.el.offsetTop-36}px`,p.style.left=`${a.el.offsetLeft+a.el.offsetWidth/2}px`),i.set(a,p)}return p},l=(a,p,h)=>{const y=f(a);y.classList.toggle("lc-settling",h),y.style.translate=`0 ${p}px`,y.style.transform=`rotate(${p*3}deg)`,y.style.opacity=String(Math.min(1,p/zt))},d=a=>{const p=i.get(a);p&&(p.classList.remove("lc-spinning"),l(a,0,!0),s.setTimeout(()=>{i.get(a)===p&&(p.remove(),i.delete(a))},220))},b=a=>{for(let p=a instanceof Element?a:null;p&&p!==t;p=p.parentElement){const h=pe(p);if(h&&(h.flags&(Ye|Ke))!==0)return h}return null},E=a=>{if(o||a.touches.length!==1)return;const p=b(a.target);if(!p)return;const h=a.changedTouches[0];o={node:p,touch:h.identifier,startY:h.clientY,pulling:!1,distance:0}},g=a=>{if(!o)return;const p=[...a.changedTouches].find(y=>y.identifier===o.touch);if(!p)return;const h=p.clientY-o.startY;if(!o.pulling){if(o.node.el.scrollTop>0||h<=0){(h<0||o.node.el.scrollTop>0)&&(o.startY=p.clientY);return}o.pulling=!0}a.cancelable&&a.preventDefault(),o.distance=Math.max(0,h*Vo),(o.node.flags&Ke)!==0&&n(o.node.id,vt,o.distance),(o.node.flags&Ye)!==0&&l(o.node,o.distance,!1)},m=a=>{if(!o||![...a.changedTouches].some(O=>O.identifier===o.touch))return;const{node:p,pulling:h,distance:y}=o;if(o=null,!h||((p.flags&Ke)!==0&&n(p.id,vt,0),(p.flags&Ye)===0))return;if(y<zo||a.type==="touchcancel"){d(p);return}l(p,zt,!0),f(p).classList.add("lc-spinning");const R=n(p.id,er);Promise.resolve(R).then(()=>d(p),()=>d(p))};return t.addEventListener("touchstart",E,{passive:!0}),t.addEventListener("touchmove",g,{passive:!1}),t.addEventListener("touchend",m),t.addEventListener("touchcancel",m),{forget(a){var p;(o==null?void 0:o.node)===a&&(o=null),(p=i.get(a))==null||p.remove(),i.delete(a)},destroy(){t.removeEventListener("touchstart",E),t.removeEventListener("touchmove",g),t.removeEventListener("touchend",m),t.removeEventListener("touchcancel",m);for(const a of i.values())a.remove();i.clear(),o=null}}},Wt=".lc-scrollable, .lc-vlist, .lc-pager-track, textarea.lc, input.lc",De=new WeakMap,pt=e=>{if(!e.isConnected)return;const t=[],n=r=>{(r.scrollLeft!==0||r.scrollTop!==0)&&t.push({el:r,left:r.scrollLeft,top:r.scrollTop})};e.matches(Wt)&&n(e);for(const r of e.querySelectorAll(Wt))n(r);t.length>0?De.set(e,t):De.delete(e)},Sn=e=>{const t=De.get(e);if(t){De.delete(e);for(const{el:n,left:r,top:s}of t)!n.isConnected||!e.contains(n)||(n.scrollLeft=r,n.scrollTop=s)}},ct=e=>{pt(e),e.remove()},_n=(e,t,n=null)=>{t.parentElement===e&&(n===null||t.nextElementSibling===n)||(t.isConnected&&pt(t),e.insertBefore(t,n),Sn(t))},Ee=0,fe=-1,Tn={run:(e,t,n,r)=>r(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},Go={[xr]:"a 3D scene",[Rr]:"a 2D scene",[Cr]:"a native view",[Me]:"a video"},jo=e=>{const t=e.transitions??Tn;let n=null,r=[],s=[];const i=new Map,o=(v,S)=>`${v}:${S}`,f=new Set,l=v=>r.includes(v),d=v=>r.some(S=>S.node===v),b=v=>v&&v.kind===Y?v.node:null,E=(v,S)=>{e.emit(v.kind===Y||v.kind===Me?v.id:0,S,v.kind,v.id)},g=(v,S,x,D)=>{let M=null;return(v===Y||v===Me)&&(M=e.node(S)??null,!M||v===Y&&M.type!=="screen")?(e.warn(`navigation: ${S} is not a live ${v===Y?"screen":"video"} node`),null):{kind:v,id:S,node:M,viewName:x,paramsJson:D||"{}",back:Ee,retired:!1}},m=(v,S)=>{var D;const x=b(v);if(!x){if((D=e.surface)!=null&&D.call(e,v,!0)){v.node&&e.rootOwned(v.node,!0);return}f.has(v.kind)||(f.add(v.kind),e.warn(`${Go[v.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(x,!0),x.el.classList.remove("lc-covered"),x.el.classList.toggle("lc-above",S),_n(e.root,x.el)},a=v=>{var x;const S=b(v);!S&&v!==n&&((x=e.surface)==null||x.call(e,v,!1)),!(!S||v===n)&&(n&&n.node===S||(S.el.classList.remove("lc-above"),d(S)?S.el.classList.add("lc-covered"):ct(S.el)))},p=v=>{const S=b(v);!S&&v.node&&!(n&&n.node===v.node)&&!d(v.node)&&(e.rootOwned(v.node,!1),v.node.parent===null&&e.emit(v.node.id,St)),S&&(n&&n.node===S||d(S)||(S.el.classList.remove("lc-above"),ct(S.el),e.rootOwned(S,!1),e.emit(S.id,St)))},h=()=>{const v=s;s=[];for(const S of v)S.node&&t.holds(S.node)?s.push(S):p(S)},y=v=>{!v||v.retired||(v.retired=!0,s.push(v),e.post(h))},R=(v,S,x)=>{const D=x===fe?Ee:x,M=b(v),B=b(S);M&&B&&B.el.classList.toggle("lc-above",!M.el.classList.contains("lc-above")),t.run(M,B,D,()=>{M==null||M.el.classList.remove("lc-above"),B==null||B.el.classList.remove("lc-above"),S&&a(S),s.length>0&&e.post(h)})},O=v=>{var S;v.kind===Y&&v.node&&((S=e.active)==null||S.call(e,v.node,!1)),E(v,ar)},A=(v,S)=>{var M,B;const x=n;if(!v||x===v)return;t.settle(),x&&O(x),n=v;const D=!!b(v)&&!!b(x);m(v,!!b(v)&&(!D||t.enterOnTop(S))),E(v,ir),v.kind===Y&&v.node&&((M=e.active)==null||M.call(e,v.node,!0)),x&&!l(x)&&y(x),R(v,x,S),(B=e.changed)==null||B.call(e)},k=v=>{var x;t.settle();const S=n;S&&(O(S),n=null,l(S)||y(S),R(null,S,v),(x=e.changed)==null||x.call(e))},U=(v,S)=>{A(v,S),e.emit(0,lr,v.kind,v.id)},N=v=>{const S=r.length;return v===-1?S-2:v<-1?Math.max(S-1+v,0):v===0?0:Math.min(v,S-1)};return{current:()=>n,stack:()=>r,setUrl(v,S,x){var M;x===null||x===""?i.delete(o(v,S)):i.set(o(v,S),x.startsWith("/")?x:`/${x}`),(n&&n.kind===v&&n.id===S||r.some(B=>B.kind===v&&B.id===S))&&((M=e.changed)==null||M.call(e))},address(){if(n){const S=i.get(o(n.kind,n.id));if(S!==void 0)return S}const v=n?r.lastIndexOf(n):r.length-1;for(let S=v<0?r.length-1:v;S>=0;S--){const x=i.get(o(r[S].kind,r[S].id));if(x!==void 0)return x}return null},forgetUrl(v,S){i.delete(o(v,S))},open(v,S,x,D,M){A(g(v,S,x,D),M)},close(v,S,x){!n||n.kind!==v||n.id!==S||k(x)},routerOpen(v,S,x,D){const M=g(v,S,x,D);if(!M)return;const B=r;r=[M];for(const z of B)z!==n&&y(z);A(M,Ee)},routerPush(v,S,x,D,M,B){const z=g(v,S,x,D);z&&(z.back=B===fe?Ee:B,r.push(z),U(z,M))},routerReplace(v,S,x,D,M,B){const z=g(v,S,x,D);if(!z)return;const H=r[r.length-1];if(!H){z.back=B===fe?Ee:B,r.push(z),U(z,M);return}z.back=B===fe?H.back:B,r[r.length-1]=z,U(z,M),y(H)},routerPop(v,S){if(r.length<=1)return!1;const x=N(v);if(x<0||x>=r.length)return!1;const D=S===fe?r[r.length-1].back:S,M=r.splice(x+1);U(r[r.length-1],D);for(const B of M)y(B);return M.length>0},routerHide(v){k(v)},routerRestore(v){const S=r[r.length-1];S&&A(S,v)},reset(){var v;t.settle();for(const S of[n,...r,...s])(v=S==null?void 0:S.node)==null||v.el.remove();n=null,r=[],s=[],i.clear()}}},Ho=250,Ko="cubic-bezier(0.2, 0.8, 0.2, 1)",Yo=6,qo=e=>{const{root:t}=e,n=t.ownerDocument,r=n.defaultView??window,s=new Map,i=g=>{var a;const m=e.value(g.node,"overlayColor");if(m==null){(a=g.scrim)==null||a.remove(),g.scrim=null,g.frame.classList.remove("lc-scrimmed");return}g.scrim||(g.scrim=n.createElement("div"),g.scrim.className="lc-scrim",g.scrim.addEventListener("click",()=>{(g.node.flags&Sr)!==0&&e.emit(g.node.id,sr)}),g.frame.insertBefore(g.scrim,g.frame.firstChild),g.frame.classList.add("lc-scrimmed")),g.scrim.style.backgroundColor=ke(m)},o=g=>{const m=e.value(g,"sheetDetents");if(m==null||m==="")return null;const a=String(m).split(",").map(Number).filter(p=>Number.isFinite(p)&&p>0).sort((p,h)=>p-h);return a.length>0?a:null},f=(g,m)=>{const a=g.sheet,p=g.node.el.offsetHeight;if(m<0)return p;const h=a.detents[a.detents.length-1],y=a.detents[Math.max(0,Math.min(m,a.detents.length-1))];return p*(1-y/h)},l=(g,m,a)=>{const p=g.sheet.holder;p.style.transition=a?`transform ${Ho}ms ${Ko}`:"none",p.style.transform=`translateY(${Math.max(0,m)}px)`},d=(g,m)=>{const a=o(g.node);if(!a||!g.sheet)return;const p=g.sheet;p.detents=a;const h=e.value(g.node,"sheetDismissible");p.dismissible=h==null||Number(h)>.5||h===!0;const y=Number(e.value(g.node,"sheetDetent")??0);if(m){l(g,f(g,-1),!1),p.holder.offsetHeight,p.detent=y,l(g,f(g,y),!0);return}y!==p.detent&&(p.detent=y,l(g,f(g,y),!0))},b=g=>{const m=g.node.el;m.addEventListener("pointerdown",a=>{const p=g.sheet;if(!p||a.pointerType==="mouse"&&a.button!==0)return;for(let k=a.target instanceof Element?a.target:null;k&&k!==m;k=k.parentElement)if(k.scrollTop>0)return;const h=f(g,p.detent);let y=!1,R=h;const O=k=>{if(k.pointerId!==a.pointerId)return;const U=k.clientY-a.clientY;if(!y){if(Math.abs(U)<Yo||Math.abs(U)<Math.abs(k.clientX-a.clientX))return;y=!0}R=Math.max(0,h+U),l(g,R,!1)},A=k=>{if(k.pointerId!==a.pointerId||(n.removeEventListener("pointermove",O),n.removeEventListener("pointerup",A),n.removeEventListener("pointercancel",A),!y||!g.sheet))return;let U=0,N=1/0;for(let D=0;D<p.detents.length;D++){const M=Math.abs(f(g,D)-R);M<N&&(N=M,U=D)}const v=f(g,0),S=m.offsetHeight;if(p.dismissible&&R>v+(S-v)/2){l(g,S,!0),(g.node.flags&Lt)!==0&&e.emit(g.node.id,wt,-1);return}p.detent=U,l(g,f(g,U),!0),(g.node.flags&Lt)!==0&&e.emit(g.node.id,wt,U)};n.addEventListener("pointermove",O),n.addEventListener("pointerup",A),n.addEventListener("pointercancel",A)})};let E=null;return{show(g,m,a){if(s.has(g))return;e.flush();const p=n.createElement("div");p.className="lc-widget-frame";const h={node:g,frame:p,scrim:null,sheet:null};if(o(g)){const R=n.createElement("div");R.className="lc-sheet",R.appendChild(g.el),p.appendChild(R),h.sheet={holder:R,detents:[1],detent:-1,dismissible:!0},b(h)}else p.appendChild(g.el);s.set(g,h),e.rootOwned(g,!0),i(h);const y=m===Y?e.node(a):void 0;(m!==Ue&&y?y.el:t).appendChild(p),Sn(g.el),h.sheet&&d(h,!0)},hide(g){const m=s.get(g);m&&(s.delete(g),pt(g.el),g.el.remove(),m.frame.remove(),e.rootOwned(g,!1))},scrim:g=>{var m;return((m=s.get(g))==null?void 0:m.scrim)??null},restyle(g){const m=s.get(g);m&&(i(m),m.sheet&&d(m,!1))},forget(g){const m=s.get(g);m&&(s.delete(g),m.frame.remove())},shown:()=>[...s.keys()],backTargets:()=>[...s.keys()].reverse().filter(g=>(g.flags&_r)!==0),isFrame:g=>g.classList.contains("lc-widget-frame"),toast(g,m){(!E||!E.isConnected)&&(E=n.createElement("div"),E.className="lc-toasts",t.appendChild(E));const a=n.createElement("div");a.className="lc-toast",a.setAttribute("role","status"),a.textContent=g,E.appendChild(a),a.offsetHeight,a.classList.add("lc-on"),r.setTimeout(()=>{a.classList.remove("lc-on"),r.setTimeout(()=>a.remove(),200)},Math.max(500,m))},destroy(){for(const g of s.values())g.frame.remove();s.clear(),E==null||E.remove(),E=null}}},Gt={pager:["pagerSetContent","pagerSelect","pagerPush","pagerPop","pagerPopToRoot","pagerReplace"],vlist:["vlistInit","vlistSetKeys","vlistInsertKeys","vlistRemoveKeys","vlistInvalidate","vlistMount","vlistScrollTo","vlistScrollToKey","vlistScrollToEnd"],plugins:["viewCall"],tween:["tweenCreate","tweenControl","tweenSeek","tweenSetRate","tweenGetTime","tweenGetElapsed","registerTweenEvent","defineTransition"]},Xo=e=>{const t=e.root,n=t.ownerDocument,r=(c,u,w)=>{for(const _ of Object.keys(u)){const V=u[_],W=V==null?null:typeof V=="number"?ee(V):Te(V);for(const ie of w?[`--${_}`,`--lc-app-${_}`]:[`--${_}`])W===null?c.style.removeProperty(ie):c.style.setProperty(ie,W)}},s=new Set,i=n.defaultView??window,o=new Set,f=c=>console.warn(`[web-lite] ${c}`),l=[],d=c=>{var u;for(const w of l){const _=(u=w.ownerOf)==null?void 0:u.call(w,c);if(_)return _}return null},b=c=>{var u;for(const w of l){const _=(u=w.roots)==null?void 0:u.call(w,c);if(_)return _}return null},E=(c,u)=>{var w;for(const _ of l)(w=_.rootActive)==null||w.call(_,c,u)},g=c=>{var u;for(const w of l)(u=w.subtreeMoved)==null||u.call(w,c)},m=()=>{for(const c of l)if(c.stage)return c.stage();return Tn};let a=null;const p=()=>a??(a=e.transitions??m()),h={run:(c,u,w,_)=>p().run(c,u,w,_),settle:()=>p().settle(),enterOnTop:c=>p().enterOnTop(c),holds:c=>p().holds(c)};let y=[],R=!1;const O=c=>{y.push(c),!R&&(R=!0,queueMicrotask(()=>{R=!1;const u=y;y=[];for(const w of u)w()}))};let A=null;const k=(c,u,...w)=>{if(A)try{return A(c,u,...w)}catch(_){i.setTimeout(()=>{throw _},0);return}},U=(c,u,...w)=>O(()=>{k(c,u,...w)});t.classList.add("lc-root");const N=e.sink??vo(n),v=ko(N),S=Ro(N,v,{bufferUrl:e.bufferUrl},f),x=new Map;let D=1;const M=new ResizeObserver(c=>{for(const u of c){const w=u.target,_=x.get(Number(w.getAttribute("data-node")));!_||_.el!==w||!(_.flags&le)||k(_.id,Hn,w.offsetLeft,w.offsetTop,w.offsetWidth,w.offsetHeight)}}),B=Bo({doc:n,bufferUrl:e.bufferUrl,drawable:c=>{var u;for(const w of l){const _=(u=w.drawable)==null?void 0:u.call(w,c);if(_)return _}return null},hasTint:c=>S.names(c,"tintColor"),swapped:(c,u)=>{M.unobserve(u),c.flags&le&&M.observe(c.el)},warn:f});S.onChange=c=>{const u=c;Ar(u,w=>S.value(u,w)),u.type==="image"&&B.restyle(u),u.type==="widget"&&P.restyle(u)};const z=Io({root:t,emit:k,value:(c,u)=>S.value(c,u),boundary:c=>P.isFrame(c)||l.some(u=>{var w;return((w=u.boundary)==null?void 0:w.call(u,c))===!0}),hit:(c,u,w)=>{var _;for(const V of l){const W=(_=V.hit)==null?void 0:_.call(V,c,u,w);if(W!=null)return W}return null}}),H=Wo({root:t,emit:k}),X=new ResizeObserver(()=>{k(0,cr,t.clientWidth,t.clientHeight)});X.observe(t),S.onWrite=(c,u)=>{var w;for(const _ of l)(w=_.styled)==null||w.call(_,c,u)};const L=c=>c.parent===null&&!c.rooted,T=(c,u,w=!0)=>{var _;for(const V of l)(_=V.forget)==null||_.call(V,c);for(const V of Fe(c))T(V,u,!1);w||u.push(c.id),z.forget(c),H.forget(c),B.forget(c),I.forgetUrl(Y,c.id),P.forget(c),S.drop(c),M.unobserve(c.el),C.unregister(c.token),x.delete(c.id),c.parent=null,c.held=!1,w&&c.el.remove()},F=c=>{if(!x.has(c.id)||c.held||!L(c))return;const u=[];T(c,u),u.length>0&&k(0,_t,u)},C=new FinalizationRegistry(c=>{const u=x.get(c);u&&(u.held=!1,L(u)&&O(()=>F(u)))}),$=c=>{c.held||O(()=>F(c))},I=jo({root:t,emit:U,post:O,warn:f,node:c=>x.get(c),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},changed:e.onNavigation,active:E,surface:(c,u)=>l.some(w=>{var _;return((_=w.destination)==null?void 0:_.call(w,c,u))===!0}),transitions:h}),P=qo({root:t,emit:k,node:c=>x.get(c),value:(c,u)=>S.value(c,u),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},flush:()=>S.flush()}),oe=()=>{var u;for(const w of P.backTargets())if(k(w.id,xe,Ue,0)===!0)return"widget";const c=I.current();if(c){const w=c.kind===Y||c.kind===Me?c.id:0;if(k(w,xe,c.kind,c.id)===!0)return"destination"}for(const w of l)if(((u=w.back)==null?void 0:u.call(w))===!0)return"feature";return I.routerPop(-1,fe)?"router":k(0,xe,Ue,0)===!0?"app":"none"},te=c=>{if(!(c.key!=="Escape"||c.defaultPrevented)){for(const u of P.backTargets())if(k(u.id,xe,Ue,0)===!0){c.preventDefault();return}}};n.addEventListener("keydown",te);const se=Mo({root:t,roots:()=>{const c=I.current();return[...c!=null&&c.node&&c.kind===Y?[{kind:"screen",node:c.node}]:[],...P.shown().map(w=>({kind:"widget",node:w}))]},held:c=>b(c),extend:(c,u,w)=>{var _;for(const V of l)(_=V.dump)==null||_.call(V,c,u,w)},value:(c,u)=>S.value(c,u),owns:(c,u)=>S.owns(c,u),flush:()=>S.flush()}),be=c=>{if(!c.isConnected)return null;S.flush();const u=sn(t)||1,w=t.getBoundingClientRect(),_=c.getBoundingClientRect();return _.width===0&&_.height===0&&c.offsetParent===null?null:[(_.left-w.left)/u,(_.top-w.top)/u,_.width/u,_.height/u]},We=()=>{const c={};for(const u of Object.keys(Gt))for(const w of Gt[u])c[w]=()=>(o.has(w)||(o.add(w),f(`${w}: this tree was made without the "${u}" feature`)),w==="tweenCreate"?null:0);return c},Ge={create(c){const u=$o(n,D++,c);wn(u),x.set(u.id,u);const w={id:u.id};return C.register(w,u.id,u.token),w},destroy(c){const u=x.get(c);if(!u)return;if(!L(u)){console.error(`[web-lite] destroy: node ${c} is attached — remove / hide / close it first`);return}u.held=!1;const w=[];T(u,w),w.length>0&&k(0,_t,w)},insert(c,u,w){var gt;const _=x.get(c),V=x.get(u);if(!_||!V||V===_)return;if(b(_)){f(`insert() on a ${_.type} — what it holds goes through its own calls`);return}if(!L(V)){f(`insert: node ${u} is not a root — remove it from where it is first`);return}const W=Fe(_),ie=Math.max(0,Math.min(w,W.length));V.parent=_,_n(_.el,V.el,((gt=W[ie])==null?void 0:gt.el)??null),g(V)},remove(c,u){const w=x.get(c),_=x.get(u);!w||!_||_.parent!==w||(_.parent=null,ct(_.el),g(_),$(_))},parent(c){var w,_;const u=x.get(c);return u?((w=u.parent)==null?void 0:w.id)??((_=d(u))==null?void 0:_.id)??0:0},children(c){const u=x.get(c);return u?(b(u)??Fe(u)).map(w=>w.id):[]},setString(c,u,w){var V;const _=x.get(c);if(_){w===null?_.strings.delete(u):_.strings.set(u,w);for(const W of l)(V=W.content)==null||V.call(W,_,u,w);switch(u){case"text":_.type==="text"&&(_.el.textContent=w??"");return;case"name":w===null?_.el.removeAttribute("data-name"):_.el.setAttribute("data-name",w);return;case"src":_.type==="image"&&B.setSrc(_,w);return;case"srcTintColor":_.type==="image"&&B.setSrcTint(_,w);return;case"sourceRect":_.type==="image"&&B.setSourceRect(_,w);return;case"value":if(_.type==="input"||_.type==="textarea"){const W=_.el;W.value!==(w??"")&&(W.value=w??"")}return;case"focus":w==="1"?_.el.focus({preventScroll:!0}):_.el.blur();return}}},setInt(c,u,w){var V;const _=x.get(c);if(_){_.strings.set(u,String(w));for(const W of l)(V=W.content)==null||V.call(W,_,u,w)}},setFlags(c,u){const w=x.get(c);if(!w)return;const _=w.flags;w.flags=u,w.el.classList.toggle(at,(u&Oe)!==0),u&le&&!(_&le)?M.observe(w.el):!(u&le)&&_&le&&M.unobserve(w.el)},getTextValue(c){const u=x.get(c);return u&&(u.type==="input"||u.type==="textarea")?u.el.value:""},setStyle(c,u,w){const _=x.get(c);_&&S.set(_,u,w)},mergeStyle(c,u){const w=x.get(c);w&&S.merge(w,u)},setClass(c,u,w){const _=x.get(c);_&&S.setClass(_,u,w)},setTheme(c){r(t,c,!0)},setNodeTheme(c,u){const w=x.get(c);if(w){r(w.el,u,!1);for(const _ of Object.keys(u))s.has(_)||!/^[A-Za-z0-9_-]+$/.test(_)||(s.add(_),N.insert("lc-base",`.lc-widget-frame { --${_}: var(--lc-app-${_}); }`));"text"in u&&w.el.toggleAttribute("data-theme-text",u.text!=null),"fontFamily"in u&&w.el.toggleAttribute("data-theme-font",u.fontFamily!=null)}},open:I.open,close:I.close,routerOpen:(c,u,w,_)=>I.routerOpen(c,u,w,_),routerPush:I.routerPush,routerReplace:I.routerReplace,routerPop:(c,u)=>{I.routerPop(c,u)},routerHide:I.routerHide,routerRestore:I.routerRestore,setDestUrl:I.setUrl,isViewSupported:()=>!1,viewVersion:()=>0,showWidget(c,u,w){const _=x.get(c);!_||P.shown().includes(_)||(P.show(_,u,w),E(_,!0))},hideWidget(c){const u=x.get(c);!u||!P.shown().includes(u)||(E(u,!1),P.hide(u))},registerFont(c,u,w,_,V,W){try{const ie=new i.FontFace(c,`url("${u}")`,{weight:String(w),style:_===2?"italic":"normal"});n.fonts.add(ie),ie.load().then(()=>V(),()=>W())}catch{W()}},fontFormat:"woff2",toast:(c,u)=>P.toast(c,u),isButtonPressed(c){const u=x.get(c);return!!u&&z.isPressed(u)},isHovered(c){const u=x.get(c);return!!u&&z.isHovered(u)},getBoundingClientRect(c){const u=x.get(c);return u?be(u.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>se.dump(),debugPaint:c=>se.paint(x.get(c)),setEmitter(c){A=c}},ae={...We(),...Ge},K={root:t,emit:k,emitLater:U,post:O,warn:f,node:c=>x.get(c),rootOwned:(c,u)=>{c.rooted=u,u||$(c)},flush:()=>S.flush(),value:(c,u)=>S.value(c,u),setStyle:(c,u,w)=>S.set(c,u,w),setString:(c,u,w)=>ae.setString(c,u,w),style:{bufferUrl:e.bufferUrl},shown:c=>{var u;return((u=I.current())==null?void 0:u.node)===c||P.shown().includes(c)},scrim:c=>P.scrim(c),stage:m,sourceChanged:c=>B.sourceChanged(c),plugins:e.plugins??null},ce={};for(const c of e.features??[]){const u=c.install(K);l.push(u),Object.assign(ae,u.bridge),Object.assign(ce,u.globals)}return{bridge:ae,globals:ce,presentation:I,back:oe,setSafeArea(c,u=[]){for(const w of["top","right","bottom","left"])t.style.setProperty(`--safe-${w}`,`${c[w]}px`),u.includes(w)?t.style.setProperty(`--safe-${w}-bar`,`${c[w]}px`):t.style.removeProperty(`--safe-${w}-bar`)},flush:()=>S.flush(),stats:()=>Object.assign({nodes:x.size,classes:v.count(),tweens:0},...l.map(c=>{var u;return((u=c.stats)==null?void 0:u.call(c))??{}})),destroy(){var c;A=null,I.reset();for(const u of l)(c=u.destroy)==null||c.call(u);P.destroy(),n.removeEventListener("keydown",te),z.destroy(),H.destroy(),X.disconnect(),M.disconnect();for(const u of x.values())C.unregister(u.token),u.el.remove();x.clear(),e.sink||N.destroy(),t.classList.remove("lc-root");for(const u of Array.from(t.style))u.startsWith("--")&&t.style.removeProperty(u)}}},G=[null],mt=new TextDecoder("utf-8"),li=async(e,t,n,r)=>{var m;let s;if(t.body)if(typeof t.body=="object"&&Array.isArray(t.body._entries)){const a=new FormData;for(let[p,h,y]of t.body._entries)typeof h=="object"?a.append(p,new Blob([he(h._id)]),y):a.append(p,h);s=a}else typeof t.body=="string"?s=t.body:r(new Error("Invalid body"));const i=await fetch(e,{method:t.method,body:s,headers:t.headers,mode:"cors",credentials:"omit"}),o=typeof t.onProgress=="function"?t.onProgress:null;if(!o){const a=await i.arrayBuffer();G.push(a),n(G.length-1,i.status);return}const f=(m=i.body)==null?void 0:m.getReader();if(!f){const a=await i.arrayBuffer();G.push(a),n(G.length-1,i.status);return}const l=Number(i.headers.get("content-length"))||void 0;let d=0;const b=[];for(;;){const{done:a,value:p}=await f.read();if(a)break;p&&(b.push(p),d+=p.length,o({loaded:d,total:l}))}const E=new Uint8Array(d);let g=0;for(const a of b)E.set(a,g),g+=a.length;G.push(E.buffer),n(G.length-1,i.status)},Jo=e=>JSON.parse(mt.decode(he(e))),kn=e=>mt.decode(he(e)),Qo=e=>new Uint8Array(he(e)).slice(),Zo=(e,t,n)=>mt.decode(he(e).slice(t,n)),es=e=>{const t=new Blob([G[e]]);return URL.createObjectURL(t)},Ln=e=>new Blob([G[e]]),he=e=>G[e],jt=e=>{G[e]=null},Be=e=>(G.push(e),G.length-1),ht=new Map,ui=(e,t)=>{ht.set(e,t);const n=Ve.get(e);n!==void 0&&(G[n]=t)},fi=e=>ht.has(e),Ve=new Map,di=e=>{for(const[t,n]of Ve)if(n===e)return t},ts=e=>{const t=Ve.get(e);if(t!==void 0)return t;const n=ht.get(e);if(!n)return-1;G.push(n);const r=G.length-1;return Ve.set(e,r),r},ns=()=>{const e=new Map,t=new Map,n=new Set,r={registerView(s,i,o=1){e.set(s,{factory:i,version:o})},registerService(s,i,o=1){t.set(s,{factory:i,version:o})},putBuffer:Be};return{views:e,services:t,has:s=>n.has(s),register(s,i){if(!n.has(s)){n.add(s);try{i(r)}catch(o){console.warn(`[web-lite] the "${s}" plugin did not register: ${o instanceof Error?o.message:o}`)}}}}},Ht={pager:["pagerSetContent"],vlist:["vlistInit"],tween:["tweenCreate","defineTransition"],canvas:["_creatorCanvas."],video:["createVideo"],plugins:["viewCall","isViewSupported","_creatorService."]},rs={pager:()=>re(()=>import("./assets/pager-Db5BY7FB.js"),[],import.meta.url).then(e=>e.pager),vlist:()=>re(()=>import("./assets/vlist-CwSYpLz-.js"),[],import.meta.url).then(e=>e.vlist),tween:()=>re(()=>import("./assets/tween-BnWYhJ7P.js"),[],import.meta.url).then(e=>e.tween),canvas:()=>re(()=>import("./assets/canvas-WxiusXCB.js"),[],import.meta.url).then(e=>e.canvas),video:()=>re(()=>import("./assets/video-BLj61nDx.js"),[],import.meta.url).then(e=>e.video),plugins:()=>re(()=>import("./assets/plugins-CuEPHbHL.js"),[],import.meta.url).then(e=>e.plugins)},xn=Object.keys(Ht).map(e=>({name:e,uses:Ht[e],load:rs[e]})),os=e=>xn.filter(t=>t.uses.some(n=>e.includes(n))).map(t=>t.name),ss=async e=>{const t=os(e);return(await Promise.all(xn.filter(r=>t.includes(r.name)).map(r=>r.load().catch(s=>(console.warn(`[web-lite] the "${r.name}" feature did not load: ${s instanceof Error?s.message:s}`),null))))).filter(r=>r!==null)},is=e=>{let t=null,n=null;const r=(l,d)=>{t==null||t(l,d)},s=()=>r(document.hidden?"pause":"resume"),i=()=>r("online"),o=()=>r("offline");return document.addEventListener("visibilitychange",s),window.addEventListener("online",i),window.addEventListener("offline",o),{bridge:{run(l,d,b,E){let g;try{g=kn(l)}catch{d("run: no such buffer");return}e.rerun(g,E,d)},restart(l){e.rerun(void 0,l)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(l){t=l},setFreedEmitter(l){n=l},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(l){window.open(l,"_blank","noopener")},setOrientation(l){var E,g,m,a;const d=l==="landscape"||l==="portrait"?l:"auto";if(e.onOrientation){e.onOrientation(d);return}const b=typeof screen<"u"?screen.orientation:void 0;if(b)try{d==="auto"?(E=b.unlock)==null||E.call(b):(a=(m=(g=b.lock)==null?void 0:g.call(b,d))==null?void 0:m.catch)==null||a.call(m,()=>{})}catch{}}},emit:r,freed:(l,d)=>{n==null||n(l,d)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",s),window.removeEventListener("online",i),window.removeEventListener("offline",o)}}},as=(e,t,n,r)=>{try{const s=document.createElement("input");s.type="file",s.multiple=n,r&&(s.accept=r),s.onchange=async()=>{const{files:i}=s;if(n){const o=[];if(!i)return e([]);for(let f of i)o.push([Be(await f.arrayBuffer()),f.name,f.size]);e(o)}else{if(!i||i.length===0)return e(null);e([[Be(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!s.files||s.files.length===0)&&e(n?[]:null)},300)},{once:!0}),s.click()}catch(s){t(s)}},cs=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 r=navigator.clipboard;if(!(r!=null&&r.readText)){n("Clipboard is not available");return}r.readText().then(t,s=>n(s instanceof Error?s.message:"Clipboard read failed"))},share(t,n){var f;const r=Ln(t),s=new File([r],"image.png",{type:"image/png"});if((f=navigator.canShare)!=null&&f.call(navigator,{files:[s]})){navigator.share({files:[s],text:n}).catch(()=>{});return}const i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=s.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i)},openFilePicker:(t,n,r,s)=>as(t,n,r,s??void 0),requestCamera(t){t()}}),ls=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},us=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[r,s,i]of t){const o=ls(s);o!==null?n.append(r,Ln(o),i):n.append(r,String(s))}return n},fs=()=>{const e=new Set,t=new FinalizationRegistry(i=>{e.delete(i)&&jt(i)}),n=i=>{const o={id:i};return e.add(i),t.register(o,i),o};let r=!1;return{bridge:{fetch(i,o,f,l,d){const b=typeof(o==null?void 0:o.onProgress)=="function"?o.onProgress:d;if(i.startsWith("id:")){const E=Number(i.slice(3));f({id:E},he(E)?200:404);return}(async()=>{var E;try{const g=await fetch(i,{method:o==null?void 0:o.method,headers:o==null?void 0:o.headers,body:us(o==null?void 0:o.body),mode:"cors",credentials:"omit"}),m=b?(E=g.body)==null?void 0:E.getReader():void 0;let a;if(!m)a=await g.arrayBuffer();else{const p=Number(g.headers.get("content-length"))||void 0,h=[];let y=0;for(;;){const{done:A,value:k}=await m.read();if(A)break;k&&(h.push(k),y+=k.length,r||b({loaded:y,total:p}))}const R=new Uint8Array(y);let O=0;for(const A of h)R.set(A,O),O+=A.length;a=R.buffer}if(r)return;f(n(Be(a)),g.status)}catch(g){r||l(g instanceof Error?g:String(g))}})()},local:i=>ts(i),toJson:i=>Jo(i),slice:(i,o,f)=>Zo(i,o,f),toText:i=>kn(i),toBytes:i=>Qo(i)},live:()=>e.size,dispose(){r=!0;for(const i of e)jt(i);e.clear()}}},Kt=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],et=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],$e=4,tt=16,Yt=16,ds=.5,ps=e=>{const t=new Set;let n=null;const r=(C,$,I=-1,P=0)=>{n==null||n(C,$,I,P)},s=C=>{if(!C.code)return;const $=t.has(C.code);t.add(C.code),r(0,C.code,-1,$||C.repeat?1:0)},i=C=>{C.code&&t.delete(C.code)&&r(1,C.code)},o=()=>{for(const C of[...t])C.startsWith("Gamepad")||(t.delete(C),r(1,C))},{root:f}=e;let l=0,d=0,b=0,E=0,g=0,m=0,a=0,p=0,h=0,y=0;const R=C=>{if(C.pointerType&&C.pointerType!=="mouse")return;const $=f.getBoundingClientRect();l=C.clientX-$.left,d=C.clientY-$.top,b+=C.movementX||0,E+=C.movementY||0},O=C=>{const $=Kt[C.button];$&&(t.add($),r(0,$))},A=C=>{const $=Kt[C.button];$&&t.delete($)&&r(1,$)},k=C=>{const $=C.deltaMode===0?.01:1;g+=C.deltaX*$,m+=C.deltaY*$},U=C=>{document.pointerLockElement===f&&C.preventDefault()},N=[],v=[],S=[],x=()=>{var $,I;const C=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let P=0;P<$e;P++){const oe=C[P]??null,te=!!oe&&oe.connected;if(te!==!!N[P]){if(N[P]=te,!te){for(const K of et)t.delete(K+"@"+P)&&(r(1,K,P),D(K));S[P]=[],v[P]=[0,0,0,0,0,0]}r(te?2:3,"",P)}if(!oe||!te)continue;const se=oe.axes,be=oe.buttons,We=(($=be[6])==null?void 0:$.value)??0,Ge=((I=be[7])==null?void 0:I.value)??0;v[P]=[se[0]??0,se[1]??0,se[2]??0,se[3]??0,We,Ge];const ae=S[P]??(S[P]=[]);for(let K=0;K<et.length;K++){const ce=be[K],c=!!ce&&(ce.pressed||ce.value>ds);if(c===!!ae[K])continue;ae[K]=c;const u=et[K];c?t.add(u+"@"+P):t.delete(u+"@"+P),D(u),r(c?0:1,u,P)}}},D=C=>{let $=!1;for(let I=0;I<$e&&!$;I++)t.has(C+"@"+I)&&($=!0);$?t.add(C):t.delete(C)};let M=0;const B=()=>{a=b,p=E,h=g,y=m,b=E=g=m=0,x(),M=requestAnimationFrame(B)},z=e.windows.filter((C,$,I)=>C&&I.indexOf(C)===$);for(const C of z)e.keyboard!==!1&&(C.addEventListener("keydown",s),C.addEventListener("keyup",i)),C.addEventListener("blur",o);return f.addEventListener("pointermove",R,!0),f.addEventListener("mousedown",O,!0),window.addEventListener("mouseup",A,!0),f.addEventListener("wheel",k,{passive:!0,capture:!0}),f.addEventListener("contextmenu",U,!0),typeof requestAnimationFrame=="function"&&(M=requestAnimationFrame(B)),{inputKey:(C,$)=>$>=0&&C.startsWith("Gamepad")?t.has(C+"@"+$):t.has(C),inputRead:C=>{var $;switch(C){case 0:return l;case 1:return d;case 2:return a;case 3:return p;case 4:return h;case 5:return y;case 6:return document.pointerLockElement===f?1:0;case 7:{let I=0;for(let P=0;P<$e;P++)N[P]&&I++;return I}}if(C>=tt){const I=Math.floor((C-tt)/Yt),P=(C-tt)%Yt;return I>=$e||!N[I]?0:P===0?1:(($=v[I])==null?void 0:$[P-1])??0}return 0},inputSetPointerLock:C=>{if(!C)return document.pointerLockElement===f&&document.exitPointerLock(),!0;if(document.pointerLockElement===f)return!0;if(typeof f.requestPointerLock!="function")return!1;try{const $=f.requestPointerLock({unadjustedMovement:!0});return $&&typeof $.catch=="function"&&$.catch(()=>{try{f.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:C=>{n=C},dispose:()=>{for(const C of z)C.removeEventListener("keydown",s),C.removeEventListener("keyup",i),C.removeEventListener("blur",o);f.removeEventListener("pointermove",R,!0),f.removeEventListener("mousedown",O,!0),window.removeEventListener("mouseup",A,!0),f.removeEventListener("wheel",k,!0),f.removeEventListener("contextmenu",U,!0),M&&cancelAnimationFrame(M),document.pointerLockElement===f&&document.exitPointerLock(),t.clear(),n=null}}},ms=e=>{const t=e.ownerDocument.defaultView??window,n=ps({windows:[t],root:e}),r=t.visualViewport,s=()=>r?Math.max(0,Math.round(t.innerHeight-r.height-r.offsetTop)):0;let i=null,o=0;const f=()=>{const d=s();d!==o&&(o=d,i==null||i(d,0))};return r==null||r.addEventListener("resize",f),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(d){n.registerInputEvent(d)},keyboardHeight:s,registerKeyboardEvent(d){i=d}},dispose(){i=null,r==null||r.removeEventListener("resize",f),n.dispose()}}},j=[null],ge=[!1],Rn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),ge[t]&&(e.currentTime=0,e.play())})},hs=(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 r=j.length;return j.push(n),ge.push(!1),Rn(n,r,t),r},gs=(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 r=j.length;return j.push(n),ge.push(!1),Rn(n,r,t),r},bs=(e,t)=>{const n=j[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},ys=(e,t)=>{const n=j[e];n&&(t?n.play():n.pause())},Es=(e,t)=>{ge[e]=t},vs=e=>{var t;return((t=j[e])==null?void 0:t.currentTime)??0},ws=(e,t)=>{const n=j[e];n&&(n.currentTime=t)},Ss=e=>{var n;const t=((n=j[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},pi=e=>j[e],Cn=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},_s=e=>{const t=j[e];t&&(Cn(t),j[e]=null,ge[e]=!1)},mi=()=>{for(let e of j)e&&Cn(e);j.length=1,ge.length=1},Ts=()=>{const e=new Map;let t=null;const n=o=>{e.delete(o)&&_s(o)},r=new FinalizationRegistry(o=>{const f=e.get(o);f&&(f.held=!1,f.playing||n(o))}),s=(o,f)=>{let l=-1;if(l=o(f,()=>{const E=e.get(l);E&&(t==null||t(l),!E.loop&&(E.playing=!1,E.held||n(l)))}),l<0)return null;e.set(l,{held:!0,playing:!1,loop:!1});const b={id:l};return r.register(b,l),b};return{bridge:{createAudio:o=>s(gs,o),createVideo:o=>s(hs,o),setVolume:bs,setLoop(o,f){const l=e.get(o);l&&(l.loop=f),Es(o,f)},setPlaying(o,f){const l=e.get(o);l&&(l.playing=f,ys(o,f),!f&&!l.held&&n(o))},time:vs,setTime:ws,duration:Ss,setEmitter(o){t=o}},live:()=>e.size,dispose(){t=null;for(const o of[...e.keys()])n(o)}}},ks=()=>{const e=[];return{bridge:{open(n,r){const s=e.length;let i;try{i=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>r("error")),s}return i.addEventListener("open",()=>r("open")),i.addEventListener("message",o=>r("message",o.data)),i.addEventListener("close",o=>{e[s]=null,r("close",o.code)}),i.addEventListener("error",()=>r("error")),e.push(i),s},send(n,r){const s=e[n];s&&s.readyState===WebSocket.OPEN&&s.send(r)},close(n){var r;(r=e[n])==null||r.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},Ls=e=>{let t="default",n=null,r=!1;const s=()=>`lecodes:${e}:${t}`,i=()=>{if(n)return n;n={};try{const d=window.localStorage.getItem(s()),b=d?JSON.parse(d):null;if(b&&typeof b=="object")for(const[E,g]of Object.entries(b))typeof g=="string"&&(n[E]=g)}catch{}return n},o=()=>{if(r=!1,!!n)try{window.localStorage.setItem(s(),JSON.stringify(n))}catch{}},f=()=>{r||(r=!0,queueMicrotask(o))};return{bridge:{get:d=>i()[d]??null,set(d,b){i()[d]=String(b),f()},remove(d){delete i()[d],f()},select(d){r&&o(),t=d,n=null}},dispose(){r&&o()}}},qt={scene3d:{uses:["_creator.createScene","_creator.createEntity"],module:"/web-lite/src/engines/scene3d.ts"},ar:{uses:["_creator.createARController"],module:"/web-lite/src/engines/ar.ts"},anim:{uses:["_creator.animator","_creator.getGlbClipSet","_creator.loadClips","_creator.createClipFromTracks"],module:"/creator-anim/dist/creatorAnim.js"},physics:{uses:["_creator.physicsBuild","_creator.physicsCreate","_creator.physicsConfigure","_creator.physicsRaycast","_creator.characterCreate","_creator.vehicleCreate","_creator.ragdollCreate"],module:"/creator-physics/dist/creatorPhysics.js"},particles:{uses:["_creator.createParticleSystem","_creator.createNoise"],module:"/creator-particles/dist/creatorParticles.js"}},xs=e=>{const t=Object.keys(qt).filter(n=>qt[n].uses.some(r=>e.includes(r)));return new Set(t)},Xt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",An={};for(let e=0;e<Xt.length;e++)An[Xt[e]]=e;const Rs=e=>{const t=[];let n=0,r=0;for(const s of e){const i=An[s];if(i===void 0)break;const o=i&32;if(r+=(i&31)<<n,o)n+=5;else{const f=r&1;r>>=1,t.push(f?-r:r),r=0,n=0}}return t};class Cs{constructor(t){je(this,"sources");je(this,"lines");this.sources=t.sources,this.lines=[];let n=0,r=0,s=0;for(const i of t.mappings.split(";")){const o=[];let f=0;if(i)for(const l of i.split(",")){const d=Rs(l);d.length!==0&&(f+=d[0],d.length>=4&&(n+=d[1],r+=d[2],s+=d[3],o.push([f,n,r,s])))}this.lines.push(o)}}originalPositionFor(t,n){const r=this.lines[t-1];if(!r||r.length===0)return null;let s=null;for(const o of r)if(o[0]<=n)s=o;else break;s??(s=r[0]);const i=this.sources[s[1]];return i===void 0?null:{source:i,line:s[2]+1,column:s[3]}}}const As=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 Cs(JSON.parse(n))}catch{return null}};let ue=null;const $s=()=>{if(ue!==null)return ue;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return ue=n?parseInt(n[1],10)-1:2,ue}return ue=2,ue},Jt=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",r=$s(),s=[];for(const i of n.split(`
275
275
  `)){const o=i.match(/<anonymous>:(\d+):(\d+)/);if(!o)continue;const f=parseInt(o[1],10)-r,l=parseInt(o[2],10)-1;if(f<1)continue;const d=t.originalPositionFor(f,l<0?0:l);if(!d)continue;const b=i.match(/at\s+([^\s(]+)\s*\(/);s.push({fn:b?b[1]:null,source:d.source,line:d.line,column:d.column})}return s},Os=e=>{const t=[],n=(o,f,l)=>{var E;const d=f instanceof Error?f.message:String(f),b=l[0];console.error(b?`[lecodes] ${d}
276
276
  at ${b.source}:${b.line}:${b.column}${b.fn?` (${b.fn})`:""}`:`[lecodes] ${d}`),(E=o.onError)==null||E.call(o,{message:d,frames:l,stack:f instanceof Error?f.stack:void 0})},r=o=>{for(let f=t.length-1;f>=0;f--){const l=t[f];if(!l.sourceMap)continue;const d=Jt(o,l.sourceMap);if(d.length>0)return n(l,o,d),!0}return!1},s=o=>{r(o.error??o.message)},i=o=>{r(o.reason)};return e.addEventListener("error",s),e.addEventListener("unhandledrejection",i),{track(o,f){const l={sourceMap:As(o),onError:f};return t.push(l),{thrown(d){n(l,d,l.sourceMap?Jt(d,l.sourceMap):[])},drop(){const d=t.indexOf(l);d>=0&&t.splice(d,1)}}},dispose(){e.removeEventListener("error",s),e.removeEventListener("unhandledrejection",i),t.length=0}}},Us=""+new URL("assets/roboto-cyrillic-ext-1gPz9dK9.woff2",import.meta.url).href,Ns=""+new URL("assets/roboto-cyrillic-DVBNKCCH.woff2",import.meta.url).href,Fs=""+new URL("assets/roboto-greek-ext-D98D44EL.woff2",import.meta.url).href,Ms=""+new URL("assets/roboto-greek-DVLYEgdx.woff2",import.meta.url).href,Ps=""+new URL("assets/roboto-latin-ext-t610Sqxq.woff2",import.meta.url).href,Is=""+new URL("assets/roboto-latin-cAJwcdBQ.woff2",import.meta.url).href,Ds=""+new URL("assets/roboto-rest-C7JkyNHT.woff2",import.meta.url).href,Bs=""+new URL("assets/roboto-vietnamese-w-p-nKZZ.woff2",import.meta.url).href,Vs="Roboto",zs="100 900",Ws=[{name:"rest",file:"roboto-rest.woff2",range:"U+02D8-02D9, U+02DB, U+030F, U+2070, U+2074-208E, U+20C1, U+2105, U+2126, U+212E, U+215B-215E, U+2202, U+2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25A0, U+25CA-25CB, U+25CF, U+EE01-EE02, U+F6C3, U+FB01-FB04, U+FFFC",bytes:13324},{name:"cyrillic-ext",file:"roboto-cyrillic-ext.woff2",range:"U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",bytes:36720},{name:"cyrillic",file:"roboto-cyrillic.woff2",range:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",bytes:23696},{name:"greek-ext",file:"roboto-greek-ext.woff2",range:"U+1F00-1FFF",bytes:4380},{name:"greek",file:"roboto-greek.woff2",range:"U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF",bytes:17588},{name:"vietnamese",file:"roboto-vietnamese.woff2",range:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB",bytes:14340},{name:"latin-ext",file:"roboto-latin-ext.woff2",range:"U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",bytes:26388},{name:"latin",file:"roboto-latin.woff2",range:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",bytes:36600}],nt={family:Vs,weight:zs,parts:Ws},Gs=Object.assign({"./assets/fonts/roboto-cyrillic-ext.woff2":Us,"./assets/fonts/roboto-cyrillic.woff2":Ns,"./assets/fonts/roboto-greek-ext.woff2":Fs,"./assets/fonts/roboto-greek.woff2":Ms,"./assets/fonts/roboto-latin-ext.woff2":Ps,"./assets/fonts/roboto-latin.woff2":Is,"./assets/fonts/roboto-rest.woff2":Ds,"./assets/fonts/roboto-vietnamese.woff2":Bs}),Qt="data-lecodes-lite-fonts",js=1500,Hs=e=>{if(e.head.querySelector(`style[${Qt}]`))return;const t=nt.parts.map(r=>{const s=Gs[`./assets/fonts/${r.file}`];if(!s)return"";const i=new URL(s,e.baseURI).href;return`@font-face{font-family:"${nt.family}";src:url("${i}") format("woff2");font-weight:${nt.weight};font-style:normal;font-display:swap;unicode-range:${r.range}}`}),n=e.createElement("style");n.setAttribute(Qt,""),n.textContent=t.join(`
277
277
  `),e.head.appendChild(n)},Ks=(e,t=[],n=js)=>{const r=e.defaultView??window,s=e.fonts?e.fonts.ready.then(()=>{},()=>{}):Promise.resolve();return new Promise(i=>{const o=r.setTimeout(i,n);Promise.all([s,...t.map(f=>f.then(()=>{},()=>{}))]).then(()=>{r.clearTimeout(o),i()})})},Zt=e=>typeof e=="object"&&e!==null&&e.lecodes===!0&&typeof e.level=="number",lt=(e,t={})=>{let n;if((t.mode??"hash")==="hash")n=e.hash.replace(/^#/,"");else{const r=t.base??"/";n=(e.pathname.startsWith(r)?e.pathname.slice(r.length-1):e.pathname).replace(/\/index\.html$/,"/")+e.search}return n===""||n==="/"?null:n.startsWith("/")?n:`/${n}`},Ys=(e,t,n={})=>{if((n.mode??"hash")==="hash")return`${t.pathname}${t.search}${e===null?"":`#${e}`}`;const r=n.base??"/";return e===null?r:r.replace(/\/$/,"")+e},qs=(e,t,n={})=>{const r=e.history,s=e.location;let i=0,o=!1,f=0,l=!1;const d=(m,a)=>{const p={lecodes:!0,level:a},h=Ys(t.address(),s,n);m==="push"?r.pushState(p,"",h):r.replaceState(p,"",h)},b=m=>{m!==0&&(f++,r.go(m))},E=()=>{if(f>0){l=!0;return}const m=t.level();if(o){i=m,d("replace",m);return}if(m>i){for(let a=i+1;a<=m;a++)d("push",a);i=m}else if(m<i){const a=m-i;i=m,b(a)}else d("replace",m)},g=m=>{if(f>0){if(f--,f>0)return;l?(l=!1,E()):d("replace",i);return}const a=m.state;if(!Zt(a)){const R=lt(s,n);r.replaceState({lecodes:!0,level:i},"",s.href),R!==null&&t.link(R);return}const p=a.level,h=i;o=!0;try{if(p<h)for(;t.level()>p;){const R=t.level();if(t.back(),t.level()>=R)break}else if(p>h){const R=lt(s,n);R!==null&&t.link(R)}}finally{o=!1}const y=Math.max(0,t.level());if(i=p,y===p){d("replace",p);return}if(p>h&&y>h){i=y,d("replace",y);return}i=y,b(y-p)};return e.addEventListener("popstate",g),Zt(r.state)?i=r.state.level:r.replaceState({lecodes:!0,level:0},"",s.href),{sync:E,reset(){const m=-i;i=0,b(m)},destroy(){e.removeEventListener("popstate",g)}}},Xs=.1,Js=e=>{const t=new Set,n=new Set,r=new Map;let s=1,i=0,o=0;const f=l=>{i=0;const d=Math.min(Xs,Math.max(0,(l-o)/1e3));o=l;for(const b of[...r.values()])b(d);r.size>0&&(i=e.requestAnimationFrame(f))};return{globals:{setTimeout(l,d,...b){const E=e.setTimeout(()=>{t.delete(E),l(...b)},d);return t.add(E),E},clearTimeout(l){t.delete(l),e.clearTimeout(l)},setInterval(l,d,...b){const E=e.setInterval(()=>l(...b),d);return n.add(E),E},clearInterval(l){n.delete(l),e.clearInterval(l)},setLoop(l){const d=s++;return r.set(d,l),i===0&&(o=e.performance.now(),i=e.requestAnimationFrame(f)),d},clearLoop(l){r.delete(l)}},dispose(){for(const l of t)e.clearTimeout(l);for(const l of n)e.clearInterval(l);t.clear(),n.clear(),r.clear(),i!==0&&e.cancelAnimationFrame(i),i=0}}},Qs=["_creator","_creator2d","_creatorNav","_creatorNet","_creatorAudio","_creatorCanvas","_creatorFiles","_creatorService"],en=new Map,Zs=e=>{let t=en.get(e);return t||en.set(e,t=es(e)),t},ei=(e,t={})=>{const n=e.ownerDocument,r=n.defaultView??window,s=Os(r),i=t.language??(()=>(navigator.language||"en").slice(0,2));let o=null;const f=ns(),l=new Set,d=k=>Promise.all([...k].map(async U=>{if(!(!t.loadPlugin||l.has(U))){l.add(U);try{const N=await t.loadPlugin(U);N&&f.register(U,N)}catch(N){console.warn(`[web-lite] the "${U}" plugin did not load: ${N instanceof Error?N.message:N}`)}}})),b=async(k,U)=>{const N=xs(k);if(!N.has("scene3d"))return{features:[],dispose(){}};try{const{createScene3d:v}=await re(async()=>{const{createScene3d:D}=await import("./assets/scene3d-CX7MAqmN.js").then(M=>M.s);return{createScene3d:D}},[],import.meta.url),S=await v(e,{preloads:U,twins:{anim:N.has("anim"),physics:N.has("physics"),particles:N.has("particles")},alpha:N.has("ar")}),x=[S.feature];return N.has("ar")&&x.push((await re(async()=>{const{createAr:D}=await import("./assets/ar-BOdQ-wV4.js");return{createAr:D}},[],import.meta.url)).createAr(S,e)),{features:x,dispose:S.dispose}}catch(v){return console.warn(`[web-lite] the 3D engine did not start: ${v instanceof Error?v.message:v}`),{features:[],dispose(){}}}};let E=t.launchRoute!==void 0?t.launchRoute:t.history?lt(r.location,t.history):null,g=t.safeArea??null,m=0;const a=n.createElement("div");a.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 p=()=>{a.isConnected||n.body.appendChild(a);const k=r.getComputedStyle(a),U=N=>Math.round(parseFloat(N)||0);return{top:U(k.paddingTop),right:U(k.paddingRight),bottom:U(k.paddingBottom),left:U(k.paddingLeft)}},h=()=>{const k=g??p();o==null||o.tree.setSafeArea(k,k.bars??[])};r.addEventListener("resize",h);const y=t.history?qs(r,{level:()=>Math.max(0,((o==null?void 0:o.tree.presentation.stack().length)??0)-1),address:()=>(o==null?void 0:o.tree.presentation.address())??null,back:()=>{o==null||o.tree.back()},link:k=>{E=k,o==null||o.emitApp("url",k)}},t.history):null,R=()=>{o==null||o.dispose(),o=null},O=(k,U,N)=>{const v=Xo({root:e,bufferUrl:Zs,features:N,plugins:f,onNavigation:()=>{var F;y==null||y.sync(),(F=t.onNavigation)==null||F.call(t,v)}}),S=Js(r),x=fs(),D=Ls(t.project??"app"),M=ks(),B=ms(e),z=Ts(),H=s.track(k,U.onError),X=is({launchUrl:()=>E,rerun:(F,C,$)=>{C!==void 0&&(E=C);const I=F??k;r.setTimeout(()=>{A(I,U).catch(P=>$==null?void 0:$(P instanceof Error?P.message:String(P)))},0)},stats:()=>JSON.stringify({live:{tree:v.stats().nodes,fetch:x.live(),media:z.live(),tween:v.stats().tweens},pending:0}),onOrientation:t.onOrientation}),L={_creatorTree:v.bridge,_creatorApp:X.bridge,_creatorDevice:cs(i),_creatorFetch:x.bridge,_creatorStorage:D.bridge,_creatorSocket:M.bridge,_creatorInput:B.bridge,_creatorMedia:z.bridge,...S.globals};for(const F of Qs)L[F]=void 0;Object.assign(L,v.globals),o={code:k,tree:v,emitApp:X.emit,dispose(){H.drop(),S.dispose(),M.dispose(),z.dispose(),B.dispose(),D.dispose(),x.dispose(),X.dispose(),v.destroy()}},h();const T=Object.keys(L);try{new Function(...T,k)(...T.map(F=>L[F]))}catch(F){H.thrown(F)}};async function A(k,U={}){const N=jn(k);if(!zn(N.sdk,yt))throw new Error(`This app was built with LeCodes SDK ${N.sdk??"older than 2.0"}; this host runs SDK ${yt}. It needs a new build.`);N.is2d&&console.warn("[web-lite] this app uses 2D scenes, which Web Lite does not show yet (docs/plans/web-lite-plan.md): its UI runs, a scene's calls fail");const v=++m;o&&(y==null||y.reset()),R(),t.defaultFont!=="system"&&Hs(n);const S=Gn(N.bootFonts,n),[x,D]=await Promise.all([ss(k),b(k,N.preloads),d(N.plugins)]);if(v!==m){D.dispose();return}x.push(...D.features),e.style.visibility="hidden";try{O(k,U,x),o==null||o.tree.flush(),e.offsetHeight,await Ks(n,[S])}finally{v===m&&(e.style.visibility="")}}return{run:A,restart(k){return o?(k!==void 0&&(E=k),A(o.code)):Promise.resolve()},tree:()=>(o==null?void 0:o.tree)??null,setSafeArea(k){g=k,h()},openRoute(k){E=k,o==null||o.emitApp("url",k)},emitAppEvent(k,U){o==null||o.emitApp(k,U)},destroy(){m++,R(),r.removeEventListener("resize",h),y==null||y.destroy(),a.remove(),s.dispose()}}},we=document.getElementById("app"),tn=document.getElementById("error"),me=new URLSearchParams(location.search),$n=e=>{tn&&(tn.textContent=e)},nn=me.has("dev")?new URL(me.get("dev")||"..",location.href).href.replace(/\/$/,""):null,rn=e=>{const t=e.frames[0];return t?`${e.message}
@@ -9,7 +9,7 @@ import { CliError, UsageError, bool, c, defineCommand, log, note, promptHidden,
9
9
  import { upsertDotEnv } from "../../project/env"
10
10
  import {
11
11
  type AppConfig, SDK_VARIANTS, VERSION_RE, childEnv, cmpVersion, ensureShellIgnored, fetchLatestSdkVersion,
12
- projectRoot, readJson, resolvePlugin, resolveSdkVersion, resolveVariant, runTool, slugify,
12
+ projectRoot, readJson, resolvePlugin, resolveSdkVersion, resolveVariant, runTool, sdkSatisfies, slugify,
13
13
  writeJson, type LockEntry,
14
14
  } from "./shared"
15
15
  import { loadIconMaster, restampManifestIcon, writeAndroidIcons } from "./icon"
@@ -278,16 +278,16 @@ export const syncAndroid = async (root: string, config: AppConfig, prior: SyncAr
278
278
  const register = android.register
279
279
  if (!module || !register) throw new CliError(`Plugin "${id}": manifest android.module / android.register missing`)
280
280
 
281
- const src = join(plugin.dir, android.sources ?? "android")
282
- if (!existsSync(src)) throw new CliError(`Plugin "${id}": sources dir ${src} missing`)
281
+ const src = join(plugin.dir, "android")
282
+ if (!existsSync(src)) throw new CliError(`Plugin "${id}": android/ folder missing in ${plugin.dir}`)
283
283
  const dest = join(pluginsDir, module)
284
284
  rmrf(dest)
285
285
  cpSync(src, dest, { recursive: true })
286
286
 
287
- // Hard error, not a warning: below minSdk the vendored sources reference SDK API that
288
- // does not exist in the linked release, so the shell cannot compile anyway.
289
- if (android.minSdk && VERSION_RE.test(android.minSdk) && cmpVersion(sdkVersion, android.minSdk) < 0) {
290
- throw new CliError(`Plugin "${id}" needs lecodes-android-sdk ${android.minSdk} but the shell links ${sdkVersion} — run \`lecodes app update\` (or set app.json android.sdk).`)
287
+ // Hard error, not a warning: outside the plugin's `sdk` range the vendored sources reference
288
+ // an SDK API the linked release does not have, so the shell cannot compile anyway.
289
+ if (!sdkSatisfies(sdkVersion, plugin.manifest.sdk)) {
290
+ throw new CliError(`Plugin "${id}" is written for lecodes-android-sdk ${plugin.manifest.sdk} but the shell links ${sdkVersion} — run \`lecodes app update\` (or set app.json android.sdk).`)
291
291
  }
292
292
  for (const entry of android.gradlePlugins ?? []) {
293
293
  const resolved = resolveGradlePlugin(id, entry)