import{b as i,c as r}from"./index-6jOCfdig.js";import{I as n}from"./iblCdfGenerator-M5Q2xp3A.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./rawTexture-CpjOe2U7.js";Object.defineProperty(r.prototype,"iblCdfGenerator",{get:function(){return this._iblCdfGenerator},set:function(e){e&&(this._iblCdfGenerator=e)},enumerable:!0,configurable:!0});r.prototype.enableIblCdfGenerator=function(){return this._iblCdfGenerator?this._iblCdfGenerator:(this._iblCdfGenerator=new n(this),this._iblCdfGenerator.isSupported?(this.environmentTexture&&(this._iblCdfGenerator.iblSource=this.environmentTexture),this._iblCdfGenerator):(this._iblCdfGenerator=null,null))};r.prototype.disableIblCdfGenerator=function(){this._iblCdfGenerator&&(this._iblCdfGenerator.dispose(),this._iblCdfGenerator=null)};class o{constructor(t){this.name=i.NAME_IBLCDFGENERATOR,this._newIblObserver=null,this.scene=t}register(){this._updateIblSource(),this._newIblObserver=this.scene.onEnvironmentTextureChangedObservable.add(this._updateIblSource.bind(this))}rebuild(){}dispose(){this.scene.onEnvironmentTextureChangedObservable.remove(this._newIblObserver)}_updateIblSource(){this.scene.iblCdfGenerator&&this.scene.environmentTexture&&(this.scene.iblCdfGenerator.iblSource=this.scene.environmentTexture)}}n._SceneComponentInitialization=e=>{let t=e._getComponent(i.NAME_IBLCDFGENERATOR);t||(t=new o(e),e._addComponent(t))};export{o as IblCdfGeneratorSceneComponent};
