import{aN as h,aO as f}from"./index-6jOCfdig.js";import{a as c}from"./declarationMapper-CGPHX8aB.js";import{A as b}from"./objectModelMapping-DT0r674A.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";const a="KHR_node_hoverability",d="targetMeshPointerOver_";c("event/onHoverIn",a,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return[d+e[0]]}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,m,t,u,r){const i=t[t.length-1];i.config=i.config||{},i.config.glTF=r;const n=e.configuration?.nodeIndex?.value[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=d+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});const p="targetMeshPointerOut_";c("event/onHoverOut",a,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return[p+e[0]]}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,s,m,t,u,r){const i=t[t.length-1];i.config=i.config||{},i.config.glTF=r;const n=e.configuration?.nodeIndex?.value[0];if(n===void 0||typeof n!="number")throw new Error("nodeIndex not found in configuration");const l=p+n;return t[1].config.variable=l,u._userVariables[l]={className:"Mesh",id:r?.nodes?.[n]._babylonTransformNode?.id,uniqueId:r?.nodes?.[n]._babylonTransformNode?.uniqueId},t}});b("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:e=>{const o=e._babylonTransformNode;return o&&o.pointerOverDisableMeshTesting!==void 0?o.pointerOverDisableMeshTesting:!0},set:(e,o)=>{o._primitiveBabylonMeshes?.forEach(s=>{s.pointerOverDisableMeshTesting=!e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"pointerOverDisableMeshTesting"],type:"boolean"});class v{constructor(o){this.name=a,this._loader=o,this.enabled=o.isExtensionUsed(a)}async onReady(){this._loader.gltf.nodes?.forEach(o=>{o.extensions?.KHR_node_hoverability&&o.extensions?.KHR_node_hoverability.hoverable===!1&&o._babylonTransformNode?.getChildMeshes().forEach(s=>{s.pointerOverDisableMeshTesting=!0})})}dispose(){this._loader=null}}h(a);f(a,!0,e=>new v(e));export{v as KHR_node_hoverability};
