import{F as l,aN as p,aO as h}from"./index-6jOCfdig.js";import{GLTFLoader as u}from"./glTFLoader-Bx351I09.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"./bone-DdTyU8i_.js";import"./skeleton-C0c5yg7x.js";import"./rawTexture-CpjOe2U7.js";import"./assetContainer-Drc86vic.js";import"./objectModelMapping-DT0r674A.js";const a="KHR_materials_volume";class d{constructor(e){this.name=a,this.order=173,this._loader=e,this.enabled=this._loader.isExtensionUsed(a),this.enabled&&this._loader._disableInstancedMesh++}dispose(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(e,o,i){return u.LoadExtensionAsync(e,o,this.name,async(t,r)=>{const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(e,o,i)),s.push(this._loadVolumePropertiesAsync(t,o,i,r)),await Promise.all(s).then(()=>{})})}_loadVolumePropertiesAsync(e,o,i,t){const r=this._loader._getOrCreateMaterialAdapter(i);if(r.transmissionWeight===0&&r.subsurfaceWeight===0||!t.thicknessFactor)return Promise.resolve();r.transmissionDepth=t.attenuationDistance!==void 0?t.attenuationDistance:Number.MAX_VALUE,r.transmissionColor=t.attenuationColor!==void 0&&t.attenuationColor.length==3?l.FromArray(t.attenuationColor):l.White(),r.volumeThickness=t.thicknessFactor??0;const s=new Array;return t.thicknessTexture&&(t.thicknessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${e}/thicknessTexture`,t.thicknessTexture,m=>{m.name=`${i.name} (Thickness)`,r.volumeThicknessTexture=m}))),Promise.all(s).then(()=>{})}}p(a);h(a,!0,n=>new d(n));export{d as KHR_materials_volume};
