@dcl-regenesislabs/web-editor 0.3.24-41731064239.commit-4e4e060 → 0.3.24-41732005646.commit-bdb4b36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/editor.js +1 -1
  2. package/package.json +2 -2
package/editor.js CHANGED
@@ -38076,4 +38076,4 @@ ${n}
38076
38076
  ${r}`));return"w"+Array.from(new Uint8Array(a).slice(0,16),s=>s.toString(16).padStart(2,"0")).join("")}function xPr(t){return`${t.file===void 0?"":`${t.file}:${t.line??1}:${t.column??0}: `}${t.severity==="error"?"ERROR":"WARNING"}: ${t.message}`}function wPr(t){return t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")} and ${t.length-3} more`}function SPr(t,n){const r=Db(t.get("package.json"));for(const a of[r==null?void 0:r.devDependencies,r==null?void 0:r.dependencies]){const s=typeof a=="object"&&a!==null?a["@dcl/sdk"]:void 0;if(typeof s=="string"&&s!==n)return`⚠ This project asks for @dcl/sdk ${s}; the editor builds it with ${n}.`}return null}function TPr(t){const{emit:n,log:r}=t;let a=null,s=!1,l=null,f=Promise.resolve();const p=k=>{const N=f.then(k,k);return f=N.catch(()=>{}),N};async function _(){if(s)throw new Error("The editor was closed");a===null&&(l=null);const k=a??zEr(t.urls);a=k;try{const N=await k.ready;return{builder:k,sdkVersion:N.sdkVersion,info:N}}catch(N){throw k.dispose(),a===k&&(a=null),N}}async function b(k,N,L){const{builder:B,info:W}=await _();let X=!1;const Q=await yPr(N,t.packages,W.snapshot,de=>{t.onPackages(k,de),L&&!X&&r("Downloading packages from npm…"),X=!0});Q.lockFile!==void 0&&(N.set(WR,Q.lockFile),await t.saveLock(k,Q.lockFile));const ee=Q.lock===null?"":dGt(Q.lock);if(ee!==l)try{await B.setPackages(Q.lock,t.packages),l=ee}catch(de){L&&r(`⚠ ${WIt(de)}`),await B.setPackages(null),l=""}if(t.onPackages(k,Q.status),!(!L||Q.status===null)){if(Q.status.state==="error")r(`✖ ${Q.status.message??"The packages could not be installed"}`);else if(Q.downloaded>0){const de=Object.entries(Q.status.installed).map(([ce,Z])=>`${ce} ${Z}`);r(`✔ Packages frozen into the scene: ${de.join(", ")} (${Q.status.total} in all)`)}for(const de of Q.status.warnings)r(`⚠ ${de}`)}}function S(k,N,L=k){const B=nqe(t.pageDir,L),W=new Set;let X=null,Q=null,ee=!0,de=!1,ce=!1,Z=null;const fe=yt=>(n({type:"failed",message:yt}),r(`✖ Build failed: ${yt.split(`
38077
38077
  `)[0]}`),!1);async function Ae(yt){const st=performance.now();n({type:"buildStarted",changed:yt}),r(yt.length===0?"Building the scene…":`Rebuilding: ${wPr(yt)}`);try{const{builder:vt,sdkVersion:mt}=await _(),He=yt.length===0?SPr(N,mt):null;He!==null&&r(He);const Mt=yt.length===0||yt.includes("package.json")||yt.includes(WR),{snapshot:$e,result:Re}=await p(async()=>{(Mt||l!==Z)&&(await b(k,N,!0),Z=l);const St=new Map(N);return{snapshot:St,result:await vt.build(St)}});if(ce)return!1;const $t=Re.diagnostics.filter(St=>St.severity==="error"||St.file===void 0||$e.has(St.file));n({type:"diagnostics",diagnostics:$t.map(({severity:St,message:ut,file:Pt,line:Ht,column:Gt})=>({severity:St,message:ut,file:Pt,line:Ht,column:Gt}))});for(const St of $t)r(xPr(St));if(!Re.ok){const St=Re.events.find(ut=>ut.type==="failed");return fe((St==null?void 0:St.type)==="failed"?St.message:"The build produced no bundle")}const xt=Db($e.get("scene.json"));return xt===null?fe("scene.json is missing or is not valid JSON"):(await ZAr({realmUrl:B,projectId:L,files:$e,buildOutputs:Re.outputs,sceneJson:xt,sdkVersion:mt,machineId:await t.machineId(L)}),ce?!1:(n({type:"bundleSaved"}),r(`✔ Built in ${Math.round(performance.now()-st)} ms`),!0))}catch(vt){return ce?!1:fe(WIt(vt))}}function je(){return ce?Promise.resolve(!1):(Q!==null||(Q=(async()=>{for(;(ee||W.size>0)&&!ce;){const yt=ee?[]:[...W];ee=!1,W.clear(),de=await Ae(yt)}return de&&!ce})().finally(()=>{Q=null})),Q)}return{id:k,files:N,start:je,flush(){return X!==null&&clearTimeout(X),X=null,je()},async published(){const yt=await(await caches.open(Ewe)).match(rqe(B)),st=await(yt==null?void 0:yt.json().catch(()=>{})),vt=st==null?void 0:st.entity;return(vt==null?void 0:vt.id)===CKe(L,await t.machineId(L))},changed(yt){ce||(W.add(yt),X!==null&&clearTimeout(X),X=setTimeout(()=>{X=null,je()},vPr))},stop(){ce=!0,X!==null&&clearTimeout(X)}}}return{realmUrl:k=>nqe(t.pageDir,k),open:S,async build(k,N,L){const{builder:B,sdkVersion:W}=await _();return p(async()=>(await b(k,N,!1),{...await B.build(N,L),sdkVersion:W}))},install:(k,N)=>p(()=>b(k,N,!1)),dispose(){s=!0,a==null||a.dispose(),a=null}}}const qIt=64*1024*1024,kPr=4*1024*1024;function EPr(t,n){return t.length>8192?!1:n==="POST"?t==="/content/entities/active":n!=="GET"&&n!=="HEAD"?!1:t==="/about"||t==="/scene.json"||/^\/content\/contents\/(?:b64-[A-Za-z0-9+/=]+|[A-Za-z0-9]+)$/.test(decodeURIComponent(t))}function APr(t,n,r){const a=t===null?null:new URL(t).origin;let s="",l=null,f="",p="",_=new AbortController,b=0,S=0;const k=(B,W=[])=>{l!==null&&a!==null&&l.postMessage({...B,session:n,instance:s},a,W)},N=async B=>{var fe;if(typeof B.requestId!="string"||B.requestId.length>128||typeof B.path!="string")return;const W=B.requestId;if(b>=64){k({type:"realm-response",requestId:W,error:"Too many preview resource requests"});return}const X=_,Q=l,ee=new AbortController,de=setTimeout(()=>ee.abort(new Error("Preview resource timed out")),3e4);let ce=0,Z;b++;try{const Ae=new URL(f+B.path);if(!Ae.href.startsWith(f+"/")||!EPr(B.path,B.method))throw new Error("Invalid preview resource");if(B.body!==void 0&&(!(B.body instanceof ArrayBuffer)||B.body.byteLength>1024*1024))throw new Error("Invalid preview request body");const je=await fetch(Ae,{method:String(B.method),credentials:"omit",redirect:"error",signal:AbortSignal.any([X.signal,ee.signal]),headers:{"Content-Type":"application/json"},body:B.method==="POST"?B.body:void 0}),yt=je.headers.get("Content-Type")??"application/octet-stream",st=yt.includes("application/json")?kPr:qIt;if(Z=(fe=je.body)==null?void 0:fe.getReader(),Number(je.headers.get("Content-Length"))>st)throw new Error("Preview resource exceeds the memory limit");const vt=[];if(Z!==void 0)for(;;){const{done:$e,value:Re}=await Z.read();if($e)break;if(ce+=Re.byteLength,S+=Re.byteLength,ce>st||S>qIt)throw new Error("Preview resource exceeds the memory limit");vt.push(Re)}const mt=new Uint8Array(ce);let He=0;for(const $e of vt)mt.set($e,He),He+=$e.byteLength;vt.length=0;let Mt=mt.buffer;if(B.method!=="HEAD"&&Mt.byteLength>0&&yt.includes("application/json")){const $e=JSON.parse(new TextDecoder().decode(Mt)),Re=$t=>typeof $t=="string"?$t.startsWith(f+"/")||$t===f?p+$t.slice(f.length):$t:Array.isArray($t)?$t.map(Re):ic($t)?Object.fromEntries(Object.entries($t).map(([xt,St])=>[xt,Re(St)])):$t;Mt=new TextEncoder().encode(JSON.stringify(Re($e))).buffer}!X.signal.aborted&&Q===l&&k({type:"realm-response",requestId:W,status:je.status,headers:{"Content-Type":yt},body:Mt},[Mt])}catch(Ae){!X.signal.aborted&&Q===l&&k({type:"realm-response",requestId:W,error:Ae instanceof Error?Ae.message:String(Ae)})}finally{clearTimeout(de),ee.abort(),Z!==void 0&&Z.cancel().catch(Ae=>{Ae instanceof Error&&Ae.name==="AbortError"||console.warn("Preview stream cleanup:",Ae)}),S-=ce,b--}},L=B=>{const W=B.data;B.origin!==a||!ic(W)||W.session!==n||W.instance!==s||s===""||(W.type==="connect"&&l===null&&B.source!==null&&"postMessage"in B.source&&(l=B.source),!(B.source!==l||l===null)&&(W.type==="realm-request"?N(W):r(W)))};return window.addEventListener("message",L),{send:k,reset:(B="",W="",X="")=>{_.abort(),_=new AbortController,l=null,s=B,f=W,p=X},dispose:()=>{_.abort(),window.removeEventListener("message",L)}}}const GIt=["localhost","127.0.0.1","[::1]"];function CPr(t,n,r=""){if(GIt.includes(new URL(t).hostname)){const a=new URLSearchParams(r).get("editor-mobile");return`${a!==null&&URL.canParse(a)&&GIt.includes(new URL(a).hostname)?new URL(a).origin:"http://127.0.0.1:8788"}/mobile-preview/index.html`}return n===null?null:new URL("mobile-preview/index.html",n.replace(/\/$/,"")+"/").href}function OPr(t){if(t===null)return null;const n=new URL(t).hostname;return n==="decentraland.zone"||n.endsWith(".decentraland.zone")?"zone":null}function PPr(t,n,r,a=null){const s=crypto.randomUUID(),l=APr(t,s,ce=>de(ce)),f=new Set,p=new Map;let _={mode:"closed",url:null,ready:!1},b=null,S="",k="",N=0,L=null,B=!1,W=null;const X=ce=>{_=ce;for(const Z of f)Z()},Q=()=>{k!==""&&l.send({type:"stop",session:s,instance:k}),l.reset(),W==null||W.close(),W=null,k="";for(const ce of p.values())ce.reject(new Error("The mobile preview was closed."));p.clear(),X({mode:"closed",url:null,ready:!1})},ee=()=>{N++,b=null,Q()};window.addEventListener("pagehide",ee);const de=ce=>{if(!ic(ce)||ce.session!==s||ce.instance!==k||(ce.type==="ready"&&(X({..._,ready:!0}),l.send({type:"visibility",session:s,instance:k,visible:_.mode!=="minimized"})),ce.type==="closed"&&ee(),ce.type!=="capture"||typeof ce.requestId!="string"))return;const Z=p.get(ce.requestId);Z!==void 0&&(typeof ce.error=="string"?Z.reject(new Error(ce.error)):typeof ce.image=="string"&&ce.image.length<=4e6&&typeof ce.width=="number"&&ce.width>0&&ce.width<=1024&&typeof ce.height=="number"&&ce.height>0&&ce.height<=1024?Z.resolve({mimeType:"image/jpeg",image:ce.image,width:ce.width,height:ce.height}):Z.reject(new Error("The mobile preview sent an invalid picture.")))};return{state:()=>_,status:()=>({mode:_.mode,ready:_.ready}),subscribe:ce=>(f.add(ce),()=>f.delete(ce)),open:async(ce,Z,fe="embedded")=>{if(B||t===null)return{ok:!1,reason:"unavailable"};const Ae=ce.replace(/\/$/,"");if(_.mode===fe&&b===Ae)return N++,{ok:!0};if((fe==="embedded"||fe==="minimized")&&(_.mode==="embedded"||_.mode==="minimized")&&b===Ae){if(N++,X({..._,mode:fe}),l.send({type:"visibility",session:s,instance:k,visible:fe!=="minimized"}),fe==="minimized")for(const Mt of p.values())Mt.reject(new Error("Restore the mobile preview before taking a picture."));return{ok:!0}}if(fe==="minimized")return{ok:!1,reason:"unavailable"};const je=fe==="tab"?window.open("about:blank",`dcl-phone-preview-${crypto.randomUUID()}`):null;if(fe==="tab"&&je===null)return{ok:!1,reason:"unavailable"};const yt=++N;if(!await fetch(t,{method:"HEAD",signal:AbortSignal.timeout(5e3)}).then(Mt=>Mt.ok,()=>!1)||yt!==N||B||je!=null&&je.closed)return je==null||je.close(),{ok:!1,reason:"unavailable"};if(Q(),await new Promise(Mt=>setTimeout(Mt,100)),yt!==N||B||je!=null&&je.closed)return je==null||je.close(),{ok:!1,reason:"unavailable"};k=crypto.randomUUID();const vt=new URL(t);vt.searchParams.set("previewSession",s),vt.searchParams.set("previewInstance",k),vt.searchParams.set("editorOrigin",window.location.origin),fe==="tab"&&vt.searchParams.set("previewDetached","1"),vt.searchParams.set("maxpixels",String(1600*720)),S=new URL(`realm/${s}/${k}`,t).href,l.reset(k,Ae,S);const mt=new URL("decentraland://open");mt.searchParams.set("preview",S),mt.searchParams.set("position",Z);const He=["--local-editor-preview","--skip-lobby","--guest-profile","--fake-deeplink",mt.href];return a!==null&&He.push("--dclenv",a),vt.searchParams.set("args",He.join(" ")),b=Ae,X({mode:fe,url:vt.href,ready:!1}),W=je,je!==null&&IPr(je,vt.href),{ok:!0}},close:ee,capture:async ce=>{if(ce.throwIfAborted(),_.mode==="closed"||!_.ready)throw new Error("Open the mobile preview and wait for it to load before taking a picture.");_.mode==="minimized"&&(L=N,X({..._,mode:"embedded"}),l.send({type:"visibility",session:s,instance:k,visible:!0}));const Z=crypto.randomUUID();try{return await new Promise((fe,Ae)=>{const je=()=>{clearTimeout(st),ce.removeEventListener("abort",yt),p.delete(Z)},yt=()=>{je(),Ae(ce.reason)},st=setTimeout(()=>{je(),Ae(new Error("The mobile preview did not answer. Bring its tab to the foreground and retry."))},1e4);p.set(Z,{resolve:vt=>{je(),fe(vt)},reject:vt=>{je(),Ae(vt)}}),ce.addEventListener("abort",yt,{once:!0}),l.send({type:"capture",session:s,instance:k,requestId:Z})})}finally{p.size===0&&(L===N&&_.mode==="embedded"&&(X({..._,mode:"minimized"}),l.send({type:"visibility",session:s,instance:k,visible:!1})),L=null)}},built:async ce=>{if(b===null)return;const Z=b,fe=await n(ce),Ae=CKe(fe,await r(fe));!B&&Z===b&&l.send({type:"scene-updated",session:s,instance:k,realm:S,entityId:Ae})},dispose:()=>{ee(),B=!0,window.removeEventListener("pagehide",ee),l.dispose(),f.clear()}}}function IPr(t,n){const r=t.document;r.title="Mobile scene preview",r.body.style.cssText="margin:0;background:#19191c;overflow:hidden";const a=r.createElement("iframe");a.title="Mobile scene preview",a.allow="autoplay; fullscreen; gamepad; cross-origin-isolated",a.style.cssText="width:100vw;height:100vh;border:0;display:block",a.src=n,r.body.replaceChildren(a)}const NPr=200,DPr=2e3,RPr=/^\((?:no logs|\+\d+ older entries not retained)\)$/;function MPr(t,n){for(let r=Math.min(t.length,n.length);r>0;r--){const a=t.length-r;if(n.slice(0,r).every((s,l)=>s===t[a+l]))return n.slice(r)}return[...n]}function LPr(t,n){let r=[],a=!1,s;const l=async()=>{try{const f=await t(`scene_logs ${NPr} --server`);if(a)return;const p=f.split(`
38078
38078
  `).filter(_=>_.trim()!==""&&!RPr.test(_.trim()));for(const _ of MPr(r,p))n(_);r=p}catch{}a||(s=setTimeout(()=>void l(),DPr))};return l(),()=>{a=!0,clearTimeout(s)}}function FPr(t,n,r){r.throwIfAborted();const a=tt.scene,s=[...t].sort().join(";");return new Promise((l,f)=>{const p=()=>{clearTimeout(N),S(),r.removeEventListener("abort",k)},_=L=>{p(),f(L)},b=()=>{var B;tt.scene===a||tt.status!=="ready"||!tt.frozen||((B=tt.scene)==null?void 0:B.parcels.map(W=>`${W.x},${W.y}`).sort().join(";"))!==s||(p(),l())},S=yqe(b),k=()=>_(r.reason),N=setTimeout(()=>_(new Error("The preview has not loaded the new parcels. Retry sceneSettings before building outside the current layout.")),9e4);r.addEventListener("abort",k,{once:!0});try{n(),b()}catch(L){_(L)}})}const jPr=new Set(["node_modules",".git","bin","dist"]),BPr=300*1024,UPr=56,$Pr=5;function zPr(t){const n=t.origin,r=typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null;return r!==null&&(r.source==="import"||r.source==="github")?r:{...r??{},source:"user"}}function VPr(t,n){const r=new Map;let a=new Map;function s(p,_){if(_.size>BPr)return t.blob(p,_.hash);let b=r.get(_.hash);return b===void 0&&(b=t.blob(p,_.hash),r.set(_.hash,b),b.catch(()=>r.delete(_.hash))),b}const l={async folders(){const p=await t.list();return a=new Map(p.map(b=>[b.name,b])),(await Promise.all(p.map(async b=>{const S=b.files["data.json"];if(S===void 0)return null;const k=await s(b.name,S).then(L=>new TextDecoder().decode(L),()=>null);if(k===null)return null;const N=Object.fromEntries(Object.entries(b.files).map(([L,B])=>[L,B.size]));return{name:b.name,data:k,files:N}}))).filter(b=>b!==null)},async read(p,_){var S;const b=(S=a.get(p.name))==null?void 0:S.files[_];if(b===void 0)throw new Error(`${p.name}/${_} is not in your library`);return s(p.name,b)}};async function f(p,_){const b={},S=new Map;for(const[N,L]of _){const B=await n(L);b[N]={hash:B,size:L.length},S.set(B,L)}const k=[...S].map(([N,L])=>({hash:N,size:L.length}));for(const N of await t.uploads(p,k)){const L=S.get(N.hash);L!==void 0&&await t.putBlob(N,L)}await t.put(p,b)}return{tree:l,async copyOut(p,_){const[b,S,k]=_.split("/");if(b!=="custom"||S===void 0||k!==void 0||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(S))throw new Error(`not a prefab folder: ${_}`);const N=`${_}/`,L=new Map;for(const[Z,fe]of p.files()){const Ae=Z.slice(N.length);Z.startsWith(N)&&!Ae.split("/").some(je=>jPr.has(je))&&L.set(Ae,fe)}const B=L.get("data.json"),W=B===void 0?null:nq(new TextDecoder().decode(B));if(W===null)throw new Error(`${_} has no readable data.json`);const X={...W,id:typeof W.id=="string"?W.id:crypto.randomUUID(),origin:zPr(W)},Q=`${JSON.stringify(X,null,2)}
38079
- `;L.set("data.json",new TextEncoder().encode(Q));const ee=pqe(jGt(W,S)).slice(0,UPr).replace(/_+$/,"")||"prefab",de=new Set((await t.list()).map(Z=>Z.name));let ce=1;for(let Z=0;Z<$Pr;Z++){let fe=ee;for(;de.has(fe);)fe=`${ee}_${++ce}`;try{return await f(fe,L),{ref:`user:${fe}`,scope:"user",data:Q}}catch(Ae){if(!(Ae instanceof EGt))throw Ae;de.add(fe)}}throw new Error("could not find a free name in your library — try again")},remove:p=>t.remove(p)}}const JIt=new WeakMap;function WPr(t){let n=JIt.get(t);return n===void 0&&(n=crypto.subtle.digest("SHA-256",new Uint8Array(t)).then(r=>[...new Uint8Array(r)].map(a=>a.toString(16).padStart(2,"0")).join("")),JIt.set(t,n)),n}async function HPr(t){const n=t.get(".dclignore"),r=PKe(t.keys(),n===void 0?void 0:new TextDecoder().decode(n)).filter(l=>l!==WR),a=new Map;let s=0;for(const l of r){const f=t.get(l);f!==void 0&&(a.set(await WPr(f),f.byteLength),s++)}return{bytes:[...a.values()].reduce((l,f)=>l+f,0),files:s}}const QIt=4e3,qPr=4e6,GPr=dNt*24*60*60*1e3,JPr="assets/images",QPr=3e3,YPr=100,XPr="Sign in to keep prefabs in your own library. The built-in prefabs work without it.",ZPr=t=>t instanceof Error?t.message:String(t);function yUe(t,n){var r,a,s;return{realm:n.replace(/\/$/,""),systemScene:"",position:((r=t.scene)==null?void 0:r.base)??((s=(a=t.scene)==null?void 0:a.parcels)==null?void 0:s[0])??"0,0",spawn:gCr(t),spawnPoints:JSON.stringify(Array.isArray(t.spawnPoints)?t.spawnPoints:[])}}const KPr=({host:t,sceneCompiler:n})=>{const r=new rOr(XCr()),a=zS(t),s=a===null||a.services.projects===null?null:kGt(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),l=()=>{const{address:Xn,isGuest:Fr}=t.identity();return Fr||Xn===null?null:Xn.toLowerCase()},f=[],p=[],_=[],b=[],S=[],k=Xn=>{f.push(Xn),f.length>QIt&&f.splice(0,f.length-QIt);for(const Fr of p)Fr(Xn)},N=PPr(CPr(t.pageDir,(a==null?void 0:a.services.projects)??null,location.search),fe,async Xn=>HIt(await X,l()??"guest",Xn),OPr((a==null?void 0:a.services.worldsContent)??null)),L=Xn=>{for(const Fr of _)Fr(Xn);Xn.type==="bundleSaved"&&de!==null&&N.built(de.id).catch(Fr=>console.error("[editor] mobile preview reload failed",Fr))},B=new Map,W=new Set,X=oMt.then(bPr),Q=TPr({pageDir:t.pageDir,urls:n,machineId:async Xn=>HIt(await X,l()??"guest",Xn),emit:L,log:k,packages:r.packages,saveLock:async(Xn,Fr)=>{await r.write(Xn,WR,Fr),St.touched(Xn,WR),(de==null?void 0:de.id)===Xn&&de.files.set(WR,Fr)},onPackages:(Xn,Fr)=>{if(Fr===null){B.delete(Xn);return}B.set(Xn,Fr);for(const oi of W)oi(Xn,Fr)}});let ee=null,de=null,ce=null,Z=null;async function fe(Xn){var Ya;const Fr=(Ya=(await r.list()).find(Za=>Za.id===Xn))==null?void 0:Ya.previewId;if(Fr!==void 0)return Fr;const oi="p"+Array.from(crypto.getRandomValues(new Uint8Array(16)),Za=>Za.toString(16).padStart(2,"0")).join("");return await r.patch(Xn,{previewId:oi}),oi}async function Ae(Xn){const Fr=new URL("preview/",t.pageDir).href,oi=await caches.open(Ewe);for(const Ya of await oi.keys())Ya.url.startsWith(Fr)&&(Xn===null||!Ya.url.startsWith(Xn))&&await oi.delete(Ya)}let je=0,yt=Promise.resolve(),st=Promise.resolve();const vt=nCr({service:(a==null?void 0:a.services.projects)??null,fetch:(Xn,Fr)=>a===null?Promise.reject(new Error("The assistant service is not configured.")):a.signedFetch(Xn,Fr),wallet:l,mobilePreview:N.status,memory:{read:async(Xn,Fr)=>{const oi=await r.assistantMemory(Xn,Fr);return ic(oi)&&typeof oi.id=="string"&&typeof oi.key=="string"?{id:oi.id,key:oi.key}:null},write:(Xn,Fr,oi)=>r.setAssistantMemory(Xn,Fr,oi)},project:()=>{const Xn=At();return{id:Xn.id,tools:{files:()=>Xn.files,write:(Fr,oi,Ya,Za)=>Mt(Xn.id,Fr,oi,{expected:Ya,signal:Za}),assets:iWt({files:()=>Xn.files}),scene:(Fr,oi)=>lke(Fr,oi,async Ya=>{var ri,yl,Ba;const Za=ss=>{var gs,qs;return JSON.stringify([(gs=ss==null?void 0:ss.scene)==null?void 0:gs.parcels,(qs=ss==null?void 0:ss.scene)==null?void 0:qs.base])};await Ik();const tl=Za(Db(await He(Xn.id,"scene.json")));await Wt(Xn.id,ss=>xCr(ss,Ya));const uu=Db(await He(Xn.id,"scene.json")),ur=Za(uu)!==tl,Pl=((ri=uu==null?void 0:uu.scene)==null?void 0:ri.parcels)??[],fh=(yl=tt.scene)==null?void 0:yl.parcels.map(ss=>`${ss.x},${ss.y}`).sort().join(";");if(ur||fh!==[...Pl].sort().join(";")){if(!await Xn.flush())throw new Error("The scene did not build. Fix the code and retry sceneSettings to load the new parcels.");oi.throwIfAborted();const ss=await fe(Xn.id);ee=yUe(uu??{},Q.realmUrl(ss)),await FPr(Pl,()=>{for(const gs of b)gs(ee)},oi)}else if(ee!==null){const ss=yUe(uu??{},ee.realm);(ss.spawn!==ee.spawn||ss.spawnPoints!==ee.spawnPoints)&&(ee={...ee,spawn:ss.spawn,spawnPoints:ss.spawnPoints},Qhr(ss.spawn,ss.spawnPoints))}return{requiredPermissions:(uu==null?void 0:uu.requiredPermissions)??[],spawnPoints:(uu==null?void 0:uu.spawnPoints)??[],parcels:Pl,base:((Ba=uu==null?void 0:uu.scene)==null?void 0:Ba.base)??null,previewReady:!0}}),written:cWt,view:(Fr,oi)=>Lse(Fr,oi),playtest:aKe,uiLayout:OHe,turnEnded:lHt,build:kOr({saveScene:nWt,fileWrites:()=>st,vendorRuntime:ese,compile:()=>Q.build(Xn.id,new Map(Xn.files)),run:rWt,mobilePreview:N.status})}}}});function mt(){vt.reset(),Z==null||Z(),Z=null,de!==null&&(de.stop(),r.close(de.id),St.flush(de.id),de=null,ce=null)}async function He(Xn,Fr){return(de==null?void 0:de.id)===Xn?de.files.get(Fr):r.read(Xn,Fr).catch(oi=>{if(!bI(oi))throw oi})}function Mt(Xn,Fr,oi,Ya){const Za=st.then(async()=>{if(Ya==null||Ya.signal.throwIfAborted(),Ya!==void 0&&((de==null?void 0:de.id)!==Xn||!uWt(de.files.get(Fr),Ya.expected)))throw new Error("This file changed. Read it again before writing.");await r.write(Xn,Fr,oi),St.touched(Xn,Fr),(de==null?void 0:de.id)===Xn&&(de.files.set(Fr,oi),de.changed(Fr))});return st=Za.catch(tl=>console.error("[editor] file write failed",tl)),Za}function $e(Xn,Fr){const oi=st.then(async()=>{const Ya=await r.remove(Xn,Fr);return Ya&&St.touched(Xn,Fr),Ya&&(de==null?void 0:de.id)===Xn&&de.files.delete(Fr)&&de.changed(Fr),Ya});return st=oi.catch(Ya=>console.error("[editor] file removal failed",Ya)),oi}function Re(Xn){const Fr=At();if(Fr.id!==Xn)throw new Error("that scene is not the one open");return{files:()=>Fr.files,write:(oi,Ya)=>Mt(Xn,oi,Ya),remove:async oi=>{await $e(Xn,oi)}}}async function $t(Xn){var Ya;const Fr=Db(await He(Xn,"scene.json").catch(()=>{})),oi=(((Ya=Fr==null?void 0:Fr.display)==null?void 0:Ya.title)??"").replace(/[\x00-\x1f\x7f]/g,"").replace(new RegExp(TGt.source,"g"),"").trim().slice(0,YPr);return oi===""?Xn:oi}async function xt(Xn,Fr){const oi=(await r.list()).find(Za=>Za.id===Xn);if(oi===void 0)return null;const Ya=await r.duplicate(Xn,`${oi.name} ${Fr}`,St.remoteIds());return await Wt(Ya.id,Za=>{var tl;return{...Za,display:{...Za.display??{},title:`${((tl=Za.display)==null?void 0:tl.title)||oi.name} ${Fr}`}}}),Ya.id}const St=uOr({store:r,session:()=>{const Xn=l();return s===null||Xn===null?null:{api:s,wallet:Xn}},account:()=>s===null?"unavailable":l()===null?"guest":"on",hash:Swe,title:$t,duplicate:async Xn=>{const Fr=await xt(Xn,uNt(new Date));if(Fr===null)throw new Error("The scene is no longer on this device");return Fr}});let ut=!1,Pt=0;async function Ht(){const Xn=++Pt,Fr=l()!==null&&(await vt.shell.aiProviders()).some(oi=>oi.available);Xn!==Pt||Fr===ut||(ut=Fr,Y0())}Ht();let Gt=l();const pt=setInterval(()=>{const Xn=l();Xn!==Gt&&(Gt=Xn,vt.reset(),Y0(),Ht(),St.refresh(!0),Ae(ce).catch(Fr=>console.warn("[editor] could not clear the previews",Fr)))},QPr),Ue=()=>{document.visibilityState==="hidden"&&St.flush()};document.addEventListener("visibilitychange",Ue);const Ke=new Set;async function Wt(Xn,Fr){const oi=Db(await He(Xn,"scene.json"));if(oi===null)throw new Error("scene.json is missing or is not valid JSON");await Mt(Xn,"scene.json",hIt(Fr(oi)))}async function bn(Xn,Fr){if(Fr==null||Fr==="")return null;const oi=await He(Xn,Fr).catch(()=>{});return oi===void 0||oi.length>qPr?null:mIt(Fr,oi)}async function fn(Xn,Fr=St.status().projects){var Ya,Za,tl,uu;const oi=Db(await He(Xn.id,"scene.json").catch(()=>{}));return{sync:Fr[Xn.id],path:Xn.id,name:Xn.name,title:((Ya=oi==null?void 0:oi.display)==null?void 0:Ya.title)||Xn.name,world:((Za=oi==null?void 0:oi.worldConfiguration)==null?void 0:Za.name)||null,parcels:Array.isArray((tl=oi==null?void 0:oi.scene)==null?void 0:tl.parcels)?oi.scene.parcels.length:0,thumbnail:await bn(Xn.id,(uu=oi==null?void 0:oi.display)==null?void 0:uu.navmapThumbnail),favourite:Xn.favourite,lastOpened:Xn.lastOpened,published:Xn.published,deletedAt:Xn.deletedAt??void 0}}async function An(Xn,Fr){var Ya,Za;mt(),f.length=0,L({type:"sessionStarted"});const oi=tl=>{if(mt(),Fr===je){k(`✖ ${tl}`);for(const uu of S)uu(tl)}};try{if(await St.prepareOpen(Xn,(ri,yl)=>k(`Downloading from your account… ${ri}/${yl}`)),Fr!==je)return;if(!await r.open(Xn)){oi("This scene is open in another tab. Close it there to edit it here.");return}const tl=await r.readAll(Xn).then(async ri=>{for(const[yl,Ba]of GEr(ri))await Mt(Xn,yl,Ba),ri.set(yl,Ba);return ri}).catch(ri=>{throw r.close(Xn),ri});if(Fr!==je){r.close(Xn);return}const uu=await fe(Xn);if(Fr!==je){r.close(Xn);return}const ur=Q.open(Xn,tl,uu);de=ur;const Pl=Q.realmUrl(uu);if(ce=Pl,k(`▶ Opening ${((Za=(Ya=Db(ur.files.get("scene.json")))==null?void 0:Ya.display)==null?void 0:Za.title)||Xn}`),!await ur.start()&&!await ur.published()){if(Fr!==je)return;k("✖ The scene did not build.");for(const ri of S)ri("The scene did not build.");return}if(await r.patch(Xn,{lastOpened:Date.now()}),Fr!==je){mt();return}const fh=Db(ur.files.get("scene.json"))??{};ee=yUe(fh,Pl),Z=LPr(ri=>t.engineConsole(ri),k);for(const ri of b)ri(ee)}catch(tl){oi(ZPr(tl))}}function xi(Xn){N.close(),ee=null;const Fr=++je,oi=vt.reset(),Ya=yt.then(async()=>{await oi,await st,Fr===je&&await Xn(Fr)});return yt=Ya.catch(Za=>console.error("[editor] project transition failed",Za)),Ya}function At(){if(de===null)throw new Error("no project is open");return de}const hi={saveFile:async({path:Xn,content:Fr})=>Mt(At().id,Xn,Fr),getFile:async({path:Xn})=>{const Fr=At().files.get(Xn)??sPr(Xn);if(Fr===void 0)throw new Error(`no such file: ${Xn}`);return{content:Fr}},removeFiles:async({filePaths:Xn})=>{const Fr=At(),oi=[],Ya=[];for(const Za of Xn)(await $e(Fr.id,Za).catch(()=>!1)?oi:Ya).push(Za);return{success:oi,failed:Ya}},getFilesSizes:async({path:Xn,ignore:Fr})=>{const oi=Xn===""?"":`${Xn.replace(/\/+$/,"")}/`;return{files:[...At().files.keys()].filter(Za=>Za.startsWith(oi)&&!Za.split("/").some(tl=>Fr.includes(tl))).sort().map(Za=>({path:Za}))}}},lr={async find(Xn){return(await r.list()).some(Fr=>Fr.id===Xn)?!0:(await St.refresh(!0),St.remoteOnly().some(Fr=>Fr.id===Xn))},files:async Xn=>(de==null?void 0:de.id)===Xn?new Map(de.files):r.readAll(Xn),manifest:Xn=>St.manifest(Xn),build:async(Xn,Fr)=>Q.build(Xn,await lr.files(Xn),Fr),dependencies:async Xn=>xGt(await He(Xn,"package.json")),onImported:Xn=>(Ke.add(Xn),()=>Ke.delete(Xn))},ks=a===null?null:YCr({host:a,setWorld:async(Xn,Fr)=>{var Ya,Za;((Za=(Ya=Db(await He(Xn,"scene.json")))==null?void 0:Ya.worldConfiguration)==null?void 0:Za.name)!==Fr&&await Wt(Xn,tl=>({...tl,worldConfiguration:{...tl.worldConfiguration??{},name:Fr}}))},files:Xn=>lr.files(Xn),build:(Xn,Fr)=>Q.build(Xn,Fr,{production:!0}),published:(Xn,Fr)=>r.patch(Xn,{published:Fr})}),Ia=(a==null?void 0:a.services.projects)==null?null:VPr(sOr(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),Swe);L_r(sCr(t.editorBase)),oCr(t.editorBase),dWt({material:cCr,sound:lCr,iconIndex:fCr,iconBlock:pCr}),Hgr(async()=>HPr(await lr.files(At().id)));const lc=mPr({builtin:EOr(t.editorBase,LB("prefabs/catalog.json"),gke),user:()=>Ia!==null&&l()!==null?Ia.tree:null}),kc={...(a==null?void 0:a.services.projects)==null?{}:{...vt.shell,aiOffered:()=>ut,aiTranscript:()=>{const Xn=Gt;if(Xn===null||de===null)return null;const Fr=de.id;return{owner:`${Fr}@${Xn.toLowerCase()}`,load:()=>r.transcript(Fr,Xn),save:oi=>r.setTranscript(Fr,Xn,oi)}}},pickProject:async()=>{},openProject:Xn=>xi(Fr=>An(Xn,Fr)),relaunchProject:Xn=>xi(Fr=>An(Xn,Fr)),closeProject:()=>xi(async()=>{mt(),L({type:"sessionStarted"}),k("■ Scene closed"),await Ae(null).catch(Xn=>console.warn("[editor] could not clear the previews",Xn))}),getState:async()=>{const Xn=await r.list(),Fr=St.status().projects,oi=St.remoteOnly().map(Ya=>({path:Ya.id,name:Ya.name,title:Ya.name,world:null,parcels:0,thumbnail:null,remoteOnly:!0}));return{recentProjects:[...Xn].sort((Ya,Za)=>Za.lastOpened-Ya.lastOpened).map(Ya=>Ya.id),projects:[...await Promise.all(Xn.map(Ya=>fn(Ya,Fr))),...oi],logs:[...f],bevyWebDir:"",editorSceneDir:"",webPort:0,scenePort:0,editorScenePort:0,favourites:Xn.filter(Ya=>Ya.favourite).map(Ya=>Ya.id)}},onStackLog:Xn=>{p.push(Xn)},onBuildEvent:Xn=>{_.push(Xn)},onServersReady:Xn=>{b.push(Xn)},requestReady:async()=>ee,phonePreview:async Xn=>ee===null?{ok:!1,reason:"no-scene"}:N.open(ee.realm,ee.position,Xn),phonePreviewState:N.state,onPhonePreviewState:N.subscribe,closePhonePreview:N.close,capturePhonePreview:N.capture,onServersError:Xn=>{S.push(Xn)},toggleFavourite:async Xn=>{const Fr=(await r.list()).find(oi=>oi.id===Xn);Fr!==void 0&&await r.patch(Xn,{favourite:!Fr.favourite})},deleteProject:async Xn=>{const Fr=await r.trash(Xn);return Fr&&St.trashed(Xn),Fr},trashedProjects:async()=>Promise.all((await r.trashed()).map(Xn=>fn(Xn))),restoreProject:async Xn=>{const Fr=await r.restore(Xn);return Fr&&St.restored(Xn),Fr},syncStatus:async()=>(St.refresh(),St.status()),onSyncStatus:Xn=>St.subscribe(Xn),resolveSyncConflict:(Xn,Fr)=>St.resolve(Xn,Fr),exportProject:async Xn=>wOr(await $t(Xn),await lr.files(Xn)),importProject:async Xn=>{const Fr=await TOr(Xn,async(oi,Ya)=>{const Za=await r.create(oi,Ya,{taken:St.remoteIds()});return St.touched(Za.id,"scene.json"),Za.id});if((Fr==null?void 0:Fr.ok)===!0){const{id:oi,needsPackages:Ya}=Fr.report;Object.keys(Ya).length>0&&r.readAll(oi).then(Za=>Q.install(oi,Za)).catch(Za=>console.warn("[editor] could not install the packages of",oi,Za));for(const Za of Ke)Za(Fr.report)}return Fr},projectPackages:async Xn=>B.get(Xn)??null,onProjectPackages:Xn=>(W.add(Xn),()=>W.delete(Xn)),...ks===null||a===null?{}:{publishScene:(Xn,Fr,oi)=>ks.publish(Xn,Fr,oi),...ks.publishShared===void 0?{}:{publishShared:ks.publishShared},publishStop:async()=>ks.stop(),publishWorlds:async()=>JCr(l(),a.services.worldsContent)},canImportFolder:xOr(),renameProject:(Xn,Fr)=>Wt(Xn,oi=>({...oi,display:{...oi.display??{},title:Fr.trim()}})),duplicateProject:Xn=>xt(Xn,"copy"),sceneTemplates:async()=>rPr(),createScene:async(Xn,Fr,oi)=>{const Ya=LGt(oi),Za=Db(Ya.get("scene.json"));if(Za===null)throw new Error(`template not found: ${oi}`);Ya.set("scene.json",hIt({...Za,display:{...Za.display??{},title:Fr.trim()}}));const tl=await r.create(Fr,Ya,{taken:St.remoteIds()});return St.touched(tl.id,"scene.json"),tl.id},openExternal:async Xn=>{/^https?:$/.test(new URL(Xn).protocol)&&window.open(Xn,"_blank","noopener,noreferrer")},compositeEntityIds:async Xn=>{for(const Fr of yCr){const oi=await He(Xn,Fr);if(oi!==void 0)return vCr(new TextDecoder().decode(oi))}return[]},sceneSettings:async Xn=>{const Fr=Db(await He(Xn,"scene.json"));if(Fr===null)throw new Error("scene.json is missing or is not valid JSON");const oi=hCr(Fr);return{...oi,thumbnail:await bn(Xn,oi.thumbnailPath)}},saveSceneSettings:async(Xn,Fr)=>{const oi=mCr(Fr);return oi!==null?oi:(await Wt(Xn,Ya=>_Cr(Ya,Fr)),null)},pickSceneThumbnail:async Xn=>{const Fr=await MGt(Object.values(iqe).join(","));if(Fr===null)return null;const oi=vGt(Fr.name);if(iqe[oi]===void 0)throw new Error("not a supported image (png, jpg, gif, webp)");const Ya=`${JPr}/scene-thumbnail${oi}`,Za=new Uint8Array(await Fr.arrayBuffer());return await Mt(Xn,Ya,Za),{path:Ya,dataUrl:mIt(Ya,Za)}},appVersion:async()=>KAr,prefabLibraryList:()=>lc.list(),prefabLibraryCopyIn:async(Xn,Fr)=>lc.copyIn(Xn,Re(Fr)),prefabLibraryUpdateCopy:async(Xn,Fr)=>lc.updateCopy(Xn,Re(Fr)),prefabUserLibrary:()=>Ia===null?"unavailable":l()===null?"guest":"on",...Ia===null?{}:{prefabLibraryCopyOut:async(Xn,Fr)=>{if(l()===null)throw new Error(XPr);return Ia.copyOut(Re(Xn),Fr)},prefabLibraryDelete:async Xn=>{const Fr=FGt(Xn);return(Fr==null?void 0:Fr.scope)==="user"&&l()!==null?Ia.remove(Fr.name):!1}}};async function Gl(){const Xn=new Set;for(const Fr of[...await r.list(),...await r.trashed()]){const oi=uGt(await He(Fr.id,WR).catch(()=>{}));for(const Ya of Object.keys((oi==null?void 0:oi.packages)??{}))Xn.add(Ya);for(const[Ya,Za]of Object.entries((oi==null?void 0:oi.dependencies)??{}))Xn.add(u7(Ya,Za))}for(const Fr of await r.packages.keys())Xn.has(Fr)||await r.packages.remove(Fr)}return r.purge(Date.now()-GPr).then(async Xn=>{const Fr=await caches.open(Ewe),oi=Xn.map(({id:Za,previewId:tl})=>Q.realmUrl(tl??Za));for(const Za of await Fr.keys())oi.some(tl=>Za.url.startsWith(tl))&&await Fr.delete(Za);const Ya=await caches.open(XAr);for(const Za of oi)await Ya.delete(`${Za}__storage`);Xn.length>0&&await Gl()}).catch(Xn=>console.warn("[editor] could not empty the trash",Xn)),{shell:kc,projects:lr,dataLayer:hi,dispose:()=>{N.dispose(),vt.dispose(),je++,mt(),Q.dispose(),clearInterval(pt),document.removeEventListener("visibilitychange",Ue),St.flush().finally(()=>St.dispose())}}};let d7=null,jq=null,kre=null,YIt=!1;function eIr(){if(d7!==null)return d7;const t=window.__dclEditorHost;if(t===void 0||t.version!==0&&t.version!==1)return console.error("[editor] window.__dclEditorHost (contract v0 or v1) is missing: nothing to mount into"),null;console.log("[editor] web build 2026-11-03T22:29:42.788Z"),hNt(t),KDt(a=>t.engineConsole(a)),gMt(()=>t.identity()),KYn.needed=!1;const n=KPr({host:t,sceneCompiler:aCr(t.editorBase)});window.editorShell=tIr(n.shell,t),O3t(n.dataLayer??null),uJe();const r=document.createElement("link");return r.rel="stylesheet",r.href=new URL("editor.css",t.editorBase).href,r.integrity=LB("editor.css"),r.crossOrigin="anonymous",r.onerror=()=>console.error("[editor] editor.css did not load or does not match the hash this editor was published with: its fonts are not applied"),document.head.appendChild(r),G1.project=null,G1.notice=null,d7={host:t,web:n,fonts:r},d7}function Pwe(){const t=jq;jq=null,t==null||t.unmount()}function tIr(t,n){const{createScene:r,importProject:a,duplicateProject:s}=t;return{...t,...r===void 0?{}:{createScene:async(l,f,p)=>{const _=await r(l,f,p);return _!==null&&nw("project_created",{project_id:_,source:"template",template:p}),_}},...a===void 0?{}:{importProject:async l=>{const f=await a(l);return(f==null?void 0:f.ok)===!0&&nw("project_created",{project_id:f.report.id,source:"import",import_kind:l}),f}},...s===void 0?{}:{duplicateProject:async l=>{const f=await s(l);return f!==null&&nw("project_created",{project_id:f,source:"duplicate",from_project_id:l}),f}},openProject:async l=>{const f=jq;Pwe(),f==null||f.api.close(),kre??(kre=NBt(n.container,C.jsx(PEr,{}))),n.setMode("edit"),G1.project=l,G1.opens++,await t.openProject(l),nw("project_opened")}}}function nIr(t,n){var p;const r=eIr();if(r===null)return()=>{};Pwe();const a=document.createElement("div");a.style.cssText="position:relative;width:100%;height:100%",DYn(a),t.appendChild(a);const s=NBt(a,C.jsx(LYn,{}),"eui-create-root"),l={api:n,unmount:()=>{s(),a.remove()}};jq=l;const f=YIt?null:((p=zS(r.host))==null?void 0:p.openProject)??null;return YIt=!0,nw("editor_opened",{deep_link:f!==null}),f!==null&&r.web.projects.find(f).catch(()=>!1).then(_=>{var b;jq===l&&(_?(b=window.editorShell)==null||b.openProject(f):G1.notice=`“${f}” is not on this device or on your account. Here are your scenes.`)}),()=>{jq===l&&Pwe()}}function rIr(){Pwe();const t=d7;if(t===null)return;d7=null;const n=Ik();kre==null||kre(),kre=null,t.fonts.remove(),G1.project=null,delete window.editorShell,gMt(null),KDt(null),hNt(null),t.host.setMode("off"),n.finally(()=>{var r,a;(a=(r=t.web).dispose)==null||a.call(r),d7===null&&O3t(null)})}window.__dclEditor={mountHome:nIr,unmount:rIr};
38079
+ `;L.set("data.json",new TextEncoder().encode(Q));const ee=pqe(jGt(W,S)).slice(0,UPr).replace(/_+$/,"")||"prefab",de=new Set((await t.list()).map(Z=>Z.name));let ce=1;for(let Z=0;Z<$Pr;Z++){let fe=ee;for(;de.has(fe);)fe=`${ee}_${++ce}`;try{return await f(fe,L),{ref:`user:${fe}`,scope:"user",data:Q}}catch(Ae){if(!(Ae instanceof EGt))throw Ae;de.add(fe)}}throw new Error("could not find a free name in your library — try again")},remove:p=>t.remove(p)}}const JIt=new WeakMap;function WPr(t){let n=JIt.get(t);return n===void 0&&(n=crypto.subtle.digest("SHA-256",new Uint8Array(t)).then(r=>[...new Uint8Array(r)].map(a=>a.toString(16).padStart(2,"0")).join("")),JIt.set(t,n)),n}async function HPr(t){const n=t.get(".dclignore"),r=PKe(t.keys(),n===void 0?void 0:new TextDecoder().decode(n)).filter(l=>l!==WR),a=new Map;let s=0;for(const l of r){const f=t.get(l);f!==void 0&&(a.set(await WPr(f),f.byteLength),s++)}return{bytes:[...a.values()].reduce((l,f)=>l+f,0),files:s}}const QIt=4e3,qPr=4e6,GPr=dNt*24*60*60*1e3,JPr="assets/images",QPr=3e3,YPr=100,XPr="Sign in to keep prefabs in your own library. The built-in prefabs work without it.",ZPr=t=>t instanceof Error?t.message:String(t);function yUe(t,n){var r,a,s;return{realm:n.replace(/\/$/,""),systemScene:"",position:((r=t.scene)==null?void 0:r.base)??((s=(a=t.scene)==null?void 0:a.parcels)==null?void 0:s[0])??"0,0",spawn:gCr(t),spawnPoints:JSON.stringify(Array.isArray(t.spawnPoints)?t.spawnPoints:[])}}const KPr=({host:t,sceneCompiler:n})=>{const r=new rOr(XCr()),a=zS(t),s=a===null||a.services.projects===null?null:kGt(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),l=()=>{const{address:Xn,isGuest:Fr}=t.identity();return Fr||Xn===null?null:Xn.toLowerCase()},f=[],p=[],_=[],b=[],S=[],k=Xn=>{f.push(Xn),f.length>QIt&&f.splice(0,f.length-QIt);for(const Fr of p)Fr(Xn)},N=PPr(CPr(t.pageDir,(a==null?void 0:a.services.projects)??null,location.search),fe,async Xn=>HIt(await X,l()??"guest",Xn),OPr((a==null?void 0:a.services.worldsContent)??null)),L=Xn=>{for(const Fr of _)Fr(Xn);Xn.type==="bundleSaved"&&de!==null&&N.built(de.id).catch(Fr=>console.error("[editor] mobile preview reload failed",Fr))},B=new Map,W=new Set,X=oMt.then(bPr),Q=TPr({pageDir:t.pageDir,urls:n,machineId:async Xn=>HIt(await X,l()??"guest",Xn),emit:L,log:k,packages:r.packages,saveLock:async(Xn,Fr)=>{await r.write(Xn,WR,Fr),St.touched(Xn,WR),(de==null?void 0:de.id)===Xn&&de.files.set(WR,Fr)},onPackages:(Xn,Fr)=>{if(Fr===null){B.delete(Xn);return}B.set(Xn,Fr);for(const oi of W)oi(Xn,Fr)}});let ee=null,de=null,ce=null,Z=null;async function fe(Xn){var Ya;const Fr=(Ya=(await r.list()).find(Za=>Za.id===Xn))==null?void 0:Ya.previewId;if(Fr!==void 0)return Fr;const oi="p"+Array.from(crypto.getRandomValues(new Uint8Array(16)),Za=>Za.toString(16).padStart(2,"0")).join("");return await r.patch(Xn,{previewId:oi}),oi}async function Ae(Xn){const Fr=new URL("preview/",t.pageDir).href,oi=await caches.open(Ewe);for(const Ya of await oi.keys())Ya.url.startsWith(Fr)&&(Xn===null||!Ya.url.startsWith(Xn))&&await oi.delete(Ya)}let je=0,yt=Promise.resolve(),st=Promise.resolve();const vt=nCr({service:(a==null?void 0:a.services.projects)??null,fetch:(Xn,Fr)=>a===null?Promise.reject(new Error("The assistant service is not configured.")):a.signedFetch(Xn,Fr),wallet:l,mobilePreview:N.status,memory:{read:async(Xn,Fr)=>{const oi=await r.assistantMemory(Xn,Fr);return ic(oi)&&typeof oi.id=="string"&&typeof oi.key=="string"?{id:oi.id,key:oi.key}:null},write:(Xn,Fr,oi)=>r.setAssistantMemory(Xn,Fr,oi)},project:()=>{const Xn=At();return{id:Xn.id,tools:{files:()=>Xn.files,write:(Fr,oi,Ya,Za)=>Mt(Xn.id,Fr,oi,{expected:Ya,signal:Za}),assets:iWt({files:()=>Xn.files}),scene:(Fr,oi)=>lke(Fr,oi,async Ya=>{var ri,yl,Ba;const Za=ss=>{var gs,qs;return JSON.stringify([(gs=ss==null?void 0:ss.scene)==null?void 0:gs.parcels,(qs=ss==null?void 0:ss.scene)==null?void 0:qs.base])};await Ik();const tl=Za(Db(await He(Xn.id,"scene.json")));await Wt(Xn.id,ss=>xCr(ss,Ya));const uu=Db(await He(Xn.id,"scene.json")),ur=Za(uu)!==tl,Pl=((ri=uu==null?void 0:uu.scene)==null?void 0:ri.parcels)??[],fh=(yl=tt.scene)==null?void 0:yl.parcels.map(ss=>`${ss.x},${ss.y}`).sort().join(";");if(ur||fh!==[...Pl].sort().join(";")){if(!await Xn.flush())throw new Error("The scene did not build. Fix the code and retry sceneSettings to load the new parcels.");oi.throwIfAborted();const ss=await fe(Xn.id);ee=yUe(uu??{},Q.realmUrl(ss)),await FPr(Pl,()=>{for(const gs of b)gs(ee)},oi)}else if(ee!==null){const ss=yUe(uu??{},ee.realm);(ss.spawn!==ee.spawn||ss.spawnPoints!==ee.spawnPoints)&&(ee={...ee,spawn:ss.spawn,spawnPoints:ss.spawnPoints},Qhr(ss.spawn,ss.spawnPoints))}return{requiredPermissions:(uu==null?void 0:uu.requiredPermissions)??[],spawnPoints:(uu==null?void 0:uu.spawnPoints)??[],parcels:Pl,base:((Ba=uu==null?void 0:uu.scene)==null?void 0:Ba.base)??null,previewReady:!0}}),written:cWt,view:(Fr,oi)=>Lse(Fr,oi),playtest:aKe,uiLayout:OHe,turnEnded:lHt,build:kOr({saveScene:nWt,fileWrites:()=>st,vendorRuntime:ese,compile:()=>Q.build(Xn.id,new Map(Xn.files)),run:rWt,mobilePreview:N.status})}}}});function mt(){vt.reset(),Z==null||Z(),Z=null,de!==null&&(de.stop(),r.close(de.id),St.flush(de.id),de=null,ce=null)}async function He(Xn,Fr){return(de==null?void 0:de.id)===Xn?de.files.get(Fr):r.read(Xn,Fr).catch(oi=>{if(!bI(oi))throw oi})}function Mt(Xn,Fr,oi,Ya){const Za=st.then(async()=>{if(Ya==null||Ya.signal.throwIfAborted(),Ya!==void 0&&((de==null?void 0:de.id)!==Xn||!uWt(de.files.get(Fr),Ya.expected)))throw new Error("This file changed. Read it again before writing.");await r.write(Xn,Fr,oi),St.touched(Xn,Fr),(de==null?void 0:de.id)===Xn&&(de.files.set(Fr,oi),de.changed(Fr))});return st=Za.catch(tl=>console.error("[editor] file write failed",tl)),Za}function $e(Xn,Fr){const oi=st.then(async()=>{const Ya=await r.remove(Xn,Fr);return Ya&&St.touched(Xn,Fr),Ya&&(de==null?void 0:de.id)===Xn&&de.files.delete(Fr)&&de.changed(Fr),Ya});return st=oi.catch(Ya=>console.error("[editor] file removal failed",Ya)),oi}function Re(Xn){const Fr=At();if(Fr.id!==Xn)throw new Error("that scene is not the one open");return{files:()=>Fr.files,write:(oi,Ya)=>Mt(Xn,oi,Ya),remove:async oi=>{await $e(Xn,oi)}}}async function $t(Xn){var Ya;const Fr=Db(await He(Xn,"scene.json").catch(()=>{})),oi=(((Ya=Fr==null?void 0:Fr.display)==null?void 0:Ya.title)??"").replace(/[\x00-\x1f\x7f]/g,"").replace(new RegExp(TGt.source,"g"),"").trim().slice(0,YPr);return oi===""?Xn:oi}async function xt(Xn,Fr){const oi=(await r.list()).find(Za=>Za.id===Xn);if(oi===void 0)return null;const Ya=await r.duplicate(Xn,`${oi.name} ${Fr}`,St.remoteIds());return await Wt(Ya.id,Za=>{var tl;return{...Za,display:{...Za.display??{},title:`${((tl=Za.display)==null?void 0:tl.title)||oi.name} ${Fr}`}}}),Ya.id}const St=uOr({store:r,session:()=>{const Xn=l();return s===null||Xn===null?null:{api:s,wallet:Xn}},account:()=>s===null?"unavailable":l()===null?"guest":"on",hash:Swe,title:$t,duplicate:async Xn=>{const Fr=await xt(Xn,uNt(new Date));if(Fr===null)throw new Error("The scene is no longer on this device");return Fr}});let ut=!1,Pt=0;async function Ht(){const Xn=++Pt,Fr=l()!==null&&(await vt.shell.aiProviders()).some(oi=>oi.available);Xn!==Pt||Fr===ut||(ut=Fr,Y0())}Ht();let Gt=l();const pt=setInterval(()=>{const Xn=l();Xn!==Gt&&(Gt=Xn,vt.reset(),Y0(),Ht(),St.refresh(!0),Ae(ce).catch(Fr=>console.warn("[editor] could not clear the previews",Fr)))},QPr),Ue=()=>{document.visibilityState==="hidden"&&St.flush()};document.addEventListener("visibilitychange",Ue);const Ke=new Set;async function Wt(Xn,Fr){const oi=Db(await He(Xn,"scene.json"));if(oi===null)throw new Error("scene.json is missing or is not valid JSON");await Mt(Xn,"scene.json",hIt(Fr(oi)))}async function bn(Xn,Fr){if(Fr==null||Fr==="")return null;const oi=await He(Xn,Fr).catch(()=>{});return oi===void 0||oi.length>qPr?null:mIt(Fr,oi)}async function fn(Xn,Fr=St.status().projects){var Ya,Za,tl,uu;const oi=Db(await He(Xn.id,"scene.json").catch(()=>{}));return{sync:Fr[Xn.id],path:Xn.id,name:Xn.name,title:((Ya=oi==null?void 0:oi.display)==null?void 0:Ya.title)||Xn.name,world:((Za=oi==null?void 0:oi.worldConfiguration)==null?void 0:Za.name)||null,parcels:Array.isArray((tl=oi==null?void 0:oi.scene)==null?void 0:tl.parcels)?oi.scene.parcels.length:0,thumbnail:await bn(Xn.id,(uu=oi==null?void 0:oi.display)==null?void 0:uu.navmapThumbnail),favourite:Xn.favourite,lastOpened:Xn.lastOpened,published:Xn.published,deletedAt:Xn.deletedAt??void 0}}async function An(Xn,Fr){var Ya,Za;mt(),f.length=0,L({type:"sessionStarted"});const oi=tl=>{if(mt(),Fr===je){k(`✖ ${tl}`);for(const uu of S)uu(tl)}};try{if(await St.prepareOpen(Xn,(ri,yl)=>k(`Downloading from your account… ${ri}/${yl}`)),Fr!==je)return;if(!await r.open(Xn)){oi("This scene is open in another tab. Close it there to edit it here.");return}const tl=await r.readAll(Xn).then(async ri=>{for(const[yl,Ba]of GEr(ri))await Mt(Xn,yl,Ba),ri.set(yl,Ba);return ri}).catch(ri=>{throw r.close(Xn),ri});if(Fr!==je){r.close(Xn);return}const uu=await fe(Xn);if(Fr!==je){r.close(Xn);return}const ur=Q.open(Xn,tl,uu);de=ur;const Pl=Q.realmUrl(uu);if(ce=Pl,k(`▶ Opening ${((Za=(Ya=Db(ur.files.get("scene.json")))==null?void 0:Ya.display)==null?void 0:Za.title)||Xn}`),!await ur.start()&&!await ur.published()){if(Fr!==je)return;k("✖ The scene did not build.");for(const ri of S)ri("The scene did not build.");return}if(await r.patch(Xn,{lastOpened:Date.now()}),Fr!==je){mt();return}const fh=Db(ur.files.get("scene.json"))??{};ee=yUe(fh,Pl),Z=LPr(ri=>t.engineConsole(ri),k);for(const ri of b)ri(ee)}catch(tl){oi(ZPr(tl))}}function xi(Xn){N.close(),ee=null;const Fr=++je,oi=vt.reset(),Ya=yt.then(async()=>{await oi,await st,Fr===je&&await Xn(Fr)});return yt=Ya.catch(Za=>console.error("[editor] project transition failed",Za)),Ya}function At(){if(de===null)throw new Error("no project is open");return de}const hi={saveFile:async({path:Xn,content:Fr})=>Mt(At().id,Xn,Fr),getFile:async({path:Xn})=>{const Fr=At().files.get(Xn)??sPr(Xn);if(Fr===void 0)throw new Error(`no such file: ${Xn}`);return{content:Fr}},removeFiles:async({filePaths:Xn})=>{const Fr=At(),oi=[],Ya=[];for(const Za of Xn)(await $e(Fr.id,Za).catch(()=>!1)?oi:Ya).push(Za);return{success:oi,failed:Ya}},getFilesSizes:async({path:Xn,ignore:Fr})=>{const oi=Xn===""?"":`${Xn.replace(/\/+$/,"")}/`;return{files:[...At().files.keys()].filter(Za=>Za.startsWith(oi)&&!Za.split("/").some(tl=>Fr.includes(tl))).sort().map(Za=>({path:Za}))}}},lr={async find(Xn){return(await r.list()).some(Fr=>Fr.id===Xn)?!0:(await St.refresh(!0),St.remoteOnly().some(Fr=>Fr.id===Xn))},files:async Xn=>(de==null?void 0:de.id)===Xn?new Map(de.files):r.readAll(Xn),manifest:Xn=>St.manifest(Xn),build:async(Xn,Fr)=>Q.build(Xn,await lr.files(Xn),Fr),dependencies:async Xn=>xGt(await He(Xn,"package.json")),onImported:Xn=>(Ke.add(Xn),()=>Ke.delete(Xn))},ks=a===null?null:YCr({host:a,setWorld:async(Xn,Fr)=>{var Ya,Za;((Za=(Ya=Db(await He(Xn,"scene.json")))==null?void 0:Ya.worldConfiguration)==null?void 0:Za.name)!==Fr&&await Wt(Xn,tl=>({...tl,worldConfiguration:{...tl.worldConfiguration??{},name:Fr}}))},files:Xn=>lr.files(Xn),build:(Xn,Fr)=>Q.build(Xn,Fr,{production:!0}),published:(Xn,Fr)=>r.patch(Xn,{published:Fr})}),Ia=(a==null?void 0:a.services.projects)==null?null:VPr(sOr(a.services.projects,(Xn,Fr)=>a.signedFetch(Xn,Fr)),Swe);L_r(sCr(t.editorBase)),oCr(t.editorBase),dWt({material:cCr,sound:lCr,iconIndex:fCr,iconBlock:pCr}),Hgr(async()=>HPr(await lr.files(At().id)));const lc=mPr({builtin:EOr(t.editorBase,LB("prefabs/catalog.json"),gke),user:()=>Ia!==null&&l()!==null?Ia.tree:null}),kc={...(a==null?void 0:a.services.projects)==null?{}:{...vt.shell,aiOffered:()=>ut,aiTranscript:()=>{const Xn=Gt;if(Xn===null||de===null)return null;const Fr=de.id;return{owner:`${Fr}@${Xn.toLowerCase()}`,load:()=>r.transcript(Fr,Xn),save:oi=>r.setTranscript(Fr,Xn,oi)}}},pickProject:async()=>{},openProject:Xn=>xi(Fr=>An(Xn,Fr)),relaunchProject:Xn=>xi(Fr=>An(Xn,Fr)),closeProject:()=>xi(async()=>{mt(),L({type:"sessionStarted"}),k("■ Scene closed"),await Ae(null).catch(Xn=>console.warn("[editor] could not clear the previews",Xn))}),getState:async()=>{const Xn=await r.list(),Fr=St.status().projects,oi=St.remoteOnly().map(Ya=>({path:Ya.id,name:Ya.name,title:Ya.name,world:null,parcels:0,thumbnail:null,remoteOnly:!0}));return{recentProjects:[...Xn].sort((Ya,Za)=>Za.lastOpened-Ya.lastOpened).map(Ya=>Ya.id),projects:[...await Promise.all(Xn.map(Ya=>fn(Ya,Fr))),...oi],logs:[...f],bevyWebDir:"",editorSceneDir:"",webPort:0,scenePort:0,editorScenePort:0,favourites:Xn.filter(Ya=>Ya.favourite).map(Ya=>Ya.id)}},onStackLog:Xn=>{p.push(Xn)},onBuildEvent:Xn=>{_.push(Xn)},onServersReady:Xn=>{b.push(Xn)},requestReady:async()=>ee,phonePreview:async Xn=>ee===null?{ok:!1,reason:"no-scene"}:N.open(ee.realm,ee.position,Xn),phonePreviewState:N.state,onPhonePreviewState:N.subscribe,closePhonePreview:N.close,capturePhonePreview:N.capture,onServersError:Xn=>{S.push(Xn)},toggleFavourite:async Xn=>{const Fr=(await r.list()).find(oi=>oi.id===Xn);Fr!==void 0&&await r.patch(Xn,{favourite:!Fr.favourite})},deleteProject:async Xn=>{const Fr=await r.trash(Xn);return Fr&&St.trashed(Xn),Fr},trashedProjects:async()=>Promise.all((await r.trashed()).map(Xn=>fn(Xn))),restoreProject:async Xn=>{const Fr=await r.restore(Xn);return Fr&&St.restored(Xn),Fr},syncStatus:async()=>(St.refresh(),St.status()),onSyncStatus:Xn=>St.subscribe(Xn),resolveSyncConflict:(Xn,Fr)=>St.resolve(Xn,Fr),exportProject:async Xn=>wOr(await $t(Xn),await lr.files(Xn)),importProject:async Xn=>{const Fr=await TOr(Xn,async(oi,Ya)=>{const Za=await r.create(oi,Ya,{taken:St.remoteIds()});return St.touched(Za.id,"scene.json"),Za.id});if((Fr==null?void 0:Fr.ok)===!0){const{id:oi,needsPackages:Ya}=Fr.report;Object.keys(Ya).length>0&&r.readAll(oi).then(Za=>Q.install(oi,Za)).catch(Za=>console.warn("[editor] could not install the packages of",oi,Za));for(const Za of Ke)Za(Fr.report)}return Fr},projectPackages:async Xn=>B.get(Xn)??null,onProjectPackages:Xn=>(W.add(Xn),()=>W.delete(Xn)),...ks===null||a===null?{}:{publishScene:(Xn,Fr,oi)=>ks.publish(Xn,Fr,oi),...ks.publishShared===void 0?{}:{publishShared:ks.publishShared},publishStop:async()=>ks.stop(),publishWorlds:async()=>JCr(l(),a.services.worldsContent)},canImportFolder:xOr(),renameProject:(Xn,Fr)=>Wt(Xn,oi=>({...oi,display:{...oi.display??{},title:Fr.trim()}})),duplicateProject:Xn=>xt(Xn,"copy"),sceneTemplates:async()=>rPr(),createScene:async(Xn,Fr,oi)=>{const Ya=LGt(oi),Za=Db(Ya.get("scene.json"));if(Za===null)throw new Error(`template not found: ${oi}`);Ya.set("scene.json",hIt({...Za,display:{...Za.display??{},title:Fr.trim()}}));const tl=await r.create(Fr,Ya,{taken:St.remoteIds()});return St.touched(tl.id,"scene.json"),tl.id},openExternal:async Xn=>{/^https?:$/.test(new URL(Xn).protocol)&&window.open(Xn,"_blank","noopener,noreferrer")},compositeEntityIds:async Xn=>{for(const Fr of yCr){const oi=await He(Xn,Fr);if(oi!==void 0)return vCr(new TextDecoder().decode(oi))}return[]},sceneSettings:async Xn=>{const Fr=Db(await He(Xn,"scene.json"));if(Fr===null)throw new Error("scene.json is missing or is not valid JSON");const oi=hCr(Fr);return{...oi,thumbnail:await bn(Xn,oi.thumbnailPath)}},saveSceneSettings:async(Xn,Fr)=>{const oi=mCr(Fr);return oi!==null?oi:(await Wt(Xn,Ya=>_Cr(Ya,Fr)),null)},pickSceneThumbnail:async Xn=>{const Fr=await MGt(Object.values(iqe).join(","));if(Fr===null)return null;const oi=vGt(Fr.name);if(iqe[oi]===void 0)throw new Error("not a supported image (png, jpg, gif, webp)");const Ya=`${JPr}/scene-thumbnail${oi}`,Za=new Uint8Array(await Fr.arrayBuffer());return await Mt(Xn,Ya,Za),{path:Ya,dataUrl:mIt(Ya,Za)}},appVersion:async()=>KAr,prefabLibraryList:()=>lc.list(),prefabLibraryCopyIn:async(Xn,Fr)=>lc.copyIn(Xn,Re(Fr)),prefabLibraryUpdateCopy:async(Xn,Fr)=>lc.updateCopy(Xn,Re(Fr)),prefabUserLibrary:()=>Ia===null?"unavailable":l()===null?"guest":"on",...Ia===null?{}:{prefabLibraryCopyOut:async(Xn,Fr)=>{if(l()===null)throw new Error(XPr);return Ia.copyOut(Re(Xn),Fr)},prefabLibraryDelete:async Xn=>{const Fr=FGt(Xn);return(Fr==null?void 0:Fr.scope)==="user"&&l()!==null?Ia.remove(Fr.name):!1}}};async function Gl(){const Xn=new Set;for(const Fr of[...await r.list(),...await r.trashed()]){const oi=uGt(await He(Fr.id,WR).catch(()=>{}));for(const Ya of Object.keys((oi==null?void 0:oi.packages)??{}))Xn.add(Ya);for(const[Ya,Za]of Object.entries((oi==null?void 0:oi.dependencies)??{}))Xn.add(u7(Ya,Za))}for(const Fr of await r.packages.keys())Xn.has(Fr)||await r.packages.remove(Fr)}return r.purge(Date.now()-GPr).then(async Xn=>{const Fr=await caches.open(Ewe),oi=Xn.map(({id:Za,previewId:tl})=>Q.realmUrl(tl??Za));for(const Za of await Fr.keys())oi.some(tl=>Za.url.startsWith(tl))&&await Fr.delete(Za);const Ya=await caches.open(XAr);for(const Za of oi)await Ya.delete(`${Za}__storage`);Xn.length>0&&await Gl()}).catch(Xn=>console.warn("[editor] could not empty the trash",Xn)),{shell:kc,projects:lr,dataLayer:hi,dispose:()=>{N.dispose(),vt.dispose(),je++,mt(),Q.dispose(),clearInterval(pt),document.removeEventListener("visibilitychange",Ue),St.flush().finally(()=>St.dispose())}}};let d7=null,jq=null,kre=null,YIt=!1;function eIr(){if(d7!==null)return d7;const t=window.__dclEditorHost;if(t===void 0||t.version!==0&&t.version!==1)return console.error("[editor] window.__dclEditorHost (contract v0 or v1) is missing: nothing to mount into"),null;console.log("[editor] web build 2026-11-03T22:36:20.617Z"),hNt(t),KDt(a=>t.engineConsole(a)),gMt(()=>t.identity()),KYn.needed=!1;const n=KPr({host:t,sceneCompiler:aCr(t.editorBase)});window.editorShell=tIr(n.shell,t),O3t(n.dataLayer??null),uJe();const r=document.createElement("link");return r.rel="stylesheet",r.href=new URL("editor.css",t.editorBase).href,r.integrity=LB("editor.css"),r.crossOrigin="anonymous",r.onerror=()=>console.error("[editor] editor.css did not load or does not match the hash this editor was published with: its fonts are not applied"),document.head.appendChild(r),G1.project=null,G1.notice=null,d7={host:t,web:n,fonts:r},d7}function Pwe(){const t=jq;jq=null,t==null||t.unmount()}function tIr(t,n){const{createScene:r,importProject:a,duplicateProject:s}=t;return{...t,...r===void 0?{}:{createScene:async(l,f,p)=>{const _=await r(l,f,p);return _!==null&&nw("project_created",{project_id:_,source:"template",template:p}),_}},...a===void 0?{}:{importProject:async l=>{const f=await a(l);return(f==null?void 0:f.ok)===!0&&nw("project_created",{project_id:f.report.id,source:"import",import_kind:l}),f}},...s===void 0?{}:{duplicateProject:async l=>{const f=await s(l);return f!==null&&nw("project_created",{project_id:f,source:"duplicate",from_project_id:l}),f}},openProject:async l=>{const f=jq;Pwe(),f==null||f.api.close(),kre??(kre=NBt(n.container,C.jsx(PEr,{}))),n.setMode("edit"),G1.project=l,G1.opens++,await t.openProject(l),nw("project_opened")}}}function nIr(t,n){var p;const r=eIr();if(r===null)return()=>{};Pwe();const a=document.createElement("div");a.style.cssText="position:relative;width:100%;height:100%",DYn(a),t.appendChild(a);const s=NBt(a,C.jsx(LYn,{}),"eui-create-root"),l={api:n,unmount:()=>{s(),a.remove()}};jq=l;const f=YIt?null:((p=zS(r.host))==null?void 0:p.openProject)??null;return YIt=!0,nw("editor_opened",{deep_link:f!==null}),f!==null&&r.web.projects.find(f).catch(()=>!1).then(_=>{var b;jq===l&&(_?(b=window.editorShell)==null||b.openProject(f):G1.notice=`“${f}” is not on this device or on your account. Here are your scenes.`)}),()=>{jq===l&&Pwe()}}function rIr(){Pwe();const t=d7;if(t===null)return;d7=null;const n=Ik();kre==null||kre(),kre=null,t.fonts.remove(),G1.project=null,delete window.editorShell,gMt(null),KDt(null),hNt(null),t.host.setMode("off"),n.finally(()=>{var r,a;(a=(r=t.web).dispose)==null||a.call(r),d7===null&&O3t(null)})}window.__dclEditor={mountHome:nIr,unmount:rIr};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl-regenesislabs/web-editor",
3
- "version": "0.3.24-41731064239.commit-4e4e060",
3
+ "version": "0.3.24-41732005646.commit-bdb4b36",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Decentraland scene editor for the web explorer: editor.js plus the files it loads beside it. Served by version, not installed.",
6
6
  "repository": {
@@ -8,5 +8,5 @@
8
8
  "url": "git+https://github.com/dcl-regenesislabs/web-editor.git",
9
9
  "directory": "packages/web"
10
10
  },
11
- "commit": "4e4e0609af981ab8f3790653568c2f9289154513"
11
+ "commit": "bdb4b365dde7e4b5df190fbd7391428cb73f332e"
12
12
  }