import{F as r,g as a,i as o}from"./KHR_interactivity-DRPs30Rf.js";import{R as s}from"./declarationMapper-CGPHX8aB.js";import{R as p}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"./objectModelMapping-DT0r674A.js";class u extends r{constructor(e){super(e),this.config=e,this._inputCases=new Map,this.case=this.registerDataInput("case",s,NaN),this.default=this.registerDataInput("default",s),this.value=this.registerDataOutput("value",s);const i=this.config.cases||[];for(let t of i){if(t=a(t),this.config.treatCasesAsIntegers&&(t=t|0,this._inputCases.has(t)))return;this._inputCases.set(t,this.registerDataInput(`in_${t}`,s))}}_updateOutputs(e){const i=this.case.getValue(e);let t;o(i)&&(t=this._getOutputValueForCase(a(i),e)),t||(t=this.default.getValue(e)),this.value.setValue(t,e)}_getOutputValueForCase(e,i){return this._inputCases.get(e)?.getValue(i)}getClassName(){return"FlowGraphDataSwitchBlock"}}p("FlowGraphDataSwitchBlock",u);export{u as FlowGraphDataSwitchBlock};
