var ea=Object.defineProperty;var ta=(a,e,t)=>e in a?ea(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var S=(a,e,t)=>(ta(a,typeof e!="symbol"?e+"":e,t),t);import{bB as Ve,b8 as Ee,av as l,aw as ae,b7 as we,cb as ve,bT as lt,bU as je,cc as ie,ca as le,eW as me,aJ as X,aM as F,aO as aa,aK as K,bm as ze,cm as ee,bk as ct,fa as Ce,fb as de,bA as ra,bX as na,bI as _,fc as sa,bD as At,fd as oa,fe as ia,ff as la,fg as ca,fh as pa,fi as q,aH as ua,fj as ma,aI as Vt,aL as Ct,fk as da,fl as fa,fm as fe,dr as ha,c8 as Te,c9 as Le,c5 as ge,ce as Ot,b3 as Et,cf as wt,f7 as ya,E as ba,C as R,fn as W,fo as D,fp as be,bl as va,e as m,x as J,f as A,aE as ga,p as C,s as O}from"./index-03b6134d.js";import{u as It}from"./index-0a53aaef.js";import{c as xa}from"./Component-3cb422ab.js";import"./postmen-9e6354af.js";import{c as Sa}from"./createOnModelChange-73358d10.js";import{R as Pa}from"./ReferencedMaterial-27ba90e2.js";import"./TextureAsset-7172cc65.js";import"./GlTFAsset-dc68541e.js";import"./MaterialAsset-dfaa82d9.js";import{MeshAsset as Ma}from"./MeshAsset-07529e4e.js";import"./AnimatorControllerAsset-616578b4.js";import"./AnimationClipAsset-a5d290cc.js";import{I as za}from"./ShaderChunkAsset-bdb39acc.js";import"./AmbientLightAsset-6b2d168c.js";import"./SpineSkeletonDataAsset-284f5f4d.js";import"./FontAsset-1e1118c1.js";import"./SceneAsset-a39f097a.js";import"./ShaderAsset-068b4b97.js";import"./PrimitiveMesh-9ff7dbc1.js";import"./XRReferenceImageAsset-823e47cd.js";import"./PrefabAsset-4bac196b.js";import"./PhysicsMaterialAsset-e9abb944.js";import"./RenderTargetAsset-e112b8ca.js";import"./AudioAsset-24b03bc3.js";import"./index-19f5510d.js";import"./MarkdownAsset-2a4a1d10.js";import{I as Ca}from"./IconPlus-99d7bb90.js";import{B as rt}from"./index-7e5ce9d9.js";import{c as Oa}from"./createReactComponent-fcd6848b.js";import"./MaterialInspector-21fc5b67.js";import"./IconPointFilled-f8224625.js";import"./ktx2-encoder-4cac07f2.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-9ce2e9d6.js";import"./AssetViewer-1a9f3cad.js";import"./glTFIO-45ff9a17.js";import"./shader-data-utils-d59bc4f5.js";import"./index-2274eaf1.js";import"./MeshThumbnail-bd30617c.js";import"./bundlers-9b0d37fc.js";import"./module-101126a2.js";import"./module-5fa1eae0.js";import"./ShaderUIScriptAsset-0c11d0ed.js";import"./FormItemArray-f1283fce.js";import"./Accordion-b106eaf3.js";import"./module-03df665c.js";import"./Menu-62cee67e.js";/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var kt=Ve("outline","ease-in","IconEaseIn",[["path",{d:"M3 20c8 0 18 -16 18 -16",key:"svg-0"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Bt=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Dt=Ve("outline","plus-minus","IconPlusMinus",[["path",{d:"M4 7h6",key:"svg-0"}],["path",{d:"M7 4v6",key:"svg-1"}],["path",{d:"M20 18h-6",key:"svg-2"}],["path",{d:"M5 19l14 -14",key:"svg-3"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Yt=Ve("outline","vector-bezier-2","IconVectorBezier2",[["path",{d:"M3 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M17 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M7 5l7 0",key:"svg-2"}],["path",{d:"M10 19l7 0",key:"svg-3"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}],["path",{d:"M7 5.5a5 6.5 0 0 1 5 6.5a5 6.5 0 0 0 5 6.5",key:"svg-6"}]]);const jt=[{type:"constant",icon:l.jsx(Bt,{size:"14px"}),columns:"1fr 32px"},{type:"gradient",icon:l.jsx(kt,{size:"14px"}),columns:"1fr 32px"},{type:"two-constant",icon:l.jsx(Dt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-gradient",icon:l.jsx(Yt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Ea(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:ie(r)}:t==="two-constant"?{type:t,label:e.label,value:[ie(r[0]),ie(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(n=>({value:ie(n.value),time:n.position})),alpha:r.alpha.map(n=>({value:n.value.a,time:n.position}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(n=>({value:ie(n.value),time:n.position})),alpha:r[0].alpha.map(n=>({value:n.value.a,time:n.position}))},{color:r[1].color.map(n=>({value:ie(n.value),time:n.position})),alpha:r[1].alpha.map(n=>({value:n.value.a,time:n.position}))}]}:e})}function wa(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:le(r)}:t==="two-constant"?{type:t,label:e.label,value:[le(r[0]),le(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(n=>({value:le(n.value),position:n.time})),alpha:r.alpha.map(n=>({value:{r:255,g:255,b:255,a:n.value},position:n.time}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(n=>({value:le(n.value),position:n.time})),alpha:r[0].alpha.map(n=>({value:{r:255,g:255,b:255,a:n.value},position:n.time}))},{color:r[1].color.map(n=>({value:le(n.value),position:n.time})),alpha:r[1].alpha.map(n=>({value:{r:255,g:255,b:255,a:n.value},position:n.time}))}]}:e})}function nt({hdr:a,value:e,onValueChange:t,...r}){return a?l.jsx(ve,{...r,mode:"hdr",value:e,onValueChange:t}):l.jsx(ve,{...r,mode:"constant",value:e,onValueChange:t})}function Ft(a){var u;const{label:e,labelFirst:t,info:r,value:n,hdr:c=!1}=a,[s,o]=Ee({prop:wa(n),onChange:i=>{a.onValueChange&&a.onValueChange(Ea(i),d)}}),[d,y]=Ee({prop:a.type,defaultProp:"constant",onChange:i=>{a.onValueChange&&a.onValueChange(n,i)}});function b(i,g){var h;return g==="trigger"?(h=jt.find(M=>M.type===i))==null?void 0:h.icon:i}const p=i=>{o(g=>g.map(h=>h.type!==d?h:{...h,value:i}))},z=i=>g=>{o(h=>h.map(M=>{if(M.type!==d)return M;const{value:j}=M;if(M.type==="two-constant"){if(i===0)return{...M,value:[g,j[1]]};if(i===1)return{...M,value:[j[0],g]}}return M}))},v=i=>{o(g=>g.map(h=>h.type!==d?h:h.type==="gradient"?{...h,value:i}:h))},f=i=>g=>{o(h=>h.map(M=>{if(M.type!==d)return M;if(M.type==="two-gradient"){const{value:j}=M;if(i===0)return{...M,value:[g,j[1]]};if(i===1)return{...M,value:[j[0],g]}}return M}))};return l.jsxs(ae,{label:e,info:r,fieldCss:{gridTemplateColumns:(u=jt.find(i=>i.type===d))==null?void 0:u.columns},children:[s.map(i=>{const{type:g,value:h}=i;if(!g||d!==g)return null;switch(g){case"constant":return l.jsx(nt,{fullsize:!0,hdr:c,value:h,onValueChange:p},"constant");case"gradient":return l.jsx(ve,{fullsize:!0,mode:"particle",value:h,onValueChange:v},"gradient");case"two-constant":return l.jsxs(we.Fragment,{children:[l.jsx(nt,{fullsize:!0,hdr:c,value:h[0],onValueChange:z(0)}),l.jsx(nt,{fullsize:!0,hdr:c,value:h[1],onValueChange:z(1)})]},"two-constant");case"two-gradient":return l.jsxs(we.Fragment,{children:[l.jsx(ve,{fullsize:!0,mode:"particle",value:h[0],onValueChange:f(0)}),l.jsx(ve,{fullsize:!0,mode:"particle",value:h[1],onValueChange:f(1)})]},"two-gradient");default:return null}}),l.jsx(lt,{defaultValue:"constant",position:"item-aligned",cornerArrow:!0,value:d,valueRenderer:b,onValueChange:i=>y(i),children:s.map(i=>l.jsx(je,{value:i.type,children:i.label||i.type},i.type))})]})}const Zt=[{type:"constant",icon:l.jsx(Bt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"curve",icon:l.jsx(kt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"two-constant",icon:l.jsx(Dt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-curve",icon:l.jsx(Yt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function ja(a,e){var t;return e==="trigger"?(t=Zt.find(r=>r.type===a))==null?void 0:t.icon:a}const st=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function _e(a){var L;const{label:e,info:t,value:r,onValueChange:n,algo:c="bezier",yRangeMode:s,yTickScale:o,yTickScaleMin:d,yTickScaleMax:y,onYTickScaleChange:b,onYTickScaleCommit:p,hideTypeSelector:z,...v}=a,[f,u]=Ee({prop:a.type,defaultProp:"constant",onChange:E=>{n&&n(r,E)}}),[i,g]=Ee({prop:r,onChange:E=>{n&&n(E,f)},defaultProp:[{value:0,type:"constant"},{value:st,type:"curve"},{value:[0,0],type:"two-constant"},{value:[st,st],type:"two-curve"}]}),h=E=>{g(V=>V.map(T=>T.type!==f?T:{...T,value:E}))},M=E=>V=>{g(T=>T.map(I=>{if(I.type!==f)return I;const{value:$}=I;return E===0?{...I,value:[V,$[1]]}:E===1?{...I,value:[$[0],V]}:I}))},j=E=>{g(V=>V.map(T=>T.type!==f?T:{...T,value:E}))},w=E=>V=>{g(T=>T.map(I=>{if(I.type!==f)return I;const{value:$}=I;return E===0?{...I,value:[V,$[1]]}:E===1?{...I,value:[$[0],V]}:I}))},Y={algo:c,yRangeMode:s,yTickScale:o,yTickScaleMin:d,yTickScaleMax:y,onYTickScaleChange:b,onYTickScaleCommit:p};return l.jsxs(ae,{label:e,info:t,fieldCss:{gridTemplateColumns:(L=Zt.find(E=>E.type===f))==null?void 0:L.columns,columnGap:"$1"},...v,children:[i.map(E=>{const{type:V,value:T,min:I,max:$,step:U}=E;if(!V||f!==V)return null;switch(V){case"constant":return l.jsx(me,{min:I,max:$,dragStep:U,step:U,value:T,onValueChange:h},"constant");case"curve":return l.jsx(rt,{...Y,value:T,onChange:j},"curve");case"two-constant":return l.jsxs(we.Fragment,{children:[l.jsx(me,{size:"sm",startSlot:"min",value:T[0],min:I,max:$,dragStep:U,step:U,onValueChange:M(0)}),l.jsx(me,{size:"sm",startSlot:"max",value:T[1],min:I,max:$,dragStep:U,step:U,onValueChange:M(1)})]},"two-constant");case"two-curve":return l.jsxs(we.Fragment,{children:[l.jsx(rt,{...Y,value:T[0],onChange:w(0)}),l.jsx(rt,{...Y,value:T[1],onChange:w(1)})]},"two-curve");default:return null}}),!z&&l.jsx(lt,{value:f,position:"item-aligned",cornerArrow:!0,valueRenderer:ja,onValueChange:E=>u(E),children:i.map(E=>l.jsx(je,{value:E.type,children:E.label||E.type},E.type))})]})}/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Ta=Oa("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);const La=X(function(a){const[e,t]=F.useState(null),r=a.data,{assetStore:n,inspectorFacade:c}=It();return F.useEffect(()=>{n.getAssetByRef(r.material).then(s=>{t(s)})},[r.material]),l.jsxs(l.Fragment,{children:[l.jsx(aa.List,{model:r,configs:r.formSchema.items,onModelChange:Sa("component",r.id,c,r)}),e&&l.jsx(Pa,{materialAsset:e})]})});async function _a(a,e){await a.assetStore.getAssetByRef(e)}var k=(a=>(a.BoxShape="BoxShape",a.CircleShape="CircleShape",a.ConeShape="ConeShape",a.HemisphereShape="HemisphereShape",a.SphereShape="SphereShape",a.MeshShape="MeshShape",a))(k||{});function Z(a,e){return{class:a.class,props:{...a.props,...e}}}const Ra=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsx(l.Fragment,{children:l.jsx(ze,{label:t("effects.shape.size"),value:{x:a.props.size.x,y:a.props.size.y,z:a.props.size.z},onChange:(r,n)=>{const c=Z(a,{size:{...a.props.size,[n]:r[n]}});e==null||e("shape",c)}})})}),Aa=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsxs(l.Fragment,{children:[l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const n=Z(a,{radius:r});e==null||e("shape",n)}}),l.jsx(ee,{label:t("effects.shape.arc"),min:0,max:360,value:a.props.arc,onChange:r=>{const n=Z(a,{arc:r});e==null||e("shape",n)}}),l.jsx(ct,{label:t("effects.shape.arc-mode.label"),options:[{label:t("effects.shape.loop"),value:Ce.Loop},{label:t("effects.shape.random"),value:Ce.Random}],value:a.props.arcMode,onChange:r=>{const n=Z(a,{arcMode:r});e==null||e("shape",n)}}),a.props.arcMode===Ce.Loop?l.jsx(ee,{label:t("effects.shape.arc-speed.label"),step:.1,dragStep:.1,value:a.props.arcSpeed,onChange:r=>{const n=Z(a,{arcSpeed:r});e==null||e("shape",n)}}):null]})}),Va=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsxs(l.Fragment,{children:[l.jsx(ct,{label:t("effects.shape.emit-type.label"),options:[{label:t("effects.shape.cone-base"),value:de.Base},{label:t("effects.shape.volume"),value:de.Volume}],value:a.props.emitType,onChange:r=>{const n=Z(a,{emitType:r});e==null||e("shape",n)}}),l.jsx(ee,{label:t("effects.shape.angle"),min:1e-4,max:90,step:.05,dragStep:.05,value:a.props.angle,onChange:r=>{const n=Z(a,{angle:r});e==null||e("shape",n)}}),l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const n=Z(a,{radius:r});e==null||e("shape",n)}}),l.jsx(ee,{label:t("effects.shape.length"),min:1e-4,step:.1,dragStep:.1,value:a.props.length,disabled:a.props.emitType===de.Base,onChange:r=>{const n=Z(a,{length:r});e==null||e("shape",n)}})]})}),Ia=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsx(l.Fragment,{children:l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const n=Z(a,{radius:r});e==null||e("shape",n)}})})}),ka=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsx(l.Fragment,{children:l.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const n=Z(a,{radius:r});e==null||e("shape",n)}})})}),Ba=X(({item:a,onModelChange:e})=>{const{t}=K(),{assetStore:r}=It(),n=Object.values(r.assets).filter(o=>o instanceof Ma),[c,s]=F.useState("");return F.useEffect(()=>{let o=!1;return(async()=>{if(!a.props.mesh){s("");return}try{const y=await r.getAssetByRef(a.props.mesh);o||s((y==null?void 0:y.name)??"")}catch{o||s("")}})(),()=>{o=!0}},[r,a.props.mesh]),l.jsx(ra,{label:t("effects.renderer.render-mode.options.mesh"),assets:n,dropLayer:0,value:c,onSelect:async o=>{s(o.name);const d=!!o.engineObject;d||na.error("Mesh asset is not initialized");const y={class:a.class,props:{...a.props,mesh:o.getCurrentRef(),enabled:d}};e==null||e("shape",y)}})}),Da=X(({item:a,onModelChange:e})=>{const{t}=K();return l.jsx(ee,{label:t("effects.shape.random-direction-amount"),info:t("effects.shape.random-direction-amount-tip"),min:0,step:1,dragStep:.05,value:a.props.randomDirectionAmount||0,onChange:r=>{const n=Z(a,{randomDirectionAmount:r});e==null||e("shape",n)}})}),Ya=X(({item:a,onModelChange:e})=>{const{t}=K(),r=a.props.position??{x:0,y:0,z:0},n=a.props.rotation??{x:0,y:0,z:0},c=a.props.scale??{x:1,y:1,z:1};return l.jsxs(l.Fragment,{children:[l.jsx(ze,{label:t("effects.shape.position"),value:{x:r.x,y:r.y,z:r.z},onChange:(s,o)=>{const d=Z(a,{position:{x:r.x,y:r.y,z:r.z,[o]:s[o]},rotation:{x:n.x,y:n.y,z:n.z},scale:{x:c.x,y:c.y,z:c.z}});e==null||e("shape",d)}}),l.jsx(ze,{label:t("effects.shape.rotation"),value:{x:n.x,y:n.y,z:n.z},onChange:(s,o)=>{const d=Z(a,{position:{x:r.x,y:r.y,z:r.z},rotation:{x:n.x,y:n.y,z:n.z,[o]:s[o]},scale:{x:c.x,y:c.y,z:c.z}});e==null||e("shape",d)}}),l.jsx(ze,{label:t("effects.shape.scale"),value:{x:c.x,y:c.y,z:c.z},onChange:(s,o)=>{const d=Z(a,{position:{x:r.x,y:r.y,z:r.z},rotation:{x:n.x,y:n.y,z:n.z},scale:{x:c.x,y:c.y,z:c.z,[o]:s[o]}});e==null||e("shape",d)}})]})}),it=new Map;function Fa(a,e){let t;switch(e.class){case k.BoxShape:{t=new pa;const r=t.size;r.copyFrom(e.props.size),t.size=r;break}case k.CircleShape:{t=new ca,t.radius=e.props.radius,t.arc=e.props.arc,t.arcMode=e.props.arcMode,t.arcSpeed=e.props.arcSpeed;break}case k.ConeShape:{t=new la,t.angle=e.props.angle,t.radius=e.props.radius,t.length=e.props.length,t.emitType=e.props.emitType;break}case k.HemisphereShape:{t=new ia,t.radius=e.props.radius;break}case k.SphereShape:{t=new oa,t.radius=e.props.radius;break}case k.MeshShape:{t=new sa;const r=e.props.mesh;if(r!=null&&r.refId){const n=a.root.assetStore.assets[r.refId];t.mesh=n==null?void 0:n.engineObject}t.mesh||(t.mesh=At.createSphere(a.engineObject.engine));break}}if(t){if(e.props.randomDirectionAmount=e.props.randomDirectionAmount??0,t.randomDirectionAmount=e.props.randomDirectionAmount,t.enabled=e.props.enabled,e.props.position){const r=e.props.position;t.position.set(r.x,r.y,r.z)}if(e.props.rotation){const r=e.props.rotation;t.rotation.set(r.x,r.y,r.z)}if(e.props.scale){const r=e.props.scale;t.scale.set(r.x,r.y,r.z)}}return t}const Za=(a,e,t)=>{let r=it.get(`${a.id}-${t.class}`);r&&(r=JSON.parse(r),it.delete(`${a.id}-${t.class}`),Object.assign(t.props,r));const n=Fa(a,t);n&&a.applyEmissionShape(n)},Xa={BoxShape:Ra,CircleShape:Aa,ConeShape:Va,HemisphereShape:Ia,SphereShape:ka,MeshShape:Ba},$a={BoxShape:{class:k.BoxShape,props:{size:{x:1,y:1,z:1},randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},CircleShape:{class:k.CircleShape,props:{radius:1,arc:360,arcMode:Ce.Random,arcSpeed:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},ConeShape:{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},HemisphereShape:{class:k.HemisphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},SphereShape:{class:k.SphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},MeshShape:{class:k.MeshShape,props:{randomDirectionAmount:0,enabled:!0,mesh:void 0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}}},qa=X(({model:a,onModelChange:e})=>{const{t}=K(),r=a.shape;if(!r.class)return;const n=Xa[r.class];return l.jsxs(l.Fragment,{children:[l.jsx(ct,{label:t("effects.shape.type.label"),info:t("effects.shape.type.info"),value:r.class,options:[{label:t("effects.shape.options.box"),value:k.BoxShape},{label:t("effects.shape.options.circle"),value:k.CircleShape},{label:t("effects.shape.options.cone"),value:k.ConeShape},{label:t("effects.shape.options.hemisphere"),value:k.HemisphereShape},{label:t("effects.shape.options.sphere"),value:k.SphereShape},{label:t("effects.shape.options.mesh"),value:k.MeshShape}],onChange:c=>{const s=$a[c];if(a.shape&&a.shape.class!==c&&it.set(`${a.id}-${a.shape.class}`,JSON.stringify(a.shape.props)),s.class!==r.class){const o=_(s);e==null||e("shape",o)}}}),l.jsx(n,{item:r,component:a.engineObject,onModelChange:e}),l.jsx(Da,{item:r,component:a.engineObject,onModelChange:e}),l.jsx(Ya,{item:r,component:a.engineObject,onModelChange:e})]})}),pt=["constant","two-constant","curve","two-curve"],te=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Re(a){return a.map(e=>({x:e.constructParams[0],y:e.constructParams[1]}))}const Tt={class:"ParticleCurve",constructParams:[{class:"CurveKey",constructParams:[0,0]},{class:"CurveKey",constructParams:[.25,.25]},{class:"CurveKey",constructParams:[.75,.75]},{class:"CurveKey",constructParams:[1,1]}]};function B(a,e=0,t=0,r=q.Constant){return{module:a,mode:r,constantMin:t,constantMax:e,curveMax:_(Tt),curveMin:_(Tt)}}function ce(a,e=0,t=0,r=q.Constant){return{enabled:!1,x:B(a,e,t,r),y:B(a,e,t,r),z:B(a,e,t,r)}}const Ka=a=>a===1/0?1/0:Math.max(1,Math.floor(a));function Na(a){if(!(a!=null&&a.constructParams))return;const e=a.constructParams[2];e===null?a.constructParams[2]=1/0:typeof e=="number"&&e!==1/0&&(a.constructParams[2]=Math.max(1,Math.floor(e)))}const Ae=1,ut=.01,Ga=ua("div",{height:"$6",display:"flex",alignItems:"center",paddingLeft:"$2",fontSize:"$sm",borderRadius:"$1",backgroundColor:"$softBg",color:"$gray9",userSelect:"none"}),Ha=l.jsx(Ta,{size:"14px"});function Wa(a,e){return e==="trigger"?Ha:a}const Ua={class:"Burst",constructParams:[0,{class:"ParticleCompositeCurve",constructParams:[15],props:{mode:q.Constant,constantMax:15,constantMin:0}},Ae,ut]},Ja=X(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=K(),{label:n,info:c}=e,s=a.bursts,[o,d]=F.useState(-1),y=u=>{const i=_(s);u(i),t==null||t("bursts",i)},b=(u,i)=>{y(g=>{const h=g[u];h&&i(h)})},p=u=>{y(i=>{i.splice(u,1)})},z=()=>{y(u=>{u.push(_(Ua))})},v=[{title:r("effects.burst.time.label")},{title:r("effects.burst.count.label")},{title:r("effects.burst.cycles.label")},{title:r("effects.burst.interval.label")}],f=(u,i)=>{const g=Math.max(1,u.constructParams[1].props.constantMax??0,u.constructParams[1].props.constantMin??0);return{data:u,cells:[l.jsx(ae,{children:l.jsx(me,{min:0,max:a.duration,step:.05,dragStep:.05,value:u.constructParams[0],onValueChange:h=>{b(i,M=>{M.constructParams[0]=h})}})},`time-${i}`),l.jsx(_e,{type:pt[u.constructParams[1].props.mode],direction:"column",algo:"bezier",yRangeMode:"positive",yTickScale:g,yTickScaleMin:0,yTickScaleMax:g,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:u.constructParams[1].props.constantMax,type:"constant",min:0,step:1},{value:[u.constructParams[1].props.constantMin,u.constructParams[1].props.constantMax],type:"two-constant",min:0,step:1}],onValueChange:(h,M)=>{const j=h.find(w=>w.type===M);j&&b(i,w=>{switch(M){case"constant":{w.constructParams[1].props.mode=q.Constant,w.constructParams[1].props.constantMax=j.value;break}case"two-constant":{w.constructParams[1].props.mode=q.TwoConstants,w.constructParams[1].props.constantMin=j.value[0],w.constructParams[1].props.constantMax=j.value[1];break}}})}},`count-${i}`),l.jsxs(ae,{fieldCss:{gridTemplateColumns:"minmax(0, 1fr) 32px",columnGap:"$1"},children:[u.constructParams[2]===1/0?l.jsx(Ga,{children:"∞"}):l.jsx(me,{min:1,step:1,dragStep:1,value:u.constructParams[2]??Ae,onValueChange:h=>{b(i,M=>{M.constructParams[2]=Ka(h)})}}),l.jsxs(lt,{value:u.constructParams[2]===1/0?"infinity":"number",position:"item-aligned",cornerArrow:!0,valueRenderer:Wa,onValueChange:h=>{b(i,M=>{M.constructParams[2]=h==="infinity"?1/0:Ae})},children:[l.jsx(je,{value:"number",children:r("effects.burst.cycles.number")}),l.jsx(je,{value:"infinity",children:r("effects.burst.cycles.infinity")})]})]},`cycles-${i}`),l.jsx(ae,{children:l.jsx(me,{disabled:!u.constructParams[2]||u.constructParams[2]===1,min:.01,step:.01,dragStep:.01,value:u.constructParams[3]??ut,onValueChange:h=>{b(i,M=>{M.constructParams[3]=h})}})},`interval-${i}`)]}};return l.jsx(ma,{columns:v,items:s.map((u,i)=>f(u,i)),label:r(n),info:r(c),addable:!1,emptyText:r("effects.burst.empty","No bursts"),selectedIndex:o,onRowClick:d,sideSlot:l.jsxs(Vt,{direction:"column",gap:"xs",children:[l.jsx(Ct,{variant:"soft",onClick:z,css:{flex:1},children:l.jsx(Ca,{size:"14px"})}),l.jsx(Ct,{variant:"soft",css:{flex:1},onClick:()=>{const u=o>=0&&o<s.length?o:s.length-1;u>=0&&(p(u),d(Math.min(u,s.length-2)))},children:l.jsx(za,{size:"14px"})})]})})}),Qa=(a,e,t)=>{const r=a.engineObject.generator.emission,n=r.bursts;for(let c=n.length-1;c>=0;c--)r.removeBurst(n[c]);for(let c=0;c<t.length;c++){const s=t[c];if(!s||!Array.isArray(s.constructParams)||s.constructParams.length<2){console.warn(`Invalid burst item at index ${c}:`,s);continue}const o=s.constructParams[0],d=s.constructParams[1],y=s.constructParams[2]??Ae,b=s.constructParams[3]??ut;if(!d||!d.props){console.warn(`Invalid burst count data at index ${c}:`,d);continue}const p=d.props,z=new da(p.constantMax);z.mode=p.mode,z.constantMin=p.constantMin,z.constantMax=p.constantMax,z.constant=p.constantMax;const v=new fa(o,z);v.cycles=y,v.repeatInterval=b,r.addBurst(v)}};function Lt(a="colorOverLifetime"){return{module:a,mode:fe.Gradient,gradientMax:{class:"ParticleGradient",constructParams:[[{color:{r:1,g:1,b:1,a:1},time:0},{color:{r:1,g:1,b:1,a:1},time:.3},{color:{r:1,g:1,b:1,a:1},time:.6},{color:{r:1,g:1,b:1,a:1},time:1}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]},gradientMin:{class:"ParticleGradient",constructParams:[[{time:0,color:{r:1,g:1,b:1,a:1}},{time:.3,color:{r:1,g:1,b:1,a:1}},{time:.6,color:{r:1,g:1,b:1,a:1}},{time:1,color:{r:1,g:1,b:1,a:1}}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]}}}const Me=["x","y","z"],er={constant:q.Constant,"two-constant":q.TwoConstants,curve:q.Curve,"two-curve":q.TwoCurves},he=X(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=K(),n=e.property,{mainAxis:c}=e,s=a[n],[o,d]=F.useState({x:{max:te,min:te},y:{max:te,min:te},z:{max:te,min:te}}),[y,b]=F.useState(e.yTickScale??1),p=pt[s.x.mode];function z(i){return(g,h)=>{const M=g.find(L=>L.type===h);if(!M)return;const j=_(s),w=j[i],Y=er[h];for(const L of Me)j[L].mode=Y;switch(h){case"constant":w.constantMax=M.value;break;case"two-constant":w.constantMin=M.value[0],w.constantMax=M.value[1];break;case"curve":{if(M.value.length>4)return;d(L=>({...L,[i]:{...L[i],max:M.value}})),M.value.forEach((L,E)=>{w.curveMax.constructParams[E].constructParams[0]=L.x,w.curveMax.constructParams[E].constructParams[1]=L.y*y});break}case"two-curve":{if(M.value[0].length>4||M.value[1].length>4)return;d(L=>({...L,[i]:{min:M.value[0],max:M.value[1]}})),M.value[0].forEach((L,E)=>{w.curveMin.constructParams[E].constructParams[0]=L.x,w.curveMin.constructParams[E].constructParams[1]=L.y*y}),M.value[1].forEach((L,E)=>{w.curveMax.constructParams[E].constructParams[0]=L.x,w.curveMax.constructParams[E].constructParams[1]=L.y*y});break}}a[n]=j,t==null||t(n,j)}}function v(i){return[{value:s[i].constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[s[i].constantMin,s[i].constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:o[i].max,type:"curve",label:r("effects.curve.curve")},{value:[o[i].min,o[i].max],type:"two-curve",label:r("effects.curve.two-curve")}]}const f=i=>{const g=i/y,h=_(s);for(const M of Me){const j=h[M];j.curveMax.constructParams.forEach(w=>{w.constructParams[1]*=g}),j.curveMin.constructParams.forEach(w=>{w.constructParams[1]*=g})}b(i),a[n]=h,t==null||t(n,h)},u={algo:"linear",yRangeMode:e.yRangeMode,yTickScale:y,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:f,onYTickScaleCommit:()=>{}};return F.useEffect(()=>{const i={};for(const g of Me)i[g]={max:Re(s[g].curveMax.constructParams).map(h=>({...h,y:h.y/y})),min:Re(s[g].curveMin.constructParams).map(h=>({...h,y:h.y/y}))};d(i)},[]),l.jsxs(l.Fragment,{children:[l.jsx(ha,{label:e.toggleLabel?r(e.toggleLabel):r("effects.curve.3d-prefix")+" "+r(e.label||n),info:r(e.info),value:s.enabled,onChange:i=>{const g=_(s);g.enabled=i,a[n]=g,t==null||t(n,g)}}),s.enabled?l.jsx(ae,{label:"",children:l.jsx(Vt,{direction:"column",gap:"xxs",children:Me.map((i,g)=>l.jsx(_e,{label:r(i).toLocaleUpperCase(),type:p,css:{gridTemplateColumns:"$4 repeat(3, minmax(0px, 1fr))"},...u,value:v(i),hideTypeSelector:g!==0,onValueChange:z(i)},i))})}):l.jsx(_e,{label:r(e.label||n),type:p,...u,value:v(c),onValueChange:z(c)})]})}),ye=a=>(e,t,r)=>{var s,o;const n=(o=(s=e.engineObject)==null?void 0:s.generator)==null?void 0:o[r.x.module];if(!n){console.warn(`Module container not found for: ${r.x.module}`);return}n[a]=r.enabled;const c={x:n[t+"X"],y:n[t+"Y"],z:n[t+"Z"]};for(const d in c){const y=r[d],b=c[d];if(!b){console.warn(`Axis module not found for: ${d} in ${t}`);continue}b.mode=y.mode,b.constantMax=y.constantMax,b.constantMin=y.constantMin,b.curveMax=new Te,y.curveMax.constructParams.forEach(p=>{const z=p.constructParams[0],v=p.constructParams[1];b.curveMax.addKey(new Le(z,v))}),b.curveMin=new Te,y.curveMin.constructParams.forEach(p=>{const z=p.constructParams[0],v=p.constructParams[1];b.curveMin.addKey(new Le(z,v))})}},N=X(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=K(),n=e.property,c=a[n],[s,o]=F.useState(te),[d,y]=F.useState(te),[b,p]=F.useState(e.yTickScale??1);F.useEffect(()=>{const v=Re(c.curveMax.constructParams),f=Re(c.curveMin.constructParams);o(v),y(f)},[]);const z=(v,f)=>{const u=v.find(g=>g.type===f);if(!u)return;const i=_(c);switch(f){case"constant":i.mode=q.Constant,i.constantMax=u.value;break;case"two-constant":i.mode=q.TwoConstants,i.constantMin=u.value[0],i.constantMax=u.value[1];break;case"curve":{if(u.value.length>4)return;o(u.value),i.mode=q.Curve,u.value.forEach((g,h)=>{i.curveMax.constructParams[h].constructParams[0]=g.x,i.curveMax.constructParams[h].constructParams[1]=g.y});break}case"two-curve":{if(u.value[0].length>4||u.value[1].length>4)return;i.mode=q.TwoCurves,y(u.value[0]),o(u.value[1]),u.value[0].forEach((g,h)=>{i.curveMin.constructParams[h].constructParams[0]=g.x,i.curveMin.constructParams[h].constructParams[1]=g.y}),u.value[1].forEach((g,h)=>{i.curveMax.constructParams[h].constructParams[0]=g.x,i.curveMax.constructParams[h].constructParams[1]=g.y});break}}a[n]=i,t==null||t(n,i)};return l.jsx(l.Fragment,{children:l.jsx(_e,{label:r(e.label||e.property),info:r(e.info),type:pt[c.mode],algo:"linear",yRangeMode:e.yRangeMode,yTickScale:b,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:p,onYTickScaleCommit:()=>{},value:[{value:c.constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[c.constantMin,c.constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:s,type:"curve",label:r("effects.curve.curve")},{value:[d,s],type:"two-curve",label:r("effects.curve.two-curve")}],onValueChange:z})})}),G=(a,e,t)=>{var c,s;const r=(s=(c=a.engineObject)==null?void 0:c.generator)==null?void 0:s[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const n=r[e];if(!n){console.warn(`Module not found for property: ${e} in ${t.module}`);return}n.mode=t.mode,n.constantMax=t.constantMax,n.constantMin=t.constantMin,n.curveMax=new Te,t.curveMax.constructParams.forEach(o=>{const d=o.constructParams[0],y=o.constructParams[1];n.curveMax.addKey(new Le(d,y))}),n.curveMin=new Te,t.curveMin.constructParams.forEach(o=>{const d=o.constructParams[0],y=o.constructParams[1];n.curveMin.addKey(new Le(d,y))})},tr=["constant","two-constant"],ar=X(({model:a,inspectorConfig:e,onModelChange:t})=>{var y,b;const{t:r}=K(),n=e.property,c=a[n],s={...ge(c.constantMax),intensity:((y=c.constantMax)==null?void 0:y.intensity)??1},o={...ge(c.constantMin),intensity:((b=c.constantMin)==null?void 0:b.intensity)??1},d=(p,z)=>{const v=p.find(u=>u.type===z);if(!v)return;const f=_(c);switch(z){case"constant":{f.mode=fe.Constant,f.constantMax=v.value;break}case"two-constant":{const u=v.value[0],i=v.value[1];f.mode=fe.TwoConstants,f.constantMin=u,f.constantMax=i;break}}a[n]=f,t==null||t(n,f)};return l.jsx(Ft,{label:r(e.label||e.property),type:tr[c.mode],info:r(e.info),hdr:!0,value:[{value:s,type:"constant",label:r("effects.curve.constant")},{value:[o,s],type:"two-constant",label:r("effects.curve.two-constant")}],onValueChange:d})}),rr=(a,e,t)=>{const r=a.engineObject.generator.main.startColor;r.mode=t.mode;const{constantMax:n,constantMin:c}=t,s=n.intensity??1,o=c.intensity??1;r.constantMax.set(n.r*s,n.g*s,n.b*s,n.a),r.constantMin.set(c.r*o,c.g*o,c.b*o,c.a)},nr=["gradient","two-gradient"],sr=X(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=K(),n=e.property,c=a[n],s=(o,d)=>{var p,z;if(!o.find(v=>v.type===d))return;const b=_(c);switch(d){case"gradient":{const v=o.find(f=>f.type===d);if(!((p=v==null?void 0:v.value)!=null&&p.color)||!((z=v==null?void 0:v.value)!=null&&z.alpha)){console.warn(`Invalid gradient value structure for ${n}`);return}if(v.value.color.length>4||v.value.alpha.length>4)return;b.mode=fe.Gradient,b.gradientMax.constructParams=[v.value.color.map(f=>({color:f.value,time:f.time})),v.value.alpha.map(f=>({alpha:f.value,time:f.time}))];break}case"two-gradient":{const v=o.find(f=>f.type===d);if(v.value[0].color.length>4||v.value[0].alpha.length>4||v.value[1].color.length>4||v.value[1].alpha.length>4)return;b.mode=fe.TwoGradients,b.gradientMin.constructParams=[v.value[0].color.map(f=>({color:f.value,time:f.time})),v.value[0].alpha.map(f=>({alpha:f.value,time:f.time}))],b.gradientMax.constructParams=[v.value[1].color.map(f=>({color:f.value,time:f.time})),v.value[1].alpha.map(f=>({alpha:f.value,time:f.time}))];break}}a[n]=b,t==null||t(n,b)};return l.jsx(l.Fragment,{children:l.jsx(Ft,{label:r(e.property),type:nr[c.mode-2],info:r(e.info),value:[{value:{color:c.gradientMax.constructParams[0].map(o=>({value:ge(o.color),time:o.time})),alpha:c.gradientMax.constructParams[1].map(o=>({value:o.alpha,time:o.time}))},type:"gradient",label:r("effects.curve.gradient")},{value:[{color:c.gradientMin.constructParams[0].map(o=>({value:ge(o.color),time:o.time})),alpha:c.gradientMin.constructParams[1].map(o=>({value:o.alpha,time:o.time}))},{color:c.gradientMax.constructParams[0].map(o=>({value:ge(o.color),time:o.time})),alpha:c.gradientMax.constructParams[1].map(o=>({value:o.alpha,time:o.time}))}],type:"two-gradient",label:r("effects.curve.two-gradient")}],onValueChange:s})})}),pe=[],ue=[],or=(a,e,t)=>{var d,y,b;const r=(y=(d=a.engineObject)==null?void 0:d.generator)==null?void 0:y[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const n=r[e];if(!n){console.warn(`Module not found for property: ${e} in ${t.module}`);return}if(n.mode=t.mode,pe.length=0,ue.length=0,!((b=t.gradientMax)!=null&&b.constructParams)||!Array.isArray(t.gradientMax.constructParams)){console.warn(`Invalid gradientMax.constructParams for ${e}`);return}const c=t.gradientMax.constructParams,s=c[0]||[],o=c[1]||[];Array.isArray(s)&&s.forEach(p=>{if(p&&p.color&&typeof p.time=="number"){const z=p.color;pe.push(new Ot(p.time,new Et(z.r??0,z.g??0,z.b??0,z.a??1)))}}),Array.isArray(o)&&o.forEach(p=>{p&&typeof p.time=="number"&&typeof p.alpha=="number"&&ue.push(new wt(p.time,p.alpha))}),n.gradientMax.setKeys(pe,ue),pe.length=0,ue.length=0,t.gradientMin.constructParams[0].forEach(p=>{pe.push(new Ot(p.time,new Et(p.color.r,p.color.g,p.color.b,p.color.a)))}),t.gradientMin.constructParams[1].forEach(p=>{ue.push(new wt(p.time,p.alpha))}),n.gradientMin.setKeys(pe,ue)};function Oe(a){return a-Math.floor(a*(1/289))*289}function H(a){return Oe((34*a+1)*a)}function ot(a,e,t){const r=.16666666666666666,n=1/3,c=(a+e+t)*n,s=Math.floor(a+c),o=Math.floor(e+c),d=Math.floor(t+c),y=(s+o+d)*r,b=a-s+y,p=e-o+y,z=t-d+y;let v,f,u,i,g,h;b>=p?p>=z?(v=1,f=0,u=0,i=1,g=1,h=0):b>=z?(v=1,f=0,u=0,i=1,g=0,h=1):(v=0,f=0,u=1,i=1,g=0,h=1):p<z?(v=0,f=0,u=1,i=0,g=1,h=1):b<z?(v=0,f=1,u=0,i=0,g=1,h=1):(v=0,f=1,u=0,i=1,g=1,h=0);const M=b-v+r,j=p-f+r,w=z-u+r,Y=b-i+n,L=p-g+n,E=z-h+n,V=b-.5,T=p-.5,I=z-.5,$=Oe(s),U=Oe(o),xe=Oe(d),Xt=H(H(H(xe)+U)+$),$t=H(H(H(xe+u)+U+f)+$+v),qt=H(H(H(xe+h)+U+g)+$+i),Kt=H(H(H(xe+1)+U+1)+$+1),Ie=.142857142857,mt=Ie*2-0,dt=Ie*.5-1,ke=Ie*1-0;function Se(bt){const vt=bt-49*Math.floor(bt*ke*ke),gt=Math.floor(vt*ke),Ut=Math.floor(vt-7*gt),xt=gt*mt+dt,St=Ut*mt+dt,Pe=1-Math.abs(xt)-Math.abs(St),Pt=xt,Mt=St,Jt=Math.floor(Pt)*2+1,Qt=Math.floor(Mt)*2+1,zt=-(Pe<0?1:0),et=Pt+Jt*zt,tt=Mt+Qt*zt,at=1.79284291400159-.85373472095314*(et*et+tt*tt+Pe*Pe);return[et*at,tt*at,Pe*at]}const re=Se(Xt),ne=Se($t),se=Se(qt),oe=Se(Kt),Be=Math.max(.6-(b*b+p*p+z*z),0),De=Math.max(.6-(M*M+j*j+w*w),0),Ye=Math.max(.6-(Y*Y+L*L+E*E),0),Fe=Math.max(.6-(V*V+T*T+I*I),0),Ze=Be*Be,Xe=De*De,$e=Ye*Ye,qe=Fe*Fe,Ke=Ze*Ze,Ne=Xe*Xe,Ge=$e*$e,He=qe*qe,Nt=re[0]*b+re[1]*p+re[2]*z,Gt=ne[0]*M+ne[1]*j+ne[2]*w,Ht=se[0]*Y+se[1]*L+se[2]*E,Wt=oe[0]*V+oe[1]*T+oe[2]*I,We=Ze*Be*Nt,Ue=Xe*De*Gt,Je=$e*Ye*Ht,Qe=qe*Fe*Wt;let ft=-8*(We*b+Ue*M+Je*Y+Qe*V),ht=-8*(We*p+Ue*j+Je*L+Qe*T),yt=-8*(We*z+Ue*w+Je*E+Qe*I);return ft+=Ke*re[0]+Ne*ne[0]+Ge*se[0]+He*oe[0],ht+=Ke*re[1]+Ne*ne[1]+Ge*se[1]+He*oe[1],yt+=Ke*re[2]+Ne*ne[2]+Ge*se[2]+He*oe[2],[ft*42,ht*42,yt*42]}function _t(a,e,t){ot(t,e,a);const n=ot(a+100,t,e);return ot(e,a+100,t)[1]-n[2]}function ir(a,e,t,r,n,c,s){let o=_t(a*r,e*r,t*r),d=1,y=r,b=1;for(let p=1;p<n;p++)b*=s,y*=c,d+=b,o+=b*_t(a*y,e*y,t*y);return o/d}const Q=80,Rt=5,lr=({model:a})=>{const e=F.useRef(null),t=F.useRef(0);return F.useEffect(()=>{const r=e.current;if(!r)return;const n=r.getContext("2d");if(!n)return;const c=ya(()=>{var f,u;const s=((u=(f=a.noiseStrength)==null?void 0:f.x)==null?void 0:u.constantMax)??1,o=a.noiseFrequency??.5,d=a.noiseScrollSpeed??0,y=a.noiseOctaveCount??1,b=a.noiseOctaveIntensityMultiplier??.5,p=a.noiseOctaveFrequencyMultiplier??2;cancelAnimationFrame(t.current);const z=performance.now(),v=i=>{const g=(i-z)/1e3*d,h=n.createImageData(Q,Q),M=h.data;for(let j=0;j<Q;j++){const w=(1-j/Q)*Rt;for(let Y=0;Y<Q;Y++){const L=Y/Q*Rt,E=ir(L,w,g,o,y,p,b),V=Math.max(0,Math.min(255,Math.round((E*s*(.5/7)+.5)*255))),T=(j*Q+Y)*4;M[T]=V,M[T+1]=V,M[T+2]=V,M[T+3]=255}}n.putImageData(h,0,0),d>0&&(t.current=requestAnimationFrame(v))};t.current=requestAnimationFrame(v)});return()=>{cancelAnimationFrame(t.current),c()}},[a]),l.jsx(ae,{label:" ",labelCss:{visibility:"hidden"},children:l.jsxs("div",{style:{position:"relative",width:80,height:80},children:[l.jsx("canvas",{ref:e,width:Q,height:Q,style:{width:80,height:80,borderRadius:4,border:"1px solid var(--color-border-default, rgba(255,255,255,0.12))",display:"block"}}),l.jsx("span",{style:{position:"absolute",bottom:2,left:0,right:0,textAlign:"center",fontSize:9,color:"rgba(255,255,255,0.6)",textShadow:"0 1px 2px rgba(0,0,0,0.8)",pointerEvents:"none"},children:"Preview"})]})})};var cr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,P=(a,e,t,r)=>{for(var n=r>1?void 0:r?pr(e,t):e,c=a.length-1,s;c>=0;c--)(s=a[c])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&cr(e,t,n),n};let x=class extends ba{constructor(e,t){super(e,t);S(this,"_emissionModuleEnabled",!0);S(this,"_emissionShapeModuleEnabled",!0);S(this,"_rotationOverLifetimeModuleEnabled",!1);S(this,"_sizeOverLifetimeModuleEnabled",!1);S(this,"_textureSheetAnimationModuleEnabled",!1);S(this,"_velocityOverLifetimeModuleEnabled",!1);S(this,"_forceOverLifetimeModuleEnabled",!1);S(this,"_limitVelocityOverLifetimeModuleEnabled",!1);S(this,"_colorOverLifetimeModuleEnabled",!1);S(this,"_noiseModuleEnabled",!1);S(this,"material",{refId:"0000202"});S(this,"priority",0);S(this,"velocityScale",0);S(this,"lengthScale",2);S(this,"pivot",{x:0,y:0,z:0});S(this,"renderMode",W.Billboard);S(this,"mesh",null);S(this,"duration",5);S(this,"isLoop",!0);S(this,"startDelay",B("main"));S(this,"startLifetime",B("main",5));S(this,"startSpeed",B("main",5));S(this,"startSize",ce("main",1));S(this,"startRotation",ce("main"));S(this,"flipRotation",0);S(this,"startColor",{module:"main",mode:fe.Constant,constantMax:{r:1,g:1,b:1,a:1,intensity:1},constantMin:{r:1,g:1,b:1,a:1,intensity:1}});S(this,"gravityModifier",B("main"));S(this,"simulationSpace",D.Local);S(this,"simulationSpeed",1);S(this,"scalingMode",be.Local);S(this,"playOnEnabled",!0);S(this,"maxParticles",1e3);S(this,"rateOverTime",B("emission",10));S(this,"shape",{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!0}});S(this,"bursts",[]);S(this,"size",ce("sizeOverLifetime",1));S(this,"rotation",ce("rotationOverLifetime",45));S(this,"textureSheetAnimationType",0);S(this,"cycleCount",1);S(this,"tiling",{x:1,y:1});S(this,"frameOverTime",B("textureSheetAnimation",1,0,q.Curve));S(this,"spaceMode",D.Local);S(this,"forceSpaceMode",D.Local);S(this,"velocityX",B("velocityOverLifetime"));S(this,"velocityY",B("velocityOverLifetime"));S(this,"velocityZ",B("velocityOverLifetime"));S(this,"speed",ce("limitVelocityOverLifetime",1));S(this,"limitVelocitySpaceMode",D.Local);S(this,"dampen",0);S(this,"drag",B("limitVelocityOverLifetime"));S(this,"multiplyDragByParticleSize",!1);S(this,"multiplyDragByParticleVelocity",!1);S(this,"forceX",B("forceOverLifetime"));S(this,"forceY",B("forceOverLifetime"));S(this,"forceZ",B("forceOverLifetime"));S(this,"color",Lt());S(this,"noisePreview",null);S(this,"noiseStrength",ce("noise",1));S(this,"noiseFrequency",.5);S(this,"noiseScrollSpeed",0);S(this,"noiseOctaveCount",1);S(this,"noiseOctaveIntensityMultiplier",.5);S(this,"noiseOctaveFrequencyMultiplier",2);const r=this.formSchema,n=(s,o,d,y,b,p)=>{const z=m(s);r.addGroup(z,o,{controlOpenKey:d,defaultOpen:p,sectionTitle:{title:z,onToggle:v=>{b==null||b(v),this.root.inspectorFacade.componentChange(this.id,d,v),this.applyBoundPathChange(y,R.Toggle,v)}}})};n("effects.renderer.sections.emission",["rateOverTime","bursts"],"_emissionModuleEnabled","generator.emission.enabled"),n("effects.renderer.sections.shape",["shape"],"_emissionShapeModuleEnabled","generator.emission.shape.enabled",s=>{this.shape.props.enabled=s}),n("effects.renderer.sections.size-over-lifetime",["size"],"_sizeOverLifetimeModuleEnabled","generator.sizeOverLifetime.enabled"),n("effects.renderer.sections.rotation-over-lifetime",["rotation"],"_rotationOverLifetimeModuleEnabled","generator.rotationOverLifetime.enabled"),n("effects.renderer.sections.force-over-lifetime",["forceSpaceMode","forceX","forceY","forceZ"],"_forceOverLifetimeModuleEnabled","generator.forceOverLifetime.enabled"),n("effects.renderer.sections.velocity-over-lifetime",["spaceMode","velocityX","velocityY","velocityZ"],"_velocityOverLifetimeModuleEnabled","generator.velocityOverLifetime.enabled"),n("effects.renderer.sections.limit-velocity-over-lifetime",["speed","limitVelocitySpaceMode","dampen","drag","multiplyDragByParticleSize","multiplyDragByParticleVelocity"],"_limitVelocityOverLifetimeModuleEnabled","generator.limitVelocityOverLifetime.enabled"),n("effects.renderer.sections.texture-sheet-animation",["textureSheetAnimationType","cycleCount","tiling","frameOverTime"],"_textureSheetAnimationModuleEnabled","generator.textureSheetAnimation.enabled"),n("effects.renderer.sections.color-over-lifetime",["color"],"_colorOverLifetimeModuleEnabled","generator.colorOverLifetime.enabled"),n("effects.renderer.sections.noise",["noisePreview","noiseStrength","noiseFrequency","noiseScrollSpeed","noiseOctaveCount","noiseOctaveIntensityMultiplier","noiseOctaveFrequencyMultiplier"],"_noiseModuleEnabled","generator.noise.enabled");const c=m("effects.renderer.sections.rendering");r.addGroup(c,["renderMode","mesh","material","velocityScale","lengthScale","pivot","priority"],{sectionTitle:{title:c}})}applyEmissionShape(e){this.applyBoundPathChange("generator.emission.shape",R.Input,e)}onInitComplete(){this._applyEditorRuntimeState()}_applyRendererMeshFromRef(){this.applyBoundPathChange("mesh",R.AssetPicker,this.mesh??null)}_applyEditorRuntimeState(){const{_engineObject:{generator:e}}=this;if(this.applyBoundPathChange("enabled",R.Toggle,this._enabled),this.applyBoundPathChange("renderMode",R.Select,this.renderMode),e.emission.enabled=this._emissionModuleEnabled,e.emission.shape.enabled=this._emissionShapeModuleEnabled,this.shape.class===k.MeshShape){const t=e.emission.shape,r=this.shape.props.mesh;r?(t.enabled=!1,_a(this.root,r).then(()=>{this.applyBoundPathChange("generator.emission.shape.mesh",R.AssetPicker,r),t.enabled=this._emissionShapeModuleEnabled})):this.applyBoundPathChange("generator.emission.shape.mesh",R.Input,At.createSphere(this.engineObject.engine))}e.rotationOverLifetime.enabled=this._rotationOverLifetimeModuleEnabled,e.sizeOverLifetime.enabled=this._sizeOverLifetimeModuleEnabled,e.textureSheetAnimation.enabled=this._textureSheetAnimationModuleEnabled,e.velocityOverLifetime.enabled=this._velocityOverLifetimeModuleEnabled,e.limitVelocityOverLifetime.enabled=this._limitVelocityOverLifetimeModuleEnabled,e.forceOverLifetime.enabled=this._forceOverLifetimeModuleEnabled,e.main.simulationSpeed=0,e.colorOverLifetime.enabled=this._colorOverLifetimeModuleEnabled,e.noise.enabled=this._noiseModuleEnabled,this.renderMode===W.Mesh&&this._applyRendererMeshFromRef()}async bindEngineObject(e){e.enabled=!1,await super.bindEngineObject(e)}rebindEngineObject(e){super.rebindEngineObject(e),e.enabled=!1,this._applyEditorRuntimeState()}deserialize(e){var r,n,c;const t=e.props;if(this._enabled=(t==null?void 0:t.enabled)??!0,t!=null&&t.generator){this.priority=t.priority??this.priority,this.velocityScale=t.velocityScale??this.velocityScale,this.lengthScale=t.lengthScale??this.lengthScale,this.pivot=t.pivot??this.pivot,this.renderMode=t.renderMode??this.renderMode,this.mesh=t.mesh??null;const{main:s,emission:o,sizeOverLifetime:d,rotationOverLifetime:y,velocityOverLifetime:b,limitVelocityOverLifetime:p,colorOverLifetime:z,textureSheetAnimation:v,forceOverLifetime:f,noise:u}=t.generator;this.duration=s.duration,this.isLoop=s.isLoop,this.startDelay=s.startDelay,this.startLifetime=s.startLifetime,this.startSpeed=s.startSpeed,this.startSize.enabled=s.startSize3D,this.startSize.x=s.startSizeX,this.startSize.y=s.startSizeY,this.startSize.z=s.startSizeZ,this.startRotation.enabled=s.startRotation3D,this.startRotation.x=s.startRotationX,this.startRotation.y=s.startRotationY,this.startRotation.z=s.startRotationZ,this.flipRotation=s.flipRotation,this.startColor=s.startColor,this.gravityModifier=s.gravityModifier,this.simulationSpace=s.simulationSpace,this.simulationSpeed=s.simulationSpeed,this.scalingMode=s.scalingMode,this.playOnEnabled=s.playOnEnabled,this.maxParticles=s.maxParticles,this._emissionModuleEnabled=o.enabled,this.rateOverTime=o.rateOverTime,this.shape=o.shape,(((r=o.shape)==null?void 0:r.class)==="Null"||o.shape===null)&&(this.shape={class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!1}}),this._emissionShapeModuleEnabled=((c=(n=o==null?void 0:o.shape)==null?void 0:n.props)==null?void 0:c.enabled)??!0,this.bursts=Array.isArray(o==null?void 0:o.bursts)?o.bursts.map(h=>(Na(h),h)):[],this._sizeOverLifetimeModuleEnabled=(d==null?void 0:d.enabled)??!1,this.size.enabled=(d==null?void 0:d.separateAxes)??!1,this.size.x=d!=null&&d.sizeX?{...d.sizeX,module:"sizeOverLifetime"}:{..._(this.size.x),module:"sizeOverLifetime"},this.size.y=d!=null&&d.sizeY?{...d.sizeY,module:"sizeOverLifetime"}:{..._(this.size.y),module:"sizeOverLifetime"},this.size.z=d!=null&&d.sizeZ?{...d.sizeZ,module:"sizeOverLifetime"}:{..._(this.size.z),module:"sizeOverLifetime"},this._rotationOverLifetimeModuleEnabled=(y==null?void 0:y.enabled)??!1,this.rotation.enabled=(y==null?void 0:y.separateAxes)??!1,this.rotation.x=y!=null&&y.rotationX?{...y.rotationX,module:"rotationOverLifetime"}:{..._(this.rotation.x),module:"rotationOverLifetime"},this.rotation.y=y!=null&&y.rotationY?{...y.rotationY,module:"rotationOverLifetime"}:{..._(this.rotation.y),module:"rotationOverLifetime"},this.rotation.z=y!=null&&y.rotationZ?{...y.rotationZ,module:"rotationOverLifetime"}:{..._(this.rotation.z),module:"rotationOverLifetime"},this._velocityOverLifetimeModuleEnabled=(b==null?void 0:b.enabled)??!1,this.velocityX=(b==null?void 0:b.velocityX)??_(this.velocityX),this.velocityY=(b==null?void 0:b.velocityY)??_(this.velocityY),this.velocityZ=(b==null?void 0:b.velocityZ)??_(this.velocityZ),this.spaceMode=(b==null?void 0:b.space)??D.Local,this._limitVelocityOverLifetimeModuleEnabled=(p==null?void 0:p.enabled)??!1,this.speed.enabled=(p==null?void 0:p.separateAxes)??!1;const i=(p==null?void 0:p.speedX)??(p==null?void 0:p.speed);this.speed.x=i?{...i,module:"limitVelocityOverLifetime"}:{..._(this.speed.x),module:"limitVelocityOverLifetime"},this.speed.y=p!=null&&p.speedY?{...p.speedY,module:"limitVelocityOverLifetime"}:{..._(this.speed.y),module:"limitVelocityOverLifetime"},this.speed.z=p!=null&&p.speedZ?{...p.speedZ,module:"limitVelocityOverLifetime"}:{..._(this.speed.z),module:"limitVelocityOverLifetime"},this.dampen=(p==null?void 0:p.dampen)??0,this.drag=p!=null&&p.drag?{...p.drag,module:"limitVelocityOverLifetime"}:B("limitVelocityOverLifetime"),this.multiplyDragByParticleSize=(p==null?void 0:p.multiplyDragByParticleSize)??!1,this.multiplyDragByParticleVelocity=(p==null?void 0:p.multiplyDragByParticleVelocity)??!1,this.limitVelocitySpaceMode=(p==null?void 0:p.space)??D.Local,this._forceOverLifetimeModuleEnabled=(f==null?void 0:f.enabled)??!1,this.forceX=(f==null?void 0:f.forceX)??B("forceOverLifetime"),this.forceY=(f==null?void 0:f.forceY)??B("forceOverLifetime"),this.forceZ=(f==null?void 0:f.forceZ)??B("forceOverLifetime"),this.forceSpaceMode=(f==null?void 0:f.space)??D.Local,z?(this._colorOverLifetimeModuleEnabled=z.enabled,this.color=z.color):(this._colorOverLifetimeModuleEnabled=!0,this.color=Lt()),this._textureSheetAnimationModuleEnabled=v.enabled,this.textureSheetAnimationType=v.type,this.cycleCount=v.cycleCount,this.tiling=v.tiling,this.frameOverTime=v.frameOverTime,this._noiseModuleEnabled=(u==null?void 0:u.enabled)??!1,this.noiseStrength.enabled=(u==null?void 0:u.separateAxes)??!1;const g=u==null?void 0:u.strengthX;this.noiseStrength.x=g?{...g,module:"noise"}:{..._(this.noiseStrength.x),module:"noise"},this.noiseStrength.y=u!=null&&u.strengthY?{...u.strengthY,module:"noise"}:{..._(this.noiseStrength.y),module:"noise"},this.noiseStrength.z=u!=null&&u.strengthZ?{...u.strengthZ,module:"noise"}:{..._(this.noiseStrength.z),module:"noise"},this.noiseFrequency=(u==null?void 0:u.frequency)??.5,this.noiseScrollSpeed=(u==null?void 0:u.scrollSpeed)??0,this.noiseOctaveCount=(u==null?void 0:u.octaveCount)??1,this.noiseOctaveIntensityMultiplier=(u==null?void 0:u.octaveIntensityMultiplier)??.5,this.noiseOctaveFrequencyMultiplier=(u==null?void 0:u.octaveFrequencyMultiplier)??2}super.deserialize(e)}toJSON(){const e=this.bursts.map(r=>{var c;if(((c=r==null?void 0:r.constructParams)==null?void 0:c[2])!==1/0)return r;const n=_(r);return n.constructParams[2]=null,n});return{type:this.type,props:va({enabled:this.enabled,priority:this.priority,velocityScale:this.velocityScale,lengthScale:this.lengthScale,pivot:this.pivot,renderMode:this.renderMode,mesh:this.mesh,material:this.material,generator:{main:{duration:this.duration,isLoop:this.isLoop,startDelay:this.startDelay,startLifetime:this.startLifetime,startSpeed:this.startSpeed,startSize3D:this.startSize.enabled,startSizeX:this.startSize.x,startSizeY:this.startSize.y,startSizeZ:this.startSize.z,startRotation3D:this.startRotation.enabled,startRotationX:this.startRotation.x,startRotationY:this.startRotation.y,startRotationZ:this.startRotation.z,flipRotation:this.flipRotation,startColor:this.startColor,gravityModifier:this.gravityModifier,simulationSpace:this.simulationSpace,simulationSpeed:this.simulationSpeed,scalingMode:this.scalingMode,playOnEnabled:this.playOnEnabled,maxParticles:this.maxParticles},emission:{enabled:this._emissionModuleEnabled,rateOverTime:this.rateOverTime,shape:this.shape,bursts:e},sizeOverLifetime:{enabled:this._sizeOverLifetimeModuleEnabled,separateAxes:this.size.enabled,sizeX:this.size.x,sizeY:this.size.y,sizeZ:this.size.z},rotationOverLifetime:{enabled:this._rotationOverLifetimeModuleEnabled,separateAxes:this.rotation.enabled,rotationX:this.rotation.x,rotationY:this.rotation.y,rotationZ:this.rotation.z},velocityOverLifetime:{enabled:this._velocityOverLifetimeModuleEnabled,space:this.spaceMode,velocityX:this.velocityX,velocityY:this.velocityY,velocityZ:this.velocityZ},limitVelocityOverLifetime:{enabled:this._limitVelocityOverLifetimeModuleEnabled,separateAxes:this.speed.enabled,speedX:this.speed.x,speedY:this.speed.y,speedZ:this.speed.z,dampen:this.dampen,drag:this.drag,multiplyDragByParticleSize:this.multiplyDragByParticleSize,multiplyDragByParticleVelocity:this.multiplyDragByParticleVelocity,space:this.limitVelocitySpaceMode},forceOverLifetime:{enabled:this._forceOverLifetimeModuleEnabled,space:this.forceSpaceMode,forceX:this.forceX,forceY:this.forceY,forceZ:this.forceZ},colorOverLifetime:{enabled:this._colorOverLifetimeModuleEnabled,color:this.color},textureSheetAnimation:{enabled:this._textureSheetAnimationModuleEnabled,type:this.textureSheetAnimationType,cycleCount:this.cycleCount,tiling:this.tiling,frameOverTime:this.frameOverTime},noise:{enabled:this._noiseModuleEnabled,separateAxes:this.noiseStrength.enabled,strengthX:this.noiseStrength.x,strengthY:this.noiseStrength.y,strengthZ:this.noiseStrength.z,frequency:this.noiseFrequency,scrollSpeed:this.noiseScrollSpeed,octaveCount:this.noiseOctaveCount,octaveIntensityMultiplier:this.noiseOctaveIntensityMultiplier,octaveFrequencyMultiplier:this.noiseOctaveFrequencyMultiplier}}})}}};P([J],x.prototype,"_emissionModuleEnabled",2);P([J],x.prototype,"_emissionShapeModuleEnabled",2);P([J],x.prototype,"_rotationOverLifetimeModuleEnabled",2);P([J],x.prototype,"_sizeOverLifetimeModuleEnabled",2);P([J],x.prototype,"_textureSheetAnimationModuleEnabled",2);P([J],x.prototype,"_velocityOverLifetimeModuleEnabled",2);P([J],x.prototype,"_forceOverLifetimeModuleEnabled",2);P([J],x.prototype,"_limitVelocityOverLifetimeModuleEnabled",2);P([J],x.prototype,"_colorOverLifetimeModuleEnabled",2);P([J],x.prototype,"_noiseModuleEnabled",2);P([A({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:ga.ReferResource,getEngineValue:a=>a.getMaterial()}),C({type:R.AssetPicker,assetType:"Material",customFilter:a=>{var e;return((e=a.engineObject.shader)==null?void 0:e.name)==="Effect/Particle"},priority:-100,label:m("effects.renderer.material.label"),info:m("effects.renderer.material.info")}),O()],x.prototype,"material",2);P([C({bindPath:"priority",min:0,step:1,dragStep:1,priority:-100,label:m("effects.renderer.priority.label"),info:m("effects.renderer.priority.info")}),O()],x.prototype,"priority",2);P([C({bindPath:"velocityScale",priority:-100,label:m("effects.renderer.velocity-scale.label"),info:m("effects.renderer.velocity-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],x.prototype,"velocityScale",2);P([C({bindPath:"lengthScale",priority:-100,label:m("effects.renderer.length-scale.label"),info:m("effects.renderer.length-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],x.prototype,"lengthScale",2);P([C({type:R.Vector3,bindPath:"pivot",label:m("effects.renderer.pivot.label"),priority:-100}),O()],x.prototype,"pivot",2);P([A({getPath:"renderMode",setPath:"renderMode"}),C({type:R.Select,value:W.Billboard,label:m("effects.renderer.render-mode.label"),options:[{label:m("effects.renderer.render-mode.options.billboard"),value:W.Billboard},{label:m("effects.renderer.render-mode.options.stretch-billboard"),value:W.StretchBillboard},{label:m("effects.renderer.render-mode.options.horizontal-billboard"),value:W.HorizontalBillboard},{label:m("effects.renderer.render-mode.options.mesh"),value:W.Mesh},{label:m("effects.renderer.render-mode.options.none"),value:W.None}],onChange(a){a.renderMode===W.Mesh&&a._applyRendererMeshFromRef()},priority:-100}),O()],x.prototype,"renderMode",2);P([C({type:R.AssetPicker,assetType:"Mesh",label:m("effects.renderer.mesh.label"),info:m("effects.renderer.mesh.info"),when:a=>a.renderMode===W.Mesh,onChange:async(a,e,t)=>{a.mesh=t?t.getCurrentRef():null;try{await a.applyBoundPathChange("mesh",R.AssetPicker,a.mesh)}catch(r){console.warn(r)}},priority:-100}),O()],x.prototype,"mesh",2);P([A({getPath:"generator.main.duration",setPath:"generator.main.duration"}),C({bindPath:"generator.main.duration",min:.05,step:.05,dragStep:.05,label:m("effects.renderer.duration.label"),info:m("effects.renderer.duration.info")}),O()],x.prototype,"duration",2);P([A({getPath:"generator.main.isLoop",setPath:"generator.main.isLoop"}),C({bindPath:"generator.main.isLoop",label:m("effects.renderer.loop.label"),info:m("effects.renderer.loop.info")}),O()],x.prototype,"isLoop",2);P([C({customComponent:N,min:0,yRangeMode:"positive",onChange:G,info:m("effects.renderer.start.delay.info"),label:m("effects.renderer.start.delay.label")}),O()],x.prototype,"startDelay",2);P([C({customComponent:N,onChange:G,min:1e-4,yRangeMode:"positive",label:m("effects.renderer.start.lifetime.label"),info:m("effects.renderer.start.lifetime.info")}),O()],x.prototype,"startLifetime",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.start.speed.label")}),O()],x.prototype,"startSpeed",2);P([C({module:"main",toggleProps:"startSize3D",axisX:"startSizeX",axisY:"startSizeY",axisZ:"startSizeZ",mainAxis:"x",customComponent:he,onChange:ye("startSize3D"),label:m("effects.renderer.start.size.label"),info:m("effects.renderer.start.size.info"),min:0,yRangeMode:"positive"}),O()],x.prototype,"startSize",2);P([C({module:"main",toggleProps:"startRotation3D",axisX:"startRotationX",axisY:"startRotationY",axisZ:"startRotationZ",mainAxis:"z",customComponent:he,onChange:ye("startRotation3D"),label:m("effects.renderer.start.rotation.label"),info:m("effects.renderer.start.rotation.info"),step:1}),O()],x.prototype,"startRotation",2);P([A({getPath:"generator.main.flipRotation",setPath:"generator.main.flipRotation"}),C({bindPath:"generator.main.flipRotation",min:0,max:1,step:.05,dragStep:.05,label:m("effects.renderer.flip-rotation.label")}),O()],x.prototype,"flipRotation",2);P([C({customComponent:ar,onChange:rr,label:m("effects.renderer.start.color.label")}),O()],x.prototype,"startColor",2);P([C({customComponent:N,info:m("effects.renderer.gravity-modifier.info"),onChange:G,label:m("effects.renderer.gravity-modifier.label")}),O()],x.prototype,"gravityModifier",2);P([A({getPath:"generator.main.simulationSpace",setPath:"generator.main.simulationSpace"}),C({type:R.Select,bindPath:"generator.main.simulationSpace",value:D.Local,label:m("effects.renderer.simulation.space.label"),info:m("effects.renderer.simulation.space.info"),options:[{label:m("effects.renderer.simulation.space.options.local"),value:D.Local},{label:m("effects.renderer.simulation.space.options.world"),value:D.World}]}),O()],x.prototype,"simulationSpace",2);P([A({getPath:"generator.main.simulationSpeed",setPath:"generator.main.simulationSpeed"}),C({bindPath:"generator.main.simulationSpeed",step:.05,dragStep:.05,label:m("effects.renderer.simulation.speed.label"),info:m("effects.renderer.simulation.speed.info")}),O()],x.prototype,"simulationSpeed",2);P([A({getPath:"generator.main.scalingMode",setPath:"generator.main.scalingMode"}),C({type:R.Select,bindPath:"generator.main.scalingMode",label:m("effects.renderer.scaling-mode.label"),info:m("effects.renderer.scaling-mode.info"),value:be.Local,options:[{label:m("effects.renderer.scaling-mode.options.world"),value:be.World},{label:m("effects.renderer.scaling-mode.options.local"),value:be.Local},{label:m("effects.renderer.scaling-mode.options.shape"),value:be.Shape}]}),O()],x.prototype,"scalingMode",2);P([A({getPath:"generator.main.playOnEnabled",setPath:"generator.main.playOnEnabled"}),C({type:R.Toggle,bindPath:"generator.main.playOnEnabled",label:m("effects.renderer.play-on-enabled.label"),info:m("effects.renderer.play-on-enabled.info")}),O()],x.prototype,"playOnEnabled",2);P([A({getPath:"generator.main.maxParticles",setPath:"generator.main.maxParticles"}),C({type:R.Number,bindPath:"generator.main.maxParticles",min:1,dragStep:1,label:m("effects.renderer.max-particles.label"),info:m("effects.renderer.max-particles.info")}),O()],x.prototype,"maxParticles",2);P([C({customComponent:N,onChange:G,min:0,yRangeMode:"positive",label:m("effects.renderer.rate-over-time.label"),info:m("effects.renderer.rate-over-time.info")}),O()],x.prototype,"rateOverTime",2);P([C({customComponent:qa,onChange:Za}),O()],x.prototype,"shape",2);P([O(),C({label:m("effects.renderer.bursts.label"),info:m("effects.renderer.bursts.info"),customComponent:Ja,onChange:Qa})],x.prototype,"bursts",2);P([C({module:"sizeOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"sizeX",axisY:"sizeY",axisZ:"sizeZ",mainAxis:"x",customComponent:he,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:m("effects.renderer.over-lifetime.size.label")}),O()],x.prototype,"size",2);P([C({module:"rotationOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"rotationX",axisY:"rotationY",axisZ:"rotationZ",mainAxis:"z",customComponent:he,onChange:ye("separateAxes"),step:1,yTickScale:45,label:m("effects.renderer.over-lifetime.rotation.label")}),O()],x.prototype,"rotation",2);P([A({getPath:"generator.textureSheetAnimation.type",setPath:"generator.textureSheetAnimation.type"}),C({type:R.Select,value:0,label:m("effects.renderer.texture-sheet.type.label"),info:m("effects.renderer.texture-sheet.type.info"),options:[{label:m("effects.renderer.texture-sheet.type.options.whole-sheet"),value:0},{label:m("effects.renderer.texture-sheet.type.options.single-row"),value:1}]}),O()],x.prototype,"textureSheetAnimationType",2);P([A({getPath:"generator.textureSheetAnimation.cycleCount",setPath:"generator.textureSheetAnimation.cycleCount"}),C({bindPath:"generator.textureSheetAnimation.cycleCount",min:1e-4,step:1,dragStep:1,label:m("effects.renderer.texture-sheet.cycle-count.label"),info:m("effects.renderer.texture-sheet.cycle-count.info")}),O()],x.prototype,"cycleCount",2);P([C({type:R.Vector2,min:1,label:m("effects.renderer.texture-sheet.tiling.label"),info:m("effects.renderer.texture-sheet.tiling.info"),onChange(a,e,t){a.applyBoundPathChange("generator.textureSheetAnimation.tiling",R.Vector2,t)}}),O()],x.prototype,"tiling",2);P([C({customComponent:N,onChange:G,min:0,max:1,yRangeMode:"positive",label:m("effects.renderer.over-lifetime.frame.label")}),O()],x.prototype,"frameOverTime",2);P([A({getPath:"generator.velocityOverLifetime.space",setPath:"generator.velocityOverLifetime.space"}),C({type:R.Select,bindPath:"generator.velocityOverLifetime.space",value:0,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.space-mode.info"),options:[{label:m("effects.renderer.space-mode.options.local"),value:D.Local},{label:m("effects.renderer.space-mode.options.world"),value:D.World}]}),O()],x.prototype,"spaceMode",2);P([A({getPath:"generator.forceOverLifetime.space",setPath:"generator.forceOverLifetime.space"}),C({type:R.Select,bindPath:"generator.forceOverLifetime.space",value:0,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.space-mode.info-force"),options:[{label:"Local",value:D.Local},{label:"World",value:D.World}]}),O()],x.prototype,"forceSpaceMode",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.x.label"),info:m("effects.renderer.velocity.x.info")}),O()],x.prototype,"velocityX",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.y.label")}),O()],x.prototype,"velocityY",2);P([C({customComponent:N,onChange:G,label:m("effects.renderer.velocity.z.label")}),O()],x.prototype,"velocityZ",2);P([C({module:"limitVelocityOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"speedX",axisY:"speedY",axisZ:"speedZ",mainAxis:"x",customComponent:he,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:m("effects.renderer.limit-velocity.limit.label")}),O()],x.prototype,"speed",2);P([A({getPath:"generator.limitVelocityOverLifetime.space",setPath:"generator.limitVelocityOverLifetime.space"}),C({type:R.Select,bindPath:"generator.limitVelocityOverLifetime.space",value:0,when:a=>a.speed.enabled,label:m("effects.renderer.space-mode.label"),info:m("effects.renderer.limit-velocity.space.info"),options:[{label:m("effects.renderer.space-mode.options.local"),value:D.Local},{label:m("effects.renderer.space-mode.options.world"),value:D.World}]}),O()],x.prototype,"limitVelocitySpaceMode",2);P([A({getPath:"generator.limitVelocityOverLifetime.dampen",setPath:"generator.limitVelocityOverLifetime.dampen"}),C({bindPath:"generator.limitVelocityOverLifetime.dampen",min:0,max:1,step:.01,dragStep:.01,label:m("effects.renderer.limit-velocity.dampen.label"),info:m("effects.renderer.limit-velocity.dampen.info")}),O()],x.prototype,"dampen",2);P([C({customComponent:N,onChange:G,min:0,yRangeMode:"positive",label:m("effects.renderer.limit-velocity.drag.label"),info:m("effects.renderer.limit-velocity.drag.info")}),O()],x.prototype,"drag",2);P([A({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize"}),C({type:R.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",label:m("effects.renderer.limit-velocity.multiply-drag-by-size.label"),info:m("effects.renderer.limit-velocity.multiply-drag-by-size.info")}),O()],x.prototype,"multiplyDragByParticleSize",2);P([A({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity"}),C({type:R.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",label:m("effects.renderer.limit-velocity.multiply-drag-by-velocity.label"),info:m("effects.renderer.limit-velocity.multiply-drag-by-velocity.info")}),O()],x.prototype,"multiplyDragByParticleVelocity",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceX",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceY",2);P([C({customComponent:N,onChange:G}),O()],x.prototype,"forceZ",2);P([C({customComponent:sr,onChange:or,label:m("effects.renderer.color-over-lifetime.label")}),O()],x.prototype,"color",2);P([C({customComponent:lr,label:m("effects.renderer.noise.preview.label")})],x.prototype,"noisePreview",2);P([C({module:"noise",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"strengthX",axisY:"strengthY",axisZ:"strengthZ",mainAxis:"x",customComponent:he,onChange:(a,e,t)=>{ye("separateAxes")(a,"strength",t)},label:m("effects.renderer.noise.strength.label")}),O()],x.prototype,"noiseStrength",2);P([A({getPath:"generator.noise.frequency",setPath:"generator.noise.frequency"}),C({bindPath:"generator.noise.frequency",min:1e-6,step:.1,dragStep:.1,label:m("effects.renderer.noise.frequency.label")}),O()],x.prototype,"noiseFrequency",2);P([A({getPath:"generator.noise.scrollSpeed",setPath:"generator.noise.scrollSpeed"}),C({bindPath:"generator.noise.scrollSpeed",min:0,step:.01,dragStep:.01,label:m("effects.renderer.noise.scroll-speed.label")}),O()],x.prototype,"noiseScrollSpeed",2);P([A({getPath:"generator.noise.octaveCount",setPath:"generator.noise.octaveCount"}),C({bindPath:"generator.noise.octaveCount",min:1,max:3,step:1,dragStep:1,label:m("effects.renderer.noise.octave-count.label")}),O()],x.prototype,"noiseOctaveCount",2);P([A({getPath:"generator.noise.octaveIntensityMultiplier",setPath:"generator.noise.octaveIntensityMultiplier"}),C({bindPath:"generator.noise.octaveIntensityMultiplier",min:0,max:1,step:.01,dragStep:.01,when:a=>a.noiseOctaveCount>1,label:m("effects.renderer.noise.octave-intensity-multiplier.label")}),O()],x.prototype,"noiseOctaveIntensityMultiplier",2);P([A({getPath:"generator.noise.octaveFrequencyMultiplier",setPath:"generator.noise.octaveFrequencyMultiplier"}),C({bindPath:"generator.noise.octaveFrequencyMultiplier",min:1,max:4,step:.1,dragStep:.1,when:a=>a.noiseOctaveCount>1,label:m("effects.renderer.noise.octave-frequency-multiplier.label")}),O()],x.prototype,"noiseOctaveFrequencyMultiplier",2);x=P([xa({type:"ParticleRenderer",customInspector:La,componentsMenu:{group:"effects",label:m("component.particle-renderer.title")}})],x);export{x as ParticleRendererComponent};
