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