@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
3 lines (2 loc) • 1.69 kB
JavaScript
import{c as e}from"./KHR_interactivity-D4lwBSW9.esm.min.js";import{R as t,b as s}from"./declarationMapper-D_filC93.esm.min.js";import{y as r,u as a}from"./index-BPURObVq.esm.min.js";import"./objectModelMapping-ClgDmo5Q.esm.min.js";import"./spotLight.pure-5s2DDDIt.esm.min.js";class i extends e{constructor(e){if(super(e),this.message=this.registerDataInput("message",t),this.logType=this.registerDataInput("logType",s,"log"),e?.messageTemplate){const s=this._getTemplateMatches(e.messageTemplate);for(const e of s)this.registerDataInput(e,t)}}_execute(e){const t=this.logType.getValue(e),s=this._getMessageValue(e);"warn"===t?r.Warn(s):"error"===t?r.Error(s):r.Log(s),this.out._activateSignal(e)}getClassName(){return"FlowGraphConsoleLogBlock"}_serializeValue(e){if(null==e)return String(e);if("object"==typeof e){const t=e.toString();if("[object Object]"===t)try{return JSON.stringify(e)}catch{return t}return t}return String(e)}_getMessageValue(e){if(this.config?.messageTemplate){let t=this.config.messageTemplate;const s=this._getTemplateMatches(t),r=this.message.getValue(e),a=null!=r&&"object"==typeof r?r:null;for(const r of s){let s;if(s=null!==a&&r in a?a[r]:this.getDataInput(r)?.getValue(e),void 0!==s){const e=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp(`\\{${e}\\}`,"g"),this._serializeValue(s))}}return t}return this.message.getValue(e)}_getTemplateMatches(e){const t=/\{([^}]+)\}/g,s=[];let r;for(;null!==(r=t.exec(e));)s.push(r[1]);return s}}let o=!1;function n(){o||(o=!0,a("FlowGraphConsoleLogBlock",i))}n();export{i as FlowGraphConsoleLogBlock,n as RegisterFlowGraphConsoleLogBlock};
//# sourceMappingURL=flowGraphConsoleLogBlock-Bmf3TQr0.esm.min.js.map