@fps-games/editor-deployment 0.2.3-beta.8 → 0.2.3-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/fps-editor-agent.mjs +3 -3
- package/licenses/THIRD_PARTY_NOTICES.txt +2 -2
- package/manifest.json +56 -56
- package/npm-shrinkwrap.json +2 -2
- package/package.json +5 -5
- package/public/assets/{index-DsjoVi0a.js → index-CdqIKk65.js} +1 -1
- package/public/assets/index-CdqIKk65.js.br +0 -0
- package/public/assets/index-CdqIKk65.js.gz +0 -0
- package/public/assets/playable-sdk-zyPm5JCa.js +8 -0
- package/public/assets/playable-sdk-zyPm5JCa.js.br +0 -0
- package/public/assets/playable-sdk-zyPm5JCa.js.gz +0 -0
- package/public/assets/playable-standard-project-BA5pc2TZ.js +5140 -0
- package/public/assets/playable-standard-project-BA5pc2TZ.js.br +0 -0
- package/public/assets/playable-standard-project-BA5pc2TZ.js.gz +0 -0
- package/public/index.html +3 -3
- package/public/index.html.br +4 -1
- package/public/index.html.gz +0 -0
- package/runtime/editor-control-plane.mjs +5 -5
- package/runtime/runtime-debug-authoring-bridge.mjs +1 -1
- package/worker/editor-service-worker.mjs +24 -24
- package/public/assets/index-DsjoVi0a.js.br +0 -0
- package/public/assets/index-DsjoVi0a.js.gz +0 -0
- package/public/assets/playable-sdk-BhG9wmjo.js +0 -9
- package/public/assets/playable-sdk-BhG9wmjo.js.br +0 -0
- package/public/assets/playable-sdk-BhG9wmjo.js.gz +0 -0
- package/public/assets/playable-standard-project-BMleU1jU.js +0 -5139
- package/public/assets/playable-standard-project-BMleU1jU.js.br +0 -0
- package/public/assets/playable-standard-project-BMleU1jU.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{gg as Hr,Z as cr,Y as Rn,B as _n,F as vn,kj as jt,kx as Cn,kk as dr,c0 as Dn,iC as Mn,jG as On,fQ as Ln,j0 as Nn,he as xn,jO as kn,l7 as Pe,le as ie,iv as jn,a5 as lr,fT as Gn,js as Fn,ab as Be,l3 as Je,ad as pe,k8 as Bn,fD as zn,fN as Un,bJ as $n,cN as Hn,bF as Vn,bH as qn,bK as Yn,bI as Wn,bL as Kn,bM as Jn,u as Xn,n as L,kf as Qn,mN as Zn,bG as ea,mM as ta,mO as ra,h5 as na,l as aa,m as oa,p as ia,E as ur,q as sa,kB as Vr,fZ as Z,ba as qr,b7 as ca,lK as da,kH as la,gu as ua,gi as ma,gh as fa,hb as ga,jd as pa,n4 as Ea,gj as ha,D as Sa,cP as ba,kA as ya,o as Ia,r as Pa,s as Aa,m1 as Ta,jB as wa,aL as mr,jo as fr,mF as gr,mk as Ra,g6 as Se,bk as _a,bj as va,gH as Ca,a3 as pr,mb as Da}from"./playable-standard-project-BMleU1jU.js";import{C as gc,a as pc,b as Ec,c as hc,d as Sc,e as bc,f as yc,g as Ic,h as Pc,i as Ac,j as Tc,k as wc,t as Rc,v as _c,w as vc,x as Cc,y as Dc,z as Mc,A as Oc,G as Lc,H as Nc,I as xc,J as kc,K as jc,L as Gc,M as Fc,N as Bc,O as zc,P as Uc,Q as $c,R as Hc,S as Vc,T as qc,U as Yc,V as Wc,W as Kc,X as Jc,_ as Xc,$ as Qc,a0 as Zc,a1 as ed,a2 as td,a4 as rd,a6 as nd,a7 as ad,a8 as od,a9 as id,aa as sd,ac as cd,ae as dd,af as ld,ag as ud,ah as md,ai as fd,aj as gd,ak as pd,al as Ed,am as hd,an as Sd,ao as bd,ap as yd,aq as Id,ar as Pd,as as Ad,at as Td,au as wd,av as Rd,aw as _d,ax as vd,ay as Cd,az as Dd,aA as Md,aB as Od,aC as Ld,aD as Nd,aE as xd,aF as kd,aG as jd,aH as Gd,aI as Fd,aJ as Bd,aK as zd,aM as Ud,aN as $d,aO as Hd,aP as Vd,aQ as qd,aR as Yd,aS as Wd,aT as Kd,aU as Jd,aV as Xd,aW as Qd,aX as Zd,aY as el,aZ as tl,a_ as rl,a$ as nl,b0 as al,b1 as ol,b2 as il,b3 as sl,b4 as cl,b5 as dl,b6 as ll,b8 as ul,b9 as ml,bb as fl,bc as gl,bd as pl,be as El,bf as hl,bg as Sl,bh as bl,bi as yl,bl as Il,bm as Pl,bn as Al,bo as Tl,bp as wl,bq as Rl,br as _l,bs as vl,bt as Cl,bu as Dl,bv as Ml,bw as Ol,bx as Ll,by as Nl,bz as xl,bA as kl,bB as jl,bC as Gl,bD as Fl,bE as Bl,bN as zl,bO as Ul,bP as $l,bQ as Hl,bR as Vl,bS as ql,bT as Yl,bU as Wl,bV as Kl,bW as Jl,bX as Xl,bY as Ql,bZ as Zl,b_ as eu,b$ as tu,c1 as ru,c2 as nu,c3 as au,c4 as ou,c5 as iu,c6 as su,c7 as cu,c8 as du,c9 as lu,ca as uu,cb as mu,cc as fu,cd as gu,ce as pu,cf as Eu,cg as hu,ch as Su,ci as bu,cj as yu,ck as Iu,cl as Pu,cm as Au,cn as Tu,co as wu,cp as Ru,cq as _u,cr as vu,cs as Cu,ct as Du,cu as Mu,cv as Ou,cw as Lu,cx as Nu,cy as xu,cz as ku,cA as ju,cB as Gu,cC as Fu,cD as Bu,cE as zu,cF as Uu,cG as $u,cH as Hu,cI as Vu,cJ as qu,cK as Yu,cL as Wu,cM as Ku,cO as Ju,cQ as Xu,cR as Qu,cS as Zu,cT as em,cU as tm,cV as rm,cW as nm,cX as am,cY as om,cZ as im,c_ as sm,c$ as cm,d0 as dm,d1 as lm,d2 as um,d3 as mm,d4 as fm,d5 as gm,d6 as pm,d7 as Em,d8 as hm,d9 as Sm,da as bm,db as ym,dc as Im,dd as Pm,de as Am,df as Tm,dg as wm,dh as Rm,di as _m,dj as vm,dk as Cm,dl as Dm,dm as Mm,dn as Om,dp as Lm,dq as Nm,dr as xm,ds as km,dt as jm,du as Gm,dv as Fm,dw as Bm,dx as zm,dy as Um,dz as $m,dA as Hm,dB as Vm,dC as qm,dD as Ym,dE as Wm,dF as Km,dG as Jm,dH as Xm,dI as Qm,dJ as Zm,dK as ef,dL as tf,dM as rf,dN as nf,dO as af,dP as of,dQ as sf,dR as cf,dS as df,dT as lf,dU as uf,dV as mf,dW as ff,dX as gf,dY as pf,dZ as Ef,d_ as hf,d$ as Sf,e0 as bf,e1 as yf,e2 as If,e3 as Pf,e4 as Af,e5 as Tf,e6 as wf,e7 as Rf,e8 as _f,e9 as vf,ea as Cf,eb as Df,ec as Mf,ed as Of,ee as Lf,ef as Nf,eg as xf,eh as kf,ei as jf,ej as Gf,ek as Ff,el as Bf,em as zf,en as Uf,eo as $f,ep as Hf,eq as Vf,er as qf,es as Yf,et as Wf,eu as Kf,ev as Jf,ew as Xf,ex as Qf,ey as Zf,ez as eg,eA as tg,eB as rg,eC as ng,eD as ag,eE as og,eF as ig,eG as sg,eH as cg,eI as dg,eJ as lg,eK as ug,eL as mg,eM as fg,eN as gg,eO as pg,eP as Eg,eQ as hg,eR as Sg,eS as bg,eT as yg,eU as Ig,eV as Pg,eW as Ag,eX as Tg,eY as wg,eZ as Rg,e_ as _g,e$ as vg,f0 as Cg,f1 as Dg,f2 as Mg,f3 as Og,f4 as Lg,f5 as Ng,f6 as xg,f7 as kg,f8 as jg,f9 as Gg,fa as Fg,fb as Bg,fc as zg,fd as Ug,fe as $g,ff as Hg,fg as Vg,fh as qg,fi as Yg,fj as Wg,fk as Kg,fl as Jg,fm as Xg,fn as Qg,fo as Zg,fp as ep,fq as tp,fr as rp,fs as np,ft as ap,fu as op,fv as ip,fw as sp,fx as cp,fy as dp,fz as lp,fC as up,fE as mp,fF as fp,fG as gp,fH as pp,fI as Ep,fJ as hp,fK as Sp,fL as bp,fM as yp,fO as Ip,fP as Pp,fR as Ap,fS as Tp,fU as wp,fV as Rp,fW as _p,fX as vp,fY as Cp,f_ as Dp,f$ as Mp,g0 as Op,g1 as Lp,g2 as Np,g3 as xp,g4 as kp,g5 as jp,g7 as Gp,g8 as Fp,g9 as Bp,ga as zp,gb as Up,gc as $p,gd as Hp,ge as Vp,gf as qp,gk as Yp,gl as Wp,gm as Kp,gn as Jp,go as Xp,gp as Qp,gq as Zp,gr as eE,gs as tE,gt as rE,gv as nE,gw as aE,gx as oE,gy as iE,gz as sE,gA as cE,gB as dE,gC as lE,gD as uE,gE as mE,gF as fE,gG as gE,gI as pE,gJ as EE,gK as hE,gL as SE,gM as bE,gN as yE,gO as IE,gP as PE,gQ as AE,gR as TE,gS as wE,gT as RE,gU as _E,gV as vE,gW as CE,gX as DE,gY as ME,gZ as OE,g_ as LE,g$ as NE,h0 as xE,h1 as kE,h2 as jE,h3 as GE,h4 as FE,h6 as BE,h7 as zE,h8 as UE,h9 as $E,ha as HE,hc as VE,hd as qE,hf as YE,hg as WE,hh as KE,hi as JE,hj as XE,hk as QE,hl as ZE,hm as eh,hn as th,ho as rh,hp as nh,hq as ah,hr as oh,hs as ih,ht as sh,hu as ch,hv as dh,hw as lh,hx as uh,hy as mh,hz as fh,hA as gh,hB as ph,hC as Eh,hD as hh,hE as Sh,hF as bh,hG as yh,hH as Ih,hI as Ph,hJ as Ah,hK as Th,hL as wh,hM as Rh,hN as _h,hO as vh,hP as Ch,hQ as Dh,hR as Mh,hS as Oh,hU as Lh,hV as Nh,hW as xh,hX as kh,hY as jh,hZ as Gh,h_ as Fh,h$ as Bh,i0 as zh,i1 as Uh,i2 as $h,i3 as Hh,i4 as Vh,i5 as qh,i6 as Yh,i7 as Wh,i8 as Kh,i9 as Jh,ia as Xh,ib as Qh,ic as Zh,id as eS,ie as tS,ig as rS,ih as nS,ii as aS,ij as oS,ik as iS,il as sS,im as cS,io as dS,ip as lS,iq as uS,ir as mS,is as fS,it as gS,iu as pS,iw as ES,ix as hS,iy as SS,iz as bS,iA as yS,iB as IS,iD as PS,iE as AS,iF as TS,iG as wS,iH as RS,iI as _S,iJ as vS,iK as CS,iL as DS,iM as MS,iN as OS,iO as LS,iP as NS,iQ as xS,iR as kS,iS as jS,iT as GS,iU as FS,iV as BS,iW as zS,iX as US,iY as $S,iZ as HS,i_ as VS,i$ as qS,j1 as YS,j2 as WS,j3 as KS,j4 as JS,j5 as XS,j6 as QS,j7 as ZS,j8 as eb,j9 as tb,ja as rb,jb as nb,jc as ab,je as ob,jf as ib,jg as sb,jh as cb,ji as db,jj as lb,jk as ub,jl as mb,jm as fb,jn as gb,jp as pb,jq as Eb,jr as hb,jt as Sb,ju as bb,jv as yb,jw as Ib,jx as Pb,jy as Ab,jz as Tb,jA as wb,jC as Rb,jD as _b,jE as vb,jF as Cb,jH as Db,jI as Mb,jJ as Ob,jK as Lb,jL as Nb,jM as xb,jN as kb,jP as jb,jQ as Gb,jR as Fb,jS as Bb,jT as zb,jU as Ub,jV as $b,jW as Hb,jX as Vb,jY as qb,jZ as Yb,j_ as Wb,j$ as Kb,k0 as Jb,k1 as Xb,k2 as Qb,k3 as Zb,k4 as ey,k5 as ty,k6 as ry,k7 as ny,k9 as ay,ka as oy,kb as iy,kc as sy,kd as cy,ke as dy,kg as ly,kh as uy,ki as my,kl as fy,km as gy,kn as py,ko as Ey,kp as hy,kq as Sy,kr as by,ks as yy,kt as Iy,ku as Py,kv as Ay,kw as Ty,ky as wy,kz as Ry,kC as _y,kD as vy,kE as Cy,kF as Dy,kG as My,kI as Oy,kJ as Ly,kK as Ny,kL as xy,kM as ky,kN as jy,kO as Gy,kP as Fy,kQ as By,kR as zy,kS as Uy,kT as $y,kU as Hy,kV as Vy,kW as qy,kX as Yy,kY as Wy,kZ as Ky,k_ as Jy,k$ as Xy,l0 as Qy,l1 as Zy,l2 as eI,l4 as tI,l5 as rI,l6 as nI,l8 as aI,l9 as oI,la as iI,lb as sI,lc as cI,ld as dI,lf as lI,lg as uI,lh as mI,li as fI,lj as gI,lk as pI,ll as EI,lm as hI,ln as SI,lo as bI,lp as yI,lq as II,lr as PI,ls as AI,lt as TI,lu as wI,lv as RI,lw as _I,lx as vI,ly as CI,lz as DI,lA as MI,lB as OI,lC as LI,lD as NI,lE as xI,lF as kI,lG as jI,lH as GI,lI as FI,lJ as BI,lL as zI,lM as UI,lN as $I,lO as HI,lP as VI,lQ as qI,lR as YI,lS as WI,lT as KI,lU as JI,lV as XI,lW as QI,lX as ZI,lY as eP,lZ as tP,l_ as rP,l$ as nP,m0 as aP,m2 as oP,m3 as iP,m4 as sP,m5 as cP,m6 as dP,m7 as lP,m8 as uP,m9 as mP,ma as fP,mc as gP,md as pP,me as EP,mf as hP,mg as SP,mh as bP,mi as yP,mj as IP,ml as PP,mm as AP,mn as TP,mo as wP,mp as RP,mq as _P,mr as vP,ms as CP,mt as DP,mu as MP,mv as OP,mw as LP,mx as NP,my as xP,mz as kP,mA as jP,mB as GP,mC as FP,mD as BP,mE as zP,mG as UP,mH as $P,mI as HP,mJ as VP,mK as qP,mL as YP,mP as WP,mQ as KP,mR as JP,mS as XP,mT as QP,mU as ZP,mV as eA,mW as tA,mX as rA,mY as nA,mZ as aA,m_ as oA,m$ as iA,n0 as sA,n1 as cA,n2 as dA,n3 as lA,n5 as uA,n6 as mA,n7 as fA,n8 as gA,n9 as pA,na as EA,nb as hA,nc as SA,nd as bA,ne as yA,nf as IA}from"./playable-standard-project-BMleU1jU.js";import"./dynamicTexture-Cuby-VOT.js";import"@fps-games/editor-core/plugin-host";function Cs(e,t){const r=Hr(e),a=Ma(t),n=r.revision??null;if(!a)return{detected:!0,sourceId:r.sourceId,sourceType:r.sourceType,sourceRevision:n,generatedRevision:null,reason:"missing-generated-from"};const o=typeof a.revision=="number"?a.revision:null;return a.sourceId!==r.sourceId||a.sourceType!==r.sourceType?{detected:!0,sourceId:r.sourceId,sourceType:r.sourceType,sourceRevision:n,generatedRevision:o,reason:"source-mismatch"}:n!==o?{detected:!0,sourceId:r.sourceId,sourceType:r.sourceType,sourceRevision:n,generatedRevision:o,reason:"revision-mismatch"}:{detected:!1,sourceId:r.sourceId,sourceType:r.sourceType,sourceRevision:n,generatedRevision:o}}function Ma(e){if(!e||typeof e!="object")return null;const t=e.meta;if(!t||typeof t!="object")return null;const r=t.generatedFrom;if(!r||typeof r!="object")return null;const a=r.sourceId,n=r.sourceType;return typeof a!="string"||typeof n!="string"?null:{sourceId:a,sourceType:n,revision:typeof r.revision=="number"?r.revision:void 0}}function Oa(e){const{document:t,runtimePatch:r}=e,a=e.getSourceRef?.(t)??Hr(t),n=r.sourceBinding;if(!r.applyable||!n||r.applyTarget!==cr||n.sourceId!==Rn||n.sourceType!==cr||n.sourceId!==a.sourceId||n.sourceType!==a.sourceType)return null;const o=n.objectId;if(!o||!e.findGameObject(t,o)||e.isRootGameObjectId?.(o))return null;const i=r.after;return La(i)?{label:r.label??`Apply runtime transform ${o}`,patch:e.createPatch(o,i)}:null}function Ds(e,t){return Oa({document:e,runtimePatch:t,findGameObject:(r,a)=>r.scene.gameObjects.find(n=>n.id===a)??null,isRootGameObjectId:r=>r==="root",createPatch:(r,a)=>({kind:"game-object.transform",targetId:r,transform:a})})}function La(e){if(!e||typeof e!="object")return!1;const t=e;return Rt(t.position)&&Rt(t.rotation)&&Rt(t.scale)}function Rt(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.x=="number"&&Number.isFinite(t.x)&&typeof t.y=="number"&&Number.isFinite(t.y)&&typeof t.z=="number"&&Number.isFinite(t.z)}const Yr="fps-editor.lighting-debug.open",Wr="fps-editor.lighting-debug.language",Na=[{field:"environmentIntensity",textKey:"intensity",tooltipKey:"environmentIntensity",step:.01,min:0},{field:"iblIntensity",textKey:"iblIntensity",tooltipKey:"iblIntensity",step:.01,min:0,max:4},{field:"iblRotationY",textKey:"iblRotationY",tooltipKey:"iblRotationY",step:.01},{field:"directionalIntensity",textKey:"intensity",tooltipKey:"directionalIntensity",step:.01,min:0},{field:"directionalHorizontalAngle",textKey:"horizontalAngle",tooltipKey:"horizontalAngle",step:.01,min:-180,max:180},{field:"directionalElevationAngle",textKey:"elevationAngle",tooltipKey:"elevationAngle",step:.01,min:vn,max:_n},{field:"shadowStrength",textKey:"shadowStrength",tooltipKey:"shadowStrength",step:.01,min:0,max:1},{field:"shadowSoftness",textKey:"shadowSoftness",tooltipKey:"shadowSoftness",step:.005,min:0,max:1}];function be(e){const t=Na.find(r=>r.field===e);if(!t)throw new Error(`Missing lighting number field config: ${e}`);return t}function _t(e){const t=e.trim();if(!t||/^[+-]$/.test(t)||t.endsWith(".")||/[eE][+-]?$/.test(t))return null;const r=Number(t);return Number.isFinite(r)?r:null}const Er={zh:{title:"光照调试",runtime:"运行时",languageButton:"EN",toggleTitle:"打开光照调试面板",environmentSection:"环境光",environmentTextureSection:"环境贴图 IBL",directionalSection:"直射光",shadowSection:"阴影外观",enabled:"启用",intensity:"强度",iblIntensity:"IBL 强度",iblRotationY:"IBL 旋转",skyLightColor:"天空光颜色",groundColor:"地面颜色",horizontalAngle:"水平角",elevationAngle:"高度角",lightColor:"光照颜色",rawDirection:"原始方向",shadowReadout:"阴影",shadowStrength:"阴影强度",shadowSoftness:"轮廓柔和度",shadowMap:"Shadow Map",shadowPlanarFollow:"Planar / 跟随直射光",shadowDynamic:"动态阴影",shadowBlob:"Blob 阴影",shadowStatic:"静态烘焙阴影",shadowNone:"Off",shadowUnknown:"Unknown",reset:"重置参数",save:"保存参数",resetStatus:"已重置为初始运行时光照。",savingStatus:"正在保存光照、IBL 和阴影参数...",savedStatus:"已保存光照、IBL 和阴影参数。",saveFailed:"保存失败",missingBindingStatus:"缺少光源绑定,只能临时预览,不能保存。"},en:{title:"Lighting Debug",runtime:"Runtime",languageButton:"中文",toggleTitle:"Toggle lighting debug panel",environmentSection:"Environment Light",environmentTextureSection:"Environment Texture IBL",directionalSection:"Directional Light",shadowSection:"Shadow Appearance",enabled:"Enabled",intensity:"Intensity",iblIntensity:"IBL Intensity",iblRotationY:"IBL Rotation",skyLightColor:"Sky Light Color",groundColor:"Ground Color",horizontalAngle:"Horizontal Angle",elevationAngle:"Elevation Angle",lightColor:"Light Color",rawDirection:"Raw Direction",shadowReadout:"Shadow",shadowStrength:"Shadow Strength",shadowSoftness:"Edge Softness",shadowMap:"Shadow Map",shadowPlanarFollow:"Planar / Follow Directional Light",shadowDynamic:"Dynamic Shadow",shadowBlob:"Blob Shadow",shadowStatic:"Static Baked Shadow",shadowNone:"Off",shadowUnknown:"Unknown",reset:"Reset",save:"Save Parameters",resetStatus:"Reset to initial runtime lighting.",savingStatus:"Saving lighting, IBL and shadows...",savedStatus:"Saved lighting, IBL and shadows.",saveFailed:"Save failed",missingBindingStatus:"Light binding missing; preview only, saving disabled."}},hr={zh:{languageButton:"切换光照调试面板的显示语言。",toggleTitle:"打开或关闭运行时光照调试面板。",enabled:"启用或禁用对应的运行时光源,保存后写回编辑器场景。",environmentIntensity:"环境光强度,对应运行时环境光 intensity。",iblIntensity:"环境贴图对 PBR 材质的光照贡献强度;实时预览不会重新加载贴图。",iblRotationY:"环境贴图绕 Y 轴的旋转弧度,用于调整环境反射和高光方向。",directionalIntensity:"直射光强度,对应运行时直射光 intensity。",skyLightColor:"环境光来自天空方向的漫反射颜色。",groundColor:"环境光来自地面反射方向的颜色。",horizontalAngle:"直射光在 XZ 平面内的朝向角度,会转换为运行时方向向量。",elevationAngle:"直射光相对地平线的高度角;90 度表示从正上方照下。",lightColor:"直射光漫反射颜色。",rawDirection:"只读方向向量,用于排查运行时转换结果。",shadowReadout:"只读阴影状态;支持宿主提供的运行时阴影模式摘要。",shadowStrength:"控制阴影的可见深浅;1 最深,0 不显示阴影。",shadowSoftness:"控制阴影接收边缘的柔和程度;0 表示硬边。",reset:"恢复为打开运行时时读取到的初始光照、IBL 和阴影参数。",save:"通过编辑器保存链路写回环境光、直射光、IBL 和 Shadow Map 外观参数。"},en:{languageButton:"Switch the lighting debug panel language.",toggleTitle:"Open or close the runtime lighting debug panel.",enabled:"Enable or disable the runtime light and save it back to the editor scene.",environmentIntensity:"Environment intensity. Maps to the runtime environment light intensity.",iblIntensity:"Environment texture contribution to PBR lighting. Live preview does not reload the texture.",iblRotationY:"Environment texture rotation around the Y axis in radians, affecting reflections and highlights.",directionalIntensity:"Directional intensity. Maps to the runtime directional light intensity.",skyLightColor:"Diffuse sky color for the environment light.",groundColor:"Ground bounce color for the environment light.",horizontalAngle:"Directional heading in the XZ plane, converted to a runtime direction vector.",elevationAngle:"Directional elevation above the horizon; 90 degrees points straight down.",lightColor:"Directional diffuse color.",rawDirection:"Read-only direction vector for checking runtime conversion.",shadowReadout:"Read-only shadow status supplied by the host runtime.",shadowStrength:"Visible shadow strength. One is darkest; zero hides the shadow.",shadowSoftness:"Receiver-edge softness. Zero produces a hard edge.",reset:"Restore the lighting, IBL and shadows captured when runtime opened.",save:"Save lighting, IBL and Shadow Map appearance through the editor authoring pipeline."}};function xa(e){return Er[e]??Er.zh}function ka(e){return hr[e]??hr.zh}function ja(e,t){return e==="shadow-map"?t.shadowMap:e==="planar"?t.shadowPlanarFollow:e==="dynamic"?t.shadowDynamic:e==="blob"?t.shadowBlob:e==="static"?t.shadowStatic:e==="none"?t.shadowNone:t.shadowUnknown}function Ga(e){try{return e?.localStorage?.getItem(Yr)==="true"}catch{return!1}}function Fa(e,t){try{e?.localStorage?.setItem(Yr,String(t))}catch{}}function Ba(e){try{return e?.localStorage?.getItem(Wr)==="en"?"en":"zh"}catch{return"zh"}}function za(e,t){try{e?.localStorage?.setItem(Wr,t)}catch{}}function Ms(e,t){const r=Sr(Sr(e)?.__fpsEditor),a=ce(r?.sourceId),n=ce(r?.objectGuid),o=ce(r?.objectId),i=ce(r?.propertyPath),s=ce(r?.lightType);return!a||i!=="light"||!n&&!o||t&&s&&s!==t?null:{sourceId:a,propertyPath:"light",...t?{lightType:t}:s?{lightType:s}:{},...n?{objectGuid:n}:{},...o?{objectId:o}:{}}}function Ua(e){const t=ce(e.sourceId),r=ce(e.propertyPath),a=ce(e.objectGuid),n=ce(e.objectId),o=ce(e.lightType);if(!t)throw new Error("Runtime light binding is missing sourceId.");if(r!=="light")throw new Error(`Runtime light binding is not for light: ${r??"missing"}`);if(!a&&!n)throw new Error("Runtime light binding is missing objectGuid/objectId.");return{sourceId:t,propertyPath:r,...a?{objectGuid:a}:{},...n?{objectId:n}:{},...o?{lightType:o}:{}}}function Sr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ce(e){return typeof e=="string"&&e.trim()?e.trim():null}function Ie(e){return{environment:{enabled:e.environment.enabled,binding:e.environment.binding?{...e.environment.binding}:null,light:{type:"hemispheric",intensity:e.environment.light.intensity,...e.environment.light.diffuseColor?{diffuseColor:{...e.environment.light.diffuseColor}}:{},...e.environment.light.groundColor?{groundColor:{...e.environment.light.groundColor}}:{}}},...e.environmentTexture?{environmentTexture:{...e.environmentTexture}}:{},directional:{enabled:e.directional.enabled,binding:e.directional.binding?{...e.directional.binding}:null,light:{type:"directional",intensity:e.directional.light.intensity,direction:{...e.directional.light.direction},...e.directional.light.diffuseColor?{diffuseColor:{...e.directional.light.diffuseColor}}:{}}},shadow:{...e.shadow,...e.shadow.shadowMap?{shadowMap:{...e.shadow.shadowMap,lastRefreshReasons:[...e.shadow.shadowMap.lastRefreshReasons],...e.shadow.shadowMap.appearance?{appearance:{...e.shadow.shadowMap.appearance}}:{}}}:{}}}}function gt(e){return!!e.environment.binding&&!!e.directional.binding}function Os(e){return gt(e)?[{binding:e.environment.binding,enabled:e.environment.enabled,light:e.environment.light},{binding:e.directional.binding,enabled:e.directional.enabled,light:e.directional.light}]:[]}function ze(e,t){switch(t){case"environmentIntensity":return e.environment.light.intensity;case"iblIntensity":return e.environmentTexture?.iblIntensity??0;case"iblRotationY":return e.environmentTexture?.iblRotationY??0;case"directionalIntensity":return e.directional.light.intensity;case"directionalHorizontalAngle":return jt(e.directional.light.direction).horizontalAngleDeg;case"directionalElevationAngle":return jt(e.directional.light.direction).elevationAngleDeg;case"shadowStrength":return e.shadow.shadowMap?.appearance?.strength??0;case"shadowSoftness":return e.shadow.shadowMap?.appearance?.softness??0}}function br(e,t){switch(t){case"environmentDiffuseColor":return e.environment.light.diffuseColor??{r:1,g:1,b:1};case"environmentGroundColor":return e.environment.light.groundColor??{r:.48,g:.52,b:.62};case"directionalDiffuseColor":return e.directional.light.diffuseColor??{r:1,g:1,b:1}}}function $a(e,t,r){if(!Number.isFinite(r))return Ie(e);const a=Ie(e);switch(t){case"environmentIntensity":return a.environment.light.intensity=r,a;case"iblIntensity":return a.environmentTexture&&(a.environmentTexture.iblIntensity=r),a;case"iblRotationY":return a.environmentTexture&&(a.environmentTexture.iblRotationY=r),a;case"directionalIntensity":return a.directional.light.intensity=r,a;case"directionalHorizontalAngle":{const n=dr(e.directional.light.direction);return yr(a,r,n.elevationAngleDeg)}case"directionalElevationAngle":{const n=dr(e.directional.light.direction);return yr(a,n.horizontalAngleDeg,r)}case"shadowStrength":{const n=a.shadow.shadowMap?.appearance;return n&&(n.strength=r,n.darkness=1-r),a}case"shadowSoftness":return a.shadow.shadowMap?.appearance&&(a.shadow.shadowMap.appearance.softness=r),a}}function Ha(e,t,r){const a=Ie(e);switch(t){case"environmentDiffuseColor":return a.environment.light.diffuseColor={...r},a;case"environmentGroundColor":return a.environment.light.groundColor={...r},a;case"directionalDiffuseColor":return a.directional.light.diffuseColor={...r},a}}function Va(e,t,r){const a=Ie(e);return a[t].enabled=r,a}function yr(e,t,r){const a=Dn(t,r);return qa(e,a)}function qa(e,t){const r=Ie(e);return r.directional.light.direction={...t},r.shadow.projectedLengthMultiplier=Cn(t),r}function Kr(e,t){const r=typeof t?.materialAssetId=="string"?t.materialAssetId.trim():"",a=r?e.scene.materialAssets?.find(o=>o.id===r)??null:null,n=Mn(a?.properties,t?.override);return{materialAsset:a,...a?{materialAssetShaderId:a.shaderId}:{},profile:n,...r&&!a?{missingMaterialAssetId:r}:{}}}function Ls(e,t){const r=Kr(e,t.overrides?.materialBinding),a={},n=On(r.materialAssetShaderId);return n&&(Object.keys(r.profile).length>0?(a.artistMaterialShaderId=n,a.artistMaterialProfile=r.profile):a.artistMaterialShaderId=n),a}function Ns(e,t){const r={},a=t.overrides?.materialSlotBindings??{};for(const[n,o]of Object.entries(a)){if(!n||!o)continue;const i=Kr(e,o);Object.keys(i.profile).length!==0&&(r[n]=i.profile)}return r}function xs(e,t){const r=Ya(t),a=[];for(const n of e.inspector.fields){if(n.control!=="color"||n.updateClass!=="uniform")continue;const o=Wa(e,n.schemaPath??n.path);if(o?.kind!=="color")continue;const i=o.channels===4?"vec4":"vec3",s=r.get(n.binding);if(!s){a.push({code:"material.shaderColorBindingMissing",path:n.path,binding:n.binding,expectedType:i,message:`GLSL uniform ${n.binding} is missing; expected ${i}.`});continue}s!==i&&a.push({code:"material.shaderColorBindingTypeMismatch",path:n.path,binding:n.binding,expectedType:i,actualType:s,message:`GLSL uniform ${n.binding} uses ${s}; Shader Definition expects ${i}.`})}return a}function Ya(e){const t=e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*$/gm,""),r=new Map,a=/\buniform\s+(?:(?:lowp|mediump|highp)\s+)?([A-Za-z_]\w*)\s+([A-Za-z_]\w*)\s*(?:\[[^\]]+\])?\s*;/g;for(const n of t.matchAll(a))r.set(n[2],n[1]);return r}function Wa(e,t){const r=t.replace(/^properties\./,"").split(".").filter(Boolean);let a=e.propertiesSchema;for(const n of r){if(a.kind!=="object")return null;const o=a.properties[n];if(!o)return null;a=o}return a}function ks(e,t,r={}){const a=Jr(e);let n=Ln(e);const o=[];for(const i of t){const s=Ja(i),l=Ua(s.binding);if(r.expectedSourceId&&l.sourceId!==r.expectedSourceId)throw new Error(`Runtime light binding source mismatch: ${l.sourceId} !== ${r.expectedSourceId}`);const d=Ka(n,l,a);if(!d)throw new Error("Runtime light binding did not match an editor light object.");Za(d,s.light.type,l),n=Ue(n,d.id,"enabled",s.enabled,r),n=Ue(n,d.id,"light.intensity",s.light.intensity,r),s.light.diffuseColor&&(n=Ue(n,d.id,"light.diffuseColor",s.light.diffuseColor,r)),s.light.type==="hemispheric"?s.light.groundColor&&(n=Ue(n,d.id,"light.groundColor",s.light.groundColor,r)):n=Ue(n,d.id,"light.direction",s.light.direction,r),o.push({id:d.id,...d.guid?{objectGuid:d.guid}:{},lightType:s.light.type})}return{document:n,targets:o}}function Ka(e,t,r=Jr(e)){if(t.objectGuid){const o=e.scene.gameObjects.find(i=>i.guid===t.objectGuid)??null;if(o){if(t.objectId&&o.id!==t.objectId)throw new Error(`Runtime light binding guid/id conflict: ${t.objectGuid} belongs to ${o.id}, not ${t.objectId}.`);return o}}if(!t.objectId)return null;const a=e.scene.gameObjects.find(o=>o.id===t.objectId)??null;if(!a)return null;const n=r.get(a.id);if(t.objectGuid&&n&&n!==t.objectGuid)throw new Error(`Runtime light binding guid conflict for ${a.id}.`);return a}function Ja(e){const t=eo(e.enabled,"enabled");return e.light.type==="hemispheric"?{binding:e.binding,enabled:t,light:Xa(e.light)}:{binding:e.binding,enabled:t,light:Qa(e.light)}}function Xa(e){if(e.type!=="hemispheric")throw new Error("Runtime light patch must be hemispheric.");return{type:"hemispheric",intensity:Xr(e.intensity,"hemispheric.intensity"),...e.diffuseColor?{diffuseColor:Gt(e.diffuseColor,"hemispheric.diffuseColor")}:{},...e.groundColor?{groundColor:Gt(e.groundColor,"hemispheric.groundColor")}:{}}}function Qa(e){if(e.type!=="directional")throw new Error("Runtime light patch must be directional.");return{type:"directional",intensity:Xr(e.intensity,"directional.intensity"),direction:Nn(to(e.direction,"directional.direction")),...e.diffuseColor?{diffuseColor:Gt(e.diffuseColor,"directional.diffuseColor")}:{}}}function Ue(e,t,r,a,n){return n.patchLightField?n.patchLightField(e,t,r,a):kn(e,t,r,a,n.fieldMutation)}function Za(e,t,r){if(!xn(e))throw new Error(`Runtime light binding target is not a light object: ${e.id}`);if(!e.light)throw new Error(`Runtime light binding target is missing light config: ${e.id}`);if(e.light.type!==t)throw new Error(`Runtime light binding type mismatch for ${e.id}: ${e.light.type} !== ${t}`);if(r.lightType&&r.lightType!==t)throw new Error(`Runtime light binding metadata type mismatch: ${r.lightType} !== ${t}`)}function Jr(e){const t=new Map;for(const r of e.scene.gameObjects){const a=ro(r.guid);a&&t.set(r.id,a)}return t}function eo(e,t){if(typeof e!="boolean")throw new Error(`Runtime light ${t} must be a boolean.`);return e}function Xr(e,t){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new Error(`Runtime light ${t} must be a non-negative finite number.`);return e}function Gt(e,t){return{r:xe(e.r,`${t}.r`),g:xe(e.g,`${t}.g`),b:xe(e.b,`${t}.b`)}}function to(e,t){return{x:xe(e.x,`${t}.x`),y:xe(e.y,`${t}.y`),z:xe(e.z,`${t}.z`)}}function xe(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Error(`Runtime light ${t} must be a finite number.`);return e}function ro(e){return typeof e=="string"&&e.trim()?e.trim():null}function Qr(e){const t=typeof e=="string"&&e.trim()?e.trim():void 0;if(!t)return;if(t.includes("\0"))throw new Error("external_asset_path_must_be_portable");const r=t.replace(/\\/g,"/");if(r.startsWith("/")||/^[a-z]:\//i.test(r)||/^[a-z][a-z0-9+.-]*:/i.test(r))throw new Error("external_asset_path_must_be_portable");const a=[];for(const n of r.split("/"))if(!(!n||n===".")){if(n==="..")throw new Error("external_asset_path_must_be_portable");a.push(n)}if(a.length===0)throw new Error("external_asset_path_must_be_portable");return a.join("/")}function Ae(e){return Zr(e)[0]??null}function Zr(e){return Array.isArray(e.assets)?e.assets.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):[]}function Ht(e){const t=Ae(e),r=C(e.assetType)??C(t?.assetType)??C(t?.type)??C(t?.kind);if(r&&/^(texture|image|png|jpg|jpeg|webp)$/i.test(r)||(C(e.mimeType)??C(t?.mimeType))?.toLowerCase().startsWith("image/"))return"texture";const n=en(e)??Ft(yt(e)??"")??Ft(Ye(e)??"");return n&&co(n)?"texture":"model"}function yt(e){const t=Ae(e),r=C(e.assetPath)??C(t?.assetPath)??C(e.path)??C(t?.path);if(r)return Ir(r);const a=Ye(e);return a?.startsWith("/@fs/")?Ir(a.slice(4)):null}function Ye(e){const t=Ae(e);return C(e.assetUrl)??C(t?.assetUrl)??C(t?.url)??null}function en(e){const t=Ae(e);return C(e.assetName)??C(t?.assetName)??C(t?.name)??null}function Vt(e){const t=Ae(e);return C(e.platformAssetId)??C(t?.platformAssetId)??C(e.assetId)??C(t?.assetId)??C(t?.id)??null}function ve(e){const t=Pr(e.external),r=Ae(e),a=Pr(r?.external),n=C(t.platformAssetId)??C(a.platformAssetId)??Vt(e),o=Object.prototype.hasOwnProperty.call(t,"assetPath")||Object.prototype.hasOwnProperty.call(a,"assetPath"),i=Object.prototype.hasOwnProperty.call(t,"assetPath")?t.assetPath:Object.prototype.hasOwnProperty.call(a,"assetPath")?a.assetPath:void 0;if(o&&i===void 0)throw new Error("external_asset_path_must_be_portable");const s=C(t.assetUrl)??Ye(e)??void 0;return io({platformAssetId:n,assetPath:i,assetUrl:s})}function no(e,t={}){const r=at(e.position),a=r?null:qt(e),n=a?t.projectDropPoint?.(a)??null:null;if(!r&&a&&!n)throw new Error("platform_asset_drop_point_projection_failed");const o=r??n;if(o)return{position:o,rotation:at(e.rotation)??{x:0,y:0,z:0},scale:at(e.scale)??at(e.instanceScale)??{x:1,y:1,z:1}}}function ao(e,t={}){const r=yt(e);if(!r)throw new Error("assetPath is required to register a new project asset");const a=Ht(e),n=C(e.projectAssetId),o=Vt(e),i=en(e),s=C(e.displayName),l=i??Ft(r)??`asset${a==="texture"?".png":".glb"}`,d=t.now?.()??Date.now(),S=t.payloadPath??t.createPayloadPath?.({platformAssetId:o,projectAssetId:n,now:d})??`/tmp/playable-editor-asset-${o??n??d.toString(36)}-${d.toString(36)}.json`,c={sourcePath:r,assetPath:r,assetType:a,...Ye(e)?{assetUrl:Ye(e)}:{},...C(e.guid)?{guid:C(e.guid)}:{},...n?{projectAssetId:n}:{},...o?{platformAssetId:o}:{},external:ve(e),...!t.preserveExistingPresentation||i?{assetName:l}:{},...!t.preserveExistingPresentation||s?{displayName:s??oo(l)}:{},...C(e.codeKey)?{codeKey:C(e.codeKey)}:{},...C(e.category)?{category:C(e.category)}:{},...e.defaultScale!=null?{defaultScale:e.defaultScale}:{},...e.scale!=null?{scale:e.scale}:{},...e.metadata&&typeof e.metadata=="object"&&!Array.isArray(e.metadata)?{metadata:e.metadata}:{}};return{payloadPath:S,content:c,assetName:l,assetType:a,...n?{projectAssetId:n}:{},...o?{platformAssetId:o}:{}}}function oo(e){return e.replace(/\.(glb|gltf|png|jpe?g|webp)$/i,"")}function Ir(e){return e.startsWith("/@fs/")?e.slice(4):e}function qt(e){const t=e.point;if(!t||typeof t!="object")return null;const r=t,a=typeof r.x=="number"&&Number.isFinite(r.x)?r.x:null,n=typeof r.y=="number"&&Number.isFinite(r.y)?r.y:null;if(a==null||n==null)throw new Error("platform_asset_drop_point_invalid_coordinates");if(r.space==="iframe-client-css-px")return{space:r.space,x:a,y:n};if(r.space==="scene-view-normalized"){if(a<0||a>1||n<0||n>1)throw new Error("platform_asset_drop_point_normalized_out_of_range");return{space:r.space,x:a,y:n}}throw new Error("platform_asset_drop_point_space_required")}function io(e){const t=C(e.platformAssetId),r=so(e.assetPath),a=C(e.assetUrl);if(!(!t&&!r&&!a))return{...t?{platformAssetId:t}:{},...r?{assetPath:r}:{},...a?{assetUrl:a}:{}}}function so(e){if(e===void 0)return;const t=Qr(e);if(!t)throw new Error("external_asset_path_must_be_portable");return t}function at(e){if(!e||typeof e!="object")return null;const t=e,r=typeof t.x=="number"&&Number.isFinite(t.x)?t.x:null,a=typeof t.y=="number"&&Number.isFinite(t.y)?t.y:null,n=typeof t.z=="number"&&Number.isFinite(t.z)?t.z:null;return r==null||a==null||n==null?null:{x:r,y:a,z:n}}function co(e){return/\.(png|jpe?g|webp)$/i.test(lo(e))}function Ft(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??null}function lo(e){return e.split("?")[0]??e}function C(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Pr(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function js(e={}){const t=e.ttlMs??3e4,r=e.now??(()=>Date.now()),a=new Map;return{remember(n){const o=qt(n);for(const i of Zr(n)){const s=Ar(i);if(s.length===0)continue;const l={point:o??void 0,asset:i,timestamp:r()};for(const d of s)a.set(d,l)}vt(a,t,r())},normalize(n){vt(a,t,r());const o=Ae(n);if(!o)return n;const i=Ar(o),s=i.map(l=>a.get(l)).find(l=>!!l)??null;for(const l of i)a.delete(l);return uo(n,s)},clearExpired(){vt(a,t,r())}}}function uo(e,t){const r=Ae(e);if(!r)return e;const a=t?.asset??{},n={...a,...r,...e},o=z(e.assetName)??z(r.assetName)??z(r.name)??z(a.assetName)??z(a.name),i=z(e.assetPath)??z(r.assetPath)??z(r.path)??z(a.assetPath)??z(a.path),s=z(e.assetUrl)??z(r.assetUrl)??z(r.url)??z(a.assetUrl)??z(a.url);return{...n,...o?{assetName:o}:{},...i?{assetPath:i}:{},...s?{assetUrl:s}:{},...t?.point&&!qt(n)?{point:t.point}:{}}}function vt(e,t,r){for(const[a,n]of e)r-n.timestamp>t&&e.delete(a)}function Ar(e){return[z(e.id),z(e.platformAssetId),z(e.assetId)].filter((t,r,a)=>!!t&&a.indexOf(t)===r)}function z(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function mo(e){const t=Pe(e);return Pe(t?.result)??t??{}}function tn(e){const t=mo(e.result),r=e.fallback??{},a=Pe(t.external),n=a?ve({external:a}):void 0;return{...ie(t.guid)??r.guid?{guid:ie(t.guid)??r.guid}:{},assetId:ie(t.assetId)??r.assetId??"",...ie(t.contentHash)??r.contentHash?{contentHash:ie(t.contentHash)??r.contentHash}:{},...ie(t.assetUrl)??r.assetUrl?{assetUrl:ie(t.assetUrl)??r.assetUrl}:{},...n??r.external?{external:n??r.external}:{}}}function fo(e,t){const r=ao(e,t);return{registration:r,transportPlan:{writes:[{path:r.payloadPath,content:r.content}],commands:[go(r.payloadPath,t)]}}}function go(e,t){if(typeof t.command=="string")return{cmd:`${t.command} -- --payload ${e}`,...t.cwd?{cwd:t.cwd}:{}};if(t.command)return{...t.command,cmd:t.command.cmd.includes("--payload")?t.command.cmd:`${t.command.cmd} -- --payload ${e}`};if(!t.commandName)throw new Error("asset registration commandName or command is required");return{cmd:`${t.commandName} -- --payload ${e}`,cwd:t.cwd??"."}}async function po(e,t){const r=await t.findExistingAsset?.(e);return r||rn(e,t)}async function rn(e,t){const r=yt(e),a=ie(e.projectAssetId);if(!r&&a)return{assetId:a,...ve(e)?{external:ve(e)}:{}};if(!r)throw new Error("assetPath is required to register a new project asset");const{registration:n,transportPlan:o}=fo(e,{...t,preserveExistingPresentation:!0});for(const s of o.writes)await t.writeFile(s.path,s.content);let i={};for(const s of o.commands)i=await t.runCommand(s);return tn({result:i,fallback:{assetId:a??"",external:ve(e),assetUrl:ie(n.content.assetUrl)}})}function Gs(e={}){return{postJson(t,r){return Yt(t,r,e)},writeFile(t,r){return pt(t,r,e)},runCommand(t){return Et(t,e)},executeTransportPlan(t){return nn(t,e)}}}async function Yt(e,t,r){const a=Eo(r);return a.fetchJson(jn(a.endpointBase,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function pt(e,t,r){return Yt("/file",{path:e,content:t},r)}async function Et(e,t){return Yt("/exec",{cmd:e.cmd,...e.cwd?{cwd:e.cwd}:{}},t)}async function nn(e,t){for(const a of e.writes)await pt(a.path,a.content,t);let r={};for(const a of e.commands){const n=await Et(a,t),o=Pe(n.result);r=o&&Object.keys(o).length>0?o:n}return r}function Eo(e){return typeof e=="function"?{endpointBase:lr,fetchJson:e}:{endpointBase:e?.endpointBase??lr,fetchJson:e?.fetchJson??Gn}}function ho(e={}){let t=Promise.resolve(),r=Promise.resolve();return async a=>{const n=Fn(a.name);if(n===Be.ASSET_LIBRARY_REFRESH){await bo(a,e);return}if(n===Be.ASSET_IMPORT||n===Be.ASSETS_LOADED){const o=t.then(()=>yo(a,e));t=o.catch(()=>{}),await o;return}if(n===Be.ASSET_UPDATE){const o=r.then(()=>So(a,e));r=o.catch(()=>{}),await o;return}n===Be.EDITOR_ASSET_PLACE&&await Io(a,e)}}async function So(e,t){const r=Je(e.payload),a=Wt(e.payload,t);try{await e.ensureEditorMode(),await e.harness.runExclusiveDocumentOperation(()=>e.runWithAssetLoadingOverlay(async()=>{if(!t.registerAsset)throw new Error("asset update registration is unavailable");const n=await t.registerAsset(a);if(!n.contentHash)throw new Error("asset_update_registration_missing_content_hash");const o=await e.harness.refreshUpdatedAsset({assetId:n.assetId,expectedContentHash:n.contentHash});e.postEvent(pe.ASSET_UPDATE_RESULT,{...r?{requestId:r}:{},ok:o.ok,guid:n.guid,assetId:n.assetId,contentHash:n.contentHash,external:n.external,assetCount:o.assetCount,reconciledBindingCount:o.reconciledBindingCount,warnings:o.warnings,status:o.status,...o.error?{error:o.error}:{}})}))}catch(n){const o=an(e.payload);e.postEvent(pe.ASSET_UPDATE_RESULT,{...r?{requestId:r}:{},ok:!1,assetId:Xe(a.projectAssetId)??"",...o?{external:o}:{},reconciledBindingCount:0,warnings:[],error:It(n)})}}async function bo(e,t){const r=Je(e.payload);try{await e.ensureEditorMode(),await e.harness.runExclusiveDocumentOperation(()=>e.runWithAssetLoadingOverlay(async()=>{const a=await e.harness.reloadAssets();e.postEvent(pe.ASSET_LIBRARY_REFRESHED,{...r?{requestId:r}:{},...a})}))}catch(a){e.postEvent(pe.ASSET_LIBRARY_REFRESHED,{...r?{requestId:r}:{},ok:!1,assetCount:0,status:t.refreshFailedStatus??"Asset reload failed",error:It(a)})}}async function yo(e,t){const r=Je(e.payload),a=Wt(e.payload,t);try{await e.ensureEditorMode();const n=await e.harness.runExclusiveDocumentOperation(()=>e.runWithAssetLoadingOverlay(async()=>{const o=await Po(a,t),i=await e.harness.reloadAssets();if(!i.ok)throw new Error(i.error??i.status);const s=await on(e.harness,o.assetId,{placement:sn(a,t,e.harness)}),l=Ht(a);return{...r?{requestId:r}:{},ok:s.ok,guid:o.guid,assetId:o.assetId,kind:l==="texture"?"texture":"model",external:o.external,nodeId:s.createdId??void 0,assetCount:i.assetCount,status:s.status,...s.error?{error:s.error}:{}}}));await e.harness.waitForDocumentOperationIdle?.({timeoutMs:5e3}),e.postEvent(pe.ASSET_IMPORT_RESULT,n)}catch(n){const o=an(e.payload);e.postEvent(pe.ASSET_IMPORT_RESULT,{...r?{requestId:r}:{},ok:!1,assetId:Xe(a.projectAssetId)??"",...o?{external:o}:{},error:It(n)})}}function an(e){try{return ve(e)}catch{return}}async function Io(e,t){const r=Je(e.payload),a=Wt(e.payload,t);let n=Xe(a.projectAssetId)??"";try{await e.ensureEditorMode(),await e.harness.runExclusiveDocumentOperation(()=>e.runWithAssetLoadingOverlay(async()=>{n=await Ao(a,t);const o=await on(e.harness,n,{placement:sn(a,t,e.harness)});e.postEvent(pe.EDITOR_ASSET_PLACE_RESULT,{...r?{requestId:r}:{},ok:o.ok,assetId:n,nodeId:o.createdId??void 0,status:o.status,...o.error?{error:o.error}:{}})}))}catch(o){e.postEvent(pe.EDITOR_ASSET_PLACE_RESULT,{...r?{requestId:r}:{},ok:!1,assetId:n,error:It(o)})}}function on(e,t,r){return e.createAssetFromAssetIdAsync?e.createAssetFromAssetIdAsync(t,r):Promise.resolve(e.createAssetFromAssetId(t,r))}function Wt(e,t){return t.normalizePayload?.(e)??e}async function Po(e,t){if(t.registerAssetIfNeeded)return t.registerAssetIfNeeded(e);const r=Xe(e.projectAssetId);if(!r)throw new Error("projectAssetId is required when registerAssetIfNeeded is not provided");return{assetId:r,external:ve(e)}}async function Ao(e,t){if(t.resolveAssetId)return t.resolveAssetId(e);const r=Xe(e.projectAssetId);if(!r)throw new Error("projectAssetId is required to place an editor asset");return r}function sn(e,t,r){if(t.readPlacement)return t.readPlacement(e);const a=t.placement?.projectDropPoint;return no(e,{projectDropPoint:a?n=>a(n):n=>r.projectAssetDropPoint?.(n)??null})}function It(e){return e instanceof Error?e.message:String(e)}function Xe(e){return typeof e=="string"&&e.trim()?e.trim():void 0}class De extends Error{constructor(t){super(t),this.name="PlayableEditorEntryReloadRequiredError"}}function To(e){const t=e.now??(()=>Date.now()),r=new AbortController,a=new Set;let n=Tr({phase:"idle",attempt:0,phaseStartedAtMs:t(),phaseDurationsMs:{},failure:null}),o=null,i=null,s=null,l=!1;const d=u=>{try{e.reportListenerError?.(u)}catch{}},S=(u,A={})=>{const I=t(),P={...n.phaseDurationsMs,[n.phase]:Math.max(0,I-n.phaseStartedAtMs)};n=Tr({phase:u,attempt:A.attempt??n.attempt,phaseStartedAtMs:I,phaseDurationsMs:P,failure:A.failure===void 0?null:A.failure});for(const O of[...a])try{O(n)}catch(G){d(G)}return n},c=(u,A,I)=>{try{e.reportFailure?.(Object.freeze({failure:u,cause:A,rollbackCause:I}))}catch(P){d(P)}},m=()=>{if(l||r.signal.aborted)throw Bt()},f=u=>{if(l||n.phase==="disposed")return Promise.reject(Bt());if(n.phase==="ready"||n.phase==="preparing"||n.phase==="committing"||n.phase==="editing"||n.phase==="failed"&&n.failure?.phase!=="warmup")return Promise.resolve();if(o)return o;const A=Promise.resolve().then(async()=>{try{S("warming",u===void 0?{}:{attempt:u}),m(),await e.backend.warmup?.(r.signal),m(),S("ready")}catch(I){if(l||r.signal.aborted)throw I;const P=Ve("warmup-failed","warmup",I,!0);throw S("failed",{failure:P}),c(P,I),I}});return o=A,A.finally(()=>{o===A&&(o=null)}).catch(()=>{}),A},h=async()=>{if(l||n.phase==="disposed")return Me(n.attempt);if(n.phase==="editing")return Object.freeze({ok:!0,attempt:n.attempt});if(n.phase==="failed"&&n.failure&&!n.failure.recoverable)return Object.freeze({ok:!1,attempt:n.attempt,failure:n.failure});const u=n.attempt+1;try{await f(u)}catch(I){if(l||r.signal.aborted)return Me(u);const P=n.failure??Ve("warmup-failed","warmup",I,!0);return Object.freeze({ok:!1,attempt:u,failure:P})}if(l)return Me(u);S("preparing",{attempt:u});let A;try{A=await e.backend.prepare({signal:r.signal}),m()}catch(I){if(l||r.signal.aborted)return Me(u);const P=Ve("prepare-failed","prepare",I,!0);return S("failed",{attempt:u,failure:P}),c(P,I),Object.freeze({ok:!1,attempt:u,failure:P})}S("committing",{attempt:u});try{return await e.backend.commit(A,{signal:r.signal}),m(),S("editing",{attempt:u}),Object.freeze({ok:!0,attempt:u})}catch(I){S("rolling-back",{attempt:u});try{await e.backend.rollback(A,I)}catch(O){if(l&&wr(I)&&wr(O))return Me(u);const G=ht("commit-failed","commit",I),D=ht("rollback-failed","rollback",O),B=St({...D,recoverable:!1,primary:G,rollback:D});return l||S("failed",{attempt:u,failure:B}),c(B,I,O),Object.freeze({ok:!1,attempt:u,failure:B})}if(l||r.signal.aborted)return Me(u);const P=Ve("commit-failed","commit",I,!0);return S("failed",{attempt:u,failure:P}),c(P,I),Object.freeze({ok:!1,attempt:u,failure:P})}},p=()=>{if(i)return i;const u=h();return i=u,u.finally(()=>{i===u&&(i=null)}).catch(()=>{}),u};return Object.freeze({start:()=>f(),enter:p,retry(){const u=n.failure;return n.phase!=="failed"||!u||u.recoverable?p():Promise.resolve(Object.freeze({ok:!1,attempt:n.attempt,failure:u}))},reset(){if(l||n.phase==="disposed")throw new Error("Disposed editor entry controller cannot be reset.");if(o||i)throw new Error("Editor entry controller cannot be reset during an active operation.");if(n.phase==="failed"&&n.failure&&!n.failure.recoverable)throw new Error("Non-recoverable editor entry failure cannot be reset. Refresh the page.");(n.phase!=="idle"||n.attempt!==0||n.failure)&&S("idle",{attempt:0})},getState:()=>n,subscribe(u){if(l)return()=>{};a.add(u);try{u(n)}catch(A){d(A)}return()=>{a.delete(u)}},dispose(){if(s)return s;l=!0,r.abort();const u=(async()=>{const A=[i,o].filter((I,P,O)=>I!==null&&O.indexOf(I)===P);await Promise.allSettled(A);try{await e.backend.dispose()}finally{n.phase!=="disposed"&&S("disposed"),a.clear()}})();return s=u,u.catch(()=>{s===u&&(s=null)}),u}})}function Ve(e,t,r,a){return wo(r)?St({...ht("reload-required","runtime",r),recoverable:!1}):St({...ht(e,t,r),recoverable:a})}function wo(e){return e instanceof Error&&e.name==="PlayableEditorEntryReloadRequiredError"}function ht(e,t,r){return Object.freeze({code:e,phase:t,message:Ro(r)})}function St(e){return Object.freeze({...e,primary:e.primary?Object.freeze({...e.primary}):void 0,rollback:e.rollback?Object.freeze({...e.rollback}):void 0})}function Tr(e){return Object.freeze({...e,phaseDurationsMs:Object.freeze({...e.phaseDurationsMs}),failure:e.failure?St(e.failure):null})}function Ro(e){return e instanceof Error&&e.message.trim()?e.message:typeof e=="string"&&e.trim()?e:"Unknown editor entry failure."}function wr(e){return e instanceof Error&&e.name==="AbortError"}function Bt(){const e=new Error("Editor entry was disposed.");return e.name="AbortError",e}function Me(e){return Object.freeze({ok:!1,attempt:e,failure:Ve("disposed","dispose",Bt(),!1)})}function Fs(e){let t=null;const r=Co(),a=e.enrichDocument??r.enrichDocument,n=e.dehydrateDocument??r.dehydrateDocument,i=ho({normalizePayload:s=>s,registerAssetIfNeeded:s=>po(s,{commandName:e.registerCommandName??"npm run asset:register",cwd:".",findExistingAsset:e.findExistingAsset,writeFile:pt,runCommand:Et}),registerAsset:s=>rn(s,{commandName:e.registerCommandName??"npm run asset:register",cwd:".",findExistingAsset:e.findExistingAsset,writeFile:pt,runCommand:Et}),resolveAssetId:async s=>{const l=cn(s.projectAssetId);if(l)return l;const d=await e.findExistingAsset(s);if(d)return d.assetId;throw new Error("project assetId was not found for platform asset")},placement:{projectDropPoint:e.projectDropPoint}});return{hydrateDocumentAssets:a,prepareProjectServiceDocument:n,summarize:s=>`editorScene assets=${s.assets?.length??0}, gameObjects=${s.scene?.gameObjects?.length??0}`,handleProjectAssetCommand:s=>i(s),async exportDocument(s,l,d,S=(m,f)=>{Bn(window,m,f)},c){return s.runExclusiveDocumentOperation(async()=>{ot(c);const m=s.getDocumentRevision();await Rr(s,"export"),ot(c),Ct(s,m,"export");const f=await s.reloadAssets();if(ot(c),!f.ok){const I=new Error(f.error??"asset_freshness_check_failed");throw Object.assign(I,{code:"asset_freshness_check_failed",details:f}),I}const h=s.getDocumentRevision();await Rr(s,"export"),Ct(s,h,"export");const p=await s.prepareProjectServiceDocumentExport?.(c)??null;if(c&&!p){const I=new Error("Forge Play document export requires the Project Editor Service persistence owner.");throw Object.assign(I,{code:"project_editor_service_unavailable"}),I}const u=p??await(async()=>{const I=s.getWorkingDocument();if(!I)throw new Error("editor_document_unavailable");return _o(I,e.sceneSource,t)})();if(ot(c),!p){const I=Kt(u.document);I!==null&&(t=I)}Ct(s,h,"export");const A=typeof u.sceneJsonText=="string"&&u.sceneJsonText.trim()?u.sceneJsonText:`${JSON.stringify(u.compiledArtifact?.data??u.document,null,2)}
|
|
2
|
-
`;return d.preparedRevision+=1,d.committedRevision=0,S(pe.DOCUMENT_EXPORTED,{requestId:Je(l),persistedByEditor:!0,sceneJsonText:A,localRevision:h,...typeof u.expectedVersion=="number"?{expectedVersion:u.expectedVersion}:{},...typeof u.version=="number"?{version:u.version,sceneVersion:u.version}:{},...typeof u.sceneUrl=="string"?{sceneUrl:u.sceneUrl}:{},...typeof u.updatedAt=="string"?{updatedAt:u.updatedAt}:{}}),{documentRevision:h,preparedAuthoringSource:{...p?{serviceTransactionId:p.transactionId,serviceDocumentRevision:p.documentRevision}:{document:u.document,...u.source?{source:u.source}:{}},...typeof u.version=="number"?{version:u.version}:{},...typeof u.updatedAt=="string"?{updatedAt:u.updatedAt}:{},...typeof u.sceneUrl=="string"?{sceneUrl:u.sceneUrl}:{}},...typeof u.expectedVersion=="number"?{expectedVersion:u.expectedVersion}:{},...typeof u.version=="number"?{version:u.version,sceneVersion:u.version}:{},...typeof u.sceneUrl=="string"?{sceneUrl:u.sceneUrl}:{},...typeof u.updatedAt=="string"?{updatedAt:u.updatedAt}:{}}})}}}async function _o(e,t,r){const a=Kt(e),n=r??a,o=vo(e,n);return t.save(o,{mode:"local-commit-save",...n===null?{}:{expectedAuthoringSourceRevision:n}})}function ot(e){if(!e||!e.signal.aborted&&Date.now()<e.deadlineAt)return;const t=new Error("Document export lifecycle deadline elapsed before persistence completed.");throw Object.assign(t,{code:"document_export_timeout"}),t}function Kt(e){const t=ke(ke(ke(e)?.meta)?.authoringSource);return typeof t?.revision=="number"&&Number.isFinite(t.revision)?t.revision:null}function vo(e,t){const r=Kt(e);if(t===null||r===null||r===t)return e;const a=structuredClone(e),n=ke(a),o=ke(n?.meta),i=ke(o?.authoringSource);return!n||!o||!i?e:(i.revision=t,a)}function Co(){return{enrichDocument:(e,t)=>Un(e,t),dehydrateDocument:(e,t)=>zn(e,t)}}async function Rr(e,t){if(await e.validateOperationSettledForCurrentDocument(t))return;const r=new Error(`${t}_blocked_by_validation`);throw Object.assign(r,{code:"editor_validation_failed",details:{phase:t}}),r}function Ct(e,t,r){const a=e.getDocumentRevision();if(a===t)return;const n=new Error(`${r}_canceled_document_changed`);throw Object.assign(n,{code:"editor_validation_failed",details:{phase:r,expectedDocumentRevision:t,receivedDocumentRevision:a}}),n}function cn(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function ke(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Bs(e){return{projectAssetId:cn(e.projectAssetId),platformAssetId:Vt(e)??void 0,kind:Ht(e)==="texture"?"texture":"model",assetPath:yt(e)??void 0}}function zs(e){const t=[],r=$n(),a=Hn(),n=Vn(),o=qn(),i=Yn(),s=Wn(),l=Kn(),d=Jn(),S=e.materialShaderDefinitions??Xn;try{t.push(e.host.registerCommand({manifest:N(L.HIERARCHY_SCOPE_GET),handler:async(c,m)=>{const f=e.sceneAssembly.getHierarchyItems(F(m)),h={scopeKey:"scene",scopeType:"scene",revision:m.session.getState({cloneDocuments:!1}).documentRevision,title:"Scene",readonly:!1,nodes:f.map(u=>({id:u.id,label:u.label,parentId:u.parentId??null,selectable:!0,canHaveChildren:!0,renamable:!0,deletable:!0,draggable:!0})),selectedIds:m.session.getSelection().selectedIds,activeId:m.session.getSelection().activeId,capabilities:{},totalCount:f.length,returnedCount:f.length},p=await r(h,c);return p.ok?{ok:!0,output:p.output}:{ok:!1,diagnostics:[{severity:"error",source:"hierarchy",code:p.code,message:p.message}]}}})),t.push(e.host.registerCommand({manifest:N(L.SCENE_OBJECTS_LIST),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=f.workingDocument,p=Xt(h),u=await a(h.scene.gameObjects.map(A=>qe(A,h,p)),c,f.documentRevision);return u.ok?{ok:!0,output:{objects:u.items,totalCount:u.totalCount,returnedCount:u.returnedCount,...u.nextCursor?{nextCursor:u.nextCursor}:{}}}:ye(u)}})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_RESOLVE,{activeId:"objectId"}),handler:(c,m)=>Vo(F(m),c)})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_PROPERTIES_GET),handler:(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=Qn(f.workingDocument,c,f.documentRevision,e.sceneAssembly.getInspectorObject);return h.ok?h:ye(h)}})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_REFERENCES_LIST),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=await i(f.workingDocument,c,f.documentRevision);return h.ok?h:ye(h)}})),t.push(e.host.registerCommand({manifest:N(L.ASSET_LIBRARY_LIST),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=[...await e.listAssets(f.workingDocument)].map(Zn),p=await n(h,c,ea(f.documentRevision,h));return p.ok?{ok:!0,output:{assets:p.items,totalCount:p.totalCount,returnedCount:p.returnedCount,...p.nextCursor?{nextCursor:p.nextCursor}:{}}}:ye(p)}})),t.push(e.host.registerCommand({manifest:N(L.ASSET_INFO_GET),handler:async(c,m)=>{const f=c.assetId.trim(),h=[...await e.listAssets(F(m))].find(p=>p.assetId===f||p.id===f);return h?{ok:!0,output:{asset:ta(h)}}:R("asset.notFound",`Asset was not found: ${f}`)}})),t.push(e.host.registerCommand({manifest:N(L.ASSET_REFERENCES_LIST),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=await o(f.workingDocument,c,f.documentRevision);return h.ok?h:ye(h)}})),t.push(e.host.registerCommand({manifest:N(L.AUTHORING_VALIDATION_LIST),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=await s(f.workingDocument,c,f.documentRevision);return h.ok?h:ye(h)}})),t.push(e.host.registerCommand({manifest:N(L.PREFAB_RESOLVE),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=await e.listAssets(f.workingDocument),p=f.workingDocument.assets.filter(A=>!!A.prefab).map(A=>ra(A,h)),u=await l(p,c,f.documentRevision);return u.ok?{ok:!0,output:{prefabs:u.items,resolvedPrefab:u.totalCount===1?u.items[0]??null:null,ambiguous:u.totalCount>1,currentStage:null,totalCount:u.totalCount,returnedCount:u.returnedCount,...u.nextCursor?{nextCursor:u.nextCursor}:{}}}:ye(u)}})),t.push(e.host.registerCommand({manifest:N(L.PREFAB_SCENE_GET),handler:async(c,m)=>{const f=m.session.getState({cloneDocuments:!1}),h=await d(f.workingDocument,c,f.documentRevision,{dirty:f.dirty});return h.ok?h:ye(h)}})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_ASSETS_LIST),handler:(c,m)=>({ok:!0,output:Do(F(m),c)})})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_ASSET_GET),handler:(c,m)=>Lo(F(m),c.materialAssetId)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_ASSET_CREATE),handler:(c,m)=>No(m,e.sceneAssembly,c,S)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_ASSET_RENAME),handler:(c,m)=>xo(m,e.sceneAssembly,c)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_ASSET_SET_SHADER),handler:(c,m)=>ko(m,e.sceneAssembly,c,S)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_SHADER_DEFINITIONS_LIST),handler:c=>({ok:!0,output:Mo(S,c)})})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_SHADER_DEFINITION_GET),handler:c=>Oo(S,c.shaderId)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_REFERENCES_LIST),handler:(c,m)=>jo(F(m),c)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_BINDINGS_LIST),handler:(c,m)=>({ok:!0,output:Pt(zt(F(m),c),c.cursor,c.limit)})})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_BINDING_SET),handler:(c,m)=>vr(m,e.sceneAssembly,c.targets,c.materialAssetId)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_BINDING_CLEAR),handler:(c,m)=>vr(m,e.sceneAssembly,c.targets,null)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_PROPERTIES_GET),handler:(c,m)=>Go(F(m),c.materialAssetId,c.includeSchema===!0,S)})),t.push(e.host.registerCommand({manifest:N(L.MATERIAL_PROPERTIES_PATCH),handler:(c,m)=>Fo(m,e.sceneAssembly,c,S)})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_CREATE_PRIMITIVE),handler:(c,m)=>Dr(m,e.sceneAssembly.createCreatePrimitivePatch(F(m),c),f=>({createdId:f.createdId,object:qe(F(m).scene.gameObjects.find(h=>h.id===f.createdId),F(m)),selection:m.session.getSelection()}))})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_DELETE,{selectedIds:"objectIds"}),handler:(c,m)=>Dr(m,e.sceneAssembly.createDeleteSubtreePatch(F(m),{ids:c.objectIds??(c.objectId?[c.objectId]:[])}),f=>({deletedIds:f.deletedIds??f.changedIds??[],fallbackSelectionId:m.session.getSelection().activeId,selection:m.session.getSelection()}))})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_PROPERTIES_PATCH_MANY),handler:(c,m)=>Wo(m,e.sceneAssembly,c)})),t.push(e.host.registerCommand({manifest:N(L.TRANSFORM_MOVE,{activeId:"objectId"}),handler:(c,m)=>{const f=it(F(m),c.objectId);if(!f)return R("object.notFound",`Scene object was not found: ${c.objectId}`);const h=c.position??(c.offset?{x:f.position.x+c.offset.x,y:f.position.y+c.offset.y,z:f.position.z+c.offset.z}:null);if(!h)return R("transform.invalidInput","Transform move requires position or offset.");const p=e.sceneAssembly.patchGameObjectField(F(m),c.objectId,"transform.position",h),u=it(p,c.objectId);return!u||JSON.stringify(u)===JSON.stringify(f)?R("transform.unchanged",`Transform did not change: ${c.objectId}`):(m.dispatch({type:"document.replace",document:p,label:`Move ${c.objectId}`,projectionImpact:{type:"incremental",syncTransformIds:[c.objectId]}}),{ok:!0,output:{objectId:c.objectId,before:f,after:u,selection:m.session.getSelection()}})}})),t.push(e.host.registerCommand({manifest:N(L.TRANSFORM_SET,{activeId:"objectId"}),handler:(c,m)=>{const f=F(m),h=it(f,c.objectId);if(!h)return R("object.notFound",`Scene object was not found: ${c.objectId}`);const p=["position","rotation","scale"].flatMap(I=>c[I]?[{path:`transform.${I}`,value:c[I]}]:[]),u=e.sceneAssembly.patchGameObjectPropertiesMany(f,[{objectId:c.objectId,changes:p}]),A=it(u,c.objectId);return!A||JSON.stringify(A)===JSON.stringify(h)?R("transform.unchanged",`Transform did not change: ${c.objectId}`):(m.dispatch({type:"document.replace",document:u,label:`Set transform on ${c.objectId}`,projectionImpact:{type:"incremental",syncTransformIds:[c.objectId]}}),{ok:!0,output:{objectId:c.objectId,before:h,after:A,selection:m.session.getSelection()}})}})),t.push(e.host.registerCommand({manifest:N(L.OBJECT_CREATE_FROM_ASSET),handler:async(c,m)=>{const f=F(m),h=[...await e.listAssets(f)].find(u=>u.assetId===c.assetId);if(!h)return R("asset.notFound",`Asset was not found: ${c.assetId}`);if(!na(h))return R("asset.unplaceable",`Asset is not placeable: ${c.assetId}`);const p=e.sceneAssembly.addAssetLibraryItemToDocument(f,h,$o(c));return m.dispatch({type:"document.replace",document:p.document,label:`Create ${p.gameObject.name??p.gameObject.id}`}),{ok:!0,output:{assetId:c.assetId,createdId:p.gameObject.id,object:qe(p.gameObject,p.document),selection:m.session.getSelection(),focused:!1,status:`Created ${p.gameObject.name??p.gameObject.id}`}}}}))}catch(c){for(const m of t.splice(0).reverse())m();throw c}return()=>{for(const c of t.splice(0).reverse())c()}}function Do(e,t){const r=t.query?.trim().toLowerCase()??"",a=t.path?.trim().toLowerCase()??"",n=t.shaderId?.trim()??"",o=(e.scene.materialAssets??[]).map(i=>({id:i.id,name:i.name?.trim()||i.id,shaderId:i.shaderId,...i.definitionVersion!=null?{definitionVersion:i.definitionVersion}:{},properties:structuredClone(i.properties),...i.origin?{origin:structuredClone(i.origin)}:{}})).filter(i=>!n||i.shaderId===n).filter(i=>!r||`${i.name}
|
|
3
|
-
${i.id}`.toLowerCase().includes(r)).filter(i=>!a||JSON.stringify(i.origin??{}).toLowerCase().includes(a)).sort((i,s)=>i.name.localeCompare(s.name)||i.id.localeCompare(s.id));return Pt(o,t.cursor,t.limit)}function Mo(e,t){const r=t.query?.trim().toLowerCase()??"",a=e.list().map(dn).filter(n=>t.builtin===void 0||n.builtin===t.builtin).filter(n=>!r||`${n.displayName}
|
|
4
|
-
${n.shaderId}
|
|
5
|
-
${n.runtimeKind}`.toLowerCase().includes(r)).sort((n,o)=>n.displayName.localeCompare(o.displayName)||n.shaderId.localeCompare(o.shaderId));return Pt(a,t.cursor,t.limit)}function Oo(e,t){const r=t?.trim(),a=e.get(r);return a?{ok:!0,output:{definition:{...dn(a),propertiesSchema:structuredClone(a.propertiesSchema),defaultProperties:structuredClone(a.defaultProperties),inspector:structuredClone(a.inspector)}}}:R("material.shaderDefinitionNotFound",`Shader Definition was not found: ${r}`)}function dn(e){return{shaderId:e.shaderId,version:e.version,runtimeKind:e.runtimeKind,displayName:e.displayName,builtin:ha(e.shaderId)!==null,...e.sourceFile?{sourceFile:e.sourceFile}:{},sectionCount:e.inspector.sections.length,fieldCount:e.inspector.fields.length}}function Lo(e,t){const r=t?.trim(),a=Z(e,r);return a?{ok:!0,output:{asset:{id:a.id,name:a.name?.trim()||a.id,shaderId:a.shaderId,...a.definitionVersion!=null?{definitionVersion:a.definitionVersion}:{},properties:structuredClone(a.properties),...a.origin?{origin:structuredClone(a.origin)}:{}},referenceCount:qr(e).filter(n=>n.materialAssetId===r).length}}:R("material.assetNotFound",`Material asset was not found: ${r}`)}function No(e,t,r,a){const n=r.shaderId?.trim(),o=a.get(n);if(!o)return R("material.shaderDefinitionNotFound",`Shader Definition was not found: ${n}`);const i=r.name?.trim();if(r.name!==void 0&&!i)return R("material.invalidName","Material name must not be empty.");const s=t.createMaterialAssetCreatePatch({document:e.session.getWorkingDocument(),definition:o,...i?{name:i}:{}});if(!s?.createdId)return R("material.assetMutationUnavailable","Material Asset creation is unavailable.");const l=e.session.getState({cloneDocuments:!1}).documentRevision;Jt(e,s);const d=Z(e.session.getWorkingDocument(),s.createdId);return{ok:!0,output:{asset:We(d),changed:e.session.getState({cloneDocuments:!1}).documentRevision!==l,revision:e.session.getState({cloneDocuments:!1}).documentRevision}}}function xo(e,t,r){const a=e.session.getWorkingDocument(),n=r.materialAssetId?.trim(),o=Z(a,n);if(!o)return R("material.assetNotFound",`Material asset was not found: ${n}`);const i=r.name?.trim();if(!i)return R("material.invalidName","Material name must not be empty.");const s=(a.scene.materialAssets??[]).find(c=>c.id!==n&&c.name?.trim().toLocaleLowerCase()===i.toLocaleLowerCase());if(s)return R("material.nameConflict",`A Material Asset named "${i}" already exists.`,{materialAssetId:n,conflictingMaterialAssetId:s.id,name:i});if(o.name===i)return{ok:!0,output:{asset:We(o),changed:!1,revision:e.session.getState({cloneDocuments:!1}).documentRevision}};const l=t.createMaterialAssetRenamePatch({document:a,materialAssetId:n,name:i});if(!l)return R("material.assetReadonly",`Material asset is read-only: ${n}`);const d=e.session.getState({cloneDocuments:!1}).documentRevision;Jt(e,l);const S=Z(e.session.getWorkingDocument(),n);return{ok:!0,output:{asset:We(S),changed:e.session.getState({cloneDocuments:!1}).documentRevision!==d,revision:e.session.getState({cloneDocuments:!1}).documentRevision}}}function ko(e,t,r,a){const n=e.session.getWorkingDocument(),o=r.materialAssetId?.trim(),i=Z(n,o);if(!i)return R("material.assetNotFound",`Material asset was not found: ${o}`);const s=r.shaderId?.trim(),l=a.get(s);if(!l)return R("material.shaderDefinitionNotFound",`Shader Definition was not found: ${s}`);if(i.shaderId===s)return{ok:!0,output:{asset:We(i),previousShaderId:i.shaderId,changed:!1,revision:e.session.getState({cloneDocuments:!1}).documentRevision,preservedPaths:[],resetPaths:[]}};const d=t.createMaterialAssetSetShaderPatch({document:n,materialAssetId:o,definition:l});if(!d)return R("material.assetReadonly",`Material asset is read-only: ${o}`);if((d.resetPaths?.length??0)>0&&r.allowReset!==!0)return R("material.shaderChangeRequiresConfirmation",`Changing to ${l.displayName} resets ${d.resetPaths.length} incompatible material properties.`,{materialAssetId:o,previousShaderId:i.shaderId,shaderId:s,preservedPaths:d.preservedPaths??[],resetPaths:d.resetPaths??[]});const S=e.session.getState({cloneDocuments:!1}).documentRevision;Jt(e,d);const c=Z(e.session.getWorkingDocument(),o);return{ok:!0,output:{asset:We(c),previousShaderId:i.shaderId,changed:e.session.getState({cloneDocuments:!1}).documentRevision!==S,revision:e.session.getState({cloneDocuments:!1}).documentRevision,preservedPaths:d.preservedPaths??[],resetPaths:d.resetPaths??[]}}}function Jt(e,t){e.dispatch({type:"document.patch",patch:t.patch,label:t.label,...t.reprojectIds?.length?{projectionImpact:{type:"incremental",reprojectIds:t.reprojectIds}}:{},...t.presentationImpact?{presentationImpact:t.presentationImpact}:{}})}function We(e){return{id:e.id,name:e.name?.trim()||e.id,shaderId:e.shaderId,...e.definitionVersion!=null?{definitionVersion:e.definitionVersion}:{},properties:structuredClone(e.properties),...e.origin?{origin:structuredClone(e.origin)}:{}}}function jo(e,t){const r=t.materialAssetId?.trim();if(!Z(e,r))return R("material.assetNotFound",`Material asset was not found: ${r}`);const a=qr(e).filter(n=>n.materialAssetId===r).filter(n=>!t.scope||n.scope===t.scope).map(n=>({scope:n.scope,kind:n.kind,materialAssetId:n.materialAssetId,...n.scope==="scene"?{objectId:n.gameObjectId}:{},...n.gameObjectName?{objectName:n.gameObjectName}:{},...n.prefabAssetId?{prefabAssetId:n.prefabAssetId}:{},...n.prefabNodeId?{nodeId:n.prefabNodeId}:{},...n.slotId?{slotId:n.slotId}:{},bindingPath:n.bindingPath,label:n.label})).sort((n,o)=>ge(n).localeCompare(ge(o)));return{ok:!0,output:{materialAssetId:r,...Pt(a,t.cursor,t.limit)}}}function zt(e,t){const r=t.scope==="prefab"?[]:e.scene.gameObjects.filter(n=>!t.objectId||n.id===t.objectId).flatMap(n=>{const o=ca(e,n),i=da(e,n.id)??n.overrides;return o.length===0?[bt({scope:"scene",objectId:n.id},n.overrides?.materialBinding,i?.materialBinding,i!==n.overrides?"prefab-root":"default","overrides.materialBinding.materialAssetId")]:o.map(s=>bt({scope:"scene",objectId:n.id,slotId:s.slotId},n.overrides?.materialSlotBindings?.[s.slotId],i?.materialSlotBindings?.[s.slotId],i!==n.overrides?"prefab-root":"glb-source",`overrides.materialSlotBindings.${s.slotId}.materialAssetId`))}),a=t.scope==="scene"?[]:e.assets.filter(n=>n.type==="prefab"&&!!n.prefab).filter(n=>!t.prefabAssetId||n.id===t.prefabAssetId).flatMap(n=>{const o=t.nodeId?[]:_r(e,n,null,n.prefab.overrides,void 0),i=la(n),s=(n.prefab?.nodes??[]).filter(l=>l.id!==i).filter(l=>!t.nodeId||l.id===t.nodeId).flatMap(l=>_r(e,n,l,l.overrides,n.prefab.overrides));return[...o,...s]});return[...r,...a].sort((n,o)=>ge(n.target).localeCompare(ge(o.target)))}function _r(e,t,r,a,n){const o=zo(e,t,r),i={scope:"prefab",prefabAssetId:t.id,...r?{nodeId:r.id}:{}};return o.length===0?[bt(i,a?.materialBinding,a?.materialBinding??n?.materialBinding,n?.materialBinding?"prefab-root":"default","overrides.materialBinding.materialAssetId")]:o.map(s=>bt({...i,slotId:s},a?.materialSlotBindings?.[s],a?.materialSlotBindings?.[s]??n?.materialSlotBindings?.[s],n?.materialSlotBindings?.[s]?"prefab-root":"glb-source",`overrides.materialSlotBindings.${s}.materialAssetId`))}function bt(e,t,r,a,n){const o=Cr(t?.materialAssetId),i=Cr(r?.materialAssetId),s=o?"authored":i?a:e.slotId?"glb-source":"default";return{target:e,kind:e.slotId?"slot":"root",bindingPath:n,authoredMaterialAssetId:o,effectiveMaterialAssetId:i??(s==="glb-source"?null:Sa),resolvedSource:s}}function vr(e,t,r,a){const n=F(e),o=a?.trim()||null;if(o&&!Z(n,o))return R("material.assetNotFound",`Material asset was not found: ${o}`);const i=Bo(r);if(!i.ok)return i.failure;const s=new Map(zt(n,{}).map(p=>[ge(p.target),p])),l=i.targets.map(p=>s.get(ge(p)));if(l.some(p=>!p))return R("material.invalidTarget","One or more material binding targets do not exist or require a logical slotId.");const d=l,c=i.targets[0].scope==="scene"?t.createSceneMaterialBindingPatch({document:n,materialAssetId:o,targets:l.map(p=>({objectId:p.target.objectId,path:p.bindingPath}))}):t.createPrefabMaterialBindingPatch({document:n,materialAssetId:o,targets:l.map(p=>({prefabAssetId:p.target.prefabAssetId,...p.target.nodeId?{nodeId:p.target.nodeId}:{},path:p.bindingPath}))});if(!c)return R("material.patchUnavailable","Material binding preflight rejected the atomic patch.");e.dispatch({type:"document.patch",patch:c.patch,label:c.label,...c.reprojectIds?.length?{projectionImpact:{type:"incremental",reprojectIds:c.reprojectIds}}:{},...c.presentationImpact?{presentationImpact:c.presentationImpact}:{}});const m=F(e),f=new Map(zt(m,{}).map(p=>[ge(p.target),p])),h=i.targets.map(p=>f.get(ge(p)));return{ok:!0,output:{changed:h.some((p,u)=>JSON.stringify(p)!==JSON.stringify(d[u])),changedCount:h.filter((p,u)=>JSON.stringify(p)!==JSON.stringify(d[u])).length,revision:e.session.getState({cloneDocuments:!1}).documentRevision,bindings:h}}}function Go(e,t,r,a){const n=t?.trim(),o=Z(e,n),i=o?ua(o.shaderId,a):null;return o?i?{ok:!0,output:{materialAssetId:n,shaderId:o.shaderId,properties:structuredClone(o.properties),defaults:structuredClone(i.defaultProperties),...r?{schema:structuredClone(i.propertiesSchema)}:{}}}:R("material.shaderUnsupported",`Unsupported material shader: ${o.shaderId}`):R("material.assetNotFound",`Material asset was not found: ${n}`)}function Fo(e,t,r,a){const n=F(e),o=r.materialAssetId?.trim(),i=Z(n,o);if(!i)return R("material.assetNotFound",`Material asset was not found: ${o}`);const s=new Set,l=[];for(const c of r.changes??[]){const m=Uo(c.path),f=ma(i.shaderId,m,a),h=Object.prototype.hasOwnProperty.call(c,"value"),p=c.reset===!0;if(!m||s.has(m)||!f||f.kind==="object"||h===p)return R("material.invalidPropertyPatch",`Invalid material property change: ${c.path}`);const u=p?fa(i.shaderId,m,a):{found:!0,value:c.value};if(!u.found)return R("material.invalidPropertyPatch",`Material property cannot be reset: ${m}`);s.add(m),l.push({path:m,value:u.value})}const d=t.createMaterialPropertiesPatch({document:n,materialAssetId:o,changes:l});if(!d)return R("material.invalidPropertyPatch","Material property preflight rejected the atomic patch.");e.dispatch({type:"document.patch",patch:d.patch,label:d.label,...d.reprojectIds?.length?{projectionImpact:{type:"incremental",reprojectIds:d.reprojectIds}}:{}});const S=Z(F(e),o);return{ok:!0,output:{materialAssetId:o,shaderId:S.shaderId,changed:JSON.stringify(i.properties)!==JSON.stringify(S.properties),changedPaths:JSON.stringify(i.properties)!==JSON.stringify(S.properties)?[...s]:[],revision:e.session.getState({cloneDocuments:!1}).documentRevision,properties:structuredClone(S.properties)}}}function Bo(e){if(!Array.isArray(e)||e.length===0)return{ok:!1,failure:R("material.invalidTarget","At least one material target is required.")};const t=new Set,r=[];for(const a of e){const n=a.scope,o=a.objectId?.trim(),i=a.prefabAssetId?.trim(),s=a.nodeId?.trim(),l=a.slotId?.trim();if(n==="scene"&&(!o||i||s)||n==="prefab"&&(!i||o)||n!=="scene"&&n!=="prefab")return{ok:!1,failure:R("material.invalidTarget","Material target identity is invalid.")};const d={scope:n,...o?{objectId:o}:{},...i?{prefabAssetId:i}:{},...s?{nodeId:s}:{},...l?{slotId:l}:{}},S=ge(d);if(t.has(S))return{ok:!1,failure:R("material.invalidTarget","Duplicate material target.")};t.add(S),r.push(d)}return new Set(r.map(a=>a.scope)).size!==1?{ok:!1,failure:R("material.invalidTarget","Scene and Prefab targets cannot be mixed.")}:r[0].scope==="prefab"&&new Set(r.map(a=>a.prefabAssetId)).size!==1?{ok:!1,failure:R("material.invalidTarget","One atomic command must target one Prefab asset.")}:{ok:!0,targets:r}}function zo(e,t,r){const a=r?.sourceAssetId??t.prefab?.sourceAssetId,n=e.assets.find(i=>i.id===a);return(Array.isArray(n?.metadata?.materialSlots)?n.metadata.materialSlots:[]).map(ya).filter(i=>!!i?.slotId).map(i=>i.slotId)}function Pt(e,t,r){const a=t?/^offset:(\d+)$/.exec(t.trim()):null,n=a?Number(a[1]):0,o=Number.isSafeInteger(r)?Math.max(1,Math.min(200,Number(r))):50,i=e.slice(n,n+o),s=n+i.length;return{items:i,total:e.length,...s<e.length?{nextCursor:`offset:${s}`}:{}}}function ge(e){return[e.scope??"",e.objectId??"",e.prefabAssetId??"",e.nodeId??"",e.slotId??""].join("\0")}function Uo(e){const t=typeof e=="string"?e.trim():"";return t&&!t.startsWith("properties.")?`properties.${t}`:t}function Cr(e){return typeof e=="string"&&e.trim()?e.trim():null}function $o(e){if(!(!e.position&&!e.rotation&&!e.scale))return{position:e.position??{x:0,y:0,z:0},rotation:e.rotation??{x:0,y:0,z:0},scale:e.scale??{x:1,y:1,z:1}}}function Dr(e,t,r){if(!t)return R("command.unavailable","The requested scene mutation is unavailable.");const a=Ho(t);return e.dispatch({type:"document.patch",patch:t.patch,label:t.label,...a?{projectionImpact:a}:{}}),{ok:!0,output:r?r(t):{changedIds:t.changedIds??t.deletedIds??[],...t.createdId?{createdId:t.createdId}:{},...t.selectId?{selectId:t.selectId}:{}}}}function Ho(e){const t=e.createdId?[e.createdId]:[],r=e.deletedIds??[];let a=[];if(e.reprojectIds?.length){const n=new Set([...t,...r]);a=e.reprojectIds.filter(o=>!n.has(o))}if(!(t.length===0&&r.length===0&&a.length===0))return{type:"incremental",...t.length?{createdNodeIds:t}:{},...r.length?{deletedNodeIds:r}:{},...a.length?{reprojectIds:a}:{}}}function Vo(e,t){const r=t.objectId??t.name??t.path??t.query??"",a=r.trim().toLocaleLowerCase(),n=e.scene.gameObjects.find(s=>s.id===r),o=n?[n]:e.scene.gameObjects.filter(s=>s.name?.trim().toLocaleLowerCase()===a||s.id.toLocaleLowerCase().includes(a)),i=Xt(e);return{ok:!0,output:{objects:o.map(s=>qe(s,e,i)),resolvedObject:o.length===1?qe(o[0],e,i):null,ambiguous:o.length>1}}}function qe(e,t,r=Xt(t)){const a=qo(e);return{id:e.id,label:e.name??e.id,name:e.name??e.id,type:Vr(e),...a?{sourceAssetId:a}:{},path:Yo(r,e),parentId:e.parentId??null,selectable:!0,locked:!1}}function qo(e){return e.components.find(r=>r.type==="ModelRenderer"||r.type==="ImageRenderer")?.assetId||e.prefab?.sourceAssetId||e.prefab?.prefabId}function Xt(e){return new Map(e.scene.gameObjects.map(t=>[t.id,t]))}function Yo(e,t){const r=[],a=new Set;let n=t;for(;n&&!a.has(n.id);)a.add(n.id),r.push(n.name??n.id),n=n.parentId?e.get(n.parentId):void 0;return r.reverse().join("/")}function Wo(e,t,r){const a=F(e),n=new Map(a.scene.gameObjects.map(f=>[f.id,f])),o=new Map,i=new Set,s=ba({hasMaterialAsset:(f,h)=>!!Z(f,h),isMarkerGameObject:f=>!!f.marker});let l=0;for(const f of r.targets){const h=f.objectId.trim(),p=n.get(h);if(!p)return R("object.notFound",`Scene object was not found: ${h}`);const u=new Map((t.getInspectorObject(a,h)?.sections??[]).flatMap(I=>I.properties).map(I=>[I.path,I])),A=o.get(h)??[];for(const I of f.changes){const P=I.path.trim(),O=`${h}\0${P}`;if(i.has(O))return R("object.properties.duplicateField",`Object property is duplicated: ${h}.${P}`);if(i.add(O),(P==="shadow.cast"||P==="shadow.receive")&&!ga(p))return R("object.properties.readOnly",`Shadow participation is readonly for this target: ${h}.`);const G=u.get(P),D=G?.coerce?G.coerce(I.value):pa(P,I.value),B=G?.validate?.(D)??Ea({document:a,path:P,nodeKind:Vr(p),value:D,extraValidators:[s]});if(!B.ok)return R("object.properties.invalid",`${B.message??`Invalid object property: ${P}.`} Target: ${h}.`);A.push({path:P,value:D}),l+=1}o.set(h,A)}const d=[...o].map(([f,h])=>({objectId:f,changes:h})),S=t.patchGameObjectPropertiesMany(a,d),c=new Map(S.scene.gameObjects.map(f=>[f.id,f])),m=d.map(f=>f.objectId).filter(f=>c.get(f)!==n.get(f));if(S!==a){const f=[],h=[],p=[],u=[];for(const A of m){const I=o.get(A)??[],P=new Set(I.map(O=>Ko(O.path)));if(P.has("reproject")){u.push(A);continue}P.has("transform")&&f.push(A),P.has("metadata")&&h.push(A),P.has("appearance")&&p.push(A)}e.dispatch({type:"document.replace",document:S,label:`Patch ${l} properties on ${d.length} objects`,...m.length>0?{projectionImpact:{type:"incremental",...f.length>0?{syncTransformIds:f}:{},...h.length>0?{syncMetadataIds:h}:{},...p.length>0?{syncAppearanceIds:p}:{},...u.length>0?{reprojectIds:u}:{}}}:{}})}return{ok:!0,output:{requestedObjectCount:d.length,validatedPropertyCount:l,changedObjectCount:m.length,sampleChangedObjectIds:m.slice(0,20)}}}function Ko(e){return e==="transform.position"||e.startsWith("transform.position.")||e==="transform.rotation"||e.startsWith("transform.rotation.")||e==="transform.scale"||e.startsWith("transform.scale.")?"transform":e==="name"||e.startsWith("metadata.")?"metadata":e==="active"||e==="enabled"||e.startsWith("shadow.")||e.startsWith("rendering.")||e.startsWith("overrides.material")||e.startsWith("overrides.outline")||e.startsWith("material.")?"appearance":"reproject"}function F(e){return e.session.getState({cloneDocuments:!1}).workingDocument}function N(e,t){const r=aa[e],a=ia[e],n=oa[e];if(!r)throw new Error(`Built-in Editor command metadata is missing: ${e}`);return{schemaVersion:sa,id:e,version:1,title:r.title,...ur[e]?{description:ur[e]}:{},target:r.target,access:r.access,stability:r.stability,inputSchema:a.inputSchema,outputSchema:a.outputSchema,effects:{persistence:r.access==="write"?"authoring":"none",undoable:r.access==="write",idempotent:r.access==="read"},...r.target==="authoring"&&r.access==="write"?{transaction:{compatible:!0,sideEffects:"authoring",phase:"mutation"}}:{},presentation:{category:r.category,inputMode:Jo(a.inputSchema)?"schema-form":"none",...n?.aliases?{aliases:n.aliases}:{},...n?.keywords?{keywords:n.keywords}:{},...n?.examples?{examples:n.examples}:{},...n?.shortcut?{shortcut:n.shortcut}:{},...n?.menu?{menu:n.menu}:{},...t?{selectionBinding:t}:{}}}}function it(e,t){const r=e.scene.gameObjects.find(n=>n.id===t),a=r?.components.find(n=>n.type==="Transform")??r?.transform;return!a||"mode"in a&&a.mode==="matrix"?null:{position:{...a.position},rotation:{...a.rotation},scale:{...a.scale??{x:1,y:1,z:1}}}}function Jo(e){const t=e.properties;return!!t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0}function R(e,t,r){return{ok:!1,diagnostics:[{severity:"error",source:"command",code:e,message:t,...r?{details:r}:{}}]}}function ye(e){return R(e.code,e.message)}function Us(e){return{...e,paths:{...e.paths},supportedExtensions:e.supportedExtensions?[...e.supportedExtensions]:void 0,commands:e.commands?{...e.commands}:void 0}}const $s=["model","texture","image","sound"],Qt=[".glb",".gltf"],ln=[".png",".jpg",".jpeg",".webp"],Xo=[".env",".hdr",".dds",".ktx",".ktx2"],Zt=[...ln,...Xo],er=[".mp3",".wav",".ogg",".flac",".aac",".m4a"],Qo=[...Qt,...Zt,...er];function Zo(e){return e.randomUUID?e.randomUUID():ni(e)}function un(e){return String(e??"").trim().toLowerCase().replace(/-/g,"")}function ei(e,t){const r=un(t);return`${e==="model"?"asset":e==="texture"?"texture":e==="sound"?"sound":"image"}_${r}`}function Hs(e){const n=String(e??"").trim().split(/[^a-zA-Z0-9_$]+/).filter(Boolean).map((o,i)=>i===0?o:`${o.charAt(0).toUpperCase()}${o.slice(1)}`).join("").replace(/[^a-zA-Z0-9_$]/g,"")||"assetUrl";return/^[a-zA-Z_$]/.test(n)?n:`asset${n}`}function ti(e,t=""){const r=String(e??"").trim().toLowerCase();if(r==="glb"||r==="gltf"||r==="model")return"model";if(r==="groundtexture"||r==="ground-texture"||r==="texture")return"texture";if(r==="ui"||r==="image"||r==="img")return"image";if(r==="audio"||r==="sound")return"sound";const a=ri(t);return Qt.includes(a)?"model":er.includes(a)?"sound":Zt.includes(a)?"texture":null}function ri(e){const t=e.split(/[?#]/,1)[0]??"",r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),a=t.slice(r+1),n=a.lastIndexOf(".");return n>=0?a.slice(n).toLowerCase():""}function ni(e){const t=new Uint8Array(16);if(!e.fillRandomBytes)throw new Error("Asset GUID random source must provide randomUUID or fillRandomBytes.");if(e.fillRandomBytes(t),t.every(a=>a===0))throw new Error("Asset GUID random source returned no entropy.");t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=[...t].map(a=>a.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function tr(e){let t=String(e??"").trim();const r=t.toLowerCase();for(const a of[...Qo].sort((n,o)=>o.length-n.length))if(r.endsWith(a)){t=t.slice(0,-a.length);break}return t}function Vs(e,t){return String(e??"").trim()||tr(t)||"Asset"}function qs(e,t){return tr(e||t).trim().toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_{2,}/g,"_")||null}function Ys(e){return e==="model"?Qt:e==="sound"?er:e==="texture"?Zt:e==="image"?ln:[]}class _e extends Error{constructor(t,r){super(r),this.code=t,this.name="PlayableEditorManagedAssetError"}}function ai(){const e=globalThis.crypto;return Zo({...typeof e?.randomUUID=="function"?{randomUUID:()=>e.randomUUID()}:{},fillRandomBytes(t){if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r+=1)t[r]=Math.floor(Math.random()*256)}})}function Ws(e){return un(e)}function oi(e,t){return ei(e,t)}function Mr(e){return tr(e).trim()}function mn(e,t,r){const a=di(t.kind,t.assetPath??t.assetName),n=de(t.guid),o=de(t.assetId),i=fn(t),s=li(e,t);if(s&&n&&s.guid&&s.guid!==n)throw new _e(r.errorCodes.assetIdConflict,`Requested guid "${n}" does not match existing asset guid "${s.guid}"`);const l=s?.guid??n??ai(),d=oi(a,l);if(s?.id&&s.id!==d)throw new _e(r.errorCodes.assetIdConflict,`Asset id "${s.id}" does not match guid "${l}" (expected "${d}")`);if(o&&o!==d)throw new _e(r.errorCodes.assetIdConflict,`Project asset id "${o}" does not match guid "${l}" (expected "${d}")`);const S=e.assets.find(c=>c.id===d&&c.guid&&c.guid!==l);if(S)throw new _e(r.errorCodes.assetIdConflict,`Asset id "${d}" already points to guid "${S.guid}"`);return{guid:l,assetId:d,kind:a,...i?{external:i}:s?.external?{external:s.external}:{}}}function ii(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(!e||typeof e!="object")return;const t=e,r=Dt(t.x),a=Dt(t.y),n=Dt(t.z);if(!(r==null||a==null||n==null||r<=0||a<=0||n<=0))return{x:r,y:a,z:n}}function Ut(e,t,r){const a=mn(e,t,r),n=t.displayName?.trim()||Mr(t.assetName)||Mr(t.assetPath?.split("/").pop())||"Imported Asset",o=t.category?.trim(),i=ui(t.materialMode),s=mi(t.warmupCount),l=ii(t.defaultScale??t.scale),d=fi(t.metadata);return{...a,displayName:n,...o?{category:o}:{},...i?{materialMode:i}:{},...s!=null?{warmupCount:s}:{},...typeof t.singleton=="boolean"?{singleton:t.singleton}:{},...l?{scale:l}:{},...d?{metadata:d}:{}}}function $t(e,t){if(e.kind==="model")return{id:e.assetId,guid:e.guid,type:"glb",displayName:e.displayName,...e.category?{category:e.category}:{},...e.materialMode?{materialMode:e.materialMode}:{},...e.warmupCount!=null?{warmupCount:e.warmupCount}:{},...typeof e.singleton=="boolean"?{singleton:e.singleton}:{},...e.scale?{defaults:{transform:{scale:e.scale}}}:{},...e.external?{external:e.external}:{},metadata:{...e.metadata??{},[t.metadata.key]:t.metadata.value}}}function si(e,t,r){const a=t.assetName||t.assetPath?.split("/").pop()||"imported_asset.glb",n=Ut(e,{...t,assetName:a},r),o=t.requestId,i=t.payloadPath??t.createPayloadPath?.({...o?{requestId:o}:{},guid:n.guid,assetId:n.assetId,kind:n.kind})??`/tmp/playable-editor-asset-${o??n.assetId}.json`,s=$t(n,r),l=t.registerCommand??"npm run asset:register",d={...t.assetPath?{sourcePath:t.assetPath,assetPath:t.assetPath}:{},...t.assetUrl?{assetUrl:t.assetUrl}:{},guid:n.guid,projectAssetId:n.assetId,assetType:n.kind,assetName:a,displayName:n.displayName,...n.category?{category:n.category}:{},...n.materialMode?{materialMode:n.materialMode}:{},...n.warmupCount!=null?{warmupCount:n.warmupCount}:{},...typeof n.singleton=="boolean"?{singleton:n.singleton}:{},...n.scale?{scale:n.scale}:{},...n.metadata?{metadata:n.metadata}:{},...n.external?{external:n.external}:{},...n.external?.platformAssetId?{platformAssetId:n.external.platformAssetId}:{}},S=`${l} -- --payload ${i}`;return{...o?{requestId:o}:{},guid:n.guid,assetId:n.assetId,kind:n.kind,displayName:n.displayName,...n.external?{external:n.external}:{},transportPlan:{writes:[{path:i,contentType:"application/json",content:d}],commands:[{cmd:S,cwd:".",timeoutMs:6e4}]},...s?{sceneAsset:s}:{}}}function ci(e,t){const r=de(e.assetId),a=de(e.guid);if(!r&&!a)throw new _e(t.errorCodes.missingAssetId??"missing_asset_id","Missing assetId or guid for asset unregistration");const n=e.requestId,o=e.payloadPath??e.createPayloadPath?.({...n?{requestId:n}:{},...r?{assetId:r}:{},...a?{guid:a}:{}})??`/tmp/playable-editor-asset-unregister-${n??r??a}.json`,i=e.deleteFile!==!1,s=e.unregisterCommand??"npm run asset:unregister",l={...r?{assetId:r}:{},...a?{guid:a}:{},deleteFile:i},d=`${s} -- --payload ${o}`;return{...n?{requestId:n}:{},...a?{guid:a}:{},assetId:r??"",transportPlan:{writes:[{path:o,contentType:"application/json",content:l}],commands:[{cmd:d,cwd:".",timeoutMs:6e4}]}}}function de(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function di(e,t){return ti(e,t)??"model"}function fn(e){const t=e.external&&typeof e.external=="object"?e.external:{},r=de(t.platformAssetId)??de(e.platformAssetId);let a;if(Object.prototype.hasOwnProperty.call(t,"assetPath")){try{a=Qr(t.assetPath)}catch{throw new _e("external_asset_path_must_be_portable","Explicit external.assetPath must be a non-empty portable relative path")}if(!a)throw new _e("external_asset_path_must_be_portable","Explicit external.assetPath must be a non-empty portable relative path")}const n=de(t.assetUrl)??de(e.assetUrl);if(!(!r&&!a&&!n))return{...r?{platformAssetId:r}:{},...a?{assetPath:a}:{},...n?{assetUrl:n}:{}}}function li(e,t){const r=de(t.guid),a=de(t.assetId),n=fn(t);return e.assets.find(o=>!!(r&&o.guid===r||a&&o.id===a||n?.platformAssetId&&o.external?.platformAssetId===n.platformAssetId||n?.assetPath&&o.external?.assetPath===n.assetPath))}function Dt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ui(e){return e==="shared"||e==="instance"?e:void 0}function mi(e){return Number.isInteger(e)&&e>=0?e:void 0}function fi(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return JSON.parse(JSON.stringify(e))}function gi(e){return{resolveAssetIdentity:(t,r,a=e.rules)=>$e(e,()=>mn(t,r,a)),buildAssetArgs:(t,r,a=e.rules)=>$e(e,()=>Ut(t,r,a)),createSceneAsset:(t,r=e.rules)=>$t(t,r),planAssetRegistrationCore:(t,r,a=e.rules)=>$e(e,()=>si(t,pi(r,e),a)),planAssetUnregistrationCore:(t,r=e.rules)=>$e(e,()=>ci(Ei(t,e),r)),resolveAssetReference:(t,r,a=e.rules)=>{const n=$e(e,()=>Ut(t,r,a)),o=$t(n,a);if(!o)throw new Error(`Asset "${n.assetId}" is not a placeable model asset`);return{guid:n.guid,assetId:n.assetId,displayName:n.displayName,asset:o}}}}function pi(e,t){return{...e,kind:e.kind??e.assetType,createPayloadPath:e.createPayloadPath??(e.payloadPath?void 0:t.createRegistrationPayloadPath)}}function Ei(e,t){return{...e,createPayloadPath:e.createPayloadPath??(e.payloadPath?void 0:t.createUnregistrationPayloadPath)}}function $e(e,t){try{return t()}catch(r){throw e.wrapError&&e.wrapError(r),r}}function Ks(e){const t=gi(e);return{facade:t,planAssetRegistration(r,a){return t.planAssetRegistrationCore(Or(a),r)},planAssetRegistrationWithAssets(r,a){return t.planAssetRegistrationCore({assets:r},a)},planAssetUnregistration(r){return t.planAssetUnregistrationCore(r)},resolveAssetReference(r,a){return t.resolveAssetReference(Or(a),r)}}}function Or(e){return{assets:e.getAssets()}}const hi="/__fps_runtime/debug-authoring";function Js(e={}){const t=e.endpoint?.trim()||hi,r=e.fetch??globalThis.fetch,a=Math.max(1,e.operationTimeoutMs??3e4);if(typeof r!="function")throw new Error("runtime_debug_authoring_fetch_unavailable");const n=async l=>{const d=await r(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(l)}),S=await d.json().catch(()=>null);if(!S)throw new Error(Mt(S,`runtime_debug_authoring_http_${d.status}`));if(!S.ok)throw new Error(Mt(S,`runtime_debug_authoring_http_${d.status}`));if(!d.ok)throw new Error(`runtime_debug_authoring_http_${d.status}`);return S},o=async l=>{const d=await n({kind:"command.invoke",invocation:l,timeoutMs:Math.min(a,1e4)});if(d.kind!=="operation"||!d.operation)throw new Error("runtime_debug_authoring_operation_missing");let S=d.operation;const c=Date.now()+a;for(;S.status==="accepted"||S.status==="running";){if(Date.now()>=c)throw new Error("runtime_debug_authoring_operation_timeout");await Si(25);const m=await n({kind:"operation.get",operationId:S.operationId});if(m.kind!=="operation"||!m.operation)throw new Error("runtime_debug_authoring_operation_missing");S=m.operation}if(S.status!=="completed")throw new Error(Mt({ok:!1,diagnostics:S.diagnostics??[]},`runtime_debug_authoring_operation_${S.status}`));return S};return Object.freeze({load:async()=>{const l=await n({kind:"authoring.snapshot"});if(l.kind!=="authoring.snapshot"||l.result.kind!=="snapshot-required")throw new Error("runtime_debug_authoring_snapshot_missing");const d=l.result.snapshot,S=Nr("companion"),c=await o({commandId:"document.companionState.get",input:{},requestId:S,idempotencyKey:S,expectedRevision:{serviceInstanceId:d.serviceInstanceId,document:d.documentRevision},principal:{type:"human"},source:"runtime-debug-panel",surface:"runtime-debug-panel"});return{snapshot:d,companionState:Lr(c)}},async commitAndSave(l){const d=Nr("commit"),S=await o({commandId:"runtimeDebug.commitAndSave",intentCommandId:l.commandId,input:{commandId:l.commandId,inputFingerprint:l.inputFingerprint,document:l.document,...l.companionConfigs?{companionConfigs:l.companionConfigs}:{},...l.shadowMapExperimentConfig?{shadowMapExperimentConfig:l.shadowMapExperimentConfig}:{}},requestId:d,idempotencyKey:d,expectedRevision:{serviceInstanceId:l.serviceInstanceId,document:l.expectedDocumentRevision},principal:{type:"human"},source:"runtime-debug-panel",surface:"runtime-debug-panel"});return Lr(S)}})}function Lr(e){const t=e.output;if(!t||typeof t!="object"||Array.isArray(t))throw new Error("runtime_debug_authoring_output_invalid");return t}function Mt(e,t){return e&&!e.ok&&e.diagnostics.length>0?e.diagnostics.map(r=>`${r.code}: ${r.message}`).join("; "):t}function Nr(e){const t=globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2)}`;return`runtime-debug-${e}-${t}`}function Si(e){return new Promise(t=>setTimeout(t,e))}const bi=["/__fps_editor_authoring"],yi=[["manifest","/manifest"],["commit","/commit"],["editor-scene","/editor-scene"],["editor-asset-library","/editor-asset-library"],["project-files","/project-files"],["project-media","/project-media"],["project-file","/project-file"],["save-editor-scene","/save-editor-scene"],["file","/file"],["exec","/exec"]];function Ii(e,t={}){const r=new URL(e??"","http://localhost").pathname,a=t.prefixes??bi,n=Pi(r,a);if(!n)return null;const o=r.slice(n.length)||"/",i=Ai(o);return i?{route:o,routeName:i,prefix:n}:null}function Pi(e,t){return t.find(r=>e.startsWith(r))??null}function Ai(e){return yi.find(([,t])=>e.startsWith(t))?.[0]??null}function U(e,t){return{statusCode:e,body:t}}function gn(e){return{statusCode:e,body:null}}function Ti(e){return typeof e=="string"?e:`${JSON.stringify(e??{},null,2)}
|
|
6
|
-
`}function wi(e){const r=e.match(/(?:^|\s)--payload(?:=|\s+)("[^"]+"|'[^']+'|\S+)/)?.[1]??"";return r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}async function Xs(e,t){const r=Ii(e.url);if(!r)return null;const a=(e.method??"GET").toUpperCase();if(a==="OPTIONS")return gn(204);try{if(Ri(r.routeName)){if(a!=="GET")return U(405,{ok:!1,error:"method_not_allowed"});if(r.routeName==="project-file"){const o=new URL(e.url??"","http://localhost").searchParams.get("path")?.trim()??"";if(!o)return U(400,{ok:!1,error:"missing_file_path"});const i=await t.loadProjectFile?.({path:o,route:r});return U(200,i??{ok:!1,error:"not_found"})}return U(200,await _i(r,t))}if(a!=="POST")return U(405,{ok:!1,error:"method_not_allowed"});const n=e.body??await t.readBody?.(e,r)??{};return await vi(r,n,t)}catch(n){return U(500,{ok:!1,error:n instanceof Error?n.message:String(n),code:typeof n?.code=="string"?n.code:"authoring_request_failed",details:Pe(n?.details)})}}function Ri(e){return e==="manifest"||e==="editor-scene"||e==="editor-asset-library"||e==="project-files"||e==="project-file"||e==="project-media"}async function _i(e,t){return e.routeName==="manifest"&&t.loadManifest?t.loadManifest(e):e.routeName==="editor-scene"&&t.loadEditorScene?t.loadEditorScene(e):e.routeName==="editor-asset-library"&&t.loadEditorAssetLibrary?t.loadEditorAssetLibrary(e):e.routeName==="project-files"&&t.loadProjectFiles?t.loadProjectFiles(e):{ok:!1,error:"not_found"}}async function vi(e,t,r){return e.routeName==="file"?Ci(e,t,r):e.routeName==="exec"?Di(e,t,r):e.routeName==="save-editor-scene"?Mi(e,t,r):e.routeName==="commit"?U(410,await Oi(e,t,r)):U(404,{ok:!1,error:"not_found"})}async function Ci(e,t,r){const a=String(t.path??""),n=r.normalizeTransportPath?.(a)??a;if(!n)return U(400,{ok:!1,error:"missing_file_path"});const o=t.content,i=Ti(o),s=await r.writeFile?.({body:t,path:n,rawPath:a,content:o,text:i,route:e});return U(200,s??{ok:!0,path:n})}async function Di(e,t,r){const a=String(t.cmd??""),n=wi(a);if(!n)return U(400,{ok:!1,error:"missing_payload_arg",cmd:a});const o=r.normalizeTransportPath?.(n)??n,i=await r.runCommand?.({body:t,cmd:a,payloadPath:o,rawPayloadPath:n,route:e});return U(200,i??{ok:!0,cmd:a})}async function Mi(e,t,r){const a=t.mode==="prepare-platform-save"?"prepare-platform-save":"local-commit-save",n=await r.saveEditorScene?.({body:t,mode:a,rawEditorScene:t.editorScene,route:e});return U(200,n??{ok:!1,error:"not_found"})}async function Oi(e,t,r){return r.commit?.({body:t,route:e})??{ok:!1,error:"platform_commit_route_disabled",message:"Save through /__fps_editor_authoring/save-editor-scene so scene.main remains the authoring source of truth."}}const we=Ia,ae=Pa,Qs=Aa;function Qe(e){return x(e.requestId)}function pn(e){return{requestId:Qe(e),assetName:x(e.assetName),assetPath:x(e.assetPath),assetUrl:x(e.assetUrl),guid:x(e.guid),assetId:x(e.projectAssetId),kind:x(e.assetType)??x(e.kind),platformAssetId:x(e.platformAssetId)??x(e.assetId),displayName:x(e.displayName),category:x(e.category),materialMode:e.materialMode,scale:e.scale,defaultScale:e.defaultScale,metadata:Pe(e.metadata),payloadPath:x(e.payloadPath)}}function Li(e){return{requestId:Qe(e),guid:x(e.guid),assetId:x(e.projectAssetId)??x(e.assetId),payloadPath:x(e.payloadPath),deleteFile:typeof e.deleteFile=="boolean"?e.deleteFile:void 0}}function Ni(e){const t=x(e.assetName)??"",r=x(e.assetPath);return{...pn(e),kind:x(e.assetType)??x(e.kind)??"model",rawAssetName:t,inferredAssetPath:r,inferredAssetUrl:x(e.assetUrl)??(r?`/@fs${r}`:""),instanceScale:e.instanceScale,dropSurfaceName:x(e.dropSurfaceName),clientX:typeof e.clientX=="number"&&Number.isFinite(e.clientX)?e.clientX:void 0,clientY:typeof e.clientY=="number"&&Number.isFinite(e.clientY)?e.clientY:void 0,position:e.position}}function xi(e){const t=ji(e);return{requestId:Qe(e),id:x(e.id),name:x(e.name),kind:e.kind,parentId:x(e.parentId),enabled:typeof e.enabled=="boolean"?e.enabled:void 0,transform:e.transform,instance:e.instance,primitive:e.primitive,transformType:e.transformType,...t?{customTransformData:t}:{},camera:e.camera,light:e.light}}function ki(e){return{requestId:Qe(e),nodeId:x(e.nodeId)??"",patches:Array.isArray(e.patches)?e.patches:x(e.path)?[{path:e.path,value:e.value}]:[]}}function xr(e){return{requestId:Qe(e),nodeId:x(e.nodeId)}}function x(e){if(typeof e!="string")return;const t=e.trim();return t||void 0}function ji(e){const t=new Set(["requestId","id","name","kind","parentId","enabled","transform","instance","primitive","transformType","customTransformData","camera","light"]),r=Pe(e.customTransformData),a=r?{...r}:{};for(const[n,o]of Object.entries(e))t.has(n)||(a[n]=o);return Object.keys(a).length>0?a:void 0}function Gi(e,t,r={}){const a=r.readProjectError?.(e);if(a)return a;const n=e,o=ie(n?.code)??t,i=e instanceof Error?e.message:ie(n?.message)??String(e),s=Pe(n?.details);return{code:o,error:i,...s?{details:s}:{}}}function Fi(e,t={}){const r=new Set(t.omitKeys??["rootNode"]),a={...e};for(const n of r)delete a[n];return a}function Bi(e){return{async handleCommand(t,r,a){const n=a;if(t===we.ASSET_REGISTRATION_PLAN){const o=pn(r);return await st({eventName:ae.ASSET_REGISTRATION_PLANNED,failedEventName:ae.ASSET_REGISTRATION_FAILED,requestId:o.requestId,fallbackCode:e.errorCodes.assetRegistrationPlanFailed,emitEvent:e.emitEvent,createCommandError:e.handlers.createCommandError,run:()=>e.handlers.assetRegistrationPlan(o,n)}),!0}if(t===we.ASSET_UNREGISTRATION_PLAN){const o=Li(r);return await st({eventName:ae.ASSET_UNREGISTRATION_PLANNED,failedEventName:ae.ASSET_UNREGISTRATION_FAILED,requestId:o.requestId,fallbackCode:e.errorCodes.assetUnregistrationPlanFailed,emitEvent:e.emitEvent,createCommandError:e.handlers.createCommandError,run:()=>e.handlers.assetUnregistrationPlan(o,n)}),!0}if(t===we.ASSET_IMPORT){const o=Ni(r),i=await e.handlers.assetImport(o,n);return i&&e.emitEvent(ae.ASSET_IMPORT_RESULT,i),!0}if(t===we.ASSET_REMOVE){const o=xr(r),i=await e.handlers.assetRemove(o,n);return i&&e.emitEvent(ae.ASSET_REMOVE_RESULT,i),!0}if(t===we.SCENE_NODE_CREATE){const o=xi(r);return await st({eventName:ae.SCENE_NODE_CREATE_RESULT,failedEventName:ae.SCENE_NODE_CREATE_RESULT,requestId:o.requestId,fallbackCode:e.errorCodes.sceneNodeCreateFailed,emitEvent:e.emitEvent,createCommandError:e.handlers.createCommandError,run:()=>e.handlers.sceneNodeCreate(o,n)}),!0}if(t===we.SCENE_NODE_PATCH){const o=ki(r);return await st({eventName:ae.SCENE_NODE_PATCH_RESULT,failedEventName:ae.SCENE_NODE_PATCH_RESULT,requestId:o.requestId,fallbackCode:e.errorCodes.sceneNodePatchFailed,failureExtra:{nodeId:o.nodeId},emitEvent:e.emitEvent,createCommandError:e.handlers.createCommandError,run:()=>e.handlers.sceneNodePatch(o,n)}),!0}if(t===we.SCENE_NODE_REMOVE){const o=xr(r),i=await e.handlers.sceneNodeRemove(o,n);return i&&e.emitEvent(ae.SCENE_NODE_REMOVE_RESULT,i),!0}return!1}}}async function st(e){try{const t=await e.run();t&&e.emitEvent(e.eventName,t)}catch(t){e.emitEvent(e.failedEventName,{requestId:e.requestId,ok:!1,...e.failureExtra,...e.createCommandError(t,e.fallbackCode)})}}function Zs(e){const t=e.notifyDocumentStatus??(()=>{}),r=e.createCommandError??((a,n)=>Gi(a,n));return Bi({emitEvent:e.emitEvent,errorCodes:e.errorCodes,handlers:{createCommandError:r,assetRegistrationPlan:(a,n)=>e.planAssetRegistration(a,n),assetUnregistrationPlan:(a,n)=>e.planAssetUnregistration(a,n),assetImport:(a,n)=>zi(a,n,e,t),assetRemove:(a,n)=>Ui(a,n,e,t),sceneNodeCreate:async(a,n)=>{e.ensureDocumentLoaded();const o=await e.sceneNodeCreate(a,n);return o.rootNode&&e.selectRuntimeNode?.(o.rootNode),t(),{requestId:a.requestId,ok:!0,nodeId:o.node.id,node:o.node}},sceneNodePatch:async(a,n)=>{e.ensureDocumentLoaded();const o=await e.sceneNodePatch(a,n);return o.rootNode&&e.selectRuntimeNode?.(o.rootNode),t(),{requestId:a.requestId,ok:!0,nodeId:o.node.id,node:o.node}},sceneNodeRemove:async(a,n)=>{e.ensureDocumentLoaded();const o=await e.sceneNodeRemove(a,n);return o&&(e.selectRuntimeNode?.(null),t()),{requestId:a.requestId,ok:!!o,nodeId:a.nodeId,...o?{removedNodeId:o.node.id}:{code:e.errorCodes.nodeNotFound,error:e.errorCodes.nodeNotFound}}}}})}async function zi(e,t,r,a){if(r.isBridgeActive?.())return null;r.ensureDocumentLoaded();const n=r.executeTransportPlan??(c=>nn(c)),o=$i(e.inferredAssetUrl)||(e.inferredAssetPath?`/@fs${e.inferredAssetPath}`:""),i=await r.planAssetRegistration({...e,assetName:e.rawAssetName||void 0,assetPath:e.inferredAssetPath,assetUrl:o},t),s=i.transportPlan;if(e.inferredAssetPath&&!s)throw new Error("Asset registration transportPlan is required before placing an inferred project asset.");let l=null;e.inferredAssetPath&&(l=await n(s,t));const d=tn({result:l,fallback:{guid:i.guid,assetId:i.assetId,assetUrl:o,external:i.external}}),S=await r.createAssetInstance({requestId:e.requestId,guid:d.guid,assetId:d.assetId,external:d.external,assetUrl:d.assetUrl,assetName:e.rawAssetName||void 0,displayName:e.displayName,category:e.category,materialMode:e.materialMode,scale:e.scale,defaultScale:e.defaultScale,instanceScale:e.instanceScale,metadata:e.metadata,dropSurfaceName:e.dropSurfaceName,clientX:e.clientX,clientY:e.clientY,position:e.position},t);return S.ok&&(S.rootNode&&r.selectRuntimeNode?.(S.rootNode),a()),Fi(S)}async function Ui(e,t,r,a){r.ensureDocumentLoaded();const n=e.nodeId?await r.removeAssetInstance(e,t):{ok:!1,assetId:"",code:r.errorCodes.missingNodeId,error:r.errorCodes.missingNodeId};return n.ok&&(r.selectRuntimeNode?.(null),a()),{requestId:e.requestId,...n}}function $i(e){return typeof e=="string"&&e.trim()?e.trim():void 0}const He="public-export",M="bundled-alias",Re="external-peer",oe="default",j="exclude",Ne="prebundle",Hi=[["@fps-games/editor","packages/editor/src/index.ts",null,He,oe],["@fps-games/editor/vite","packages/editor/src/vite.ts",null,He,oe],["@fps-games/engine",null,null,Re,oe],["@fps-games/engine/config",null,null,Re,oe],["@fps-games/engine/rendering",null,null,Re,oe],["@fps-games/engine/babylon",null,null,Re,Ne],["@fps-games/editor-tooling","packages/editor-tooling/src/index.ts","@fps-games/editor-tooling/dist/index.js",M,j],["@fps-games/editor-tooling/node","packages/editor-tooling/src/package-metadata-node.ts","@fps-games/editor-tooling/dist/package-metadata-node.js",M,j],["@fps-games/editor-tooling/vite","packages/editor-tooling/src/vite.ts","@fps-games/editor-tooling/dist/vite.js",M,j],["@fps-games/plugin-sdk",null,null,Re,oe],["@fps-games/plugin-sdk/host",null,null,Re,oe],["@fps-games/plugin-sdk/runtime",null,null,Re,oe],["@fps-games/plugin-hierarchy","packages/plugin-hierarchy/src/reference.ts","@fps-games/plugin-hierarchy/dist/reference.js",M,Ne],["@fps-games/plugin-hierarchy/kernel","packages/plugin-hierarchy/src/kernel.ts","@fps-games/plugin-hierarchy/dist/kernel.js",M,j],["@fps-games/plugin-hierarchy/integration","packages/plugin-hierarchy/src/integration.ts","@fps-games/plugin-hierarchy/dist/integration.js",M,j],["@fps-games/plugin-hierarchy/editor","packages/plugin-hierarchy/src/editor.ts","@fps-games/plugin-hierarchy/dist/editor.js",M,Ne],["@fps-games/editor/playable-sdk","packages/editor/src/playable-sdk.ts",null,He,oe],["@fps-games/editor/playable-sdk/upgrade-doctor","packages/editor/src/playable-sdk-upgrade-doctor.ts",null,He,oe],["@fps-games/editor/playable-sdk/vite","packages/editor/src/playable-sdk-vite.ts",null,He,oe],["@fps-games/editor-playable-sdk","packages/editor-playable-sdk/src/index.ts","@fps-games/editor-playable-sdk/dist/index.js",M,j],["@fps-games/editor-playable-sdk/internal/authoring-queries","packages/editor-playable-sdk/src/internal/authoring-queries.ts","@fps-games/editor-playable-sdk/dist/internal/authoring-queries.js",M,j],["@fps-games/editor-playable-sdk/internal/local-harness","packages/editor-playable-sdk/src/internal/local-harness.ts","@fps-games/editor-playable-sdk/dist/internal/local-harness.js",M,j],["@fps-games/editor-playable-sdk/upgrade-doctor","packages/editor-playable-sdk/src/upgrade-doctor/index.ts","@fps-games/editor-playable-sdk/dist/upgrade-doctor/index.js",M,j],["@fps-games/editor-playable-sdk/vite","packages/editor-playable-sdk/src/vite/index.ts","@fps-games/editor-playable-sdk/dist/vite/index.js",M,j],["@fps-games/editor-babylon","packages/editor-babylon/src/index.ts","@fps-games/editor-babylon/dist/index.js",M,j],["@fps-games/editor-browser","packages/editor-browser/src/index.ts","@fps-games/editor-browser/dist/index.js",M,j],["@fps-games/editor-browser/plugin-contributions","packages/editor-browser/src/plugin-contributions.ts","@fps-games/editor-browser/dist/plugin-contributions.js",M,j],["@fps-games/editor-browser/runtime-debug","packages/editor-browser/src/runtime-debug.ts","@fps-games/editor-browser/dist/runtime-debug.js",M,j],["@fps-games/editor-core","packages/editor-core/src/index.ts","@fps-games/editor-core/dist/index.js",M,j],["@fps-games/editor-core/plugin-host","packages/editor-core/src/editor-plugin-host.ts","@fps-games/editor-core/dist/editor-plugin-host.js",M,j],["@fps-games/editor-core/lifecycle","packages/editor-core/src/lifecycle.ts","@fps-games/editor-core/dist/lifecycle.js",M,j],["@fps-games/editor-core/events","packages/editor-core/src/events.ts","@fps-games/editor-core/dist/events.js",M,j],["@fps-games/editor-core/document-adapter","packages/editor-core/src/document-adapter.ts","@fps-games/editor-core/dist/document-adapter.js",M,j],["@fps-games/editor-core/diagnostics","packages/editor-core/src/editor-diagnostic-store.ts","@fps-games/editor-core/dist/editor-diagnostic-store.js",M,j],["@fps-games/editor-core/tools","packages/editor-core/src/editor-tools.ts","@fps-games/editor-core/dist/editor-tools.js",M,j],["@fps-games/editor-forge-play","packages/editor-forge-play/src/index.ts","@fps-games/editor-forge-play/dist/index.js",M,j],["@fps-games/editor-protocol","packages/editor-protocol/src/index.ts","@fps-games/editor-protocol/dist/index.js",M,j],["@fps-games/editor-ui","packages/editor-ui/src/index.ts","@fps-games/editor-ui/dist/index.js",M,j],["@babel/parser",null,"@babel/parser/lib/index.js",M,Ne],["@playcanvas/observer",null,"@playcanvas/observer/dist/index.mjs",M,j],["@playcanvas/pcui",null,"@playcanvas/pcui/dist/module/src/index.mjs",M,j],["@playcanvas/pcui/styles",null,"@playcanvas/pcui/styles/dist/index.mjs",M,j],["semver",null,"semver/index.js",M,Ne]],Ze=Object.freeze(Hi.map(([e,t,r,a,n])=>Object.freeze({packageId:e,...t?{sourceFile:t}:{},...r?{bundledFile:r,bundledRoot:"editor-node-modules"}:{},resolution:a,optimizer:n,projectAllowlist:!0}))),ec=Object.freeze(Ze.filter(e=>e.projectAllowlist).map(e=>e.packageId)),tc=Object.freeze(Ze.filter(e=>e.resolution===M).map(e=>e.packageId)),rc=Object.freeze(Ze.filter(e=>e.optimizer===Ne).map(e=>e.packageId));function Vi(e,t={}){const r=t.resolvePath??rr;return{entries:Ze.filter(a=>typeof a.sourceFile=="string").map(a=>({packageId:a.packageId,file:r(e,...a.sourceFile.split("/"))}))}}function nc(e,t={}){const r=Vi(e,{resolvePath:t.resolvePath}),a=t.relativePath??Yi,n={};for(const o of r.entries){if(o.packageId==="semver")continue;const i=t.pathOverrides?.[o.packageId];n[o.packageId]=i?qi(i):[t.projectRoot?Ge(a(t.projectRoot,o.file)):Ge(o.file)]}return{paths:n}}function ac(e,t={}){const r=t.resolvePath??rr,a=r(e,"node_modules","@fps-games","editor");return{editorPackageRoot:a,bundledEditorPackagesRoot:r(a,"node_modules","@fps-games"),bundledEditorNodeModulesRoot:r(a,"node_modules"),editorPackageJsonPath:r(a,"package.json")}}function oc(e){const t=e.resolvePath??rr,r=e.bundledEditorNodeModulesRoot??kr(e.bundledEditorPackagesRoot),a=e.editorPackageRoot??kr(r);return{entries:Ze.filter(o=>o.resolution===M&&typeof o.bundledFile=="string").map(o=>({packageId:o.packageId,file:t(o.bundledRoot==="editor-package"?a:r,...o.bundledFile.split("/"))}))}}function ic(e,t){return e.entries.filter(r=>!t(r.file)).map(r=>({packageId:r.packageId,file:r.file}))}function sc(e,t="The @fps-games editor package aliases point to missing files."){return[t,...e.map(r=>`- ${r.packageId}: ${r.file}`)].join(`
|
|
7
|
-
`)}function rr(...e){return e.filter(t=>t.length>0).join("/").replace(/\/+/g,"/")}function Ge(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function kr(e){const t=Ge(e).replace(/\/$/,""),r=t.lastIndexOf("/");return r>0?t.slice(0,r):"."}function qi(e){return(Array.isArray(e)?e:[e]).map(Ge)}function Yi(e,t){const r=Ge(e).replace(/\/$/,""),a=Ge(t).replace(/\/$/,""),n=r.split("/").filter(Boolean),o=a.split("/").filter(Boolean);let i=0;for(;i<n.length&&i<o.length&&n[i]===o[i];)i+=1;const s=n.slice(i).map(()=>".."),l=o.slice(i);return[...s,...l].join("/")||"."}const Wi=new Set(["leftToRight","rightToLeft","bottomToTop","topToBottom"]);function cc(e){const t=Ta(e),r={uiKind:e.uiKind,size:{width:e.size.width,depth:e.size.depth},layers:e.layers.map((a,n)=>Ki(a,n)),rendering:{textureWidth:t.width,textureHeight:t.height}};return e.aspectSourceLayerId&&(r.aspectSourceLayerId=e.aspectSourceLayerId),typeof e.lockAspectToBorder=="boolean"&&(r.lockAspectToBorder=e.lockAspectToBorder),e.mask&&(r.mask={...typeof e.mask.enabled=="boolean"?{enabled:e.mask.enabled}:{},...e.mask.source==="roundedRect"||e.mask.source==="borderAlpha"||e.mask.source==="texture"?{source:e.mask.source}:{},...e.mask.textureId?{textureId:e.mask.textureId}:{},...typeof e.mask.cornerRadius=="number"&&Number.isFinite(e.mask.cornerRadius)?{cornerRadius:e.mask.cornerRadius}:{},...typeof e.mask.padding=="number"&&Number.isFinite(e.mask.padding)?{padding:e.mask.padding}:{}}),e.rendering&&(r.rendering={...r.rendering,...typeof e.rendering.alphaIndex=="number"&&Number.isFinite(e.rendering.alphaIndex)?{alphaIndex:e.rendering.alphaIndex}:{},...typeof e.rendering.diffuseTextureLevel=="number"&&Number.isFinite(e.rendering.diffuseTextureLevel)?{diffuseTextureLevel:e.rendering.diffuseTextureLevel}:{},...typeof e.rendering.emissiveTextureLevel=="number"&&Number.isFinite(e.rendering.emissiveTextureLevel)?{emissiveTextureLevel:e.rendering.emissiveTextureLevel}:{}}),r}function Ki(e,t){const r=wa(e.rotationDeg??0)??0,a={id:e.id,role:e.role,zOrder:typeof e.zOrder=="number"&&Number.isFinite(e.zOrder)?e.zOrder:t,rect:Ji(e.rect),...r!==0?{rotationDeg:r}:{},...typeof e.enabled=="boolean"?{enabled:e.enabled}:{},...typeof e.opacity=="number"&&Number.isFinite(e.opacity)?{opacity:e.opacity}:{}};return e.kind==="texture"?{...a,kind:"texture",...e.textureId?{textureId:e.textureId}:{},...e.tint?{tint:Oe(e.tint)}:{},...e.imageFit?{imageFit:e.imageFit}:{}}:e.kind==="textureProgress"?{...a,kind:"textureProgress",...e.textureId?{textureId:e.textureId}:{},value:Gr(e.value),...e.tint?{tint:Oe(e.tint)}:{},...e.imageFit?{imageFit:e.imageFit}:{},...jr(e.direction)?{direction:e.direction}:{}}:e.kind==="color"?{...a,kind:"color",color:Oe(e.color)}:e.kind==="progress"?{...a,kind:"progress",value:Gr(e.value??0),color:Oe(e.color),...jr(e.direction)?{direction:e.direction}:{}}:{...a,kind:"text",text:{value:e.text.value,color:Oe(e.text.color),...e.text.fontFamily?{fontFamily:e.text.fontFamily}:{},...typeof e.text.fontSize=="number"&&Number.isFinite(e.text.fontSize)?{fontSize:e.text.fontSize}:{},...e.text.fontWeight!=null?{fontWeight:String(e.text.fontWeight)}:{},...e.text.strokeColor?{strokeColor:Oe(e.text.strokeColor)}:{},...typeof e.text.strokeWidth=="number"&&Number.isFinite(e.text.strokeWidth)?{strokeWidth:e.text.strokeWidth}:{},...e.text.align==="left"||e.text.align==="center"||e.text.align==="right"?{align:e.text.align}:{},...e.text.baseline==="top"||e.text.baseline==="middle"||e.text.baseline==="bottom"?{baseline:e.text.baseline}:{}}}}function Ji(e){return{x:e.x,z:e.z,width:e.width,depth:e.depth}}function Oe(e){return{r:e.r,g:e.g,b:e.b,...typeof e.a=="number"?{a:e.a}:{}}}function jr(e){return typeof e=="string"&&Wi.has(e)}function Gr(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}const En=1,Xi="/__fps_editor/entry-manifest.json",Qi="no-cache",Zi="public, max-age=31536000, immutable";function es(e){return ns({schemaVersion:En,build:{packageName:le(e.packageName,"packageName"),version:le(e.version,"version"),buildId:le(e.buildId,"buildId"),distHash:le(e.distHash,"distHash")},entry:{kind:"module",url:hn(e.entryUrl),cache:e.entryCache??"revalidate"},cacheControl:{manifest:Qi,immutableResource:Zi}})}function ts(e){if(!Ot(e))throw new Error("Editor entry manifest must be an object.");if(e.schemaVersion!==En)throw new Error(`Unsupported Editor entry manifest schemaVersion: ${String(e.schemaVersion)}.`);if(!Ot(e.build))throw new Error("Editor entry manifest build must be an object.");if(!Ot(e.entry))throw new Error("Editor entry manifest entry must be an object.");if(e.entry.kind!=="module")throw new Error("Editor entry manifest entry.kind must be module.");if(e.entry.cache!=="revalidate"&&e.entry.cache!=="immutable")throw new Error("Editor entry manifest entry.cache must be revalidate or immutable.");return es({packageName:le(e.build.packageName,"build.packageName"),version:le(e.build.version,"build.version"),buildId:le(e.build.buildId,"build.buildId"),distHash:le(e.build.distHash,"build.distHash"),entryUrl:hn(e.entry.url),entryCache:e.entry.cache})}function rs(e,t){const r=new URL(e.entry.url,le(t.baseUrl,"baseUrl"));r.searchParams.set("fps-editor-build",e.build.buildId);const a=t.retryAttempt??1;if(!Number.isInteger(a)||a<1)throw new Error("Editor entry retryAttempt must be a positive integer.");return a>1?r.searchParams.set("fps-editor-entry-retry",String(a)):r.searchParams.delete("fps-editor-entry-retry"),r.href}function ns(e){return Object.freeze({...e,build:Object.freeze({...e.build}),entry:Object.freeze({...e.entry}),cacheControl:Object.freeze({...e.cacheControl})})}function hn(e){const t=le(e,"entry.url");let r;try{r=new URL(t,"https://fps-editor.invalid/")}catch{throw new Error(`Editor entry manifest entry.url is invalid: ${t}.`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`Editor entry manifest entry.url must use HTTP(S): ${t}.`);return t}function le(e,t){if(typeof e!="string"||!e.trim())throw new Error(`Editor entry manifest ${t} must be a non-empty string.`);return e.trim()}function Ot(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function as(e){const t=new URL(e.manifestUrl??Xi,e.baseUrl).href,r=e.fetchManifest??is();let a=null,n,o=!1,i=0,s=null;return Object.freeze({load:d=>{if(o)return Promise.resolve(n);if(s)return s;const S=(async()=>{Lt(d);const c=a??await os({fetchManifest:r,manifestUrl:t,signal:d});Lt(d),a=c;const m=i+1,f=rs(c,{baseUrl:e.baseUrl,retryAttempt:m});i=m;const h=await e.importModule(f);return Lt(d),n=h,o=!0,h})();return s=S,S.finally(()=>{s===S&&(s=null)}).catch(()=>{}),S},getManifest:()=>a,getImportAttempt:()=>i})}async function os(e){const t=await e.fetchManifest(e.manifestUrl,{cache:"no-cache",headers:Object.freeze({accept:"application/json"}),...e.signal?{signal:e.signal}:{}});if(!t.ok)throw new Error(`Editor entry manifest request failed with HTTP ${t.status}.`);return ts(await t.json())}function is(){const e=globalThis.fetch;if(typeof e!="function")throw new Error("Editor entry module loader requires fetchManifest outside a browser.");return e.bind(globalThis)}function Lt(e){if(!e?.aborted)return;const t=new Error("Editor entry module load was aborted.");throw t.name="AbortError",t}function ss(e={}){const t=e.performance??us(),r=e.maxResourceDetails??100,a=e.resourceTimingBufferSize??2e3;if(!Number.isInteger(r)||r<0)throw new Error("Editor entry maxResourceDetails must be a non-negative integer.");if(!Number.isInteger(a)||a<1)throw new Error("Editor entry resourceTimingBufferSize must be a positive integer.");return t.setResourceTimingBufferSize?.(a),Object.freeze({mark(){return Object.freeze({startedAtMs:t.now(),resourceIndex:t.getEntriesByType("resource").length})},measure(n){const o=t.getEntriesByType("resource").slice(n.resourceIndex).flatMap(ls).filter(l=>e.includeResource?.(l)??!0).map(cs),i={network:0,revalidated:0,cache:0,unknown:0};for(const l of o)i[l.cacheStatus]+=1;const s=o.slice(0,r);return Object.freeze({durationMs:Math.max(0,t.now()-n.startedAtMs),resourceCount:o.length,transferSize:Nt(o,l=>l.transferSize),encodedBodySize:Nt(o,l=>l.encodedBodySize),decodedBodySize:Nt(o,l=>l.decodedBodySize),cacheCounts:Object.freeze(i),resources:Object.freeze(s),truncatedResourceCount:o.length-s.length})}})}function cs(e){const t=je(e.transferSize),r=je(e.encodedBodySize),a=je(e.decodedBodySize);return Object.freeze({name:e.name,initiatorType:e.initiatorType??"",startTimeMs:e.startTime,durationMs:e.duration,transferSize:t,encodedBodySize:r,decodedBodySize:a,cacheStatus:ds({transferSize:t,encodedBodySize:r,decodedBodySize:a})})}function ds(e){return e.transferSize===0?e.encodedBodySize>0||e.decodedBodySize>0?"cache":"unknown":e.encodedBodySize>0&&e.transferSize<e.encodedBodySize?"revalidated":"network"}function ls(e){if(!e||typeof e!="object"||Array.isArray(e))return[];const t=e;return typeof t.name!="string"||!t.name?[]:!Number.isFinite(t.startTime)||!Number.isFinite(t.duration)?[]:[{name:t.name,initiatorType:typeof t.initiatorType=="string"?t.initiatorType:"",startTime:t.startTime,duration:t.duration,transferSize:je(t.transferSize),encodedBodySize:je(t.encodedBodySize),decodedBodySize:je(t.decodedBodySize)}]}function us(){const e=globalThis.performance;if(!e||typeof e!="object")throw new Error("Editor entry performance tracker requires a performance adapter.");const t=e;if(typeof t.now!="function"||typeof t.getEntriesByType!="function")throw new Error("Editor entry performance tracker requires now() and getEntriesByType().");return t}function je(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:0}function Nt(e,t){return e.reduce((r,a)=>r+t(a),0)}async function dc(e,t){const r=String(e.method??"GET").toUpperCase();if(r==="OPTIONS")return gn(204);try{if(r==="GET"){const l=ps(await t.loadConfig?.()),d=l.renderingConfig;mr(d);const S=fr(d);return U(200,{ok:!0,...l.response,renderingConfig:gs(d),normalized:S,summary:gr(S)})}if(r!=="POST")return U(405,{ok:!1,error:"method_not_allowed"});const a=e.body??await t.readBody?.(e)??{},n=Ke(a.renderingConfig);if(!n)return U(400,{ok:!1,error:"missing_rendering_config"});mr(n);const o=fr(n),i=gr(o),s=await t.saveConfig?.({body:a,renderingConfig:n,normalized:o,summary:i});return U(200,{ok:!0,...s??{},renderingConfig:n,normalized:o,summary:i})}catch(a){const n=ms(a),o=fs(a);return U(n?.startsWith("schema.")?400:500,{ok:!1,error:n??(a instanceof Error?a.message:String(a)),...o?{path:o}:{},details:Ke(a?.details)})}}function ms(e){const t=e?.code;return typeof t=="string"&&t?t:null}function fs(e){const t=e?.path;return typeof t=="string"&&t?t:null}function Ke(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function gs(e){return Ke(e)??{}}function ps(e){const t=Ke(e);return t&&Object.prototype.hasOwnProperty.call(t,"renderingConfig")?{renderingConfig:t.renderingConfig,response:Ke(t.response)??{}}:{renderingConfig:e??{},response:{}}}function Es(e){const t=e.root??document.body,r=t.ownerDocument,a=e.tooltipDataAttribute??"editorRuntimeDebugTooltip",n=e.tooltipDelayMs??160;let o=e.initialOpen===!0,i=e.language,s=0,l=null,d=0;const S=e.panelMode==="managed",c=r.createElement("div");c.style.cssText=S?["position:relative","display:none","width:100%","max-width:100%","flex-direction:column","align-items:stretch",'font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"color:#edf2ff","pointer-events:none"].join(";"):["position:fixed",`right:${kt(e.placement?.right??16)}`,`bottom:${kt(e.placement?.bottom??16)}`,`z-index:${e.placement?.zIndex??2147482600}`,"display:none","flex-direction:column","align-items:flex-end",'font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"color:#edf2ff","pointer-events:none"].join(";");const m=r.createElement("button");m.type="button",m.textContent=e.toggleLabel,m.style.cssText=["pointer-events:auto",S?"align-self:flex-end":"","height:34px","padding:0 12px","border:1px solid rgba(148, 163, 184, 0.36)","border-radius:7px","background:rgba(15, 23, 42, 0.88)","color:#f8fafc",'font:600 12px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"box-shadow:0 10px 26px rgba(0,0,0,0.28)","cursor:pointer"].join(";");const f=r.createElement("section");f.style.cssText=["pointer-events:auto",`width:${S?"100%":kt(e.placement?.width??320)}`,"max-height:min(70vh, 720px)","overflow:auto","box-sizing:border-box","margin-bottom:8px","padding:12px","border:1px solid rgba(148, 163, 184, 0.28)","border-radius:8px","background:rgba(13, 18, 28, 0.94)","box-shadow:0 18px 44px rgba(0,0,0,0.34)","backdrop-filter:blur(8px)","display:none"].join(";");const h=r.createElement("div");h.style.cssText="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;";const p=r.createElement("div");p.style.cssText="font-size:13px;font-weight:700;line-height:1.2;";const u=r.createElement("div");u.style.cssText="display:flex;align-items:center;gap:8px;";const A=r.createElement("div");A.style.cssText="font-size:11px;color:#93c5fd;line-height:1.2;";const I=r.createElement("button");I.type="button",I.style.cssText=["height:24px","padding:0 8px","border:1px solid rgba(148, 163, 184, 0.3)","border-radius:6px","background:rgba(30, 41, 59, 0.8)","color:#dbeafe",'font:700 11px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"cursor:pointer"].join(";"),u.append(A,I),h.append(p,u);const P=r.createElement("div"),O=r.createElement("div");O.style.cssText="display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;";const G=r.createElement("div");G.style.cssText="min-height:16px;margin-top:8px;font-size:11px;color:#94a3b8;",f.append(h,P,O,G),c.append(f,m),t.append(c);const D=r.createElement("div");D.style.cssText=["position:fixed","z-index:2147483601","display:none","max-width:min(280px, calc(100vw - 16px))","box-sizing:border-box","padding:5px 7px","border:1px solid rgba(148, 163, 184, 0.32)","border-radius:5px","background:rgba(15, 23, 42, 0.94)","box-shadow:0 10px 26px rgba(0, 0, 0, 0.3)","color:#dbeafe",'font:700 11px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"line-height:1.35","white-space:normal","pointer-events:none"].join(";"),t.append(D);const B={root:t,ownerDocument:r,container:c,panel:f,title:p,modeLabel:A,languageButton:I,toggleButton:m,content:P,actions:O,status:G,get open(){return o},get language(){return i},setOpen(w){o=w,ee(),e.onOpenChange?.(o)},setLanguageChrome(w){i=w.language,p.textContent=w.title,A.textContent=w.modeLabel,I.textContent=w.languageButtonLabel,B.setTooltip(I,w.languageTooltip??""),B.setTooltip(m,w.toggleTooltip??""),w.toggleTooltip&&m.setAttribute("aria-label",w.toggleTooltip)},setToggleActive(w){m.style.background=w?"rgba(29, 78, 216, 0.9)":"rgba(15, 23, 42, 0.88)"},setStatus(w,k={}){G.textContent=w,G.style.color=k.tone==="error"?"#fca5a5":"#94a3b8",s&&r.defaultView?.clearTimeout(s),s=0,!k.sticky&&(s=r.defaultView?.setTimeout(()=>{G.textContent===w&&(G.textContent=""),s=0},1800)??0)},setTooltip(w,k){const V=k.trim();if(!V){delete w.dataset[a],w.removeAttribute("title");return}w.dataset[a]=V,w.removeAttribute("title")},hideTooltip:q,dispose(){s&&r.defaultView?.clearTimeout(s),he(),c.removeEventListener("pointerover",H),c.removeEventListener("pointerout",ue),c.removeEventListener("focusin",Ee),c.removeEventListener("focusout",q),c.removeEventListener("click",q),c.remove(),D.remove()}};return m.addEventListener("click",()=>B.setOpen(!o)),c.addEventListener("pointerover",H),c.addEventListener("pointerout",ue),c.addEventListener("focusin",Ee),c.addEventListener("focusout",q),c.addEventListener("click",q),B.setLanguageChrome({title:e.title,modeLabel:e.modeLabel,languageButtonLabel:e.languageButtonLabel,toggleTooltip:e.toggleTooltip,languageTooltip:e.languageTooltip,language:i}),ee(),B;function ee(){c.style.display="flex",f.style.display=o?"block":"none",B.setToggleActive(o),o||q()}function H(w){const k=K(w.target);!k||k===l||me(k)}function ue(w){if(!l)return;const k=w.relatedTarget instanceof Node?w.relatedTarget:null;k&&l.contains(k)||q()}function Ee(w){const k=K(w.target);k&&me(k)}function K(w){return w instanceof HTMLElement?w.closest(`[data-${Ss(a)}]`):null}function me(w){const k=w.dataset[a]?.trim();if(!k){q();return}he(),l=w,d=r.defaultView?.setTimeout(()=>{d=0,l===w&&Te(w,k)},n)??0}function Te(w,k){D.textContent=k,D.style.display="",D.style.left="0px",D.style.top="0px";const V=w.getBoundingClientRect(),te=D.getBoundingClientRect(),J=r.defaultView?.innerWidth??r.documentElement.clientWidth,X=r.defaultView?.innerHeight??r.documentElement.clientHeight,W=Math.max(8,Math.min(V.left+(V.width-te.width)/2,J-te.width-8)),b=V.bottom+7,y=V.top-te.height-7,_=b+te.height<=X-8?b:Math.max(8,y);D.style.left=`${W}px`,D.style.top=`${_}px`}function q(){he(),l=null,D.style.display="none",D.textContent=""}function he(){d&&(r.defaultView?.clearTimeout(d),d=0)}}function Fr(e){const t=e.createElement("button");return t.type="button",t.style.cssText=["height:28px","border:1px solid rgba(148, 163, 184, 0.32)","border-radius:6px","background:rgba(30, 41, 59, 0.86)","color:#f8fafc",'font:600 11px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"cursor:pointer"].join(";"),t}function Y(e){const t=e.createElement("label");return t.style.cssText="font-size:11px;color:#cbd5e1;",t}function ct(e){const t=e.createElement("div");return t.style.cssText="display:grid;grid-template-columns:1fr 108px;gap:7px 8px;align-items:center;",t}function dt(e){const t=e.createElement("div");return t.style.cssText="display:flex;flex-direction:column;gap:7px;",t}function lt(e){const t=e.createElement("div");return t.style.cssText="font-size:11px;font-weight:800;color:#e2e8f0;letter-spacing:0;text-transform:none;",t}function Le(e,t={}){const r=e.createElement("input");return r.type="number",t.step!=null&&(r.step=String(t.step)),t.min!=null&&(r.min=String(t.min)),t.max!=null&&(r.max=String(t.max)),r.inputMode="decimal",r.style.cssText=Sn(),r}function hs(e,t={}){const r=e.createElement("input");return r.type="range",t.step!=null&&(r.step=String(t.step)),t.min!=null&&(r.min=String(t.min)),t.max!=null&&(r.max=String(t.max)),r.style.cssText="width:100%;min-width:0;height:18px;margin:0;accent-color:#3b82f6;cursor:pointer;",r}function xt(e){const t=e.createElement("input");return t.type="color",t.style.cssText=[Sn(),"padding:2px 4px"].join(";"),t}function Br(e){const t=e.createElement("input");return t.type="checkbox",t.style.cssText="justify-self:start;width:16px;height:16px;accent-color:#3b82f6;",t}function zr(e){const t=e.createElement("div");return t.style.cssText=["min-height:26px","box-sizing:border-box","padding:5px 6px","border:1px solid rgba(148, 163, 184, 0.2)","border-radius:6px","background:rgba(15, 23, 42, 0.58)","color:#dbeafe","font:11px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","line-height:1.35","white-space:normal"].join(";"),t}function Sn(e="12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"){return["width:108px","height:26px","min-width:0","box-sizing:border-box","border:1px solid rgba(148, 163, 184, 0.34)","border-radius:6px","background:rgba(15, 23, 42, 0.84)","color:#f8fafc","padding:0 6px",`font:${e}`].join(";")}function kt(e){return typeof e=="number"?`${e}px`:e}function Ss(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function lc(e){const t=e.root??document.body,r=t.ownerDocument;let a=Ba(r.defaultView),n=!1,o=!1,i=0,s=null,l=null;const d=Es({root:t,toggleLabel:"Light",title:ne().title,modeLabel:ne().runtime,languageButtonLabel:ne().languageButton,toggleTooltip:wt().toggleTitle,languageTooltip:wt().languageButton,tooltipDataAttribute:"lightingDebugTooltip",initialOpen:Ga(r.defaultView),language:a,panelMode:e.panelMode,placement:{right:100,width:330,...e.placement},onOpenChange:g=>{Fa(r.defaultView,g),g&&Fe(0)}}),S=dt(r),c=lt(r),m=ct(r),f=Br(r),h=Le(r,be("environmentIntensity")),p=xt(r),u=xt(r);m.append(Y(r),f,Y(r),h,Y(r),p,Y(r),u),S.append(c,m);const A=dt(r),I=lt(r),P=ct(r),O=Le(r,be("iblIntensity")),G=Le(r,be("iblRotationY"));P.append(Y(r),O,Y(r),G),A.append(I,P);const D=dt(r),B=lt(r),ee=ct(r),H=Br(r),ue=Le(r,be("directionalIntensity")),Ee=Le(r,be("directionalHorizontalAngle")),K=Le(r,be("directionalElevationAngle")),me=xt(r),Te=zr(r),q=zr(r);ee.append(Y(r),H,Y(r),ue,Y(r),Ee,Y(r),K,Y(r),me,Y(r),Te,Y(r),q),D.append(B,ee);const he=dt(r),w=lt(r),k=ct(r),V=g=>{const E=r.createElement("div");E.style.cssText="display:grid;grid-template-columns:minmax(54px,1fr) 36px;align-items:center;gap:6px;min-width:0;";const T=hs(r,be(g)),v=r.createElement("output");return v.style.cssText="font:11px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;color:#dbeafe;text-align:right;font-variant-numeric:tabular-nums;",T.dataset.lightingDebugOutputId=g,v.dataset.lightingDebugOutput=g,T.addEventListener("input",()=>{v.value=Se(Number(T.value))}),E.append(T,v),{input:T,wrapper:E}},te=V("shadowStrength"),J=V("shadowSoftness");k.append(Y(r),te.wrapper,Y(r),J.wrapper),he.append(w,k),d.content.style.cssText="display:flex;flex-direction:column;gap:10px;",d.content.append(S,A,D,he);const X=Fr(r),W=Fr(r);d.actions.append(X,W);const b=ee.children,y={environmentEnabled:m.children[0],environmentIntensity:m.children[2],environmentDiffuseColor:m.children[4],environmentGroundColor:m.children[6],iblIntensity:P.children[0],iblRotationY:P.children[2],directionalEnabled:b[0],directionalIntensity:b[2],directionalHorizontalAngle:b[4],directionalElevationAngle:b[6],directionalDiffuseColor:b[8],rawDirection:b[10],shadowReadout:b[12],shadowStrength:k.children[0],shadowSoftness:k.children[2]},_=new Map([["environmentIntensity",h],["iblIntensity",O],["iblRotationY",G],["directionalIntensity",ue],["directionalHorizontalAngle",Ee],["directionalElevationAngle",K],["shadowStrength",te.input],["shadowSoftness",J.input]]),$=new Map([["environmentDiffuseColor",p],["environmentGroundColor",u],["directionalDiffuseColor",me]]),Q=[f,H];f.addEventListener("change",()=>{Ce({kind:"enabled",target:"environment"})}),H.addEventListener("change",()=>{Ce({kind:"enabled",target:"directional"})});for(const[g,E]of _)E.addEventListener("input",()=>{E.type==="number"&&_t(E.value)===null||Ce({kind:"number",field:g})}),E.type==="number"&&(E.addEventListener("blur",()=>or(g)),E.addEventListener("keydown",T=>{T.key==="Enter"?(T.preventDefault(),or(g),E.blur()):T.key==="Escape"&&(T.preventDefault(),ir(g),E.blur())}));for(const[g,E]of $)E.addEventListener("input",()=>Ce({kind:"color",field:g}));return d.languageButton.addEventListener("click",()=>{a=a==="zh"?"en":"zh",za(r.defaultView,a),sr()}),X.addEventListener("click",()=>{!s||n||(nr(s),At(s),d.setStatus(ne().resetStatus))}),W.addEventListener("click",()=>{const g=l??e.readSnapshot();if(!g||n||!gt(g)){d.setStatus(ne().missingBindingStatus,{tone:"error"});return}n=!0,se(g),d.setStatus(ne().savingStatus,{sticky:!0}),Promise.resolve(e.saveSnapshot(g)).then(()=>{d.setStatus(ne().savedStatus,{sticky:!0}),e.reloadAfterSave!==!1&&r.defaultView?.location.reload()}).catch(E=>{console.error("[EditorRuntimeLightingDebugPanel] Save lighting failed",E),n=!1,d.setStatus(bs(E,ne().saveFailed),{sticky:!0,tone:"error"}),se(l)})}),sr(),et(),{dispose(){o=!0,i&&r.defaultView?.clearTimeout(i),d.dispose()}};function et(){if(o)return;i=0;const g=e.readSnapshot();g?(s||(s=Ie(g)),l=Ie(g)):(s=null,l=null),se(g),Fe(d.open?250:1e3)}function Fe(g){o||(i&&r.defaultView?.clearTimeout(i),i=r.defaultView?.setTimeout(et,g)??0)}function se(g){if(d.container.style.display=g?"flex":"none",!g){d.hideTooltip();return}for(const T of[..._.values(),...$.values(),...Q])T.disabled=n;const E=!!g.shadow.shadowMap?.appearance;A.style.display=g.environmentTexture?"flex":"none",he.style.display=E?"flex":"none",te.input.disabled=n||!E,J.input.disabled=n||!E,X.disabled=!s||n,W.disabled=n||!gt(g),W.style.opacity=W.disabled?"0.68":"1",W.style.cursor=W.disabled?"not-allowed":"pointer",Tn()||nr(g),Tt(g),!gt(g)&&!n&&d.setStatus(ne().missingBindingStatus,{tone:"error"})}function Ce(g){if(n)return;const E=l??e.readSnapshot();if(!E)return;const T=ar(E,g);At(T),In(T)}function At(g){e.applySnapshot(g),l=Ie(g),Tt(g)}function nr(g){f.checked=g.environment.enabled,H.checked=g.directional.enabled,re("environmentIntensity",g.environment.light.intensity),tt("environmentDiffuseColor",g.environment.light.diffuseColor??{r:1,g:1,b:1}),tt("environmentGroundColor",g.environment.light.groundColor??{r:.48,g:.52,b:.62}),g.environmentTexture&&(re("iblIntensity",g.environmentTexture.iblIntensity),re("iblRotationY",g.environmentTexture.iblRotationY));const E=jt(g.directional.light.direction);re("directionalIntensity",g.directional.light.intensity),re("directionalHorizontalAngle",E.horizontalAngleDeg),re("directionalElevationAngle",E.elevationAngleDeg),tt("directionalDiffuseColor",g.directional.light.diffuseColor??{r:1,g:1,b:1}),g.shadow.shadowMap?.appearance&&(re("shadowStrength",g.shadow.shadowMap.appearance.strength),re("shadowSoftness",g.shadow.shadowMap.appearance.softness))}function In(g){const E=r.activeElement;E!==f&&(f.checked=g.environment.enabled),E!==H&&(H.checked=g.directional.enabled);for(const T of _.keys()){const v=_.get(T);!v||E===v||re(T,ze(g,T))}for(const T of $.keys()){const v=$.get(T);!v||E===v||tt(T,br(g,T))}}function ar(g,E){if(E.kind==="enabled"){const v=E.target==="environment"?f.checked:H.checked;return Va(g,E.target,v)}if(E.kind==="color"){const v=br(g,E.field);return Ha(g,E.field,An(E.field,v))}const T=ze(g,E.field);return $a(g,E.field,Pn(E.field,T))}function re(g,E){const T=_.get(g);if(!T)return;T.value=String(Ra(E));const v=d.container.querySelector(`output[data-lighting-debug-output="${g}"]`);v&&(v.value=Se(E))}function Pn(g,E){const T=_.get(g);if(!T)return E;const v=_t(T.value);if(v===null)return E;const rt=be(g),nt=rt.min??Number.NEGATIVE_INFINITY,wn=rt.max??Number.POSITIVE_INFINITY;return Math.min(wn,Math.max(nt,v))}function or(g){if(n)return;const E=l??e.readSnapshot();if(!E)return;const T=_.get(g);if(!T||_t(T.value)===null){ir(g);return}const v=ar(E,{kind:"number",field:g}),rt=ze(E,g),nt=ze(v,g);Math.abs(nt-rt)>1e-6&&At(v),re(g,nt)}function ir(g){const E=l??e.readSnapshot();E&&re(g,ze(E,g))}function tt(g,E){const T=$.get(g);T&&(T.value=_a(E))}function An(g,E){const T=$.get(g);return T?va(T.value,E):E}function Tt(g){const E=g.directional.light.direction;Te.textContent=`x ${Se(E.x)} y ${Se(E.y)} z ${Se(E.z)}`;const T=ja(g.shadow.mode,ne()),v=g.shadow.shadowMap;q.textContent=g.shadow.mode==="shadow-map"&&v?[`${T} / ${v.backend??"pending"}`,...v.appearance?[`strength ${Se(v.appearance.strength)} softness ${Se(v.appearance.softness)}`]:[],`depth S ${v.staticRefreshCount??"-"} D ${v.dynamicRefreshCount??"-"} C ${v.compositeRefreshCount??"-"}`,v.lastRefreshReasons[v.lastRefreshReasons.length-1]??"ready"].join(`
|
|
8
|
-
`):`${T}
|
|
9
|
-
shadow length x${Se(g.shadow.projectedLengthMultiplier)}`}function sr(){const g=ne(),E=wt();d.setLanguageChrome({title:g.title,modeLabel:g.runtime,languageButtonLabel:g.languageButton,toggleTooltip:E.toggleTitle,languageTooltip:E.languageButton,language:a}),c.textContent=g.environmentSection,I.textContent=g.environmentTextureSection,B.textContent=g.directionalSection,w.textContent=g.shadowSection,y.environmentEnabled.textContent=g.enabled,y.environmentIntensity.textContent=g.intensity,y.environmentDiffuseColor.textContent=g.skyLightColor,y.environmentGroundColor.textContent=g.groundColor,y.iblIntensity.textContent=g.iblIntensity,y.iblRotationY.textContent=g.iblRotationY,y.directionalEnabled.textContent=g.enabled,y.directionalIntensity.textContent=g.intensity,y.directionalHorizontalAngle.textContent=g.horizontalAngle,y.directionalElevationAngle.textContent=g.elevationAngle,y.directionalDiffuseColor.textContent=g.lightColor,y.rawDirection.textContent=g.rawDirection,y.shadowReadout.textContent=g.shadowReadout,y.shadowStrength.textContent=g.shadowStrength,y.shadowSoftness.textContent=g.shadowSoftness;for(const[T,v]of _)v.setAttribute("aria-label",y[T].textContent??T);d.setTooltip(f,E.enabled),d.setTooltip(y.environmentEnabled,E.enabled),d.setTooltip(y.environmentIntensity,E.environmentIntensity),d.setTooltip(h,E.environmentIntensity),d.setTooltip(y.environmentDiffuseColor,E.skyLightColor),d.setTooltip(p,E.skyLightColor),d.setTooltip(y.environmentGroundColor,E.groundColor),d.setTooltip(u,E.groundColor),d.setTooltip(y.iblIntensity,E.iblIntensity),d.setTooltip(O,E.iblIntensity),d.setTooltip(y.iblRotationY,E.iblRotationY),d.setTooltip(G,E.iblRotationY),d.setTooltip(H,E.enabled),d.setTooltip(y.directionalEnabled,E.enabled),d.setTooltip(y.directionalIntensity,E.directionalIntensity),d.setTooltip(ue,E.directionalIntensity),d.setTooltip(y.directionalHorizontalAngle,E.horizontalAngle),d.setTooltip(Ee,E.horizontalAngle),d.setTooltip(y.directionalElevationAngle,E.elevationAngle),d.setTooltip(K,E.elevationAngle),d.setTooltip(y.directionalDiffuseColor,E.lightColor),d.setTooltip(me,E.lightColor),d.setTooltip(y.rawDirection,E.rawDirection),d.setTooltip(Te,E.rawDirection),d.setTooltip(y.shadowReadout,E.shadowReadout),d.setTooltip(q,E.shadowReadout),d.setTooltip(y.shadowStrength,E.shadowStrength),d.setTooltip(te.input,E.shadowStrength),d.setTooltip(y.shadowSoftness,E.shadowSoftness),d.setTooltip(J.input,E.shadowSoftness),X.textContent=g.reset,d.setTooltip(X,E.reset),W.textContent=g.save,d.setTooltip(W,E.save),l&&Tt(l)}function Tn(){const g=r.activeElement;return g===d.languageButton||g===f||g===H||[..._.values()].includes(g)||[...$.values()].includes(g)}function ne(){return xa(a)}function wt(){return ka(a)}}function bs(e,t){const r=e instanceof Error?e.message:String(e??"");return r?`${t}: ${r}`:t}const ys=Object.freeze({preparingEditor:"正在准备编辑器…",enterEditor:"进入编辑场景",checkingEditor:"正在检查编辑环境…",enteringEditor:"正在进入编辑界面…",restoringPlayMode:"正在恢复游戏…",retryEditor:"重试进入编辑器",reloadPage:"刷新页面恢复"});function uc(e){const t=e.browser?.window??window,r=e.browser?.document??t.document,a=e.browser?.canvasId??"renderCanvas",n=e.initialMode??"play",o=e.initialModeIntent??"fresh",i=Object.freeze({...ys,...e.browser?.entryContent}),s=(b,y)=>{e.reportError?e.reportError(b,y):console.error(`[FpsGameEditor] ${b}`,y)};Ca({scope:t,reportError:b=>s("Browser Command Host failed",b)});const l=as({baseUrl:e.editorModule.baseUrl,...e.editorModule.manifestUrl?{manifestUrl:e.editorModule.manifestUrl}:{},importModule:e.editorModule.importModule}),d=ss({performance:t.performance}),S=new Set,c=new Set,m=new WeakMap;let f=null,h=null,p=ut(),u=null,A=null,I=!1,P=null,O=!1,G=null,D;const B=()=>P,ee=()=>{if(O)return;const b=t;b.__FPS_EDITOR_ENTRY_DIAGNOSTICS__=p},H=()=>Object.freeze({entry:P??D.getState()}),ue=()=>{if(O)return;const b=H();for(const y of[...S])try{y(b)}catch(_){s("editor entry listener failed",_)}},Ee=b=>{if(b.phase==="preparing"){u=d.mark(),p=ut({...p,enter:null}),ee();return}if(!(b.phase==="editing"||b.phase==="failed"&&b.failure?.phase!=="warmup")||!u)return;const _=u;u=null,p=ut({...p,enter:d.measure(_)}),ee()},K=b=>{const y=m.get(b);if(y)return y;const _=Promise.resolve().then(()=>b.switcher.dispose());return m.set(b,_),_.finally(()=>{m.get(b)===_&&m.delete(b)}).catch(()=>{}),_},me=async()=>{const b=[];for(const y of[...c])try{await K(y),c.delete(y)}catch(_){b.push(_)}mt(b,"Retired Local Editor entry cleanup failed.")},Te=b=>{f===b&&(f=null),c.add(b),A!==null&&t.clearTimeout(A),A=t.setTimeout(()=>{if(A=null,!(O||P)){try{D.reset()}catch(y){s("editor entry reset after play-mode return failed",y);return}D.start().catch(y=>s("editor warmup after play-mode return failed",y))}},0)},q=b=>{if(P)return Promise.reject(new De(P.failure?.message??i.reloadPage));if(O||b.aborted)return Promise.reject(ft());if(f)return Promise.resolve(f);if(h)return h;const y=me().then(async()=>{const _=d.mark();let $;try{$=await l.load(b)}catch(se){throw Ps(se)?new De("开发服务已更新,当前预览已失效,请刷新页面。"):se}finally{p=ut({build:l.getManifest()?.build??null,editorModuleImportAttempt:l.getImportAttempt(),editorModuleWarmup:d.measure(_),enter:p.enter}),ee()}if(P)throw new De(P.failure?.message??i.reloadPage);if(O||b.aborted)throw ft();const Q={switcher:void 0,editorModeEntryAttempted:!1,playModeEntryCompleted:!1},et=await e.editorModule.mount($,{projectMode:{async enterEditorMode(se){W(),Q.editorModeEntryAttempted=!0;const Ce=Ts(r,a);try{await e.projectMode.enterEditorMode(se)}finally{ws(r,Ce)}},async enterPlayMode(se){W(),await e.projectMode.enterPlayMode(se),Q.playModeEntryCompleted=!0,Te(Q)}},getCanvas:()=>bn(r,a)},b);Q.switcher=et;const Fe=B();if(Fe)throw await K(Q),new De(Fe.failure?.message??i.reloadPage);if(O||b.aborted)throw await K(Q),ft();return f=Q,Q});return h=y,y.finally(()=>{h===y&&(h=null)}).catch(()=>{}),y};D=To({backend:{warmup:b=>q(b).then(()=>{}),prepare:b=>q(b.signal),async commit(b,y){if(b!==f)throw new Error("Prepared Local Editor switcher is no longer current.");if(await b.switcher.enterEditor(),y.signal.aborted)throw ft()},async rollback(b){const y=[];try{await K(b),c.delete(b),f===b&&(f=null)}catch(_){y.push(_)}if(b.editorModeEntryAttempted&&!b.playModeEntryCompleted)try{await e.projectMode.enterPlayMode({reason:"editor-entry-rollback"}),b.playModeEntryCompleted=!0}catch(_){y.push(_)}mt(y,"Local Editor entry rollback failed.")},async dispose(){const b=h;await Promise.allSettled(b?[b]:[]);const y=[];if(f){const _=f;try{await K(_),f===_&&(f=null)}catch($){y.push($)}}try{await me()}catch(_){y.push(_)}mt(y,"Local Editor entry cleanup failed.")}},reportFailure:({failure:b,cause:y,rollbackCause:_})=>{s(`editor entry ${b.code}`,_===void 0?y:yn(b.message,[y,_]))},reportListenerError:b=>s("editor entry listener failed",b)});const w=D.subscribe(b=>{Ee(b),ue()});ee();const k=b=>{if(O||P)return;const y=Is(b),_=D.getState();P=Object.freeze({..._,phase:"failed",phaseStartedAtMs:Date.now(),failure:Object.freeze({code:"reload-required",phase:"runtime",message:y.message,recoverable:!1})}),ue();const $=f;$&&(f=null,c.add($),K($).then(()=>{c.delete($)}).catch(Q=>s("stale local editor cleanup failed",Q)))};t.addEventListener(pr,k);const V={start:()=>P?Promise.reject(new De(P.failure?.message??i.reloadPage)):D.start(),enterEditor:()=>P?Promise.resolve(Ur(P)):D.enter(),retryEditorEntry:()=>P?Promise.resolve(Ur(P)):D.retry(),getEntryState:H,getDiagnostics:()=>p,subscribe(b){return O?()=>{}:(S.add(b),b(H()),()=>S.delete(b))},dispose(){if(G)return G;O=!0;const b=(async()=>{t.removeEventListener("beforeunload",X),t.removeEventListener("pagehide",X),t.removeEventListener(pr,k),r.removeEventListener("DOMContentLoaded",J),A!==null&&(t.clearTimeout(A),A=null),te(),w(),S.clear(),delete t.__FPS_EDITOR_ENTRY_DIAGNOSTICS__;const y=[];try{await D.dispose()}catch(_){y.push(_)}y.push(...await Da()),mt(y,"Local Editor Entry cleanup failed.")})();return G=b,b.catch(()=>{G===b&&(G=null)}),b}},te=e.browser?.showEntryButton===!1?()=>{}:As(V,t,r,e.browser?.root,i,s),J=()=>{if(O||I)return;I=!0,r.removeEventListener("DOMContentLoaded",J),(n==="edit"&&o==="fresh"?V.enterEditor():V.start()).catch(y=>s("local editor entry start failed",y))},X=()=>{V.dispose().catch(b=>s("local editor entry dispose failed",b))};return t.addEventListener("beforeunload",X),t.addEventListener("pagehide",X),e.browser?.autoStart!==!1&&(r.readyState==="loading"?(r.addEventListener("DOMContentLoaded",J,{once:!0}),t.queueMicrotask(J)):J()),V;function W(){if(P)throw new De(P.failure?.message??i.reloadPage)}}function Is(e){const t=e.detail;return t&&typeof t=="object"&&(t.code==="authentication-invalidated"||t.code==="service-instance-changed")&&typeof t.message=="string"&&t.message.trim()?Object.freeze({code:t.code,message:t.message}):Object.freeze({code:"service-instance-changed",message:"开发服务已更新,当前预览已失效,请刷新页面。"})}function Ur(e){return Object.freeze({ok:!1,attempt:e.attempt,failure:e.failure})}function Ps(e){const t=e instanceof Error?e.message:String(e);return/failed to fetch dynamically imported module|error loading dynamically imported module|importing a module script failed/i.test(t)}function As(e,t,r,a,n,o){r.getElementById("fps-game-editor-entry-surface")?.remove(),r.getElementById("fps-game-editor-entry")?.remove();const i=r.createElement("div");i.id="fps-game-editor-entry-surface";const s=r.createElement("p");s.style.cssText=["margin:0 0 14px","color:var(--fps-editor-panel-fg,#edf0f2)",'font:500 14px/1.6 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif'].join(";");const l=r.createElement("button");l.id="fps-game-editor-entry",l.type="button";const d=["position:fixed","top:14px","right:16px","z-index:2147482604","height:32px","min-width:104px","padding:0 12px","border:1px solid #aee7c2","border-radius:999px","background:#e1f8e8","color:#2f6f52",'font:800 12px system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',"box-shadow:0 8px 20px rgba(15,23,42,.18)","white-space:nowrap","user-select:none"].join(";"),S=["position:static","height:36px","min-width:132px","padding:0 14px","border:1px solid var(--fps-editor-border-strong,#59656d)","border-radius:4px","background:var(--fps-editor-field-bg,#252b2f)","color:var(--fps-editor-panel-fg,#f4f6f7)",'font:700 13px system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',"box-shadow:none","white-space:nowrap","user-select:none"].join(";");l.style.cssText=d,i.append(s,l);let c=$r(e.getEntryState(),n);const m=p=>{c=$r(p,n);const u=c.action==="reload";l.disabled=c.disabled,l.textContent=c.label,l.title=c.title,l.style.cssText=u?S:d,l.style.opacity=c.disabled?".72":"1",l.style.cursor=c.disabled?"default":"pointer",s.hidden=!u||a!==void 0,s.textContent=p.entry.failure?.message??n.reloadPage,i.setAttribute("role",u?"alert":"presentation"),i.style.cssText=u&&a===void 0?["position:fixed","left:50%","top:50%","transform:translate(-50%,-50%)","z-index:2147482604","width:min(420px,calc(100vw - 32px))","padding:20px","border:1px solid var(--fps-editor-danger-border,#714040)","border-radius:6px","background:var(--fps-editor-panel-bg,#171b1e)","box-shadow:0 18px 50px rgba(0,0,0,.42)"].join(";"):"",c.hidden?i.remove():i.isConnected||(a??r.body)?.append(i)},f=e.subscribe(m),h=()=>{(c.action==="enter"?e.enterEditor():c.action==="retry"?e.retryEditorEntry():c.action==="reload"?Promise.resolve(t.location.reload()):Promise.resolve()).catch(u=>o("editor entry action failed",u))};return l.addEventListener("click",h),()=>{f(),l.removeEventListener("click",h),i.remove()}}function $r(e,t){switch(e.entry.phase){case"idle":case"warming":return fe("none",!0,!1,t.preparingEditor);case"ready":return fe("enter",!1,!1,t.enterEditor);case"preparing":return fe("none",!0,!1,t.checkingEditor);case"committing":return fe("none",!0,!1,t.enteringEditor);case"rolling-back":return fe("none",!0,!1,t.restoringPlayMode);case"failed":return e.entry.failure?.recoverable?fe("retry",!1,!1,t.retryEditor,e.entry.failure.message):fe("reload",!1,!1,t.reloadPage,e.entry.failure?.message);case"editing":case"disposed":return fe("none",!0,!0,t.enterEditor)}return fe("none",!0,!0,t.enterEditor)}function fe(e,t,r,a,n=a){return Object.freeze({action:e,disabled:t,hidden:r,label:a,title:n})}function ut(e={}){return Object.freeze({build:e.build??null,editorModuleImportAttempt:e.editorModuleImportAttempt??0,editorModuleWarmup:e.editorModuleWarmup??null,enter:e.enter??null})}function Ts(e,t){const r=bn(e,t);return r?.parentNode?{canvas:r,parent:r.parentNode,nextSibling:r.nextSibling}:null}function ws(e,t){if(!t||t.canvas.isConnected)return;const r=t.parent.isConnected?t.parent:e.body,a=t.nextSibling?.parentNode===r?t.nextSibling:null;r.insertBefore(t.canvas,a)}function bn(e,t){const r=e.getElementById(t),a=e.defaultView?.HTMLCanvasElement;return a?r instanceof a?r:null:r?.tagName==="CANVAS"?r:null}function yn(e,t){return Object.assign(new Error(e),{errors:[...t]})}function mt(e,t){if(e.length===1)throw e[0];if(e.length>1)throw yn(t,e)}function ft(){return Object.assign(new Error("Local Editor Entry was disposed."),{name:"AbortError"})}export{gc as CAMERA_LANGUAGE_OPTIONS,Sa as DEFAULT_EDITOR_SCENE_ARTIST_MATERIAL_ASSET_ID,pc as DEFAULT_EDITOR_SCENE_CAMERA,Ec as DEFAULT_EDITOR_SCENE_ENVIRONMENT_LIGHT,hc as DEFAULT_EDITOR_SCENE_SUN_LIGHT,Sc as DEFAULT_EDITOR_SCENE_TRANSFORM_TYPE_OPTIONS,bc as DEFAULT_PBR_EDITOR_SCENE_MATERIAL_ASSET,yc as DEFAULT_PBR_EDITOR_SCENE_MATERIAL_ASSET_GUID,Ic as DEFAULT_PBR_EDITOR_SCENE_MATERIAL_ASSET_ID,Pc as DEFAULT_READONLY_EDITOR_SCENE_MATERIAL_ASSET_IDS,Ac as DEFAULT_STANDARD_EDITOR_SCENE_MATERIAL_ASSET,Tc as DEFAULT_STANDARD_EDITOR_SCENE_MATERIAL_ASSET_GUID,wc as DEFAULT_STANDARD_EDITOR_SCENE_MATERIAL_ASSET_ID,Rc as EDITOR_SCENE_BUILTIN_MATERIAL_SHADER_DEFINITIONS,Xn as EDITOR_SCENE_BUILTIN_MATERIAL_SHADER_DEFINITION_REGISTRY,_c as EDITOR_SCENE_DEFAULT_DIRECTIONAL_LIGHT_DIRECTION,vc as EDITOR_SCENE_DUPLICATE_MATERIAL_ASSET_VALUE_PREFIX,Cc as EDITOR_SCENE_ENVIRONMENT_LIGHT_ID,Dc as EDITOR_SCENE_FIELD_SCHEMA,Mc as EDITOR_SCENE_LARGE_SELECTION_LIGHTWEIGHT_INSPECTOR_THRESHOLD,Wr as EDITOR_SCENE_LIGHTING_DEBUG_LANGUAGE_STORAGE_KEY,Na as EDITOR_SCENE_LIGHTING_DEBUG_NUMBER_FIELDS,Yr as EDITOR_SCENE_LIGHTING_DEBUG_STORAGE_KEY,Er as EDITOR_SCENE_LIGHTING_DEBUG_TEXT,hr as EDITOR_SCENE_LIGHTING_DEBUG_TOOLTIPS,Oc as EDITOR_SCENE_LIGHT_DIRECTION_ELEVATION_ANGLE_PATH,_n as EDITOR_SCENE_LIGHT_DIRECTION_ELEVATION_MAX_DEG,vn as EDITOR_SCENE_LIGHT_DIRECTION_ELEVATION_MIN_DEG,Lc as EDITOR_SCENE_LIGHT_DIRECTION_HORIZONTAL_ANGLE_PATH,Nc as EDITOR_SCENE_LIGHT_DIRECTION_HORIZONTAL_MAX_DEG,xc as EDITOR_SCENE_LIGHT_DIRECTION_HORIZONTAL_MIN_DEG,kc as EDITOR_SCENE_LIGHT_INSPECTOR_LANGUAGE_OPTIONS,jc as EDITOR_SCENE_MAIN_CAMERA_ID,Gc as EDITOR_SCENE_MATERIAL_ASSET_FIELD_PATH_PREFIX,Fc as EDITOR_SCENE_MATERIAL_ASSET_ID_PREFIX,Bc as EDITOR_SCENE_PREFAB_COMPOSITION_VERSION,zc as EDITOR_SCENE_PREFAB_DEFAULT_MODEL_NODE_ID,Uc as EDITOR_SCENE_PREFAB_DEFAULT_ROOT_NODE_ID,$c as EDITOR_SCENE_RENDERING_PROFILE_ALLOWED_PATCH_PATHS,Hc as EDITOR_SCENE_ROOT_ID,Vc as EDITOR_SCENE_ROOT_TRANSFORM,qc as EDITOR_SCENE_RUNTIME_COLOR_SLOTS,Yc as EDITOR_SCENE_RUNTIME_INTENSITY_SLOTS,Wc as EDITOR_SCENE_RUNTIME_METALLIC_ROUGHNESS_SLOTS,Kc as EDITOR_SCENE_RUNTIME_TEXTURE_SLOTS,Jc as EDITOR_SCENE_SCHEMA_VERSION,Rn as EDITOR_SCENE_SOURCE_ID,cr as EDITOR_SCENE_SOURCE_TYPE,Xc as EDITOR_SCENE_STATIC_SHADOW_BAKE_ACTION_PATH,Qc as EDITOR_SCENE_SUN_LIGHT_ID,Zc as FPS_GAME_EDITOR_GROUND_DECAL_FEATURE_ID,ed as FPS_GAME_EDITOR_GROUND_DECAL_PLUGIN_ID,td as FPS_GAME_EDITOR_GROUND_DECAL_PLUGIN_PACKAGE,hi as FPS_GAME_EDITOR_RUNTIME_DEBUG_AUTHORING_PATH,rd as MATERIAL_LANGUAGE_OPTIONS,lr as PLAYABLE_AUTHORING_API_BASE,nd as PLAYABLE_BABYLON_DEFAULT_OUTLINE_OVERRIDE,$s as PLAYABLE_EDITOR_ASSET_CATALOG_KINDS,tc as PLAYABLE_EDITOR_BUNDLED_ALIAS_PACKAGE_IDS,we as PLAYABLE_EDITOR_COMMAND_NAME,Qo as PLAYABLE_EDITOR_DEFAULT_EXTENSIONS,Zi as PLAYABLE_EDITOR_ENTRY_IMMUTABLE_CACHE_CONTROL,Qi as PLAYABLE_EDITOR_ENTRY_MANIFEST_CACHE_CONTROL,Xi as PLAYABLE_EDITOR_ENTRY_MANIFEST_PATH,En as PLAYABLE_EDITOR_ENTRY_MANIFEST_SCHEMA_VERSION,Xo as PLAYABLE_EDITOR_ENVIRONMENT_TEXTURE_EXTENSIONS,ae as PLAYABLE_EDITOR_EVENT_NAME,ln as PLAYABLE_EDITOR_IMAGE_EXTENSIONS,Qt as PLAYABLE_EDITOR_MODEL_EXTENSIONS,ec as PLAYABLE_EDITOR_PACKAGE_IDS,Ze as PLAYABLE_EDITOR_PACKAGE_RESOLUTION_CONTRACT,Qs as PLAYABLE_EDITOR_POST_MESSAGE,rc as PLAYABLE_EDITOR_PREBUNDLE_PACKAGE_IDS,ad as PLAYABLE_EDITOR_SCENE_COMPILER_ID,od as PLAYABLE_EDITOR_SCENE_COMPILER_VERSION,id as PLAYABLE_EDITOR_SCENE_OUTLINE_DEFAULT_DISABLED_REASON,er as PLAYABLE_EDITOR_SOUND_EXTENSIONS,Zt as PLAYABLE_EDITOR_TEXTURE_EXTENSIONS,sd as PLAYABLE_FORGE_PLAY_BRIDGE_SOURCE,Be as PLAYABLE_FORGE_PLAY_COMMAND,cd as PLAYABLE_FORGE_PLAY_COMMAND_ALIASES,pe as PLAYABLE_FORGE_PLAY_EVENT,dd as PLAYABLE_FORGE_PLAY_EVENT_ALIASES,ld as PLAYABLE_FORGE_PLAY_HISTORY_COMMANDS,ud as PLAYABLE_FORGE_PLAY_POST_MESSAGE,md as PLAYABLE_FORGE_PLAY_PROJECT_ASSET_COMMANDS,fd as PLAYABLE_GROUND_DECAL_TEXTURE_TINT,gd as PLAYABLE_LOCAL_EDITOR_HOST_MANIFEST_VERSION,pd as PLAYABLE_LOCAL_EDITOR_HOST_REQUIRED_CONTRACT,Ed as PLAYABLE_LOCAL_EDITOR_SAVE_CANCELLATION_CODE,De as PlayableEditorEntryReloadRequiredError,_e as PlayableEditorManagedAssetError,hd as SCENE_MAIN_SOURCE_RENDERING_COMPANION_CONFIG_KEY,Sd as SCENE_MAIN_SOURCE_STATIC_SHADOWS_COMPANION_CONFIG_KEY,bd as addAssetLibraryItemToEditorSceneDocument,yd as addEditorSceneLightingPreviewColors,Id as addEditorSceneMaterialAsset,Pd as addEditorSceneMaterialAssetAndBind,Ad as addEditorSceneMaterialAssetAndBindPrefabOverride,Td as addEditorScenePrefabAsset,wd as addVec3,Rd as appendEditorSceneReadonlyInspectorProperty,_d as appendEditorSceneRuntimeColorProperties,vd as appendEditorSceneRuntimeInspectorProperty,Cd as appendEditorSceneRuntimeTextureProperties,Dd as appendEditorSceneRuntimeVector3Properties,Md as applyEditorSceneDocumentMutationPatch,Od as applyEditorSceneJsonFieldPatch,Ld as applyEditorSceneRenderingProfileAction,Nd as applyEditorSceneRenderingProfilePatch,xd as applyEditorSceneSerializedPropertyPatch,kd as areMarkerGraphsEqual,jd as assertEditorSceneDocumentAssetCatalogCompleteness,Gd as assertEditorSceneMarkerConfigContract,Fd as assertEditorSceneMaterialAssetIntegrity,Bd as assertEditorScenePrefabMarkerNodeContract,zd as assertEditorSceneTransformComponentContract,Ud as assertPlayableEditorSceneDocumentContract,$d as assertPlayableEditorScenePersistedSourceContract,Ut as buildPlayableEditorManagedAssetArgs,Hd as bumpEditorSceneAuthoringSourceRevision,Vd as callEditorSceneRuntimeMethod,qd as canEditEditorSceneShadowSettings,Yd as canEditorSceneGameObjectHaveChildren,Wd as canPatchPlayableEditorSceneGroundDecalMultiField,Kd as canPatchPlayableGroundDecalLayerField,gt as canSaveEditorSceneLightingDebugSnapshot,Jd as canonicalizePlayableJsonNumbers,Xd as clampEditorSceneLightingPreview01,Qd as clampEditorSceneLightingPreviewNumber,Zd as clampEditorSceneMaterialPreview01,el as cleanupEditorSceneGameObjectOverrides,tl as cleanupLegacyImportedEditorSceneMaterialBindings,rl as cloneBuiltInMarkerTypeDefinition,nl as cloneEditorSceneDocument,Ie as cloneEditorSceneLightingDebugSnapshot,al as cloneEditorTransformMatrix,ol as cloneEditorTransformSnapshot,il as cloneMarker,sl as cloneMarkerGraphCommand,cl as cloneMarkerTypeDefinition,dl as cloneRelation,ll as cloneVec3,ca as collectEditorSceneChildMaterialSlots,ul as collectEditorSceneGameObjectSubtreeIds,ml as collectEditorSceneMaterialAssetBindingIds,qr as collectEditorSceneMaterialAssetReferences,fl as collectEditorSceneMaterialAssetUsages,gl as collectEditorSceneRenderingAlphaIndexMigrationTargetIds,pl as collectEditorSceneRuntimeChildNodes,El as collectEditorSceneRuntimeMeshes,hl as collectEditorSceneSlotSourceMaterialIndices,Sl as collectEditorSceneSubtreeIdList,bl as collectEditorSceneSubtreeIds,yl as collectEditorShadowReceiverCandidates,ic as collectMissingPlayableEditorPackageAliasFiles,va as colorFromEditorSceneLightingHex,_a as colorToEditorSceneLightingHex,Il as combineEditorTransforms,Pl as compareEditorSceneAssetLibraryItems,Al as compileEditorSceneDocumentToSceneConfig,cc as compilePlayableGroundDecalRuntimeConfig,Tl as composeEditorTransformMatrix,wl as createArtistMaterialAssetInspectorProperties,Rl as createArtistMaterialBindingSummary,_l as createArtistMaterialInspectorSections,vl as createAuthoredMarkerTypeDefinition,Cl as createBabylonAssetContainerProjectionImporter,Dl as createBabylonPrimitiveProjectionInstancingController,Ml as createBoundsCenter,Ol as createCameraInspectorProperties,Ll as createChildMaterialBindingInspectorProperties,Nl as createChildMaterialBindingSummary,xl as createDefaultEditorSceneCameraGameObject,kl as createDefaultEditorSceneEnvironmentLightGameObject,jl as createDefaultEditorSceneSunLightGameObject,Ds as createDefaultEditorSceneTransformPatchFromRuntimePatch,Gl as createDefaultMarkerScaleForKind,Fl as createDefaultPbrEditorSceneMaterialAsset,Bl as createDefaultStandardEditorSceneMaterialAsset,zl as createEditorSceneAssetFromLibraryItem,Ul as createEditorSceneAssetHydrationCatalog,$l as createEditorSceneAssetLibrary,Hl as createEditorSceneAssetLibraryItem,Vl as createEditorSceneAssetPlacementPatch,ql as createEditorSceneAuthoringSourceDescriptor,Yl as createEditorSceneCameraInspectorSection,Wl as createEditorSceneCommonInspectorProperties,Kl as createEditorSceneCommonInspectorSection,Jl as createEditorSceneComponentsInspectorProperties,Xl as createEditorSceneComponentsInspectorSection,Ql as createEditorSceneComponentsInspectorSummary,Zl as createEditorSceneCreateGroupPatch,eu as createEditorSceneCreatePrimitivePatch,tu as createEditorSceneDeleteSubtreePatch,Dn as createEditorSceneDirectionalLightDirectionFromAngles,ru as createEditorSceneDirectionalLightDirectionFromTransformRotation,nu as createEditorSceneDirectionalLightShadowSummaryInspectorSection,au as createEditorSceneDocumentInspectorProperty,ou as createEditorSceneDocumentInspectorSections,iu as createEditorSceneDuplicateMaterialAssetForBindingPatch,su as createEditorSceneDuplicateMaterialAssetValue,cu as createEditorSceneDuplicateSelectionPatch,du as createEditorSceneDuplicatedMaterialAsset,lu as createEditorSceneDuplicatedMaterialAssetCopy,uu as createEditorSceneDuplicatedPrefabDefinition,mu as createEditorSceneFieldInspectorValidator,fu as createEditorSceneGameObjectFieldPatch,gu as createEditorSceneGameObjectGuid,pu as createEditorSceneGameObjectsFieldPatch,Eu as createEditorSceneGroupSelectionPatch,hu as createEditorSceneHierarchyMovePatch,Su as createEditorSceneHierarchySourceInspectorProperties,bu as createEditorSceneHierarchySourceInspectorSection,yu as createEditorSceneHierarchySourceInspectorSummary,Iu as createEditorSceneIdentityTransformComponent,Pu as createEditorSceneInspectorActionProperty,Au as createEditorSceneLightInspectorProperties,Tu as createEditorSceneLightInspectorSections,wu as createEditorSceneMarkerConfig,Ru as createEditorSceneMarkerGameObjectDocument,_u as createEditorSceneMarkerGeometry,vu as createEditorSceneMarkerGraphPatchLabel,Cu as createEditorSceneMaterialActionPatch,Du as createEditorSceneMaterialAssetFieldInspectorPropertyInput,Mu as createEditorSceneMaterialAssetFromShaderDefinition,Ou as createEditorSceneMaterialAssetFromSourceProfile,Lu as createEditorSceneMaterialAssetGuid,Nu as createEditorSceneMaterialAssetId,xu as createEditorSceneMaterialAssetInspectorObject,ku as createEditorSceneMaterialAssetMeta,ju as createEditorSceneMaterialAssetOwnershipView,Gu as createEditorSceneMaterialAssetPreview,Fu as createEditorSceneMaterialAssetSelectionId,Bu as createEditorSceneMaterialBindingSummary,zu as createEditorSceneMaterialBrowserAssetItems,Uu as createEditorSceneMaterialPickerControlOptions,$u as createEditorSceneMaterialShaderDefinitionRegistry,Hu as createEditorSceneMetadataInspectorProperties,Vu as createEditorSceneMetadataInspectorSection,qu as createEditorSceneMetadataInspectorSummary,Yu as createEditorSceneModelAssetInspectorObject,Wu as createEditorSceneModelAssetSelectionId,Ku as createEditorSceneModelGameObjectForAsset,Ju as createEditorScenePlacementWorldTransform,ba as createEditorScenePlayableFieldInspectorExtraValidator,Xu as createEditorScenePrefabActionPatch,Qu as createEditorScenePrefabAgentSummary,Zu as createEditorScenePrefabBrowserAssetItems,em as createEditorScenePrefabDefinitionFromAsset,tm as createEditorScenePrefabDefinitionFromGameObject,rm as createEditorScenePrefabGameObjectForAsset,nm as createEditorScenePrefabGroupNode,am as createEditorScenePrefabGuid,om as createEditorScenePrefabInstanceGameObject,im as createEditorScenePrefabInstanceScopedNodeId,sm as createEditorScenePrefabMarkerNode,cm as createEditorScenePrefabMaterialOverrideInspectorSection,dm as createEditorScenePrefabNodeFromAsset,lm as createEditorScenePrefabPrimitiveNode,um as createEditorScenePrefabSourceStructureInspectorSection,mm as createEditorScenePrefabStageCompositionProjectionNodes,fm as createEditorScenePrefabStageContextLightProjectionNodes,gm as createEditorScenePrefabStageInspectorObject,pm as createEditorScenePrefabStageMaterialSlotGroup,Em as createEditorScenePrefabStageMaterialSlotItems,hm as createEditorScenePrefabStageModelProjectionNode,Sm as createEditorScenePrefabStageNodeFallbackLabel,bm as createEditorScenePrefabStageNodeTransform,ym as createEditorScenePrefabStageNodeTreeItem,Im as createEditorScenePrefabStageProjectionKind,Pm as createEditorScenePrefabStageProjectionNodeFromCompositionNode,Am as createEditorScenePrefabStageProjectionNodeId,Tm as createEditorScenePrefabStageRuntimeGroups,wm as createEditorScenePrefabStageRuntimeLeaf,Rm as createEditorScenePrefabStageRuntimeNodeTree,_m as createEditorScenePrefabStageSourceItem,vm as createEditorScenePrefabStageStableId,Cm as createEditorScenePrimitiveInspectorProperties,Dm as createEditorScenePrimitiveInspectorSection,Mm as createEditorSceneReadonlyDocumentInspectorProperty,Om as createEditorSceneReadonlyInspectorProperty,Lm as createEditorSceneReadonlyInspectorSection,Nm as createEditorSceneReadonlyVector3Properties,xm as createEditorSceneRenamePatch,km as createEditorSceneRendererInspectorProperties,jm as createEditorSceneRendererInspectorSection,Gm as createEditorSceneRendererInspectorSummary,Fm as createEditorSceneRenderingInspectorSection,Bm as createEditorSceneRenderingPanelState,zm as createEditorSceneRenderingProfileDraftState,Um as createEditorSceneReparentPatch,$m as createEditorSceneRootTransformComponent,Hm as createEditorSceneRuntimeAnimationSkeletonSection,Vm as createEditorSceneRuntimeBindingSection,qm as createEditorSceneRuntimeCollisionsSection,Ym as createEditorSceneRuntimeGeometryBoxSection,Wm as createEditorSceneRuntimeInspectorSection,Km as createEditorSceneRuntimeInspectorSections,Jm as createEditorSceneRuntimeInspectorSectionsForDocument,Xm as createEditorSceneRuntimeInspectorSnapshot,Qm as createEditorSceneRuntimeIntensityPropertiesSection,Zm as createEditorSceneRuntimeMaterialColorsSection,ef as createEditorSceneRuntimeMaterialSection,tf as createEditorSceneRuntimeMaterialTexturesSection,rf as createEditorSceneRuntimeMetallicRoughnessSection,nf as createEditorSceneRuntimePhysicsSection,af as createEditorSceneRuntimePreviewImageImportPlan,of as createEditorSceneRuntimePreviewImportPlan,sf as createEditorSceneRuntimePreviewMainCameraRig,cf as createEditorSceneRuntimePreviewMissingAssetUrlDiagnostic,df as createEditorSceneRuntimePreviewModelImportPlan,lf as createEditorSceneRuntimePreviewNode,uf as createEditorSceneRuntimePreviewNodes,mf as createEditorSceneRuntimeRawMiscSection,ff as createEditorSceneRuntimeRenderingSection,gf as createEditorSceneRuntimeShadowsSection,pf as createEditorSceneSerializedMultiInspectorObject,Ef as createEditorSceneSerializedMultiInspectorSections,hf as createEditorSceneSerializedMultiObject,Sf as createEditorSceneSerializedMultiTransformPatch,bf as createEditorSceneSerializedObject,yf as createEditorSceneSerializedPropertyDescriptors,If as createEditorSceneSourceAssetFromActionInput,Pf as createEditorSceneSourceMaterialAssetForBindingPatch,Af as createEditorSceneStandardPrefabAssetFieldServices,Tf as createEditorSceneStaticShadowArtifactDiagnostic,wf as createEditorSceneStaticShadowArtifactDraftStore,Rf as createEditorSceneTextureAssetPreview,_f as createEditorSceneTexturePickerControlOptions,vf as createEditorSceneTransformBatchPatch,Cf as createEditorSceneTransformFromSerializedPath,Df as createEditorSceneTransformInspectorProperties,Mf as createEditorSceneTransformInspectorSection,Of as createEditorSceneTransformInspectorSummary,Lf as createEditorSceneTransformPatch,Oa as createEditorSceneTransformPatchFromRuntimePatch,Nf as createEditorSceneTransformRotationFromDirectionalLightDirection,xf as createEditorTransformMatrixSnapshot,kf as createFpsGameEditorAdapter,jf as createFpsGameEditorConfiguredGroundDecalSceneFeature,Gf as createFpsGameEditorDeclarativeGroundDecalSceneFeature,Ff as createFpsGameEditorGroundDecalSceneFeature,Bf as createFpsGameEditorLocalEditorHost,zf as createFpsGameEditorLocalEditorHostManifest,Ks as createFpsGameEditorManagedAssetServices,Uf as createFpsGameEditorPlayableProjectHostAssembly,$f as createFpsGameEditorProductHostAssembly,Fs as createFpsGameEditorProductProjectHostServices,Hf as createFpsGameEditorProductProjectionPreview,Vf as createFpsGameEditorProductRenderingRuntime,qf as createFpsGameEditorProductSceneHostOptions,Js as createFpsGameEditorRuntimeDebugAuthoringClient,Yf as createFpsGameEditorSceneSourceServices,Wf as createFpsGameEditorStandardAssetActionPatch,Kf as createFpsGameEditorStandardProjectRuntime,Jf as createFpsGameEditorStandardSceneAssembly,Xf as createIdentityEditorTransform,Qf as createMarkerGameObjectFromSpatialMarker,Zf as createMarkerSemanticFrameFromTransform,eg as createMarkerType,tg as createMaterialAlphaModeOptions,rg as createMaterialAssetPickerControlOptions,ng as createMaterialAssetSelectorInspectorProperty,ag as createMaterialLightingModelOptions,og as createObjectBoundSemanticFrame,Gs as createPlayableAuthoringClient,gn as createPlayableAuthoringEmptyResponse,U as createPlayableAuthoringJsonResponse,ig as createPlayableBabylonEnvironmentTextureProfile,sg as createPlayableBabylonOutlineInspectorSection,cg as createPlayableBabylonOutlineInspectorSeedPatchValue,dg as createPlayableBabylonPlanarShadowPolicyInput,lg as createPlayableBabylonPlanarShadowPreviewOptions,ug as createPlayableBabylonRenderingAlphaIndexMigrationPatch,mg as createPlayableBabylonRenderingCapability,fg as createPlayableBabylonRenderingCapabilityFacade,gg as createPlayableBabylonRenderingDiagnostics,pg as createPlayableBabylonRenderingPanelState,Eg as createPlayableBabylonWorldRendering,Bi as createPlayableBridgeCommandAssetAdapter,Fi as createPlayableBridgeEventPayload,Zo as createPlayableEditorAssetGuid,ei as createPlayableEditorAssetId,oc as createPlayableEditorBundledPackageAliasPlan,ac as createPlayableEditorBundledPackageRoots,hg as createPlayableEditorDoctorReport,To as createPlayableEditorEntryController,es as createPlayableEditorEntryManifest,as as createPlayableEditorEntryModuleLoader,rs as createPlayableEditorEntryModuleUrl,ss as createPlayableEditorEntryPerformanceTracker,gi as createPlayableEditorManagedAssetFacade,ai as createPlayableEditorManagedAssetGuid,oi as createPlayableEditorManagedAssetId,$t as createPlayableEditorManagedSceneAsset,Sg as createPlayableEditorSceneFieldMutationOptions,bg as createPlayableEditorSceneHierarchyFacade,yg as createPlayableEditorSceneInspectorMultiObject,Ig as createPlayableEditorSceneInspectorObject,Pg as createPlayableEditorSceneInspectorPropertyPatch,Ag as createPlayableEditorSceneInspectorSections,Tg as createPlayableEditorSceneMarkerGraphFacade,wg as createPlayableEditorSceneMarkerInspectorSection,Rg as createPlayableEditorSceneObjectCommandFacade,_g as createPlayableEditorSceneOutlineInspectorSection,vg as createPlayableEditorSceneSessionFacade,Vi as createPlayableEditorSourcePackageAliasPlan,nc as createPlayableEditorSourceTsconfigPathsPlan,Cg as createPlayableForgePlaySaveState,Dg as createPlayableGroundDecalDocumentBridge,Mg as createPlayableGroundDecalDocumentServices,Og as createPlayableGroundDecalInspectorProperties,Lg as createPlayableGroundDecalInspectorSection,Ng as createPlayableGroundDecalInspectorServices,xg as createPlayableGroundDecalLayerLabel,kg as createPlayableGroundDecalMultiInspectorSection,jg as createPlayableLocalEditorHost,Gg as createPlayableLocalEditorLoadingOverlay,js as createPlayablePlatformAssetDropCache,ao as createPlayablePlatformAssetRegistrationPayload,fo as createPlayablePlatformAssetRegistrationTransportPlan,Zs as createPlayableProjectAssetBridgeAdapter,ho as createPlayableProjectAssetCommandHandler,Fg as createPrefabInstanceInspectorSection,Bg as createPrefabMaterialBindingPresentationImpact,zg as createPrefabStageEditableProperty,Ug as createPrefabStageShadowDefaultProperties,$g as createReadonlyMaterialSlotListInspectorProperties,Hg as createRuntimeSceneCompiledArtifact,Vg as createSceneMainSourceDriver,qg as createSceneMainSourceSaveCompanionConfigPayload,Yg as createSceneMaterialBindingPresentationImpact,Wg as createSceneObjectMarkerTargetRef,Kg as createSpatialMarkerFromGameObject,Jg as createSpatialMarkerGeometryForPresentation,Xg as createSpatialMarkerGeometryForTargetPatch,Qg as createSpatialMarkerGeometryFromGameObject,Zg as createSpatialMarkersFromGameObjects,ep as createStableEditorSceneMaterialAssetGuid,tp as createTexturePickerControlOptions,rp as createUniqueEditorSceneGameObjectDisplayName,np as createUniqueEditorSceneGameObjectId,ap as createUniqueEditorSceneId,op as createUniqueEditorSceneMaterialAssetId,ip as createUniqueEditorScenePrefabAssetId,sp as createUniqueMarkerGameObjectId,cp as createVec3,dp as defineFpsGameEditorFeature,lp as defineFpsGameEditorProject,Us as definePlayableEditorAssetDatabaseConfig,up as degreesToEditorSceneRadians,zn as dehydrateEditorSceneDocumentAssets,mp as deleteDefaultEditorSceneMaterialAsset,fp as deleteEditorSceneMarkerGameObject,gp as deleteEditorSceneMaterialAsset,pp as deleteEditorScenePrefabNode,Ep as deleteMarkerType,hp as describeEditorSceneRuntimeObject,Sp as detectEditorSceneDirectionalLightOrientationDrift,Cs as detectEditorSceneRuntimeInputDrift,bp as editorSceneGuidToStableToken,yp as encodeEditorScenePrefabInstanceIdentitySegment,Un as enrichEditorSceneDocumentAssets,Ip as ensureDefaultEditorSceneMaterialAssets,Pp as ensureEditorSceneAuthoringSource,Ln as ensureEditorSceneGameObjectGuids,Ap as ensureEditorScenePrefabComposition,Tp as ensurePlayableEditorSceneEnvironmentDefaultsCore,nn as executePlayableAssetTransportPlan,wp as findEditorSceneGameObject,Rp as findEditorSceneImageRenderer,_p as findEditorSceneInspectorTextureAsset,vp as findEditorSceneInspectorTextureAssetFromContext,be as findEditorSceneLightingDebugNumberFieldConfig,Cp as findEditorSceneLightingPreviewLightObject,Z as findEditorSceneMaterialAsset,Dp as findEditorSceneModelRenderer,Mp as findEditorScenePrefabAsset,Op as findEditorScenePrefabNode,Lp as findEditorScenePrefabStageInspectorItem,Np as findEditorScenePrefabStageStructureItem,Ka as findEditorSceneRuntimeLightTarget,xp as findEditorSceneTransform,kp as flattenEditorScenePrefabStageStructureItems,jp as formatEditorSceneBoundsSummary,Se as formatEditorSceneLightingNumber,ja as formatEditorSceneLightingShadowMode,Gp as formatEditorSceneMaterialPreviewNumber,Fp as formatEditorSceneMaterialSlotLabel,Bp as formatEditorScenePrefabStageMaterialSlotSummary,zp as formatPlayableEditorDoctorReport,sc as formatPlayableEditorPackageAliasPlanError,Up as formatPlayableLocalEditorHostCompatibilityReport,$p as getArtistMaterialInspectorText,Hp as getBuiltInMarkerType,Vp as getCameraInspectorText,qp as getDefaultEditorSceneMaterialPreset,Hr as getEditorSceneAuthoringSourceRef,Yp as getEditorSceneGameObjectWorldTransform,Wp as getEditorSceneGameObjectWorldTrsTransform,Kp as getEditorSceneHierarchyItems,Jp as getEditorSceneLightInspectorLanguage,Xp as getEditorSceneLightInspectorText,Qp as getEditorSceneMarkerGraphPatchSelection,Zp as getEditorSceneMarkerTypeCatalogFromGraph,eE as getEditorSceneMaterialAssetDefaultPreset,tE as getEditorSceneMaterialAssetDisplayMeta,rE as getEditorSceneMaterialAssetDisplayName,ua as getEditorSceneMaterialShaderDefinition,nE as getEditorSceneMaterialSlotPrimaryOwnerPath,aE as getEditorScenePrefabStageDescriptor,oE as getEditorScenePrefabStageProjectionNodeIdForNode,iE as getEditorScenePrefabStageProjectionNodes,sE as getEditorScenePrefabStageStructure,cE as getEditorSceneRelationTypeCatalog,dE as getEditorSceneSlotMaterialBinding,lE as getEditorSceneSlotMaterialBindingPath,uE as getEditorSceneSlotSelectionKey,mE as getEditorSceneSlotSourceMaterialName,fE as getEditorSceneSlotSourceMaterialProfile,gE as getNextEditorSceneAssetPlacementPosition,Ys as getPlayableEditorAssetKindExtensions,ri as getPlayableEditorAssetPathExtension,pE as getPlayableForgePlayHistoryResultEventName,EE as getTopLevelSceneGraphNodeIds,hE as groundDecalFeature,un as guidToPlayableEditorAssetStableToken,Ws as guidToPlayableEditorManagedAssetStableToken,dc as handleEditorSceneRenderingProfileAuthoringRequest,Xs as handlePlayableAuthoringServerRequest,SE as hasDetectedModelMaterialSlots,bE as hasEditorSceneAncestorDescendantPair,yE as hasEditorSceneCamera,IE as hasEditorSceneDescendants,PE as hasEditorSceneMaterialAsset,AE as hasEditorScenePrefabForSourceAsset,TE as hasEditorScenePrefabStageRuntimeStructure,wE as hasInvalidEditorSceneCameraRelationships,RE as hasReadonlyEditorSceneMaterialSlotReimportIssues,_E as hslToEditorSceneMaterialPreviewRgb,vE as inspectPlayableEditorHostCompatibilityReport,CE as inspectPlayableLocalEditorHostManifest,DE as installPlayableForgePlayModeBridge,ME as isBlockedPlayableEditorSceneSystemFieldPatch,OE as isBuiltInMarkerType,LE as isCompiledArtifactForSource,NE as isDefaultEditorSceneMaterialAsset,xE as isDefaultReadonlyEditorSceneMaterialAsset,kE as isDeletedRelationEndpoint,jE as isEditorProjectFilePreviewable,GE as isEditorProjectMediaPreviewable,FE as isEditorSceneArtistMaterialPatchPath,na as isEditorSceneAssetPlaceable,BE as isEditorSceneCameraGameObject,zE as isEditorSceneCameraProjection,UE as isEditorSceneColor,$E as isEditorSceneDuplicateMaterialAssetPickerValue,HE as isEditorSceneFiniteNumber,ga as isEditorSceneGameObjectShadowParticipationOwner,VE as isEditorSceneGroupLikeGameObject,qE as isEditorSceneLightDirectionAnglePath,xn as isEditorSceneLightGameObject,YE as isEditorSceneLightType,WE as isEditorSceneMarkerGameObject,KE as isEditorSceneMarkerGraphCommandSupported,JE as isEditorSceneMaterialAssetReadonlyForInspector,XE as isEditorSceneMaterialBindingNullableStringPath,QE as isEditorSceneMaterialBindingPath,ZE as isEditorSceneMaterialColorRgb,eh as isEditorSceneMaterialColorRgba,th as isEditorSceneMatrixTransformComponent,rh as isEditorSceneNonNegativeFiniteNumber,nh as isEditorSceneOptionalBoolean,ah as isEditorSceneOptionalNonEmptyString,oh as isEditorSceneOptionalString,ih as isEditorScenePositiveFiniteNumber,sh as isEditorScenePositiveSize,ch as isEditorScenePrefabAsset,dh as isEditorScenePrefabCoreMaterialOverridePath,lh as isEditorScenePrefabDefaultShadowPath,uh as isEditorScenePrefabInstance,mh as isEditorScenePrefabMaterialAssetIdOverridePath,fh as isEditorScenePrefabOverridePath,gh as isEditorSceneProtectedSystemGameObject,ph as isEditorSceneProtectedSystemGameObjectId,Eh as isEditorSceneRenderingProfileDraftDirty,hh as isEditorSceneRenderingProfilePatchPath,Sh as isEditorSceneRootGameObject,bh as isEditorSceneRootGameObjectId,yh as isEditorSceneRootTransformPath,Ih as isEditorSceneRuntimeMeshLike,Ph as isEditorSceneScale,Ah as isEditorSceneSelectableHierarchyId,Th as isEditorSceneStringArray,wh as isEditorSceneTextureAsset,Rh as isEditorSceneTransformLike,_h as isEditorSceneTrsTransformComponent,vh as isEditorSceneUnitRangeNumber,Ch as isEditorSceneVec2,Dh as isEditorSceneVec3,Mh as isEditorTransformMatrixSnapshot,Oh as isEditorTransformTrsSnapshot,Lh as isMarkerEndpoint,Nh as isMarkerTypeDefinitionValid,xh as isObjectMarkerKind,kh as isPlayableBabylonOutlineInspectorPatchPath,jh as isPlayableBabylonRenderingEnvironmentTextureAsset,Gh as isPlayableBabylonRenderingEnvironmentTextureResource,Fh as isPlayableEditorSceneGroundDecalProjectionPath,Bh as isPlayableGroundDecalEditableColorLayer,zh as isPlayableGroundDecalEditableTextLayer,Uh as isPlayableGroundDecalEditableTextureLayer,$h as isPlayableGroundDecalInspectorPatchPath,Hh as isPlayableGroundDecalLayerColorAlphaPath,Vh as isPlayableGroundDecalLayerColorPath,qh as isPlayableGroundDecalLayerProgressPreviewPercentPath,Yh as isPlayableGroundDecalLayerRectPath,Wh as isPlayableGroundDecalLayerRotationPath,Kh as isPlayableGroundDecalLayerTextColorAlphaPath,Jh as isPlayableGroundDecalLayerTextColorPath,Xh as isPlayableGroundDecalLayerTextFontSizePath,Qh as isPlayableGroundDecalLayerTextValuePath,Zh as isPlayableGroundDecalLayerTexturePath,eS as isPlayableGroundDecalLayerTextureTintAlphaPath,tS as isPlayableGroundDecalLayerTextureTintPath,rS as isPlayableGroundDecalLayoutEditableLayer,nS as isPlayableGroundDecalLayoutPatchCompatibleWithDecal,aS as isPlayableGroundDecalProjectEditableLayer,oS as isPlayableGroundDecalRenderingTextureDimensionPath,iS as isPlayableGroundDecalRotationEditableLayer,sS as isPlayableGroundDecalSerializedMultiFieldPath,cS as isPlayableLocalEditorSaveCancellation,dS as isReadonlyEditorSceneMaterialAsset,lS as isRegionMarkerKind,uS as isRelationEndpointValid,mS as isTargetRefValid,fS as isValidEditorAffineTransformMatrix,gS as isVec3ApproximatelyEqual,pS as isVec3Like,ES as loadEditorAssetLibrary,hS as loadEditorProjectFile,SS as loadEditorProjectFiles,os as loadPlayableEditorEntryManifest,bS as loadSceneMainSource,yS as markEditorSceneInspectorPropertiesEffect,IS as markEditorSceneRenderingProfileDraftSaved,Ii as matchPlayableAuthoringRoute,PS as mergeEditorSceneAssetWithLibraryItem,AS as mergeEditorSceneCameraDefaults,TS as mergeEditorSceneLightDefaults,wS as mergeEditorSceneMaterialBindingOverrides,RS as mergeEditorScenePrefabOverrides,_S as mergeEditorSceneSourceMaterialProfile,vS as mergeMarkerTypeDefinition,CS as mergePlayableEditorDoctorReports,DS as mergePlayableGroundDecalDefaults,MS as migrateEditorSceneDocumentRenderingAlphaIndex,OS as migrateEditorSceneGameObjectsRenderingAlphaIndex,LS as migrateEditorSceneMarkerGraphMarkersToGameObjects,NS as migrateEditorSceneMaterialAssetShader,xS as mixEditorSceneLightingPreviewColor,Es as mountEditorRuntimeDebugPanelShell,lc as mountEditorRuntimeLightingDebugPanel,uc as mountFpsGameEditorLocalEditorEntry,kS as mountFpsGameEditorProductLocalEditor,jS as mountFpsGameEditorProductLocalEditorFromEnvironmentModule,GS as mountFpsGameEditorStandardLocalEditorFromEnvironmentModule,FS as mountFpsGameEditorStandardProject,BS as normalizeCompiledArtifacts,zS as normalizeEditorSceneCameraAfterFieldPatch,US as normalizeEditorSceneCameraGameObject,$S as normalizeEditorSceneFieldInspectorValue,HS as normalizeEditorSceneGameObjectDisplayName,VS as normalizeEditorSceneHierarchyDocument,qS as normalizeEditorSceneLightDirectionAngleValue,Nn as normalizeEditorSceneLightDirectionVector,YS as normalizeEditorSceneLightingAngleDegrees,WS as normalizeEditorSceneLightingPreviewVec3,KS as normalizeEditorSceneMarkerGameObject,JS as normalizeEditorSceneMarkerGameObjects,XS as normalizeEditorSceneMarkerGraph,QS as normalizeEditorSceneMarkerGraphCommand,ZS as normalizeEditorSceneMarkerPresentation,eb as normalizeEditorSceneMaterialAssetValue,tb as normalizeEditorSceneMaterialBindings,rb as normalizeEditorSceneMaterialPreviewHue,nb as normalizeEditorSceneMaterialSlotOwnerPath,ab as normalizeEditorScenePlainTransformGameObject,pa as normalizeEditorScenePlayableInspectorValue,ob as normalizeEditorScenePrefabAssetComposition,ib as normalizeEditorScenePrefabAssetFieldValue,sb as normalizeEditorScenePrefabIdentifierPart,cb as normalizeEditorScenePrefabStageOwnerNodePath,db as normalizeEditorScenePrimitiveShape,lb as normalizeEditorSceneRootGameObject,ub as normalizeEditorSceneRootTransformDocument,Ua as normalizeEditorSceneRuntimeLightBinding,mb as normalizeEditorSceneRuntimePreviewProjectUrlPath,fb as normalizeEditorSceneShadowAuthoringSource,gb as normalizeEditorSceneSystemLightGameObject,pb as normalizeMarkerBoxSize,Eb as normalizeMarkerNodeKind,qs as normalizePlayableEditorAssetCodeKey,Vs as normalizePlayableEditorAssetDisplayName,ti as normalizePlayableEditorAssetKind,hb as normalizePlayableEditorSceneGroundDecalGameObject,Fn as normalizePlayableForgePlayCommandName,Ir as normalizePlayableFsPath,Sb as normalizePlayableGroundDecalAlphaValue,bb as normalizePlayableGroundDecalColorValue,yb as normalizePlayableGroundDecalFontSizeValue,Ib as normalizePlayableGroundDecalInspectorFieldValue,Pb as normalizePlayableGroundDecalLayoutLayerPatch,Ab as normalizePlayableGroundDecalLayoutPatchValue,Tb as normalizePlayableGroundDecalLayoutRect,wb as normalizePlayableGroundDecalProgressPreviewPercentValue,wa as normalizePlayableGroundDecalRotationDegrees,Rb as normalizePlayableGroundDecalTextureDimension,_b as normalizePlayableGroundDecalUiScaleAfterFieldPatch,vb as normalizePlayableGroundDecalUiScales,Cb as normalizePlayableGroundDecalUiScalesForCommand,uo as normalizePlayablePlatformAssetPayload,Qr as normalizePlayablePortableAssetPath,Db as parseEditorSceneDuplicateMaterialAssetValue,_t as parseEditorSceneLightingDebugNumberDraft,Mb as parseEditorSceneMaterialAssetFieldPath,Ob as parseEditorSceneMaterialAssetSelectionId,Lb as parseEditorSceneModelAssetSelectionId,ts as parsePlayableEditorEntryManifest,Nb as parsePlayableGroundDecalLayerPatchPath,xb as patchEditorSceneDirectionalLightOrientationAngles,kb as patchEditorSceneGameObjectByField,kn as patchEditorSceneGameObjectField,jb as patchEditorSceneGameObjectFieldsMany,Gb as patchEditorSceneGameObjectMaterialBinding,Fb as patchEditorSceneGameObjectTransform,Bb as patchEditorSceneGameObjectsField,zb as patchEditorSceneMaterialAsset,Ub as patchEditorSceneMaterialAssetField,$b as patchEditorScenePrefabAsset,Hb as patchEditorScenePrefabAssetField,Vb as patchEditorScenePrefabOverride,ks as patchEditorSceneRuntimeLights,qb as patchMarkerGameObjectFromSpatialMarker,Yb as patchMarkerGameObjectTransformComponents,Wb as patchPlayableEditorSceneDirectionalLightAngleField,Kb as patchPlayableEditorSceneGameObjectFieldWithServices,Jb as patchPlayableEditorSceneGameObjectsFieldWithServices,Xb as patchPlayableEditorSceneGroundDecalInspectorField,Qb as patchPlayableEditorSceneGroundDecalKind,Zb as patchPlayableEditorSceneGroundDecalLayout,ey as patchPlayableEditorSceneGroundDecalRenderingDimension,ty as patchPlayableGroundDecalLayer,si as planPlayableEditorAssetRegistrationCore,ci as planPlayableEditorAssetUnregistrationCore,ry as playableGroundDecalColorsEqual,ny as playableGroundDecalRectsEqual,Yt as postPlayableAuthoringJson,Bn as postPlayableForgePlayEvent,ay as preparePlayableEditorSceneDocument,oy as pruneEditorSceneArtistMaterialProfile,iy as radiansToEditorSceneDegrees,sy as readArtistMaterialInspectorLanguage,cy as readArtistMaterialTexturePickerValue,dy as readCompiledRuntimeSceneArtifact,ly as readEditorProjectFileContent,uy as readEditorProjectFileSnapshot,my as readEditorSceneAssetMaterialSlots,jt as readEditorSceneDirectionalLightAngles,dr as readEditorSceneDirectionalLightAnglesExact,fy as readEditorSceneDirectionalLightOrientation,gy as readEditorSceneGameObjectAlphaIndex,py as readEditorSceneGameObjectLocalTransform,Ey as readEditorSceneGameObjectRenderingGroupId,hy as readEditorSceneInspectorColor,Sy as readEditorSceneInspectorShadowSettings,by as readEditorSceneInspectorVec3,yy as readEditorSceneLightType,br as readEditorSceneLightingDebugColorSnapshotField,ze as readEditorSceneLightingDebugNumberSnapshotField,xa as readEditorSceneLightingDebugText,ka as readEditorSceneLightingDebugTooltipText,Iy as readEditorSceneLightingPreviewColor,Py as readEditorSceneLightingPreviewDirectionalLight,Ay as readEditorSceneLightingPreviewFiniteNumber,Ty as readEditorSceneLightingPreviewHemisphericLight,Cn as readEditorSceneLightingProjectedLengthMultiplier,wy as readEditorSceneMaterialBindingConfig,Ry as readEditorSceneMaterialSlotBindingSlotId,ya as readEditorSceneMaterialSlotDescriptor,Vr as readEditorSceneNodeKind,_y as readEditorScenePhysicsParam,vy as readEditorScenePrefabMaterialOverrideBinding,Cy as readEditorScenePrefabNodeChildren,Dy as readEditorScenePrefabNodes,My as readEditorScenePrefabOverrideMaterialPath,la as readEditorScenePrefabRootNodeId,Oy as readEditorScenePrefabStageMaterialSlot,Ly as readEditorSceneRuntimeArrayLength,Ny as readEditorSceneRuntimeArrayLengthFromMethod,xy as readEditorSceneRuntimeBoolean,ky as readEditorSceneRuntimeBounds,jy as readEditorSceneRuntimeClassName,Gy as readEditorSceneRuntimeIsEnabled,Ms as readEditorSceneRuntimeLightBinding,Fy as readEditorSceneRuntimeNumber,By as readEditorSceneRuntimePreviewAssetId,zy as readEditorSceneRuntimePreviewAssetKind,Uy as readEditorSceneRuntimePreviewAssetMetadata,$y as readEditorSceneRuntimeProjectionAssetId,Hy as readEditorSceneRuntimeProjectionAssetMetadata,Vy as readEditorSceneRuntimeString,qy as readEditorSceneRuntimeValue,Yy as readEditorSceneTextureUrl,Wy as readEditorSceneTransformVector,Ky as readEditorTransformPosition,Bs as readFpsGameEditorPlatformAssetLookup,Jy as readMarkerConfigTarget,Xy as readMarkerGameObjectScale,Qy as readMarkerTypeDefinition,Zy as readMarkerTypeOverrides,Ni as readPlayableAssetImportInput,pn as readPlayableAssetRegistrationPlanInput,mo as readPlayableAssetRegistrationResultRecord,Li as readPlayableAssetUnregistrationPlanInput,wi as readPlayableAuthoringPayloadPathFromCommand,Qe as readPlayableBridgeRequestId,ii as readPlayableEditorManagedAssetScale,eI as readPlayableForgePlayHistoryOperationOptions,Je as readPlayableForgePlayRequestId,tI as readPlayableGroundDecalFiniteNumber,rI as readPlayableGroundDecalPositiveFiniteNumber,qt as readPlayablePlatformAssetDropPoint,ve as readPlayablePlatformAssetExternal,Ht as readPlayablePlatformAssetKind,en as readPlayablePlatformAssetName,yt as readPlayablePlatformAssetPath,no as readPlayablePlatformAssetPlacement,Ae as readPlayablePlatformAssetRecord,Zr as readPlayablePlatformAssetRecords,Ye as readPlayablePlatformAssetUrl,Vt as readPlayablePlatformRawAssetId,xi as readPlayableSceneNodeCreateInput,ki as readPlayableSceneNodePatchInput,xr as readPlayableSceneNodeRemoveInput,nI as readRawEditorSceneGameObjectLocalTransform,aI as readSceneMainSourceRenderingConfig,oI as readSceneMainSourceSaveCompanionConfigs,iI as readSceneMainSourceStaticShadowsArtifact,sI as readSpatialMarkerTransformPosition,cI as readSpatialMarkerTransformRotation,dI as readSpatialMarkerTransformScale,Ba as readStoredEditorSceneLightingDebugLanguage,Ga as readStoredEditorSceneLightingDebugOpen,lI as rebaseEditorScenePrefabMarkerConfig,uI as rebaseEditorScenePrefabMarkerTarget,mI as reconcileEditorSceneMaterialSlotReimportBindings,fI as reduceEditorSceneDocumentMutation,gI as reduceEditorSceneMarkerGameObjectCommand,pI as reduceEditorSceneMarkerGraph,EI as reducePlayableEditorSceneDocumentCore,zs as registerFpsGameEditorStandardAuthoringCommands,rn as registerPlayablePlatformAsset,po as registerPlayablePlatformAssetIfNeeded,hI as renameEditorScenePrefabAsset,SI as renameEditorScenePrefabNode,bI as reparentEditorScenePrefabNode,yI as replaceEditorSceneMaterialAsset,II as replaceEditorScenePrefabAsset,PI as replacePlayableEditorSceneGroundDecalUi,AI as resetEditorSceneRenderingProfileDraft,TI as resolveDefaultEditorSceneMaterialAssetDeleteState,wI as resolveEditorProjectFileExtension,RI as resolveEditorProjectFileLanguage,_I as resolveEditorProjectMediaSource,vI as resolveEditorProjectMediaSupport,Kr as resolveEditorSceneArtistMaterialBinding,Ls as resolveEditorSceneArtistMaterialRuntimePreview,Ns as resolveEditorSceneArtistMaterialSlotProfiles,CI as resolveEditorSceneAssetAvailabilityKey,DI as resolveEditorSceneAssetLibraryItemRelativePath,MI as resolveEditorSceneEffectiveShadowMode,OI as resolveEditorSceneFieldSchema,LI as resolveEditorSceneGameObjectRendering,NI as resolveEditorSceneGameObjectRuntimeEntityIds,xI as resolveEditorSceneGameObjectShadowSettings,kI as resolveEditorSceneLightingPreviewProfile,jI as resolveEditorSceneMaterialAssetDeleteState,GI as resolveEditorSceneMaterialAssetIntegrity,FI as resolveEditorSceneMaterialRuntimeKind,BI as resolveEditorSceneMaterialSlotReimportDiff,da as resolveEditorScenePrefabInstanceEffectiveOverrides,zI as resolveEditorScenePrefabInstanceMarkers,UI as resolveEditorScenePrefabInstanceRelation,$I as resolveEditorScenePrefabSourceAssetId,HI as resolveEditorScenePrefabSourceSessionState,VI as resolveEditorScenePrefabStageMarkers,qI as resolveEditorScenePrefabStageMaterialDropTarget,YI as resolveEditorScenePrefabStageMaterialOverrideTarget,WI as resolveEditorScenePrefabStagePreviewTarget,KI as resolveEditorSceneProjectedMaterialRuntimeKind,JI as resolveEditorSceneRenderingAlphaIndexPresetValueMigration,XI as resolveEditorSceneRootContainerId,QI as resolveEditorSceneRuntimePreviewAssetUrl,ZI as resolveEditorSceneRuntimePreviewAssetUrlCandidate,eP as resolveEditorShadowPlan,tP as resolveEditorTransformPreserveWorldPolicy,rP as resolveFpsGameEditorFeatureSceneContribution,nP as resolveFpsGameEditorGroundDecalFeatureConfig,aP as resolveFpsGameEditorStaticProject,oP as resolveMarkerGeometryKindForPresentation,iP as resolveMarkerNodeKindForType,sP as resolvePlayableBabylonPlanarShadowPolicy,cP as resolvePlayableBabylonRenderingEnvironmentTextureDiagnostic,dP as resolvePlayableBabylonRenderingEnvironmentTextureResource,mn as resolvePlayableEditorAssetIdentity,lP as resolvePlayableGroundDecalImageRect,uP as resolvePlayableGroundDecalMultiInspectorTargetIds,mP as resolvePlayableGroundDecalUiInspectorScale,fP as resolvePlayableGroundDecalUniformScaleFromVec3,tn as resolvePlayablePlatformAssetRegistrationResult,gP as rewriteMarkerRelationEndpoint,pP as rewriteMarkerRelationIds,EP as rewriteMarkerTargetRef,hP as rewriteSpatialMarkerGeometryTargetRefs,SP as rewriteSpatialMarkerTargetRefs,bP as rgbToEditorSceneMaterialPreviewHsl,yP as rotateVec3ByEuler,IP as roundEditorSceneInspectorNumber,Ra as roundEditorSceneLightingNumber,PP as roundPlayableGroundDecalFieldValue,Et as runPlayableAuthoringCommand,AP as sanitizeEditorSceneGameObjectId,TP as sanitizeEditorSceneId,wP as sanitizeEditorSceneMaterialAssetIdPart,Qa as sanitizeEditorSceneRuntimeDirectionalLight,Xa as sanitizeEditorSceneRuntimeHemisphericLight,Ja as sanitizeEditorSceneRuntimeLightingPatch,RP as sanitizeMarkerGameObjectId,Mr as sanitizePlayableEditorManagedAssetName,_P as saveSceneMainSource,vP as scaleEditorSceneLightingPreviewColor,CP as selectEditorScenePrefabNode,DP as serializeEditorSceneStaticShadowArtifact,Ti as serializePlayableAuthoringFileContent,MP as setEditorScenePrefabNodeMarker,OP as setEditorScenePrefabNodeTransform,LP as setEditorSceneRenderingProfileDraftConfig,NP as setEditorSceneRenderingProfileDraftError,xP as shallowEditorSceneGameObjectsEqual,kP as shouldApplyMarkerDefaultScaleForKind,jP as shouldApplyMarkerDefaultScaleOnPresentationChange,GP as shouldPreserveTransformForMarkerGeometry,FP as splitEditorSceneFieldPath,BP as splitMaterialSlotBindingFieldPath,oo as stripKnownPlayableAssetExtension,tr as stripKnownPlayableEditorAssetExtension,zP as sumEditorSceneRuntimeMeshNumbers,UP as summarizeSaveResult,$P as syncEditorSceneDirectionalLightOrientationAfterTransformPatch,HP as syncEditorSceneDirectionalLightTransformRotationAfterDirectionPatch,VP as syncEditorSceneMarkerGraph,qP as syncEditorSceneMarkerGraphDocument,YP as syncEditorScenePrefabRootNodeFields,WP as toEditorLocalTransformFromWorld,KP as toEditorSceneInspectorLabel,JP as toEditorSceneInspectorSafeValue,XP as toEditorSceneLocalTransformForParent,QP as toEditorSceneLocalTransformFromWorld,ZP as toEditorSceneLocalTrsTransformForParent,eA as toEditorScenePreserveWorldLocalTransformForParent,Os as toEditorSceneRuntimeLightingPatches,tA as toEditorSceneTransformComponent,rA as toEditorSceneTransformSnapshot,Gi as toPlayableBridgeCommandError,Hs as toPlayableEditorAssetImportName,nA as toneMapEditorSceneLightingPreviewColor,aA as toneMapEditorSceneLightingPreviewNumber,oA as transformEditorSceneMaterialPreviewBaseColor,iA as tryCreateEditorSceneTransformComponent,sA as tryCreateEditorSceneTransformSnapshot,Ha as updateEditorSceneLightingDebugSnapshotColorField,qa as updateEditorSceneLightingDebugSnapshotDirection,Va as updateEditorSceneLightingDebugSnapshotEnabled,yr as updateEditorSceneLightingDebugSnapshotFromAngles,$a as updateEditorSceneLightingDebugSnapshotNumberField,cA as updateEditorSceneMarkerGameObject,dA as updateMarkerType,lA as validateAndNormalizeEditorSceneMaterialAssetField,Ea as validateEditorSceneFieldInspectorValue,uA as validateEditorSceneGroupSelection,mA as validateEditorSceneHierarchyMove,fA as validateEditorSceneMaterialAssetFieldValue,xs as validateEditorSceneMaterialGlslColorBindings,gA as validateEditorScenePrefabAssetFieldValue,pA as validateEditorSceneReparent,EA as validatePlayableGroundDecalInspectorField,hA as validateSceneMainDocument,SA as waitForPlayableLocalEditorPaint,bA as waitForPlayableMilliseconds,yA as withEditorSceneMarkerGraph,IA as writeMarkerTypeOverrides,pt as writePlayableAuthoringFile,za as writeStoredEditorSceneLightingDebugLanguage,Fa as writeStoredEditorSceneLightingDebugOpen};
|
|
Binary file
|
|
Binary file
|