import{b as m}from"./KHR_interactivity-DRPs30Rf.js";import{R as a}from"./declarationMapper-CGPHX8aB.js";import{L as r,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 l extends m{constructor(e){if(super(e),this.message=this.registerDataInput("message",a),this.logType=this.registerDataInput("logType",a,"log"),e?.messageTemplate){const t=this._getTemplateMatches(e.messageTemplate);for(const s of t)this.registerDataInput(s,a)}}_execute(e){const t=this.logType.getValue(e),s=this._getMessageValue(e);t==="warn"?r.Warn(s):t==="error"?r.Error(s):r.Log(s),this.out._activateSignal(e)}getClassName(){return"FlowGraphConsoleLogBlock"}_getMessageValue(e){if(this.config?.messageTemplate){let t=this.config.messageTemplate;const s=this._getTemplateMatches(t);for(const o of s){const i=this.getDataInput(o)?.getValue(e);i!==void 0&&(t=t.replace(new RegExp(`\\{${o}\\}`,"g"),i.toString()))}return t}else return this.message.getValue(e)}_getTemplateMatches(e){const t=/\{([^}]+)\}/g,s=[];let o;for(;(o=t.exec(e))!==null;)s.push(o[1]);return s}}p("FlowGraphConsoleLogBlock",l);export{l as FlowGraphConsoleLogBlock};
