import{GLTFLoader as n}from"./glTFLoader-Bx351I09.js";import{F as p,aN as c,aO as m}from"./index-6jOCfdig.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 l="KHR_materials_specular";class d{constructor(t){this.name=l,this.order=190,this._loader=t,this.enabled=this._loader.isExtensionUsed(l)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,r,a){return n.LoadExtensionAsync(t,r,this.name,async(s,o)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(t,r,a)),e.push(this._loadSpecularPropertiesAsync(s,o,a));const u=this._loader._getOrCreateMaterialAdapter(a);return o.extensions&&o.extensions.EXT_materials_specular_edge_color&&o.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&u.enableSpecularEdgeColor(!0),await Promise.all(e).then(()=>{})})}_loadSpecularPropertiesAsync(t,r,a){const s=this._loader._getOrCreateMaterialAdapter(a),o=new Array;return s.specularWeight=r.specularFactor??1,s.specularColor=r.specularColorFactor!==void 0?p.FromArray(r.specularColorFactor):new p(1,1,1),r.specularTexture&&(r.specularTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync(`${t}/specularTexture`,r.specularTexture,e=>{e.name=`${a.name} (Specular)`,s.specularWeightTexture=e}))),r.specularColorTexture&&o.push(this._loader.loadTextureInfoAsync(`${t}/specularColorTexture`,r.specularColorTexture,e=>{e.name=`${a.name} (Specular Color)`,s.specularColorTexture=e})),Promise.all(o).then(()=>{})}}c(l);m(l,!0,i=>new d(i));export{d as KHR_materials_specular};
