vscode-behavior3 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{A as t,C as n,D as r,E as i,M as a,N as o,O as s,S as c,T as l,_ as u,a as d,b as f,d as p,f as m,g as h,h as g,i as _,j as v,k as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as ee,v as te,w as O,x as ne,y as re}from"./ui-vendor-CpXf__no.js";import{a as ie,c as ae,d as oe,f as k,i as se,l as ce,n as le,o as ue,p as A,r as de,s as j,t as fe,u as M}from"./graph-vendor-ww5KcpJ-.js";import{a as pe,c as me,d as he,f as ge,i as _e,l as ve,m as ye,n as be,o as xe,p as N,r as Se,s as Ce,t as we,u as Te}from"./vendor-ZD6A8unu.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var P=e(o()),Ee=e(a()),F=ge(),De=(0,P.createContext)({nodeJsonVisible:!1,toggleNodeJsonVisible:()=>void 0}),Oe=({children:e})=>{let[t,n]=(0,P.useState)(!1);return(0,F.jsx)(De.Provider,{value:{nodeJsonVisible:t,toggleNodeJsonVisible:()=>n(e=>!e)},children:e})},ke=()=>(0,P.useContext)(De),Ae={about:`About Behavior3`,actuaSize:`Actual Size`,actualSize:`Actual Size`,add:`Add`,alertNewVersion:`This file is created by a newer version of Behavior3({{version}}), please upgrade to the latest version.`,batch:`Batch Script`,batchCompleted:`Batch completed`,batchFailed:`Batch failed, more information can be found in the console.`,build:`Build`,buildCompleted:`Build completed`,buildFailed:`Build failed, more information can be found in the console.`,cancel:`Cancel`,compact:`Compact`,console:`Console`,copy:`Copy`,createProject:`Create Project`,checkExpr:`Check expression`,cut:`Cut`,delete:`Delete`,deleteNode:`Delete Node`,devTools:`Toggle Developer Tools`,donotSave:`Don't Save`,duplicate:`Duplicate`,editSubtree:`Edit Subtree`,fieldRequired:`Field '{{field}}' is required`,forceReload:`Force Reload`,fullscreen:`Toggle Full Screen`,hide:`Hide Behavior3`,hideOthers:`Hide Others`,insertNode:`Insert Node`,jumpNode:`Jump Node`,language:`Language`,moveToTrash:`Move to Trash`,newFile:`New File...`,newFolder:`New Folder...`,newWindow:`New Window`,nodeDefinition:`NODES`,normal:`Normal`,open:`Open...`,openProject:`Open Project`,paste:`Paste`,quit:`Quit Behavior3`,recent:`Recent`,redo:`Redo`,reload:`Reload`,reset:`Reset`,"reset.confirm":`Reset to original value?`,"reset.defaultConfirm":`Reset to default value?`,rename:`Rename...`,replace:`Replace`,reportIssue:`Report Issue`,revealFileOnMac:`Reveal in Finder`,revealFileOnWindows:`Reveal in File Explorer`,save:`Save`,saveAll:`Save All`,saveAs:`Save As...`,saveAsSubtree:`Save As Subtree`,searchFile:`Search File`,searchNode:`Search Node`,selectAll:`Select All`,services:`Services`,setupBuildScript:`Setup Build Script`,start:`Start`,undo:`Undo`,unhide:`Show All`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`,"menu.edit":`Edit`,"menu.file":`File`,"menu.view":`View`,"menu.window":`Window`,"menu.help":`Help`,"workspace.saveAllOnClose":`Do you want to save the changes to the following {{count}} files?`,"workspace.saveOnClose":`Do you want to save the changes you made to '{{name}}'?`,"workspace.reloadFile":`'{{name}}' has changed, do you want to reload now?`,"explorer.deleteFile":`Are you sure you want delete '{{name}}'?`,"explorer.deleteFolder":`Are you sure you want delete '{{name}}' and its contents?`,"explorer.replaceFile":`Are you sure you want replace '{{name}}'?`,"explorer.restoreFileInfo":`You can restore this file from the Trash.`,"explorer.title":`Explorer`,"tree.overview":`Overview`,"tree.name":`Tree name`,"tree.desc":`Tree desc`,"tree.export":`Export`,"tree.prefix":`ID prefix`,"tree.group":`Enable Node Grouping`,"tree.group.placeholder":`Select node groups`,"tree.vars":`Define Variables`,"tree.vars.local":`Local Variables`,"tree.vars.add":`Add Variable`,"tree.vars.name":`name`,"tree.vars.invalidName":`Invalid variable name`,"tree.vars.desc":`description`,"tree.vars.imports":`Import Variables`,"tree.vars.subtree":`Subtree Variables`,"tree.import.add":`Add Import`,"tree.custom":`Custom Data`,"tree.custom.add":`Add Entry`,"tree.custom.key":`key`,"tree.custom.value":`value`,"tree.custom.type.string":`String value`,"tree.custom.type.number":`Number value`,"tree.custom.type.boolean":`Boolean value`,"tree.custom.type.invalid":`Invalid custom value`,"regnode.input":`Input: `,"regnode.output":`Output: `,"regnode.args":`Args: `,"regnode.mark":`Mark: `,"regnode.subtree":`Subtree: `,"node.args":`Const arguments`,"node.children.unlimited":`Unlimited`,"node.children":`Num children`,"node.debug":`Debug`,"node.deleteRootNodeDenied":`Unable to delete the root node`,"node.dropDenied":`This node position is denied to drop the node`,"node.desc":`Node desc`,"node.disabled":`Disabled`,"node.editSubtreeDenied":`Unable to edit the subtree node`,"node.editFailed":`Node '{{name}}' edit failed`,"node.group":`Node group`,"node.groupNotEnabled":`One of '{{group}}' node group is not enabled in current file`,"node.id":`Node id`,"node.inputVariable":`Input variables`,"node.invalidChildren":`Invalid number of children`,"node.invalidExpression":`Invalid expression`,"node.invalidValue":`Invalid value`,"node.invalidVariableName":`Invalid variable name, should start with a letter or underscore`,"node.name":`Node name`,"node.noNodeSelected":`No node selected`,"node.notFound":`Node '{{name}}' not found`,"node.oneof.error":`Only one is allowed between input '{{input}}' and argument '{{desc}}({{arg}})'`,"node.oneof.inputNotfound":`Input '{{input}}' not found`,"node.outputVariable":`Output variables`,"node.pasteDataError":`Paste data error`,"node.rootNodeAsSubtree":`Root node cann't be save as subtree`,"node.subtree":`Subtree`,"node.subtreeMissing":`Subtree file is missing: {{path}}`,"node.subtreeInvalid":`Subtree file is invalid: {{path}}`,"node.subtreeCyclic":`Subtree reference is cyclic: {{path}}`,"node.subtreeOpenFailed":`Failed to open subtree: file not found or unreadable ({{path}})`,"node.subtreePathError":`You should save the subtree inside the current workspace`,"node.subtreeSaveRootError":`Root node cann't be save as subtree`,"node.subtreeSaveSuccess":`Saved and converted to subtree node: {{path}}`,"node.moveSubtreeDenied":`Cannot move nodes inside a subtree`,"node.dropSubtreeInternalDenied":`Cannot drop onto a subtree internal node`,"node.moveRootDenied":`Cannot move the root node`,"node.dropAroundRootDenied":`Cannot place a node before or after the root`,"node.addChildToSubtreeRefDenied":`Cannot add child nodes to a subtree reference`,"node.moveIntoDescendantDenied":`Cannot move a node into its own descendant`,"node.type":`Node type`,"node.undefinedVariable":`Variable '{{variable}}' is not defined`,"node.jsonData":`JSON Data`,"node.unknown.title":`Unknown Node`,"node.unknownType":`Unknown`,"node.resolutionError":`Resolution Error`,"node.unknown.desc":`New node`,"build.success":`Build completed.`,"build.failed":`Build failed.`,"editor.loading":`Loading editor...`,"editor.externalChangeConflict":`External file change detected while the document has unsaved edits.`,"editor.reloadFromDisk":`Reload`,"editor.dismissConflict":`Dismiss`,"editor.newerVersionEditDenied":`This file is created by a newer version of Behavior3({{version}}). Please upgrade to the latest version.`,"inspector.noActiveDocument":`Open a Behavior3 editor to inspect and edit the active tree.`,"inspector.embeddedModeNotice":`Inspector is configured to appear inside the Behavior3 editor.`,"inspector.embeddedToolbar.build":`Build Behavior Tree`,"inspector.embeddedToolbar.toggleEditorMode":`Toggle Editor Mode`,"inspector.embeddedToolbar.toggleInspectorNodeJson":`Toggle Raw Node JSON`,"inspector.embeddedToolbar.createProject":`Create Project`,"inspector.embeddedToolbar.createTree":`Create Behavior Tree`,"mutation.invalidJsonPath":`Invalid JSON path: {{path}}`,"mutation.missingSelectedNode":`No selected node is available for this mutation.`,"mutation.selectedNodeMismatch":`The selected node changed before the mutation was applied.`,"mutation.missingTargetNode":`The target node could not be found.`,"mutation.missingSourceNode":`The source node could not be found.`,"mutation.missingSubtreeOriginal":`Missing subtree original snapshot for this mutation.`,"mutation.missingDetachedSubtreeRoot":`Missing detached subtree snapshot for this mutation.`,"mutation.moveRootDenied":`Cannot move the root node.`,"mutation.dropAroundRootDenied":`Cannot drop before or after the root node.`,"mutation.addChildToSubtreeRefDenied":`Cannot add a child directly to a subtree reference.`,"mutation.moveIntoDescendantDenied":`Cannot move a node into its own descendant.`,"mutation.deleteRootNodeDenied":`Cannot delete the root node.`,"mutation.editSubtreeDenied":`Cannot edit structure on a subtree reference.`,"mutation.saveSelectedAsSubtreeRootDenied":`The root node cannot be saved as a subtree.`,"mutation.saveSelectedAsSubtreeMissingTarget":`The target node could not be saved as a subtree.`,"mutation.saveSelectedAsSubtreePostSaveMissingTarget":`The target node could not be found after saving the subtree.`,"runtime.nodeCheckRuntimeHasErrors":`Checker runtime has errors.`,"runtime.invalidSavedSubtreePath":`Host returned an invalid saved subtree path.`,"runtime.unsupportedDocumentMutation":`Unsupported document mutation.`,"runtime.visibleHookNotRegistered":`Visible '{{name}}' is not registered.`,"runtime.visibleHookFailed":`Visible '{{name}}' failed: {{error}}`,"runtime.visibleExpressionDisabled":`Visible expression is disabled; enable settings.allowNewFunction.`,"runtime.visibleExpressionCompileFailed":`Visible expression failed to compile: {{error}}`,"runtime.visibleExpressionFailed":`Visible expression failed: {{error}}`,"runtime.visibleExpressionUnknownArg":`Visible expression referenced args.{{property}}, but '{{property}}' is not in the defined arg scope (defined args: {{definedArgs}}).`,"runtime.visibleExpressionNoArgs":`Visible expression referenced args.{{property}}, but this node defines no args.`,"runtime.visibleExpressionUnknownSlotIndex":`Visible expression referenced {{fieldKind}}[{{index}}], but {{definedScope}}.`,"runtime.visibleExpressionInvalidSlotProperty":`Visible expression referenced {{fieldKind}}.{{property}}, but {{fieldKind}} only supports defined numeric slot indices.`,"runtime.visibleSlotScopeNone":`this node defines no {{fieldKind}} slots`,"runtime.visibleSlotScopeIndex":`the defined {{fieldKind}} index is {{start}}`,"runtime.visibleSlotScopeRange":`the defined {{fieldKind}} indices are {{start}}..{{end}}`,"runtime.visibleSlotScopeRangeVariadic":`the defined {{fieldKind}} indices are {{start}}..{{end}}+`,"override.resetTitle":`Reset this override?`,"form.enterJsonArray":`Enter JSON array`,"form.enterJsonValue":`Enter JSON value`,"form.unset":`Unset`,"form.true":`True`,"form.false":`False`,"validation.jsonArray":`{{name}} must be a JSON array`,"validation.integer":`{{field}} must be an integer`,"validation.number":`{{field}} must be a number`,"validation.missingOneofInput":`Missing input slot for oneof '{{input}}'`,"validation.oneof":`Only one of '{{left}}' and '{{right}}' can be set`,"validation.invalidJsonPath":`Path must be a workdir-relative .json file: {{path}}`,"validation.variableDescriptionRequired":`Variable description is required`,"validation.customKeyRequired":`Custom key is required`,"validation.customKeyDuplicate":`Custom key '{{key}}' is duplicated`,"validation.customValueInvalid":`Custom value must be a string, number, or boolean`},je={about:`关于 Behavior3`,actualSize:`实际大小`,add:`添加`,alertNewVersion:`此文件由新版本 Behavior3({{version}}) 创建,请升级到最新版本。`,batch:`批处理脚本`,batchCompleted:`批处理完成`,batchFailed:`批处理出现错误,详情请查看控制台!`,build:`构建`,buildCompleted:`构建完成`,buildFailed:`构建出现错误,详情请查看控制台!`,cancel:`取消`,compact:`紧凑`,console:`控制台`,checkExpr:`检查表达式`,copy:`复制`,createProject:`新建项目`,cut:`剪切`,delete:`删除`,deleteNode:`删除节点`,devTools:`切换开发者工具`,donotSave:`不保存`,duplicate:`生成副本`,editSubtree:`编辑子树`,fieldRequired:`字段“{{field}}”必填`,forceReload:`强制重新加载`,fullscreen:`切换全屏`,hide:`隐藏 Behavior3`,hideOthers:`隐藏其它`,insertNode:`插入节点`,jumpNode:`跳转节点`,language:`语言`,moveToTrash:`移至回收站`,newFile:`新建行为树...`,newFolder:`新建目录...`,newWindow:`新建窗口`,nodeDefinition:`节点定义`,normal:`正常`,open:`打开...`,openProject:`打开项目`,paste:`粘贴`,quit:`退出 Behavior3`,recent:`最近打开`,redo:`重做`,reload:`重新加载`,reset:`重置`,"reset.confirm":`重置为原始值?`,"reset.defaultConfirm":`重置为默认值?`,rename:`重命名...`,replace:`替换`,reportIssue:`问题反馈`,revealFileOnMac:`在 Finder 中显示`,revealFileOnWindows:`在文件管理器中打开`,save:`保存`,saveAll:`保存全部`,saveAs:`另存为...`,saveAsSubtree:`另存为子树`,searchFile:`搜索文件`,searchNode:`搜索节点`,selectAll:`全选`,services:`服务`,setupBuildScript:`设置构建脚本`,start:`开始`,undo:`撤销`,unhide:`显示所有`,zoomIn:`放大`,zoomOut:`缩小`,"menu.file":`文件`,"menu.edit":`编辑`,"menu.view":`视图`,"menu.window":`窗口`,"menu.help":`帮助`,"workspace.saveAllOnClose":`你需要保存对以下 {{count}} 个文件的修改吗?`,"workspace.saveOnClose":`你需要保存对文件 {{name}} 的修改吗?`,"workspace.reloadFile":`文件 {{name}} 发生改变,你需要重新加载吗?`,"explorer.deleteFile":`你确定要删除文件 '{{name}}'?`,"explorer.deleteFolder":`你确定要删除目录 '{{name}}'?`,"explorer.replaceFile":`你确定要替换文件 '{{name}}'?`,"explorer.restoreFileInfo":`你可以从回收站恢复此文件。`,"explorer.title":`资源浏览`,"tree.overview":`概况`,"tree.name":`行为树`,"tree.desc":`说明`,"tree.export":`导出`,"tree.prefix":`标识前缀`,"tree.group":`启用节点分组`,"tree.group.placeholder":`选择节点分组`,"tree.vars":`定义变量`,"tree.vars.local":`本地变量`,"tree.vars.add":`添加变量`,"tree.vars.name":`变量名`,"tree.vars.invalidName":`变量名不合法`,"tree.vars.desc":`变量说明`,"tree.vars.imports":`导入变量`,"tree.vars.subtree":`子树变量`,"tree.import.add":`添加导入`,"tree.custom":`自定义数据`,"tree.custom.add":`添加条目`,"tree.custom.key":`键`,"tree.custom.value":`值`,"tree.custom.type.string":`字符串值`,"tree.custom.type.number":`数字值`,"tree.custom.type.boolean":`布尔值`,"tree.custom.type.invalid":`非法的自定义值`,"regnode.input":`输入:`,"regnode.output":`输出:`,"regnode.args":`参数:`,"regnode.mark":`备注:`,"regnode.subtree":`子树:`,"node.args":`常量参数`,"node.children.unlimited":`无限制`,"node.children":`子节点数量`,"node.debug":`调试`,"node.deleteRootNodeDenied":`不能删除根节点`,"node.dropDenied":`此节点位置不允许放置拖拽的节点`,"node.desc":`节点说明`,"node.disabled":`禁用`,"node.editSubtreeDenied":`不能编辑子树节点`,"node.editFailed":`节点 {{name}} 编辑失败`,"node.group":`节点分组`,"node.groupNotEnabled":`节点分组 “{{group}}” 任意一个未在当前文件中启用`,"node.id":`节点标识`,"node.inputVariable":`输入变量`,"node.invalidChildren":`子节点数量不合法`,"node.invalidExpression":`表达式不合法`,"node.invalidValue":`无效的值`,"node.invalidVariableName":`变量名必须以字母或下划线开头`,"node.name":`节点名称`,"node.noNodeSelected":`未选择任务节点`,"node.notFound":`节点 “{{name}}” 不存在`,"node.oneof.error":`输入项 “{{input}}” 和参数 “{{desc}}({{arg}})” 之中,只能选择设置其中之一`,"node.oneof.inputNotfound":`输入项“{{input}}”不存在`,"node.outputVariable":`输出变量`,"node.pasteDataError":`粘贴数据出错`,"node.rootNodeAsSubtree":`根节点不能保存为子树`,"node.subtree":`子树`,"node.subtreeMissing":`子树文件缺失:{{path}}`,"node.subtreeInvalid":`子树文件无效:{{path}}`,"node.subtreeCyclic":`子树引用出现循环:{{path}}`,"node.subtreeOpenFailed":`打开子树失败:文件不存在或不可读({{path}})`,"node.subtreePathError":`子树必须保存在当前工作区的目录内`,"node.subtreeSaveRootError":`根节点不能保存为子树`,"node.subtreeSaveSuccess":`已保存并转换为子树节点:{{path}}`,"node.moveSubtreeDenied":`不能移动子树内部节点`,"node.dropSubtreeInternalDenied":`不能拖放到子树内部节点`,"node.moveRootDenied":`不能移动根节点`,"node.dropAroundRootDenied":`不能将节点放到根节点之前或之后`,"node.addChildToSubtreeRefDenied":`不能向子树引用添加子节点`,"node.moveIntoDescendantDenied":`不能将节点移动到自己的后代节点中`,"node.type":`节点类型`,"node.undefinedVariable":`变量 “{{variable}}” 未定义`,"node.jsonData":`JSON 数据`,"node.unknown.title":`未知节点`,"node.unknownType":`未知`,"node.resolutionError":`解析错误`,"node.unknown.desc":`新建节点`,"build.success":`构建完成。`,"build.failed":`构建失败。`,"editor.loading":`正在加载编辑器...`,"editor.externalChangeConflict":`检测到外部文件变更,当前文档还有未保存修改。`,"editor.reloadFromDisk":`重新载入`,"editor.dismissConflict":`忽略`,"editor.newerVersionEditDenied":`此文件由新版本 Behavior3({{version}}) 创建,请升级到最新版本后再编辑。`,"inspector.noActiveDocument":`打开一个 Behavior3 编辑器后,这里会显示当前行为树的 Inspector,并支持直接编辑。`,"inspector.embeddedModeNotice":`Inspector 当前配置为在 Behavior3 编辑器内部显示。`,"inspector.embeddedToolbar.build":`构建行为树`,"inspector.embeddedToolbar.toggleEditorMode":`切换编辑器模式`,"inspector.embeddedToolbar.toggleInspectorNodeJson":`切换原始节点 JSON`,"inspector.embeddedToolbar.createProject":`新建项目`,"inspector.embeddedToolbar.createTree":`新建行为树`,"mutation.invalidJsonPath":`无效的 JSON 路径: {{path}}`,"mutation.missingSelectedNode":`当前没有可用于提交此修改的选中节点。`,"mutation.selectedNodeMismatch":`当前选中节点已变化,请重试。`,"mutation.missingTargetNode":`未找到目标节点,请重试。`,"mutation.missingSourceNode":`未找到源节点,请重试。`,"mutation.missingSubtreeOriginal":`缺少 subtree 原始节点快照,请重试。`,"mutation.missingDetachedSubtreeRoot":`缺少用于解绑 subtree 引用的快照,请重试。`,"mutation.moveRootDenied":`不能移动根节点。`,"mutation.dropAroundRootDenied":`不能围绕根节点插入。`,"mutation.addChildToSubtreeRefDenied":`不能直接向 subtree 引用添加子节点。`,"mutation.moveIntoDescendantDenied":`不能移动到自己的后代下。`,"mutation.deleteRootNodeDenied":`不能删除根节点。`,"mutation.editSubtreeDenied":`不能在 subtree 引用上直接修改结构。`,"mutation.saveSelectedAsSubtreeRootDenied":`根节点不能另存为 subtree。`,"mutation.saveSelectedAsSubtreeMissingTarget":`未找到可另存为 subtree 的目标节点。`,"mutation.saveSelectedAsSubtreePostSaveMissingTarget":`提交 subtree 保存结果时未找到目标节点。`,"runtime.nodeCheckRuntimeHasErrors":`checker 运行时存在错误。`,"runtime.invalidSavedSubtreePath":`宿主返回了无效的 subtree 保存路径。`,"runtime.unsupportedDocumentMutation":`不支持此文档修改。`,"runtime.visibleHookNotRegistered":`visible “{{name}}” 未注册。`,"runtime.visibleHookFailed":`visible “{{name}}” 执行失败:{{error}}`,"runtime.visibleExpressionDisabled":`visible 表达式已禁用;请启用 settings.allowNewFunction。`,"runtime.visibleExpressionCompileFailed":`visible 表达式编译失败:{{error}}`,"runtime.visibleExpressionFailed":`visible 表达式执行失败:{{error}}`,"runtime.visibleExpressionUnknownArg":`visible 表达式引用了 args.{{property}},但 “{{property}}” 不在已定义的参数范围内(已定义参数:{{definedArgs}})。`,"runtime.visibleExpressionNoArgs":`visible 表达式引用了 args.{{property}},但当前节点未定义参数。`,"runtime.visibleExpressionUnknownSlotIndex":`visible 表达式引用了 {{fieldKind}}[{{index}}],但{{definedScope}}。`,"runtime.visibleExpressionInvalidSlotProperty":`visible 表达式引用了 {{fieldKind}}.{{property}},但 {{fieldKind}} 仅支持已定义的数字槽位索引。`,"runtime.visibleSlotScopeNone":`当前节点未定义{{fieldKind}}槽位`,"runtime.visibleSlotScopeIndex":`已定义的{{fieldKind}}槽位索引只有 {{start}}`,"runtime.visibleSlotScopeRange":`已定义的{{fieldKind}}槽位索引范围是 {{start}}..{{end}}`,"runtime.visibleSlotScopeRangeVariadic":`已定义的{{fieldKind}}槽位索引范围是 {{start}}..{{end}}+`,"override.resetTitle":`重置此覆盖?`,"form.enterJsonArray":`输入 JSON 数组`,"form.enterJsonValue":`输入 JSON 值`,"form.unset":`未设置`,"form.true":`是`,"form.false":`否`,"validation.jsonArray":`{{name}} 必须是 JSON 数组`,"validation.integer":`{{field}} 必须是整数`,"validation.number":`{{field}} 必须是数字`,"validation.missingOneofInput":`缺少 oneof 输入项 “{{input}}”`,"validation.oneof":`“{{left}}” 和 “{{right}}” 只能设置其中之一`,"validation.invalidJsonPath":`路径必须是工作目录内的相对 .json 文件:{{path}}`,"validation.variableDescriptionRequired":`变量说明必填`,"validation.customKeyRequired":`自定义 key 必填`,"validation.customKeyDuplicate":`自定义 key “{{key}}” 重复了`,"validation.customValueInvalid":`自定义值必须是字符串、数字或布尔值`},Me=[`en`,`zh`],Ne=e=>(e??``).toLowerCase().startsWith(`zh`)?`zh`:`en`;ve.use(ye).init({returnNull:!1,initImmediate:!1,lng:typeof document<`u`&&document.documentElement.lang?Ne(document.documentElement.lang):typeof navigator<`u`&&navigator.language?Ne(navigator.language):`en`,fallbackLng:`en`,supportedLngs:[...Me],interpolation:{escapeValue:!1},react:{useSuspense:!1},resources:{zh:{translation:je},en:{translation:Ae}}});var Pe=async e=>{let t=Ne(e);return ve.resolvedLanguage!==t&&await ve.changeLanguage(t),typeof document<`u`&&(document.documentElement.lang=t===`zh`?`zh-CN`:`en`),t},I=ve,Fe=e(me()),Ie=Ce(),L=navigator.platform.toUpperCase().indexOf(`MAC`)>=0,R=e=>(e.indexOf(`ctrl`)>=0&&L&&(e=e.replace(`ctrl`,Ie.Key.Meta)),e.toLowerCase()),Le=(e,t,n,r)=>(r||={},r.target=t,r.exactMatch=!0,(0,Fe.default)(e,(e,t)=>!e.repeat&&n(e,t),r)),z={Backspace:Ie.Key.Backspace,CloseEditor:R(`ctrl.w`),CloseAllOtherEditors:R(`ctrl.shift.w`),Copy:R(`ctrl.c`),Cut:R(`ctrl.x`),Delete:Ie.Key.Delete,Duplicate:R(`ctrl.d`),Enter:Ie.Key.Enter,Escape:Ie.Key.Escape,F2:Ie.Key.F2,Insert:Ie.Key.Insert,JumpNode:R(`ctrl.g`),MacDelete:L?R(`ctrl.backspace`):``,Paste:R(`ctrl.v`),Redo:R(L?`shift.ctrl.z`:`ctrl.y`),Replace:R(`shift.ctrl.v`),Save:R(`ctrl.s`),SearchTree:R(`ctrl.p`),SearchNode:R(`ctrl.f`),SelectAll:R(`ctrl.a`),Undo:R(`ctrl.z`)},Re=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%2024%2024'%20height='200px'%20width='200px'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='none'%20stroke-width='2'%20d='M1,23%20L4,20%20L1,23%20Z%20M20,4%20L23,1%20L20,4%20Z%20M9,11%20L12,8%20L9,11%20Z%20M13,15%20L16,12%20L13,15%20Z%20M10,5%20L19,14%20L20,13%20C22,11%2024.0533047,8.00000006%2020,4%20C15.9466953,-5.91784286e-08%2013,2%2011,4%20L10,5%20Z%20M4,11%20L5,10%20L14,19%20L13,20%20C11.0000005,22%207.9999999,24.0873857%204,20%20C9.84858655e-08,15.9126143%202,13%204,11%20Z'%3e%3c/path%3e%3c/svg%3e`,ze=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20width='200'%20height='200'%3e%3cdefs%3e%3cpath%20d='M196.55%2017.95Q196.55%200%20178.65%200H136.2q-17.95%200-17.95%2017.95v2.6h-78.5Q23%2021%2022.65%2037.1v27.85h-4.7Q0%2064.95%200%2082.9v32.05q0%2017.95%2017.95%2017.95h4.7v29.55q.2%2016.5%2017.9%2016.5h77.7v3.15q0%2017.9%2017.95%2017.9h42.45q17.9%200%2017.9-17.9v-22.65q0-17.95-17.9-17.95H136.2q-17.95%200-17.95%2017.95V162h-77.7q-.7%200-.9-.1v-29H50q17.95%200%2017.95-17.95v-6.4h50.3v2.65q0%2017.9%2017.95%2017.9h42.45q17.9%200%2017.9-17.9V88.55q0-17.95-17.9-17.95H136.2q-17.95%200-17.95%2017.95v3h-50.3V82.9q0-17.95-17.95-17.95H39.65V37.7q.15-.2.6-.2h78v3.1q0%2017.9%2017.95%2017.9h42.45q17.9%200%2017.9-17.9V17.95M179.6%2040.6q0%20.9-.95.9H136.2q-.95%200-.95-.9V17.95q0-.95.95-.95h42.45q.95%200%20.95.95V40.6m-.95%2047q.95%200%20.95.95v22.65q0%20.95-.95.95H136.2q-.95%200-.95-.95V88.55q0-.95.95-.95h42.45m.95%2094.5q0%20.95-.95.95H136.2q-.95%200-.95-.95v-22.65q0-.95.95-.95h42.45q.95%200%20.95.95v22.65M17%2082.9q0-.95.95-.95H50q.95%200%20.95.95v32.05q0%20.95-.95.95H17.95q-.95%200-.95-.95V82.9z'%20id='prefix__a'/%3e%3c/defs%3e%3cuse%20xlink:href='%23prefix__a'/%3e%3c/svg%3e`,Be=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%2024%2024'%20height='1em'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0z'%3e%3c/path%3e%3cpath%20d='M11.07%2012.85c.77-1.39%202.25-2.21%203.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69%200-2.52%201.28-2.87%202.34L6.54%206.96C7.25%204.83%209.18%203%2011.99%203c2.35%200%203.96%201.07%204.78%202.41.7%201.15%201.11%203.3.03%204.9-1.2%201.77-2.35%202.31-2.97%203.45-.25.46-.35.76-.35%202.24h-2.89c-.01-.78-.13-2.05.48-3.15zM14%2020c0%201.1-.9%202-2%202s-2-.9-2-2%20.9-2%202-2%202%20.9%202%202z'%3e%3c/path%3e%3c/svg%3e`,Ve=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%20512%20512'%20height='200px'%20width='200px'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M511.988%20288.9c-.478%2017.43-15.217%2031.1-32.653%2031.1H424v16c0%2021.864-4.882%2042.584-13.6%2061.145l60.228%2060.228c12.496%2012.497%2012.496%2032.758%200%2045.255-12.498%2012.497-32.759%2012.496-45.256%200l-54.736-54.736C345.886%20467.965%20314.351%20480%20280%20480V236c0-6.627-5.373-12-12-12h-24c-6.627%200-12%205.373-12%2012v244c-34.351%200-65.886-12.035-90.636-32.108l-54.736%2054.736c-12.498%2012.497-32.759%2012.496-45.256%200-12.496-12.497-12.496-32.758%200-45.255l60.228-60.228C92.882%20378.584%2088%20357.864%2088%20336v-16H32.666C15.23%20320%20.491%20306.33.013%20288.9-.484%20270.816%2014.028%20256%2032%20256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758%200-45.255%2012.498-12.497%2032.758-12.497%2045.256%200L141.255%20160h229.489l54.627-54.627c12.498-12.497%2032.758-12.497%2045.256%200%2012.496%2012.497%2012.496%2032.758%200%2045.255L424%20197.255V256h56c17.972%200%2032.484%2014.816%2031.988%2032.9zM257%200c-61.856%200-112%2050.144-112%20112h224C369%2050.144%20318.856%200%20257%200z'%3e%3c/path%3e%3c/svg%3e`,He=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%20512%20512'%20height='1em'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='48'%20d='M200.66%20352H144a96%2096%200%200%201%200-192h55.41m113.18%200H368a96%2096%200%200%201%200%20192h-56.66m-142.27-96h175.86'%3e%3c/path%3e%3c/svg%3e`,Ue=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%2024%2024'%20height='200px'%20width='200px'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%2012C1%205.925%205.925%201%2012%201s11%204.925%2011%2011-4.925%2011-11%2011S1%2018.075%201%2012Zm16.333-4.167a.825.825%200%200%200-1.166-1.166l-9.5%209.5a.825.825%200%200%200%201.166%201.166Z'%3e%3c/path%3e%3c/svg%3e`,We=`data:image/svg+xml,%3csvg%20stroke='currentColor'%20fill='currentColor'%20stroke-width='0'%20viewBox='0%200%2016%2016'%20height='1em'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.938%202.016A.13.13%200%200%201%208.002%202a.13.13%200%200%201%20.063.016.15.15%200%200%201%20.054.057l6.857%2011.667c.036.06.035.124.002.183a.2.2%200%200%201-.054.06.1.1%200%200%201-.066.017H1.146a.1.1%200%200%201-.066-.017.2.2%200%200%201-.054-.06.18.18%200%200%201%20.002-.183L7.884%202.073a.15.15%200%200%201%20.054-.057m1.044-.45a1.13%201.13%200%200%200-1.96%200L.165%2013.233c-.457.778.091%201.767.98%201.767h13.713c.889%200%201.438-.99.98-1.767z'%3e%3c/path%3e%3cpath%20d='M7.002%2012a1%201%200%201%201%202%200%201%201%200%200%201-2%200M7.1%205.995a.905.905%200%201%201%201.8%200l-.35%203.507a.552.552%200%200%201-1.1%200z'%3e%3c/path%3e%3c/svg%3e`,Ge=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1603437207465'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='868'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cdefs%3e%3cstyle%20type='text/css'%3e%3c/style%3e%3c/defs%3e%3cpath%20d='M85.312%2085.312V384H384V85.312H85.312zM0%200h469.312v469.312H0V0z%20m0%20554.688h469.312V1024H0V554.688zM85.312%20640v298.688H384V640H85.312zM554.688%200H1024v469.312H554.688V0zM640%2085.312V384h298.688V85.312H640zM554.688%20554.688H1024V1024H554.688V554.688zM640%20640v298.688h298.688V640H640z'%20fill='%23000000'%20p-id='869'%3e%3c/path%3e%3c/svg%3e`,Ke=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2038.4%2048.65%20Q%2035.7%2046%2032%2046%2028.35%2046%2025.6%2048.65%2023%2051.35%2023%2055%2023%2058.85%2025.6%2061.35%2028.25%2064%2032%2064%2035.75%2064%2038.4%2061.35%2041%2058.75%2041%2055%2041%2051.4%2038.4%2048.65%20M%2035.5%2058.6%20Q%2034.1%2060%2032%2060%2029.95%2060%2028.45%2058.6%2027%2057.15%2027%2055%2027%2052.9%2028.45%2051.45%2030%2050%2032%2050%2034.05%2050%2035.5%2051.45%2037%2052.95%2037%2055%2037%2057.1%2035.5%2058.6%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.6%2025.7%20Q%2023%2028.3%2023%2032%2023%2035.8%2025.6%2038.4%2028.3%2041%2032%2041%2035.75%2041%2038.4%2038.4%2041%2035.75%2041%2032%2041%2028.4%2038.4%2025.7%2035.7%2023%2032%2023%2028.3%2023%2025.6%2025.7%20M%2032%2027%20Q%2034.1%2027%2035.5%2028.5%2037%2030%2037%2032%2037%2034.15%2035.5%2035.55%2034.1%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.15%2027%2032%2027%2029.95%2028.45%2028.5%2029.95%2027%2032%2027%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2038.4%202.7%20Q%2035.7%200%2032%200%2028.3%200%2025.6%202.7%2023%205.3%2023%209%2023%2012.85%2025.6%2015.35%2028.25%2018%2032%2018%2035.75%2018%2038.4%2015.35%2041%2012.75%2041%209%2041%205.4%2038.4%202.7%20M%2035.5%205.5%20Q%2037%207%2037%209%2037%2011.15%2035.5%2012.55%2034.1%2014%2032%2014%2029.9%2014%2028.45%2012.55%2027%2011.15%2027%209%2027%206.95%2028.45%205.5%2029.95%204%2032%204%2034.1%204%2035.5%205.5%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_2_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3c/svg%3e`,qe=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2013.95%2027.05%20Q%2011.9%2025%209%2025%206.1%2025%204.05%2027.05%202%2029.1%202%2032%202%2034.95%204.05%2036.95%206.1%2039%209%2039%2011.9%2039%2013.95%2036.95%2016%2034.9%2016%2032%2016%2029.1%2013.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3c/svg%3e`,Je=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2036.95%2027.05%20Q%2034.9%2025%2032%2025%2029.1%2025%2027.05%2027.05%2025%2029.1%2025%2032%2025%2034.95%2027.05%2036.95%2029.1%2039%2032%2039%2034.9%2039%2036.95%2036.95%2039%2034.9%2039%2032%2039%2029.1%2036.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3c/svg%3e`,Ye=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2013.95%2027.05%20Q%2011.9%2025%209%2025%206.1%2025%204.05%2027.05%202%2029.1%202%2032%202%2034.95%204.05%2036.95%206.1%2039%209%2039%2011.9%2039%2013.95%2036.95%2016%2034.9%2016%2032%2016%2029.1%2013.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2036.95%2027.05%20Q%2034.9%2025%2032%2025%2029.1%2025%2027.05%2027.05%2025%2029.1%2025%2032%2025%2034.95%2027.05%2036.95%2029.1%2039%2032%2039%2034.9%2039%2036.95%2036.95%2039%2034.9%2039%2032%2039%2029.1%2036.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_4_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_4_FILL'/%3e%3c/g%3e%3c/svg%3e`,Xe=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2059.95%2027.05%20Q%2057.9%2025%2055%2025%2052.1%2025%2050.05%2027.05%2048%2029.1%2048%2032%2048%2034.95%2050.05%2036.95%2052.1%2039%2055%2039%2057.9%2039%2059.95%2036.95%2062%2034.9%2062%2032%2062%2029.1%2059.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3c/svg%3e`,Ze=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2013.95%2036.95%20Q%2016%2034.9%2016%2032%2016%2029.1%2013.95%2027.05%2011.9%2025%209%2025%206.1%2025%204.05%2027.05%202%2029.1%202%2032%202%2034.95%204.05%2036.95%206.1%2039%209%2039%2011.9%2039%2013.95%2036.95%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2012.55%2028.45%20Q%2014%2029.95%2014%2032%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2028.45%20Q%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%204.05%2042.05%20Q%202%2044.1%202%2047%202%2049.9%204.05%2051.95%206.1%2054%209%2054%2011.9%2054%2013.95%2051.95%2016%2049.9%2016%2047%2016%2044.05%2013.95%2042.05%2011.9%2040%209%2040%206.1%2040%204.05%2042.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_4_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%209%2038%20Q%205.3%2038%202.65%2040.6%200%2043.25%200%2047%200%2050.7%202.65%2053.35%205.3%2056%209%2056%2012.75%2056%2015.35%2053.35%2018%2050.7%2018%2047%2018%2043.25%2015.35%2040.6%2012.75%2038%209%2038%20M%204%2047%20Q%204%2044.9%205.45%2043.45%206.95%2042%209%2042%2011.1%2042%2012.55%2043.45%2014%2044.9%2014%2047%2014%2049.05%2012.55%2050.55%2011.1%2052%209%2052%206.95%2052%205.45%2050.55%204%2049.05%204%2047%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%201,%20-1,%200,%2064,0.5)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%201.0555572509765625,%20-1.0555572509765625,%200,%2066.3,0.5)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%201.0555572509765625,%20-1.0555572509765625,%200,%2066.3,-1.8)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%20-15,63.5)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1.0555572509765625,%201.0555572509765625,%200,%20-17.1,63.5)%20'%3e%3cuse%20xlink:href='%23Layer0_4_FILL'/%3e%3c/g%3e%3c/svg%3e`,Qe=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2036.95%2027.05%20Q%2034.9%2025%2032%2025%2029.1%2025%2027.05%2027.05%2025%2029.1%2025%2032%2025%2034.95%2027.05%2036.95%2029.1%2039%2032%2039%2034.9%2039%2036.95%2036.95%2039%2034.9%2039%2032%2039%2029.1%2036.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2059.95%2027.05%20Q%2057.9%2025%2055%2025%2052.1%2025%2050.05%2027.05%2048%2029.1%2048%2032%2048%2034.95%2050.05%2036.95%2052.1%2039%2055%2039%2057.9%2039%2059.95%2036.95%2062%2034.9%2062%2032%2062%2029.1%2059.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_4_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_4_FILL'/%3e%3c/g%3e%3c/svg%3e`,$e=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2013.95%2027.05%20Q%2011.9%2025%209%2025%206.1%2025%204.05%2027.05%202%2029.1%202%2032%202%2034.95%204.05%2036.95%206.1%2039%209%2039%2011.9%2039%2013.95%2036.95%2016%2034.9%2016%2032%2016%2029.1%2013.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2018%2032%20Q%2018%2028.3%2015.35%2025.65%2012.7%2023%209%2023%205.25%2023%202.65%2025.65%200%2028.3%200%2032%200%2035.75%202.65%2038.4%205.25%2041%209%2041%2012.7%2041%2015.35%2038.4%2018%2035.75%2018%2032%20M%2014%2032%20Q%2014%2034.1%2012.55%2035.55%2011.05%2037%209%2037%206.9%2037%205.45%2035.55%204%2034.1%204%2032%204%2029.95%205.45%2028.45%206.9%2027%209%2027%2011.05%2027%2012.55%2028.45%2014%2029.95%2014%2032%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2036.95%2027.05%20Q%2034.9%2025%2032%2025%2029.1%2025%2027.05%2027.05%2025%2029.1%2025%2032%2025%2034.95%2027.05%2036.95%2029.1%2039%2032%2039%2034.9%2039%2036.95%2036.95%2039%2034.9%2039%2032%2039%2029.1%2036.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_3_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.65%2025.65%20Q%2023%2028.3%2023%2032%2023%2035.75%2025.65%2038.4%2028.25%2041%2032%2041%2035.7%2041%2038.35%2038.4%2041%2035.75%2041%2032%2041%2028.3%2038.35%2025.65%2035.7%2023%2032%2023%2028.25%2023%2025.65%2025.65%20M%2035.55%2035.55%20Q%2034.05%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.1%2027%2032%2027%2029.95%2028.45%2028.45%2029.9%2027%2032%2027%2034.05%2027%2035.55%2028.45%2037%2029.95%2037%2032%2037%2034.1%2035.55%2035.55%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_4_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2059.95%2027.05%20Q%2057.9%2025%2055%2025%2052.1%2025%2050.05%2027.05%2048%2029.1%2048%2032%2048%2034.95%2050.05%2036.95%2052.1%2039%2055%2039%2057.9%2039%2059.95%2036.95%2062%2034.9%2062%2032%2062%2029.1%2059.95%2027.05%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_5_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2048.65%2025.65%20Q%2046%2028.3%2046%2032%2046%2035.75%2048.65%2038.4%2051.25%2041%2055%2041%2058.7%2041%2061.35%2038.4%2064%2035.75%2064%2032%2064%2028.3%2061.35%2025.65%2058.7%2023%2055%2023%2051.25%2023%2048.65%2025.65%20M%2051.45%2028.45%20Q%2052.9%2027%2055%2027%2057.05%2027%2058.55%2028.45%2060%2029.95%2060%2032%2060%2034.1%2058.55%2035.55%2057.05%2037%2055%2037%2052.9%2037%2051.45%2035.55%2050%2034.1%2050%2032%2050%2029.95%2051.45%2028.45%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_1_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_2_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_3_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_4_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%200,%20-1,%201,%200,%200,64)%20'%3e%3cuse%20xlink:href='%23Layer0_5_FILL'/%3e%3c/g%3e%3c/svg%3e`,B=(e,t)=>{if(typeof document>`u`)return t;for(let t of[document.body,document.documentElement]){if(!t)continue;let n=getComputedStyle(t).getPropertyValue(e).trim();if(n)return n}return t},et=(e,t)=>{let n=B(e,`${t}`),r=Number(n);return Number.isFinite(r)?r:t},tt=(e,t)=>B(e,t),nt=()=>({collapseBg:`#ffffff`,collapseBorder:`#666666`,collapseText:`#666666`,divider:B(`--b3-node-divider`,`#666666`),dragSource:B(`--b3-drag-source`,`#ffa500`),dropChild:B(`--b3-drop-child`,`#ff4d4f`),focusColor:B(`--b3-node-focus-color`,`#ffab00`),focusOpacity:et(`--b3-node-focus-opacity`,.45),grayBorder:B(`--b3-node-gray-border`,`#30363d`),grayFill:B(`--b3-node-gray-fill`,`#0d1117`),grayRail:B(`--b3-node-gray-rail`,`#30363d`),grayText:B(`--b3-node-gray-text`,`#666666`),highlightBg:B(`--b3-node-highlight-bg`,`#0d1117`),highlightText:B(`--b3-node-highlight-text`,`#ffffff`),idStroke:B(`--b3-node-id-stroke`,`#000000`),idText:B(`--b3-node-id-text`,`#ffffff`),nodeBg:B(`--b3-node-content-bg`,`#ffffff`),nodeText:B(`--b3-node-text`,`#111827`),overrideBar:B(`--b3-override-bar`,`#d39a21`),subtreeOutline:B(`--b3-subtree-outline`,`#a5b1be`)}),rt={Action:`#1769dd`,Composite:`#34d800`,Condition:`#f72585`,Decorator:`#b2eb35`,Error:`#ff0000`,Other:`#707070`},it={Action:Re,Composite:ze,Condition:Be,Decorator:He,Error:We,Other:Ge},at={0:Ke,1:qe,2:Je,3:Ye,4:Xe,5:Ze,6:Qe,7:$e},ot=e(xe()),V=(e,t)=>JSON.stringify(e)===JSON.stringify(t),st=e=>{if(e!=null)try{return ot.default.stringify(e)}catch{return String(e)}},ct=e=>typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):st(e)??``,lt=class{constructor(e){this.data=[],this._indentCount=0,this._indent=e}get indentCount(){return this._indentCount}indent(){this._indentCount+=this._indent}unindent(){this._indentCount-=this._indent}padding(){this._indent>0&&this.data.push(` `.repeat(this._indentCount))}linefeed(){this._indent>0&&this.data.push(`
2
+ `)}writeLine(e){this.padding(),this.data.push(e),this.linefeed()}writeLines(e){for(let t of e.split(`
3
+ `))this.writeLine(t)}writeString(e){this.data.push(e)}toString(){return this.data.join(``)}},ut=e=>e.replaceAll(`\r
4
+ `,`
5
+ `).replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`).replaceAll(`
6
+ `,`\\n`).replaceAll(` `,`\\t`).replaceAll(`\r`,`\\r`).replaceAll(`\b`,`\\b`).replaceAll(`\f`,`\\f`),dt=(e,t,n)=>{let r=e,i=Object.keys(r).filter(e=>!e.startsWith(`!`)&&(!n||!n[e])&&(!t||t(r[e]))),a=[],o=[];for(let e of i){let t=Number(e);!isNaN(t)&&isFinite(t)?a.push(e):o.push(e)}return a.sort((e,t)=>Number(e)-Number(t)||e.localeCompare(t)),o.sort((e,t)=>e.localeCompare(t)),[...a,...o]},ft=(e,t)=>e===(e|0)?e.toFixed(0):e.toFixed(t).replace(/\.?0+$/,``),pt=(e,t)=>{let n=[];t??={},t.indent=Math.max(t.indent??4,0),t.precision=t.precision??10;let r=new lt(t.indent),i={format:`json`,indent:t.indent,precision:t.precision,buffer:r,writeValue:a,writeArray:s,writeObject:o};function a(e){typeof e==`number`?r.writeString(ft(e,i.precision)):typeof e==`boolean`?r.writeString(e.toString()):e===null?r.writeString(`null`):e===void 0?r.writeString(`undefined`):typeof e==`string`?(r.writeString(`"`),r.writeString(ut(e)),r.writeString(`"`)):Array.isArray(e)?s(e):typeof e!=`object`||!e||e===void 0?a(e):Array.isArray(e)?s(e):o(e)}function o(e){if(n.length>256)throw Error(`json stringify stack overflow: ${n.join(`->`)}`);if(e[`!stringify`]){e[`!stringify`](e,i);return}let t=dt(e,e=>e!==void 0,e[`!ignore`]),o=i.indent>0?` `:``;r.writeString(`{`),r.linefeed(),r.indent();for(let i=0;i<t.length;i++){let s=t[i],c=e[s];n.push(s),r.padding(),r.writeString(`"${s}":${o}`),a(c),i<t.length-1&&r.writeString(`,`),r.linefeed(),n.pop()}r.unindent(),r.padding(),r.writeString(`}`)}function s(e){if(e[`!stringify`]){e[`!stringify`](e,i);return}r.writeString(`[`),r.linefeed(),r.indent();for(let t=0;t<e.length;t++){let n=e[t];r.padding(),a(n),t<e.length-1&&r.writeString(`,`),r.linefeed()}r.unindent(),r.padding(),r.writeString(`]`)}return a(e),r.toString()},mt=`12px`,ht=`13px`,gt=`sans-serif`,_t=e=>e>0?e*18:0,vt=(e,t)=>({highlightTop:e+18+1,nextSectionTop:e+_t(t),textTop:e+18}),yt=null,bt=new Map,xt=new Map,St=e=>({fontSize:e??ht,fontFamily:gt}),Ct=(e,t)=>{let{fontSize:n,fontFamily:r}=St(t),i=`${e}-${n}-${r}`,a=bt.get(i);if(a!==void 0)return a;if(yt||=typeof document>`u`?null:document.createElement(`canvas`).getContext(`2d`),!yt){let t=Number.parseFloat(n)||13;return e.length*t*.62}yt.font=`${n} ${r}`,yt.wordSpacing=`0px`,yt.letterSpacing=`0px`;let o=yt.measureText(e).width;return bt.set(i,o),o},wt=e=>e===`,`||e===`;`||e===` `||e===` `||e===`
7
+ `||e===`\r`||e===`)`||e===`]`||e===`}`||e===`,`||e===`;`||e===`、`,Tt=(e,t)=>{if(t>=e.length)return e.length;let n=Math.max(1,Math.floor(t*.55));for(let r=t;r>=n;--r)if(wt(e[r-1]??``))return r;return t},Et=(e,t,n)=>{let r=`${e}-${t}-${n??``}`,i=xt.get(r);if(i)return i;let a=[],o=e;for(;o.length>0;){let e=0,r=o.length;for(;e<r;){let i=Math.floor((e+r+1)/2);Ct(o.slice(0,i),n)<=t?e=i:r=i-1}if(e>0){let t=Tt(o,e),n=o.slice(0,t).trimEnd();a.push(n||o.slice(0,t)),o=o.slice(t).trimStart();continue}a.push(o.slice(0,1)),o=o.slice(1)}return xt.set(r,a),a},Dt=(e,t,n)=>{let r=Et(e,t,n);return r.length>1?`${r[0].slice(0,-1)}...`:r[0]??``},Ot=(e,t,n)=>{let r=Et(e,t,n);return{str:r.join(`
8
+ `),line:r.length}},kt=e=>e.argsText?Ot(`${I.t(`regnode.args`)}${e.argsText}`,206,mt):{str:``,line:0},At=e=>{let t=e.inputs.map(e=>e.label).filter(Boolean);return t.length===0?{str:``,line:0}:Ot(`${I.t(`regnode.input`)}${st(t)??`[]`}`,206,mt)},jt=e=>{let t=e.outputs.map(e=>e.label).filter(Boolean);return t.length===0?{str:``,line:0}:Ot(`${I.t(`regnode.output`)}${st(t)??`[]`}`,206,mt)},Mt=e=>{let t=52;e.subtreePath&&(t+=_t(1));let n=kt(e);n.line>0&&(t+=_t(n.line));let r=At(e);r.line>0&&(t+=_t(r.line));let i=jt(e);return i.line>0&&(t+=_t(i.line)),{width:260,height:Math.max(52,t)}},Nt=()=>{let e=nt();return{dragsrc:{"drag-src":{visibility:`visible`}},dragup:{"drag-up":{visibility:`visible`}},dragdown:{"drag-down":{visibility:`visible`}},dragright:{"drag-right":{visibility:`visible`}},focused:{"focus-halo":{visibility:`visible`}},highlightargs:{"args-bg":{visibility:`visible`},"args-text":{fill:e.highlightText}},highlightinput:{"input-bg":{visibility:`visible`},"input-text":{fill:e.highlightText}},highlightoutput:{"output-bg":{visibility:`visible`},"output-text":{fill:e.highlightText}},highlightgray:{collapse:{opacity:.45},"desc-text":{fill:e.grayText},debug:{opacity:.45},disabled:{opacity:.45},icon:{opacity:.45},"id-text":{fill:e.grayText,stroke:e.idStroke},"input-text":{fill:e.grayText},"key-shape":{fill:e.grayFill,stroke:e.grayBorder},"name-bg":{fill:e.grayRail},"name-line":{stroke:e.divider},"name-text":{fill:e.grayText},"override-bar":{opacity:.45},"output-text":{fill:e.grayText},"path-text":{fill:e.grayText},status:{opacity:.45},"args-text":{fill:e.grayText}},selected:{"selection-halo":{visibility:`visible`}}}},Pt=`b3-tree-node`,Ft=28,It=40,Lt=4,Rt=e=>Math.max(18,e*18-2),zt=!1,Bt=class extends se{constructor(...e){super(...e),this.width=260,this.height=52,this.radius=Lt,this.accent=rt.Other,this.contentY=Ft,this.states=[],this.palette=nt()}getKeyStyle(e){let t=super.getKeyStyle(e);return t&&(t.x=0,t.y=0),t}getHaloStyle(e){let t=super.getHaloStyle(e);return t&&(t.x=0,t.y=0),t}drawSelectionHalo(e){this.upsert(`selection-halo`,k,{x:-6,y:-6,width:this.width+12,height:this.height+12,lineWidth:6,radius:this.radius+6,stroke:this.accent,strokeOpacity:.28,fill:this.accent,fillOpacity:0,visibility:`hidden`},e)}drawFocusHalo(e){this.upsert(`focus-halo`,k,{x:-8,y:-8,width:this.width+16,height:this.height+16,lineWidth:4,radius:this.radius+8,stroke:this.palette.focusColor,strokeOpacity:this.palette.focusOpacity,fill:this.palette.focusColor,fillOpacity:0,visibility:`hidden`},e)}drawBackground(e,t){let n={...e,size:[this.width,this.height],lineWidth:2,radius:this.radius};this.applyStyle(`key-shape`,n),this.drawKeyShape(n,t)}drawNameBackground(e){this.upsert(`name-bg`,k,{width:It,height:this.height,fill:this.accent,radius:[this.radius,0,0,this.radius]},e),this.upsert(`name-line`,oe,{d:[[`M`,46,23],[`L`,this.width-40,23]],stroke:this.palette.divider,lineWidth:1},e)}drawIdText(e){this.upsert(`id-text`,A,{fill:this.palette.idText,fontSize:20,lineHeight:20,lineWidth:2,stroke:this.palette.idStroke,text:this.node.renderedIdLabel,textAlign:`right`,textBaseline:`top`,x:-3,y:this.height/2-8},e)}drawTypeIcon(e){this.upsert(`icon`,M,{x:5,y:this.height/2-16,height:30,opacity:1,width:30,src:this.node.icon?.trim()||it[this.node.nodeStyleKind]},e)}drawStatusIcon(e){this.upsert(`status`,M,{x:this.width-18,y:3,height:20,opacity:1,width:20,src:at[this.node.statusBits]??`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20preserveAspectRatio='none'%20x='0px'%20y='0px'%20width='64px'%20height='64px'%20viewBox='0%200%2064%2064'%3e%3cdefs%3e%3cg%20id='Layer0_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2038.4%2048.65%20Q%2035.7%2046%2032%2046%2028.35%2046%2025.6%2048.65%2023%2051.35%2023%2055%2023%2058.85%2025.6%2061.35%2028.25%2064%2032%2064%2035.75%2064%2038.4%2061.35%2041%2058.75%2041%2055%2041%2051.4%2038.4%2048.65%20M%2035.5%2058.6%20Q%2034.1%2060%2032%2060%2029.95%2060%2028.45%2058.6%2027%2057.15%2027%2055%2027%2052.9%2028.45%2051.45%2030%2050%2032%2050%2034.05%2050%2035.5%2051.45%2037%2052.95%2037%2055%2037%2057.1%2035.5%2058.6%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2025.6%2025.7%20Q%2023%2028.3%2023%2032%2023%2035.8%2025.6%2038.4%2028.3%2041%2032%2041%2035.75%2041%2038.4%2038.4%2041%2035.75%2041%2032%2041%2028.4%2038.4%2025.7%2035.7%2023%2032%2023%2028.3%2023%2025.6%2025.7%20M%2032%2027%20Q%2034.1%2027%2035.5%2028.5%2037%2030%2037%2032%2037%2034.15%2035.5%2035.55%2034.1%2037%2032%2037%2029.9%2037%2028.45%2035.55%2027%2034.15%2027%2032%2027%2029.95%2028.45%2028.5%2029.95%2027%2032%2027%20Z'/%3e%3c/g%3e%3cg%20id='Layer0_2_MEMBER_0_MEMBER_0_MEMBER_0_FILL'%3e%3cpath%20fill='%23000000'%20stroke='none'%20d='%20M%2038.4%202.7%20Q%2035.7%200%2032%200%2028.3%200%2025.6%202.7%2023%205.3%2023%209%2023%2012.85%2025.6%2015.35%2028.25%2018%2032%2018%2035.75%2018%2038.4%2015.35%2041%2012.75%2041%209%2041%205.4%2038.4%202.7%20M%2035.5%205.5%20Q%2037%207%2037%209%2037%2011.15%2035.5%2012.55%2034.1%2014%2032%2014%2029.9%2014%2028.45%2012.55%2027%2011.15%2027%209%2027%206.95%2028.45%205.5%2029.95%204%2032%204%2034.1%204%2035.5%205.5%20Z'/%3e%3c/g%3e%3c/defs%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_0_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_1_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3cg%20transform='matrix(%201,%200,%200,%201,%201,0)%20'%3e%3cuse%20xlink:href='%23Layer0_2_MEMBER_0_MEMBER_0_MEMBER_0_FILL'/%3e%3c/g%3e%3c/svg%3e`},e)}drawDebugIcon(e){this.upsert(`debug`,M,{x:this.width-30,y:4,height:16,opacity:1,width:16,src:Ve,visibility:this.node.debug?`visible`:`hidden`},e)}drawDisabledIcon(e){this.upsert(`disabled`,M,{x:this.width-30-(this.node.debug?18:0),y:4,height:16,opacity:1,width:16,src:Ue,visibility:this.node.disabled?`visible`:`hidden`},e)}drawOverrideBar(e){this.upsert(`override-bar`,k,{x:this.width-17,y:1,width:16,height:this.height-2,fill:this.palette.overrideBar,lineWidth:2,opacity:1,radius:[0,this.radius-1,this.radius-1,0],visibility:this.node.hasOverride?`visible`:`hidden`},e)}drawNameText(e){this.upsert(`name-text`,A,{fill:this.palette.nodeText,fontSize:14,fontWeight:`bolder`,text:this.node.title,textBaseline:`top`,x:46,y:L?3:2},e)}drawDescText(e){let t=this.node.subtitle?Dt(`${I.t(`regnode.mark`)}${this.node.subtitle}`,206,`12px`):``;this.upsert(`desc-text`,A,{fill:this.palette.nodeText,fontSize:12,fontWeight:`bolder`,lineHeight:18,text:t,textBaseline:`top`,x:46,y:this.contentY,visibility:t?`visible`:`hidden`},e)}drawArgsText(e){let{str:t,line:n}=kt(this.node),r=vt(this.contentY,n);this.upsert(`args-bg`,k,{x:44,y:r.highlightTop,width:210,height:Rt(n),fill:this.palette.highlightBg,radius:this.radius,visibility:`hidden`},e),this.upsert(`args-text`,A,{fill:this.palette.nodeText,fontSize:12,fontWeight:`normal`,lineHeight:18,text:t,textBaseline:`top`,x:46,y:r.textTop,visibility:t?`visible`:`hidden`},e),this.contentY=r.nextSectionTop}drawInputText(e){let{str:t,line:n}=At(this.node),r=vt(this.contentY,n);this.upsert(`input-bg`,k,{fill:this.palette.highlightBg,height:Rt(n),radius:this.radius,visibility:`hidden`,width:210,x:44,y:r.highlightTop},e),this.upsert(`input-text`,A,{fill:this.palette.nodeText,fontSize:12,fontWeight:`normal`,lineHeight:18,text:t,textBaseline:`top`,x:46,y:r.textTop,visibility:t?`visible`:`hidden`},e),this.contentY=r.nextSectionTop}drawOutputText(e){let{str:t,line:n}=jt(this.node),r=vt(this.contentY,n);this.upsert(`output-bg`,k,{fill:this.palette.highlightBg,height:Rt(n),radius:this.radius,visibility:`hidden`,width:210,x:44,y:r.highlightTop},e),this.upsert(`output-text`,A,{fill:this.palette.nodeText,fontSize:12,fontWeight:`normal`,lineHeight:18,text:t,textBaseline:`top`,x:46,y:r.textTop,visibility:t?`visible`:`hidden`},e),this.contentY=r.nextSectionTop}drawSubtreeText(e){let t=!!this.node.subtreePath&&this.id!==`1`,n=t?Dt(`${I.t(`regnode.subtree`)}${this.node.subtreePath}`,206,`12px`):``,r=vt(this.contentY,+!!n);this.upsert(`subtree`,k,{x:-10,y:-10,width:this.width+20,height:this.height+20,stroke:this.palette.subtreeOutline,lineWidth:3,lineDash:[10,5],radius:this.radius,visibility:t?`visible`:`hidden`},e),this.upsert(`path-text`,A,{fill:this.palette.nodeText,fontSize:12,lineHeight:18,text:n,textBaseline:`top`,x:46,y:r.textTop,visibility:n?`visible`:`hidden`},e),this.contentY=r.nextSectionTop}drawCollapseBadge(e,t){this.upsert(`collapse`,ie,{backgroundFill:this.palette.collapseBg,backgroundHeight:14,backgroundLineWidth:1,backgroundRadius:7,backgroundStroke:this.palette.collapseBorder,backgroundWidth:14,cursor:`pointer`,fill:this.palette.collapseText,fontSize:16,opacity:1,text:e.collapsed?`+`:`-`,textAlign:`center`,textBaseline:`middle`,visibility:this.node.childKeys.length>0?`visible`:`hidden`,x:this.width,y:this.height/2},t)}drawDragShapes(e){this.upsert(`drag-src`,k,{width:this.width,height:this.height,lineWidth:0,fillOpacity:.8,fill:this.palette.dragSource,radius:this.radius,visibility:`hidden`},e),this.upsert(`drag-up`,k,{width:this.width,height:this.height/2,lineWidth:2,stroke:this.palette.dropChild,strokeOpacity:.8,fill:this.palette.dropChild,fillOpacity:.8,radius:[this.radius,this.radius,0,0],visibility:`hidden`},e),this.upsert(`drag-down`,k,{y:this.height/2,width:this.width,height:this.height/2,lineWidth:2,stroke:this.palette.dropChild,strokeOpacity:.8,fill:this.palette.dropChild,fillOpacity:.8,radius:[0,0,this.radius,this.radius],visibility:`hidden`},e),this.upsert(`drag-right`,k,{x:this.width/2,width:this.width/2,height:this.height,lineWidth:2,stroke:this.palette.dropChild,strokeOpacity:.8,fill:this.palette.dropChild,fillOpacity:.8,radius:[0,this.radius,this.radius,0],visibility:`hidden`},e)}render(e,t){let n=this.context.model.getNodeLikeDatum(this.id).data;this.node=n.vm,this.palette=nt(),this.width=n.width,this.height=n.height,this.accent=this.node.accentColor??rt[this.node.nodeStyleKind]??rt.Other,this.contentY=Ft,this.states=this.context.graph.getElementState(this.id),this.resetStyle(),!(!e||!t)&&(e.fill=this.palette.nodeBg,e.stroke=this.accent,this.drawSelectionHalo(t),this.drawFocusHalo(t),this.drawBackground(e,t),this.drawNameBackground(t),this.drawOverrideBar(t),this.drawNameText(t),this.drawTypeIcon(t),this.drawStatusIcon(t),this.drawDebugIcon(t),this.drawDisabledIcon(t),this.drawDescText(t),this.drawArgsText(t),this.drawInputText(t),this.drawOutputText(t),this.drawSubtreeText(t),this.drawDragShapes(t),this.drawCollapseBadge(e,t),this.drawIdText(t))}upsert(e,t,n,r,i){return this.applyStyle(e,n),super.upsert(e,t,n,r,i)}applyStyle(e,t){if(!t)return;let n=this.attributes[e]??{};for(let e in n)t[e]=n[e]}resetStyle(){let e=this.context.graph.getOptions().node?.state;if(!e)return;let t=new Set;Object.keys(e).forEach(n=>{for(let r in e[n])t.add(r)}),this.states.forEach(n=>{let r=e[n];if(r)for(let e in r)t.delete(e)});for(let e of t)this.attributes[e]=void 0}},Vt=()=>{zt||=(de(ue.NODE,Pt,Bt),!0)},Ht=e=>e,Ut=(e,t)=>{e.setNode(t)},Wt=(e,t)=>{e.setEdge(t)},Gt=e=>{let t=e;return!!(t?.rendered&&!t?.destroyed)},Kt=e=>{let t=e;if(!t?.rendered||t.destroyed||!t.context?.viewport||!t.getPosition||!t.getZoom)return null;try{let[e,n]=t.getPosition(),r=t.getZoom();return[e,n,r].every(e=>Number.isFinite(e))?{zoom:r,x:e,y:n}:null}catch{return null}},qt=e=>{let t=e.target?.id;return typeof t==`string`||typeof t==`number`?String(t):null},Jt=e=>{let t=e.canvas,n=t?.x,r=t?.y;return typeof n!=`number`||typeof r!=`number`||!Number.isFinite(n)||!Number.isFinite(r)?null:[n,r]},Yt=e=>{let t=e.data?.vm?.ref.displayId;return typeof t==`string`||typeof t==`number`?t:null},Xt=e=>e,Zt=e=>{let t=e?.data;return!t||typeof t.width!=`number`||typeof t.height!=`number`||!t.vm?null:t},Qt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),$t=(e,t)=>e.structuralStableId===t.structuralStableId&&e.sourceStableId===t.sourceStableId&&e.sourceTreePath===t.sourceTreePath&&Qt(e.subtreeStack,t.subtreeStack),en=(e,t)=>e.some(e=>$t(e,t)),tn=(e,t)=>t?e.filter(e=>t.nodes.some(t=>$t(t.ref,e))):[],nn=(e,t)=>en(e,t)?e.filter(e=>!$t(e,t)):[...e,t],rn=(e,t)=>e.nodes.find(e=>e.ref.instanceKey===t)??null,an=(e,t)=>{let n=[],r=rn(e,t);for(;r?.parentKey;){let t=rn(e,r.parentKey);if(!t)break;n.push(t.ref),r=t}return n},on=(e,t,n)=>{if(!t||e.length===0)return[...e];let r=an(t,n);return r.length===0?[...e]:e.filter(e=>!r.some(t=>$t(e,t)))},sn=(e,t)=>en(t,e.ref)?[]:e.childKeys,cn=(e,t)=>{let n=e??null;for(;n;){if(n.className===t)return!0;n=n.parentElement??null}return!1},ln=(e,t)=>cn(e.originalTarget,t)||cn(e.target,t),un=1,dn=(e,t,n)=>Math.min(n,Math.max(t,e)),fn=e=>{let t=e.deltaY===0?e.deltaX:e.deltaY;return!Number.isFinite(t)||t===0?null:1+dn(-t,-50,50)*un/100},pn=e=>{let{event:t,isEnabled:n,getOrigin:r,zoomTo:i}=e;if(!n())return;let a=fn(t);a&&(t.preventDefault(),t.stopPropagation(),i(a,r()))},mn={zoom:1,x:0,y:0},hn=[{key:`right`,placement:`right`},{key:`left`,placement:`left`}],gn=()=>({type:Pt,style:{ports:hn},state:Ht(Nt())}),_n=()=>({type:`cubic-horizontal`,style:{lineWidth:2,stroke:tt(`--b3-graph-edge`,`#A3B1BF`)}}),vn=e=>e.zoom===mn.zoom&&e.x===mn.x&&e.y===mn.y,yn=e=>e===`before`?`dragup`:e===`after`?`dragdown`:e===`child`?`dragright`:null,bn=e=>{let t=Yt(e),n=Number(t??e.id);return Number.isFinite(n)?n:2**53-1},xn=(e,t)=>{let n=bn(e)-bn(t);return n===0?String(e.id).localeCompare(String(t.id)):n},Sn=class{constructor(){this.container=null,this.handlers=null,this.graph=null,this.resizeObserver=null,this.resizeRestoreFrame=null,this.model=null,this.selection={selectedNodeKey:null},this.highlights={activeVariableNames:[],variableHits:{}},this.search={query:``,mode:`content`,caseSensitive:!1,focusOnly:!0,resultKeys:[],activeResultIndex:0},this.focusedNodeKey=null,this.viewport={...mn},this.dragIntent={sourceKey:null,targetKey:null,position:null},this.collapsedNodeRefs=[],this.suppressTransformSync=!1,this.handleGraphTransform=()=>{this.suppressTransformSync||!this.graph||this.syncViewportFromGraph()},this.applyWheelZoom=async(e,t)=>{!this.graph||!this.isGraphRendered()||(await this.graph.zoomTo(this.graph.getZoom()*e,!1,t),this.syncViewportFromGraph())},this.handleNativeWheel=e=>{pn({event:e,isEnabled:()=>!!(this.graph&&this.isGraphRendered()),getOrigin:()=>this.getWheelViewportOrigin(e),zoomTo:(e,t)=>this.applyWheelZoom(e,t)})},this.handleCanvasClick=()=>{this.handlers?.onCanvasSelected()},this.handleNodeContextMenu=e=>{let t=qt(e);if(!t)return;let n=this.getNodeVM(t);n&&this.handlers?.onNodeSelected(n.ref,{via:`contextMenu`})},this.handleNodeClick=e=>{let t=qt(e);if(!t)return;let n=this.getNodeVM(t);if(!n)return;if(ln(e,`collapse`)){this.handleCollapseToggle(n);return}let r=!1;if(ln(e,`input-text`)){let e=n.inputs.map(e=>e.variable).filter(e=>!!e);e.length>0&&(r=!0,this.handlers?.onVariableHotspotClicked(n.ref,{kind:`input`,variableNames:e}))}else if(ln(e,`output-text`)){let e=n.outputs.map(e=>e.variable).filter(e=>!!e);e.length>0&&(r=!0,this.handlers?.onVariableHotspotClicked(n.ref,{kind:`output`,variableNames:e}))}this.handlers?.onNodeSelected(n.ref,{via:`click`,clearVariableFocus:!r})},this.handleNodeDoubleClick=e=>{let t=qt(e);if(!t)return;let n=this.getNodeVM(t);n&&this.handlers?.onNodeDoubleClicked(n.ref)},this.handleNodeDragStart=e=>{let t=qt(e);if(!t)return;let n=this.getNodeVM(t);!n||n.subtreeNode||(this.dragIntent={sourceKey:t,targetKey:null,position:null},this.refreshNodeStates())},this.handleNodeDragEnd=()=>{this.clearDragIntent()},this.handleNodeDragEnter=e=>{if(!this.dragIntent.sourceKey)return;let t=qt(e);!t||t===this.dragIntent.sourceKey||this.updateDragIntent(t,this.dragIntent.position)},this.handleNodeDragLeave=e=>{let t=qt(e);!t||t===this.dragIntent.sourceKey||this.dragIntent.targetKey===t&&this.updateDragIntent(null,null)},this.handleNodeDrag=e=>{if(!this.graph||!this.dragIntent.sourceKey||!this.dragIntent.targetKey)return;let t=this.dragIntent.targetKey,n=Zt(this.graph.getNodeData(t));if(!n)return;let r=this.graph.getElementPosition(t),i=Jt(e);if(!r||!i)return;let a=i[0]-r[0],o=i[1]-r[1],s=a>n.width/2?`child`:o>n.height/2?`after`:`before`;this.updateDragIntent(t,s)},this.handleNodeDrop=async e=>{if(!this.dragIntent.sourceKey||!this.dragIntent.position)return;let t=this.dragIntent.targetKey??qt(e),n=this.dragIntent.sourceKey,r=this.dragIntent.position;if(this.clearDragIntent(),!t||n===t)return;let i=this.getNodeVM(n),a=this.getNodeVM(t);!i||!a||await this.handlers?.onDropCommitted({source:i.ref,target:a.ref,position:r})}}syncThemeOptions(){this.graph&&(Ut(this.graph,gn()),Wt(this.graph,_n()))}getWheelViewportOrigin(e){let t=this.container;if(!t)return;let n=t.getBoundingClientRect();return[e.clientX-n.left,e.clientY-n.top]}isGraphRendered(){return Gt(this.graph)}readViewportFromGraph(){return Kt(this.graph)}readViewportAnchorCandidate(e){if(!this.graph?.hasNode(e))return null;let t=this.getNodeVM(e);if(!t)return null;try{let n=this.graph.getElementPosition(e),r=this.graph.getViewportByCanvas(n),i=r[0],a=r[1];return!Number.isFinite(i)||!Number.isFinite(a)?null:{ref:t.ref,viewportPosition:[i,a]}}catch{return null}}readViewportAnchor(e,t){if(!e||!this.graph||!this.isGraphRendered())return null;let n=[],r=e;for(;r;){let e=this.readViewportAnchorCandidate(r);if(!e&&!t?.skipMissingCandidates)break;e&&n.push(e),r=this.getNodeVM(r)?.parentKey??null}return n.length>0?{candidates:n}:null}readViewportCenterAnchor(){if(!this.graph||!this.model||!this.isGraphRendered())return null;let e=this.container?.clientWidth??0,t=this.container?.clientHeight??0;if(e<=0||t<=0)return null;let n=[e/2,t/2],r=null;for(let e of this.model.nodes){let t=e.ref.instanceKey;if(this.graph.hasNode(t))try{let e=this.graph.getElementPosition(t),i=this.graph.getViewportByCanvas(e),a=Math.hypot(i[0]-n[0],i[1]-n[1]);(!r||a<r.distance)&&(r={nodeKey:t,distance:a})}catch{}}return r?this.readViewportAnchor(r.nodeKey):null}resolveViewportAnchorCandidate(e){for(let t of e.candidates){let e=this.model?.nodes.find(e=>$t(e.ref,t.ref));if(e?.ref.instanceKey&&this.graph?.hasNode(e.ref.instanceKey))return{candidate:t,nodeKey:e.ref.instanceKey}}return null}async applyAnchorViewportCompensation(e){let t=e?this.resolveViewportAnchorCandidate(e):null;if(!e||!t||!this.graph||!this.isGraphRendered()||!this.graph.hasNode(t.nodeKey))return;let n=0,r=0;try{let e=this.graph.getElementPosition(t.nodeKey),i=this.graph.getViewportByCanvas(e);n=t.candidate.viewportPosition[0]-i[0],r=t.candidate.viewportPosition[1]-i[1]}catch{return}if(!(Math.abs(n)<.01&&Math.abs(r)<.01)){this.suppressTransformSync=!0;try{await this.graph.translateBy([n,r],!1),this.syncViewportFromGraph()}finally{this.suppressTransformSync=!1}}}getNodeVM(e){return this.model?.nodes.find(t=>t.ref.instanceKey===e)??null}async handleCollapseToggle(e){let t=this.readViewportAnchor(e.ref.instanceKey);this.collapsedNodeRefs=nn(this.collapsedNodeRefs,e.ref),await this.renderGraphData(t)}async ensureNodeVisible(e){if(!this.graph||!this.model||this.graph.hasNode(e))return;let t=on(this.collapsedNodeRefs,this.model,e);if(t.length===this.collapsedNodeRefs.length)return;let n=this.readViewportAnchor(e,{skipMissingCandidates:!0});this.collapsedNodeRefs=t,await this.renderGraphData(n)}getNodeDatum(e){let t=Mt(e);return{vm:e,width:t.width,height:t.height}}getNodeStates(e){let t=[],n=e.ref.instanceKey,r=this.highlights.variableHits[n]??[],i=this.highlights.activeVariableNames.length>0&&r.length===0,a=this.search.focusOnly&&this.search.query.length>0&&!this.search.resultKeys.includes(n);if(this.selection.selectedNodeKey===n&&t.push(`selected`),this.focusedNodeKey===n&&t.push(`focused`),(i||a)&&t.push(`highlightgray`),r.includes(`args`)&&t.push(`highlightargs`),r.includes(`input`)&&t.push(`highlightinput`),r.includes(`output`)&&t.push(`highlightoutput`),this.dragIntent.sourceKey===n&&t.push(`dragsrc`),this.dragIntent.targetKey===n){let e=yn(this.dragIntent.position);e&&t.push(e)}return t}refreshNodeStates(){if(!(!this.graph||!this.model||!this.isGraphRendered()))for(let e of this.model.nodes)this.graph.hasNode(e.ref.instanceKey)&&this.graph.setElementState(e.ref.instanceKey,this.getNodeStates(e))}buildTreeDatum(e){let t=this.getNodeVM(e);if(!t)return null;let n=this.getNodeDatum(t),r=en(this.collapsedNodeRefs,t.ref),i=sn(t,this.collapsedNodeRefs);return{id:e,nodeData:{id:t.ref.instanceKey,type:Pt,data:Xt(n),style:{size:[n.width,n.height],cursor:`pointer`,collapsed:r,draggable:!t.subtreeNode,ports:hn},children:i,depth:t.depth},children:i.map(e=>this.buildTreeDatum(e)).filter(e=>!!e)}}buildGraphData(e){let t=this.buildTreeDatum(e.rootKey);return t?fe(t,{getNodeData:e=>e.nodeData,getEdgeData:(e,t)=>({id:`${e.id}->${t.id}`,source:e.id,sourcePort:`right`,target:t.id,targetPort:`left`}),getChildren:e=>e.children??[]}):null}async rerenderWithStableViewport(e){if(this.graph){if(!e){await this.graph.render();return}this.suppressTransformSync=!0;try{this.isGraphRendered()||await this.graph.render(),await this.graph.zoomTo(1,!1),await this.graph.translateTo([0,0],!1),await this.graph.render(),await this.applyViewportSnapshot(e)}finally{this.suppressTransformSync=!1}}}async renderGraphData(e=null){if(!this.graph)return;if(this.cancelPendingResizeRestore(),!this.model||this.model.nodes.length===0){await this.graph.clear();return}let t=this.buildGraphData(this.model);if(!t){await this.graph.clear();return}let n={...this.viewport};await this.graph.clear(),this.graph.setData(t),await this.rerenderWithStableViewport(n),await this.applyAnchorViewportCompensation(e),vn(this.viewport)&&this.syncViewportFromGraph(),this.refreshNodeStates()}async applyViewportSnapshot(e){if(!this.graph||!this.isGraphRendered()){this.viewport={...e};return}await this.graph.zoomTo(e.zoom,!1),await this.graph.translateTo([e.x,e.y],!1),this.viewport={...e}}async applyViewport(e){if(this.graph){if(!this.isGraphRendered()){this.viewport={...e};return}this.suppressTransformSync=!0;try{await this.applyViewportSnapshot(e)}finally{this.suppressTransformSync=!1}}}scheduleResizeViewportRestore(e,t){this.cancelPendingResizeRestore(),this.resizeRestoreFrame=window.requestAnimationFrame(()=>{this.resizeRestoreFrame=null,(async()=>{await this.applyViewport(e),await this.applyAnchorViewportCompensation(t)})()})}cancelPendingResizeRestore(){this.resizeRestoreFrame!=null&&(window.cancelAnimationFrame(this.resizeRestoreFrame),this.resizeRestoreFrame=null)}syncViewportFromGraph(){let e=this.readViewportFromGraph();e&&(this.viewport=e)}updateDragIntent(e,t){this.dragIntent.targetKey===e&&this.dragIntent.position===t||(this.dragIntent={...this.dragIntent,targetKey:e,position:t},this.refreshNodeStates())}clearDragIntent(){let e=this.dragIntent.sourceKey!==null||this.dragIntent.targetKey!==null||this.dragIntent.position!==null;this.dragIntent={sourceKey:null,targetKey:null,position:null},e&&this.refreshNodeStates()}async mount(e,t){this.container=e,this.handlers=t,Vt();let n=new le({container:e,animation:!1,zoomRange:[.25,2],behaviors:[`drag-canvas`],node:gn(),edge:_n(),layout:{type:`compact-box`,direction:`LR`,sortBy:xn,getHeight:e=>Number(e.data?.height??52),getWidth:e=>Number(e.data?.width??260),getVGap:()=>10,getHGap:()=>30}});n.on(ce.CLICK,this.handleCanvasClick),n.on(j.CONTEXT_MENU,this.handleNodeContextMenu),n.on(j.CLICK,this.handleNodeClick),n.on(j.DBLCLICK,this.handleNodeDoubleClick),n.on(j.DRAG_START,this.handleNodeDragStart),n.on(j.DRAG_END,this.handleNodeDragEnd),n.on(j.DRAG_ENTER,this.handleNodeDragEnter),n.on(j.DRAG_LEAVE,this.handleNodeDragLeave),n.on(j.DRAG,this.handleNodeDrag),n.on(j.DROP,this.handleNodeDrop),n.on(ae.AFTER_TRANSFORM,this.handleGraphTransform),e.addEventListener(`wheel`,this.handleNativeWheel,{passive:!1}),this.graph=n,this.resizeObserver=new ResizeObserver(e=>{let t=e[0];if(!t||!this.graph)return;let n={...this.viewport},r=this.readViewportCenterAnchor(),i=Math.max(1,Math.round(t.contentRect.width)),a=Math.max(1,Math.round(t.contentRect.height));this.graph.resize(i,a),this.viewport={...n},this.scheduleResizeViewportRestore(n,r)}),this.resizeObserver.observe(e),await this.renderGraphData()}unmount(){this.cancelPendingResizeRestore(),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.container?.removeEventListener(`wheel`,this.handleNativeWheel),this.graph?.destroy(),this.graph=null,this.container=null,this.handlers=null,this.clearDragIntent()}async render(e,t){let n=t?.anchorNodeKey?this.readViewportAnchor(t.anchorNodeKey,{skipMissingCandidates:!0})??this.readViewportCenterAnchor():this.readViewportCenterAnchor();this.model=e,this.collapsedNodeRefs=tn(this.collapsedNodeRefs,e),this.clearDragIntent(),this.syncThemeOptions(),await this.renderGraphData(n)}pickNearestNodeAnchor(e,t){let n=this.readViewportAnchorCandidate(e);if(!n)return null;let r=null,i=new Set;for(let a of t){if(a===e||i.has(a))continue;i.add(a);let t=this.readViewportAnchorCandidate(a);if(!t)continue;let o=Math.hypot(t.viewportPosition[0]-n.viewportPosition[0],t.viewportPosition[1]-n.viewportPosition[1]);(!r||o<r.distance)&&(r={nodeKey:a,distance:o})}return r?.nodeKey??null}async applySelection(e){this.selection=e,this.refreshNodeStates()}async applyHighlights(e){this.highlights=e,this.refreshNodeStates()}async applySearch(e){this.search=e,(!e.query||e.resultKeys.length===0)&&(this.focusedNodeKey=null),this.refreshNodeStates()}async focusNode(e){this.focusedNodeKey=e,await this.ensureNodeVisible(e),this.refreshNodeStates(),this.graph?.hasNode(e)&&this.isGraphRendered()&&(await this.graph.focusElement(e,!1),this.syncViewportFromGraph())}async restoreViewport(e){this.viewport={...e},await this.applyViewport(e)}getViewport(){return{...this.viewport}}},Cn=()=>new Sn,wn=e=>({success:!1,error:`Host request '${e}' timed out`}),Tn={readFile:{resultType:`readFileResult`,createTimeoutResponse:()=>({content:null}),resolveResult:e=>({content:e.content})},saveSubtree:{resultType:`saveSubtreeResult`,createTimeoutResponse:()=>wn(`saveSubtree`),resolveResult:e=>({success:e.success,error:e.error})},saveSubtreeAs:{resultType:`saveSubtreeAsResult`,createTimeoutResponse:()=>({savedPath:null,error:`Host request 'saveSubtreeAs' timed out`}),resolveResult:(e,t)=>{let n=e.savedPath?t.parseWorkdirRelativeJsonPath(e.savedPath):null;return{savedPath:n,error:e.error??(e.savedPath&&!n?`Host returned an invalid saved subtree path`:void 0)}}},saveDocument:{resultType:`saveDocumentResult`,createTimeoutResponse:()=>wn(`saveDocument`),resolveResult:e=>({success:e.success,error:e.error})},revertDocument:{resultType:`revertDocumentResult`,createTimeoutResponse:()=>wn(`revertDocument`),resolveResult:e=>({success:e.success,error:e.error})},mutateDocument:{resultType:`mutateDocumentResult`,createTimeoutResponse:()=>wn(`mutateDocument`),resolveResult:e=>({success:e.success,error:e.error})},validateNodeFields:{resultType:`validateNodeFieldsResult`,createTimeoutResponse:()=>({diagnostics:[],error:`Host request 'validateNodeFields' timed out`}),resolveResult:e=>({diagnostics:e.diagnostics,error:e.error})},resolveNodeFieldVisibility:{resultType:`resolveNodeFieldVisibilityResult`,createTimeoutResponse:()=>({visibility:{args:{},input:{},output:{}},error:`Host request 'resolveNodeFieldVisibility' timed out`}),resolveResult:e=>({visibility:e.visibility,error:e.error})}},En=Object.fromEntries(Object.entries(Tn).map(([e,t])=>[t.resultType,e])),Dn=e=>Tn[e].createTimeoutResponse(),On=e=>e.type in En,kn=(e,t)=>{let n=En[e.type],r=Tn[n];return{requestId:e.requestId,type:n,value:r.resolveResult(e,t)}};function An(){return{log:console.log.bind(console),debug:console.debug.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)}}An();var jn=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,Mn=/^[a-zA-Z]:[\\/]/,Nn=e=>e.replace(/\\/g,`/`),Pn=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t||t.includes(`\0`)||t.startsWith(`/`)||t.startsWith(`\\`)||Mn.test(t)||jn.test(t))return null;let n=Nn(t);for(;n.startsWith(`./`);)n=n.slice(2);return!n||n.startsWith(`/`)||n.endsWith(`/`)||n.split(`/`).some(e=>!e||e===`.`||e===`..`)||!n.toLowerCase().endsWith(`.json`)?null:n},Fn=e=>{let t=Pn(e);if(!t)throw Error(`Invalid workdir-relative JSON path: ${e}`);return t},In=e=>({path:Fn(e.path),vars:e.vars.map(e=>({name:e.name,desc:e.desc??``})),depends:[]}),Ln=e=>({instanceKey:String(e.instanceKey??``),displayId:String(e.displayId??``),structuralStableId:String(e.structuralStableId??``),sourceStableId:String(e.sourceStableId??``),sourceTreePath:e.sourceTreePath===null||e.sourceTreePath===void 0?null:Fn(String(e.sourceTreePath)),subtreeStack:Array.isArray(e.subtreeStack)?e.subtreeStack.map(e=>Fn(String(e))):[]}),Rn=e=>e.kind===`tree`?{kind:`tree`}:{kind:`node`,ref:Ln(e.ref)},zn=e=>({content:e.content,documentSession:e.documentSession,selection:Rn(e.selection),syncKind:e.syncKind}),Bn=e=>{let t={allowNewFunction:e.allowNewFunction,checkExpr:e.checkExpr,subtreeEditable:e.subtreeEditable,language:e.language,theme:e.theme,inspectorMode:e.inspectorMode,nodeColors:e.nodeColors};return{filePath:e.filePath,workdir:e.workdir,content:e.content,nodeDefs:e.nodeDefs,allFiles:(e.allFiles??[]).map(Fn),settings:t,documentSession:e.documentSession,selection:Rn(e.selection)}},Vn=e=>{let t={};for(let n of e.usingVars)t[n.name]={name:n.name,desc:n.desc??``};return{usingVars:t,allFiles:e.allFiles?.map(Fn),importDecls:(e.importDecls??[]).map(In),subtreeDecls:(e.subtreeDecls??[]).map(In)}},Hn=acquireVsCodeApi(),Un=new Map,Wn=3e4,Gn=0,Kn=()=>{Gn=(Gn+1)%(2**53-1);let e=Gn.toString(36),t=globalThis.crypto?.randomUUID?.();return t?`req-${e}-${t}`:`req-${Date.now().toString(36)}-${e}`},qn=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.stack??e.message;try{if(e&&typeof e==`object`)return JSON.stringify(e)}catch{}return String(e)},Jn=e=>e instanceof Error?e.stack??e.message:qn(e),H=e=>{Hn.postMessage(e)},Yn=(e,t,n=Kn(),r=Wn)=>{let i=window.setTimeout(()=>{let t=Un.get(n);t?.type===e&&(Un.delete(n),t.resolve(Dn(e)))},r);return Un.set(n,{type:e,timeout:i,resolve:t}),n},Xn=(e,t,n)=>{let r=Un.get(e);if(r?.type!==t)return!1;let i=r;return Un.delete(e),window.clearTimeout(i.timeout),i.resolve(n),!0},Zn=()=>{for(let[e,t]of Un)Un.delete(e),window.clearTimeout(t.timeout),t.resolve(Dn(t.type))};An(),(()=>{let e=e=>(...t)=>{H({type:`webviewLog`,level:e,message:t.map(qn).join(` `)})};return{log:e(`log`),info:e(`info`),warn:e(`warn`),error:e(`error`),debug:e(`debug`)}})();var Qn={parseWorkdirRelativeJsonPath:Pn},$n=()=>({connect(e){let t=(e,t)=>{H({type:`webviewLog`,level:`error`,message:`[webview:${e}] ${Jn(t)}`})},n=t=>{if(On(t)){let e=kn(t,Qn);Xn(e.requestId,e.type,e.value);return}switch(t.type){case`init`:e({type:`init`,payload:Bn(t)});return;case`documentSnapshotChanged`:e({type:`documentSnapshotChanged`,snapshot:zn(t.snapshot)});return;case`relayFocusVariable`:e({type:`focusVariable`,names:t.names});return;case`relayFocusNode`:e({type:`focusNode`,target:Ln(t.target)});return;case`varDeclLoaded`:e({type:`varDeclLoaded`,payload:Vn(t)});return;case`themeChanged`:e({type:`themeChanged`,theme:t.theme});return;case`subtreeFileChanged`:e({type:`subtreeFileChanged`});return;case`inspectorContextCleared`:e({type:`inspectorContextCleared`});return;case`toggleInspectorNodeJson`:e({type:`toggleInspectorNodeJson`});return;case`settingLoaded`:e({type:`settingLoaded`,nodeDefs:t.nodeDefs,settings:t.settings});return;case`buildResult`:e({type:`buildResult`,success:t.success,message:t.message});return}},r=e=>{try{n(e.data)}catch(e){t(`message`,e)}},i=e=>{t(`error`,e.error??e.message)},a=e=>{t(`unhandledrejection`,e.reason)};return window.addEventListener(`message`,r),window.addEventListener(`error`,i),window.addEventListener(`unhandledrejection`,a),()=>{window.removeEventListener(`message`,r),window.removeEventListener(`error`,i),window.removeEventListener(`unhandledrejection`,a),Zn()}},sendReady(){H({type:`ready`})},undo(){H({type:`undo`})},redo(){H({type:`redo`})},mutateDocument(e){return new Promise(t=>{H({type:`mutateDocument`,requestId:Yn(`mutateDocument`,t),mutation:e})})},selectTree(){H({type:`selectTree`})},selectNode(e){H({type:`selectNode`,target:e})},requestFocusVariable(e){H({type:`requestFocusVariable`,names:e})},sendRequestSetting(){H({type:`requestSetting`})},sendBuild(e){H({type:`build`,buildScriptDebug:e?.buildScriptDebug})},executeInspectorHostCommand(e){H({type:`runInspectorCommand`,command:e})},validateNodeFields(e,t,n){return new Promise(r=>{H({type:`validateNodeFields`,requestId:Yn(`validateNodeFields`,r),content:e,treePath:t,nodes:n})})},resolveNodeFieldVisibility(e,t,n){return new Promise(r=>{H({type:`resolveNodeFieldVisibility`,requestId:Yn(`resolveNodeFieldVisibility`,r),content:e,treePath:t,target:n})})},saveDocument(){return new Promise(e=>{H({type:`saveDocument`,requestId:Yn(`saveDocument`,e)})})},revertDocument(){return new Promise(e=>{H({type:`revertDocument`,requestId:Yn(`revertDocument`,e)})})},readFile(e,t){return new Promise(n=>{H({type:`readFile`,requestId:Yn(`readFile`,n),path:e,openIfSubtree:t?.openIfSubtree,openSelection:t?.openSelection})})},saveSubtree(e,t){return new Promise(n=>{H({type:`saveSubtree`,requestId:Yn(`saveSubtree`,n),path:e,content:t})})},saveSubtreeAs(e,t){return new Promise(n=>{H({type:`saveSubtreeAs`,requestId:Yn(`saveSubtreeAs`,n),content:e,suggestedBaseName:t})})},log(e,t){H({type:`webviewLog`,level:e,message:t})}}),er=`2.2.0`,tr=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],nr=e=>e.startsWith(`int`),rr=e=>e.startsWith(`float`),ir=e=>e.startsWith(`string`),ar=e=>e.startsWith(`bool`),or=e=>e.startsWith(`expr`),sr=e=>e.startsWith(`json`),cr=e=>e.options!==void 0,lr=e=>{let t=e.type.toLocaleLowerCase().toString();return t.startsWith(`action`)?`Action`:t.startsWith(`composite`)?`Composite`:t.startsWith(`decorator`)?`Decorator`:t.startsWith(`condition`)?`Condition`:`Other`},ur=`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`,dr=pe(ur,10),fr=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},pr=e=>{let t=fr(e),n=``;for(let r=0;r<10;r+=1)t=Math.imul(t^t>>>16,2246822519)>>>0,t=(t^fr(`${e}:${r}`))>>>0,n+=ur[t%62];return n},mr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),hr=(e,t)=>e&&mr(e,t.name)?e[t.name]:t.default,gr=(e,t)=>e?.args?.find(e=>e.name===t)??null,_r=e=>{let t=gr(e.nodeDef,e.argName);return!V(t?hr(e.currentArgs,t):e.currentArgs?.[e.argName],t?hr(e.originalArgs,t):e.originalArgs?.[e.argName])},vr=(e,t,n)=>{let r=new Set;return Object.keys(e??{}).forEach(e=>r.add(e)),Object.keys(t??{}).forEach(e=>r.add(e)),n?.args?.forEach(e=>r.add(e.name)),[...r]},yr=(e,t,n)=>(e.desc??``)!==(t.desc??``)||!V(e.input??[],t.input??[])||!V(e.output??[],t.output??[])||!!e.debug!=!!t.debug||!!e.disabled!=!!t.disabled?!0:vr(e.args,t.args,n).some(r=>_r({argName:r,currentArgs:e.args,originalArgs:t.args,nodeDef:n})),br=e=>new Map(e.map(e=>[e.name,e])),xr=e=>{let t=new Set;for(let n of e)for(let e of n.group??[])t.add(e);return Array.from(t).sort()},U=(e,t)=>t?e.get(t)??null:null,Sr=e=>e.replace(/\.\.\.$/,``).replace(/\?/g,``),Cr=e=>!!(e&&typeof e==`object`&&!Array.isArray(e)),W=(e,t,n)=>{let r=typeof e==`string`?e:e?.name??``,i=r.includes(`?`),a=r.endsWith(`...`)&&(t&&n!==void 0?n===t.length-1:!0),o=Cr(e)&&e.checker?.trim()||void 0,s=Cr(e)&&e.visible?.trim()||void 0;return{raw:r,name:Sr(r),label:Sr(r),required:!i,variadic:a,checker:o,visible:s}},wr=e=>e.type.match(/^\w+/)[0],G=e=>e.type.includes(`[]`),K=e=>e.type.includes(`?`),Tr=e=>{let t=e.options;if(Array.isArray(t))return t},Er=(e,t)=>{if(!cr(e))return;let n=Tr(e);if(!n?.length)return;let r=n.find(e=>!e.match);return r?r.source:n.find(e=>Object.entries(e.match).every(([e,n])=>{let r=n,i=t[e];return Array.isArray(r)&&r.includes(i)}))?.source},Dr=(e,t,n)=>{let r=t;G(e)&&Array.isArray(r)&&r.length===0&&(r=void 0),r=r===void 0?``:r;let i=n??``;return r!==``&&i===``||r===``&&i!==``},Or=null;function kr(){if(!Or)throw Error(`[b3fs] Node fs not set. Extension build must call setFs(require('fs')) first.`);return Or}var Ar=e=>e.replace(/\\/g,`/`),jr=e=>{let t=Ar(e),n=/^([A-Za-z]:)(?:\/|$)/.exec(t),r=n?`${n[1]}/`:t.startsWith(`/`)?`/`:``,i=r?t.slice(r.length):t;return{root:r,absolute:!!r,parts:i.split(`/`).filter(e=>e.length>0)}},Mr=(e,t)=>{let n=[];for(let r of e)if(r!==`.`){if(r===`..`){n.length&&n[n.length-1]!==`..`?n.pop():t||n.push(r);continue}n.push(r)}return n},Nr=(e,t,n=`.`)=>e?e+t.join(`/`):t.join(`/`)||n,q=e=>{let t=jr(e),n=Mr(t.parts,t.absolute);return Nr(t.root,n)},Pr=e=>q(e),Fr=e=>jr(e).absolute,Ir=e=>{let t=jr(q(e)),n=Mr(t.parts,t.absolute);return n.pop(),Nr(t.root,n,`.`)},Lr=(e,t)=>{let n=q(e).replace(/\/+$/,``),r=n.slice(n.lastIndexOf(`/`)+1);return t&&r.endsWith(t)?r.slice(0,-t.length):r},Rr=e=>{let t=Lr(e),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n)},zr=e=>Lr(e,Rr(e)),Br=(...e)=>q(e.filter(e=>e.length>0).join(`/`)),Vr={basename:Lr,basenameWithoutExt:zr,dirname:Ir,extname:Rr,isAbsolute:Fr,join:Br,lsdir:(e,t)=>kr().readdirSync(e,{encoding:`utf8`,recursive:t}).map(t=>Pr(Br(e,t))).sort(),normalize:q,posixPath:Pr,relative:(e,t)=>{let n=jr(q(e)),r=jr(q(t));if(n.root.toLowerCase()!==r.root.toLowerCase())return q(t);let i=Mr(n.parts,n.absolute),a=Mr(r.parts,r.absolute),o=0;for(;o<i.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o);return[...s,...c].join(`/`)||``},resolve:(...e)=>{let t=``;for(let n of e)n&&(t=Fr(n)?n:Br(t,n));return q(t)}},Hr=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Ur=(e,t)=>{if(!Hr(e))throw Error(`${t} must be an object`);return e},Wr=e=>typeof e==`string`?e:void 0,Gr=(e,t)=>{if(typeof e!=`string`||!e.trim())throw Error(`${t} must be a non-empty string`);return e},Kr=e=>e===void 0?er:Gr(e,`tree file version`),qr=(e,t)=>{if(e===void 0)return[];if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((e,n)=>{if(typeof e!=`string`)throw Error(`${t}[${n}] must be a string`);return e})},Jr=(e,t)=>qr(e,t).map((e,n)=>{let r=Pn(e);if(!r)throw Error(`${t}[${n}] must be a workdir-relative .json path`);return r}),Yr=(e,t)=>{if(e===void 0)return[];if(!Array.isArray(e))throw Error(`${t} must be an array`);return e.map((e,n)=>{let r=Ur(e,`${t}[${n}]`);return{name:Gr(r.name,`${t}[${n}].name`),desc:Wr(r.desc)??``}})},Xr=(e,t)=>{if(e===void 0)return{};let n=Ur(e,t),r={};for(let[e,i]of Object.entries(n)){let n=Ur(i,`${t}.${e}`),a=n.args;if(a!==void 0&&!Hr(a))throw Error(`${t}.${e}.args must be an object`);r[e]={desc:Wr(n.desc),input:n.input===void 0?void 0:qr(n.input,`${t}.${e}.input`),output:n.output===void 0?void 0:qr(n.output,`${t}.${e}.output`),args:a?{...a}:void 0,debug:typeof n.debug==`boolean`?n.debug:void 0,disabled:typeof n.disabled==`boolean`?n.disabled:void 0}}return r},Zr=e=>{if(e===void 0)return{};let t=Ur(e,`tree file custom`),n={};for(let[e,r]of Object.entries(t)){if(typeof r==`string`||typeof r==`number`||typeof r==`boolean`){n[e]=r;continue}if(r&&typeof r==`object`){n[e]=r;continue}throw Error(`tree file custom.${e} must be a string, number, boolean, or object`)}return n},Qr=(e,t,n)=>typeof e.uuid==`string`&&e.uuid?e.uuid:typeof e.$id==`string`&&e.$id?e.$id:n?pr(`${n}:${t}`):dr(),$r=(e,t,n)=>{let r=Ur(e,t),i=r.args;if(i!==void 0&&!Hr(i))throw Error(`${t}.args must be an object`);let a=r.children;if(a!==void 0&&!Array.isArray(a))throw Error(`${t}.children must be an array`);return{uuid:Qr(r,t,n),id:r.id===void 0?``:String(r.id),name:Gr(r.name,`${t}.name`),desc:Wr(r.desc),args:i?{...i}:void 0,input:(()=>{let e=qr(r.input,`${t}.input`);return e.length>0?e:void 0})(),output:(()=>{let e=qr(r.output,`${t}.output`);return e.length>0?e:void 0})(),children:a?.map((e,r)=>$r(e,`${t}.children[${r}]`,n))??[],debug:typeof r.debug==`boolean`?r.debug:void 0,disabled:typeof r.disabled==`boolean`?r.disabled:void 0,path:(()=>{if(r.path===void 0||r.path===``)return;let e=Pn(r.path);if(!e)throw Error(`${t}.path must be a workdir-relative .json path`);return e})(),$status:typeof r.$status==`number`&&Number.isFinite(r.$status)?r.$status:void 0}},ei=(e,t)=>{let n=Ur(e,`tree file`),r=n.overrides===void 0?n.$override:n.overrides,i=n.variables,a=i===void 0?void 0:Ur(i,`tree file variables`);return{version:Kr(n.version),name:Gr(n.name,`tree file name`),prefix:Wr(n.prefix)??``,desc:Wr(n.desc),export:typeof n.export==`boolean`?n.export:void 0,group:qr(n.group,`tree file group`),variables:{imports:Jr(a?.imports??n.import,a?`tree file variables.imports`:`tree file import`),locals:Yr(a?.locals??n.vars,a?`tree file variables.locals`:`tree file vars`)},custom:Zr(n.custom),root:$r(n.root,`tree file root`,t?.stableIdSeed),overrides:Xr(r,`tree file overrides`)}},ti=(e,t)=>ei(JSON.parse(e),t),ni=(e,t,n=0)=>{let r=(e,n)=>{if(t(e,n)===!1)return!1;if(e.children){for(let t of e.children)if(r(t,n+1)===!1)return!1}};r(e,n)},ri=e=>!!e.path&&e.id!==`1`,ii=(e,t=!0)=>{let n=e,r={uuid:n.uuid||n.$id||dr(),id:e.id,name:e.name,desc:e.desc?.trim()||void 0,path:e.path,debug:e.debug||void 0,disabled:e.disabled||void 0};if(e.input){r.input=[];for(let t of e.input)r.input.push(t??``)}if(e.output){r.output=[];for(let t of e.output)r.output.push(t??``)}if(e.args){let t={};for(let n in e.args){let r=e.args[n];r!==void 0&&(t[n]=r)}Object.keys(t).length>0&&(r.args=t)}if(e.children?.length&&!ri(e)&&t){r.children=[];for(let t of e.children)r.children.push(ii(t))}return r},ai=e=>{if(!e||typeof e!=`object`)return!1;let t=e;if(!t.uuid||t.$id)return!0;if(t.children){for(let e of t.children)if(ai(e))return!0}return!1},oi=e=>JSON.parse(JSON.stringify(e)),si=e=>oi(e),ci=(e,t)=>({version:er,name:t,desc:e.desc?.trim()||void 0,prefix:e.prefix??``,export:e.export,group:e.group??[],variables:{imports:e.variables?.imports??[],locals:e.variables?.locals??[]},root:ii(e.root),custom:e.custom??{},overrides:e.overrides??{}}),li=(e,t)=>pt(ci(e,t),{indent:2}),ui=(e,t)=>ti(e,t),di=(e,t)=>{let n=ui(e,t?{stableIdSeed:t.replace(/\\/g,`/`)}:void 0);return t&&(n.name=Vr.basenameWithoutExt(t)),ci(n,n.name)},fi=e=>li(e,e.name),pi=(e,t,n=null,r=0)=>{t(e,n,r);for(let n of e.children??[])pi(n,t,e,r+1)},mi=(e,t)=>{let n=null;return pi(e,e=>{!n&&e.uuid===t&&(n=e)}),n},hi=e=>{let t=new Set;return pi(e,e=>{e.path&&t.add(e.path)}),Array.from(t)},gi=e=>{try{let t=JSON.parse(e);return t.version===void 0||ai(t.root)||t.$override!==void 0||t.import!==void 0||t.vars!==void 0}catch{return!1}},_i=async e=>{let t={},n=new Set,r=async i=>{let a=Pn(i);if(!a||n.has(a))return;n.add(a);let o=await e.readContent(a);if(o===null){t[a]=null;return}try{let n=gi(o),i=di(o,a);t[a]=i,await e.onTreeLoaded?.({path:a,tree:i,content:o,needsWriteback:n});for(let e of hi(i.root))await r(e)}catch{t[a]={error:`invalid-subtree`}}};for(let t of hi(e.root))await r(t);return t},vi=(e,t)=>{let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e+=1){let t=n[e]??0,i=r[e]??0;if(t>i)return 1;if(t<i)return-1}return 0},yi=e=>{e.setState(e=>({...e,alertReload:!1,pendingExternalContent:null}))},bi=(e,t)=>{e.setState(e=>({...e,dirty:t.dirty,alertReload:t.alertReload,pendingExternalContent:t.pendingExternalContent}))},xi=()=>({persistedTree:null,dirty:!1,alertReload:!1,pendingExternalContent:null}),Si=()=>he(()=>xi()),Ci=e=>!!(e&&Object.keys(e).length>0),wi=e=>/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(e)&&!tr.includes(e),Ti=e=>e.split(/[^a-zA-Z0-9_.'"]/).map(e=>e.split(`.`)[0]).filter(e=>wi(e)),Ei=(e,t,n)=>{if(!e)return null;if(!wi(e))return{code:`invalid-variable-name`,field:n,variable:e};let r=Ci(t)?t:null;return r&&!r[e]?{code:`undefined-variable`,field:n,variable:e}:null},Di=(e,t,n)=>{let r=Ci(t)?t:null;for(let t of e)if(t){for(let e of Ti(t))if(r&&!r[e])return{code:`undefined-variable`,field:`args`,variable:e};if(n)try{if(!new _e(t).dryRun())return{code:`invalid-expression`,field:`args`,expression:t}}catch{return{code:`invalid-expression`,field:`args`,expression:t}}}return null},Oi=e=>e.desc||e.name,ki=(e,t)=>!e.oneof||!t?.length?-1:t.findIndex((n,r)=>W(n,t,r).label===e.oneof),Ai=(e,t,n)=>{let r=W(e?.[n]??``,e,n);return!r.variadic&&r.required&&!(t?.[n]??``)},ji=(e,t)=>K(e)?!1:ar(e.type)?t==null||t===`__unset__`:G(e)?!Array.isArray(t)||t.length===0:t==null?!0:typeof t==`string`?t.trim().length===0:!1,Mi=(e,t,n)=>({code:`invalid-arg-value`,argName:e.name,label:Oi(e),expected:t,value:n}),Ni=e=>({code:`unknown-arg-type`,argName:e.name,label:Oi(e),type:e.type}),Pi=(e,t)=>({code:`invalid-arg-option`,argName:e.name,label:Oi(e),value:t}),Fi=(e,t)=>{if(!K(e))return!1;if(t===void 0)return!0;let n=wr(e);return t===``&&(ir(n)||or(n)||sr(n))},Ii=(e,t,n,r)=>{if(Fi(e,t))return[];let i=[],a=wr(e);if(rr(a)?typeof t==`number`&&Number.isFinite(t)||i.push(Mi(e,`number`,t)):nr(a)?Number.isInteger(t)||i.push(Mi(e,`integer`,t)):ir(a)?typeof t!=`string`&&i.push(Mi(e,`string`,t)):or(a)?typeof t!=`string`&&i.push(Mi(e,`expr`,t)):sr(a)?(t===void 0||t===``)&&i.push(Mi(e,`json`,t)):ar(a)?typeof t!=`boolean`&&i.push(Mi(e,`boolean`,t)):i.push(Ni(e)),r&&cr(e)){let r=!!Er(e,n)?.find(e=>e.value===t),a=t===void 0&&K(e);r||a||i.push(Pi(e,t))}return i},Li=e=>{let{arg:t,value:n,args:r={},validateOptions:i=!0}=e;return ji(t,n)?[{code:`required-arg`,argName:t.name,label:Oi(t)}]:G(t)?n===void 0||Array.isArray(n)&&n.length===0?[]:Array.isArray(n)?n.flatMap(e=>Ii(t,e,r,i)):[Mi(t,`array`,n)]:Ii(t,n,r,i)},Ri=e=>{let{arg:t,argValue:n,inputValues:r,inputDefs:i}=e;if(!t.oneof)return null;let a=ki(t,i);return a<0?{code:`missing-oneof-input`,argName:t.name,inputLabel:t.oneof}:Dr(t,n,r?.[a])?null:{code:`oneof-conflict`,argName:t.name,inputLabel:t.oneof}},zi=e=>{let{node:t,def:n,usingVars:r,usingGroups:i,checkExpr:a}=e,o=[];if(t.resolutionError)return o;if(!n)return o.push({code:`missing-node-def`,nodeName:t.name}),o;if(n.group){let e=Array.isArray(n.group)?n.group:[n.group];e.some(e=>i?.[e])||o.push({code:`group-not-enabled`,nodeName:t.name,groups:e})}for(let e of t.input??[]){let t=Ei(e,r,`input`);t&&o.push(t)}for(let e of t.output??[]){let t=Ei(e,r,`output`);t&&o.push(t)}for(let e of n.args??[]){let i=t.args?.[e.name],s=ji(e,i);s&&o.push({code:`required-arg`,argName:e.name,label:Oi(e)});let c=Ri({arg:e,argValue:i,inputValues:t.input,inputDefs:n.input});if(c&&o.push(c),s||!or(e.type)||!i)continue;let l=Di((Array.isArray(i)?i:[i]).filter(e=>typeof e==`string`),r,a);l&&o.push(l)}if(n.children!==void 0&&n.children!==-1){let e=t.children?.filter(e=>!e.disabled).length??0;e!==n.children&&o.push({code:`invalid-children`,expected:n.children,actual:e})}for(let e=0;e<(n.input?.length??0);e+=1){let r=W(n.input?.[e]??``,n.input,e);if(r.variadic)break;Ai(n.input,t.input,e)&&o.push({code:`required-input`,index:e,label:r.label})}for(let e=0;e<(n.output?.length??0);e+=1){let r=W(n.output?.[e]??``,n.output,e);if(r.variadic)break;Ai(n.output,t.output,e)&&o.push({code:`required-output`,index:e,label:r.label})}return o},Bi={Composite:`#34d800`,Decorator:`#b2eb35`,Condition:`#f72585`,Action:`#1769dd`,Other:`#707070`,Error:`#ff0000`},Vi=e=>ct(e),Hi=(e,t,n)=>n?e.includes(t):e.toLowerCase().includes(t.toLowerCase()),Ui=(e,t)=>e?.trim()||t?.trim()||void 0,Wi=(e,t)=>!e.subtreeNode||!e.subtreeOriginal?!1:yr(e,e.subtreeOriginal,t),Gi=(e,t,n,r)=>{let i=br(t),a=[],o=[];for(let t of e.nodeOrder){let s=e.nodesByInstanceKey[t],c=U(i,s.name),l=r?.nodeFieldDiagnostics?.[s.ref.instanceKey]??[],u=zi({node:s,def:c,usingVars:r?.usingVars??null,usingGroups:r?.usingGroups??null,checkExpr:r?.checkExpr??!1}).length>0||l.length>0,d=s.resolutionError||u?`Error`:c?lr(c):`Error`,f=d===`Error`?n?.[d]??Bi[d]:c?.color?.trim()||n?.[d]||Bi[d];a.push({ref:s.ref,parentKey:s.parentKey,childKeys:s.childKeys,depth:s.depth,renderedIdLabel:s.renderedIdLabel,title:s.name,subtitle:Ui(s.desc,c?.desc),typeLabel:c?.type??(s.resolutionError?I.t(`node.resolutionError`):I.t(`node.unknownType`)),icon:c?.icon,nodeStyleKind:d,accentColor:f,debug:!!s.debug,disabled:!!s.disabled,hasOverride:Wi(s,c),subtreeNode:s.subtreeNode,subtreePath:s.path,statusBits:(s.$status??0)&7,inputs:(s.input??[]).map(e=>({label:e,variable:e||void 0})),outputs:(s.output??[]).map(e=>({label:e,variable:e||void 0})),argsText:s.args&&Object.keys(s.args).length>0?st(s.args):void 0});for(let e of s.childKeys)o.push({key:`${t}->${e}`,sourceKey:t,targetKey:e})}return{rootKey:e.rootKey,nodes:a,edges:o}},Ki=(e,t,n)=>{let r=br(t),i={};if(n.length===0)return{activeVariableNames:[],variableHits:{}};for(let t of e.nodeOrder){let a=e.nodesByInstanceKey[t],o=[];(a.input??[]).some(e=>e&&n.includes(e))&&o.push(`input`),(a.output??[]).some(e=>e&&n.includes(e))&&o.push(`output`);let s=U(r,a.name);for(let e of s?.args??[]){if(!or(e.type))continue;let t=a.args?.[e.name];if((Array.isArray(t)?t:[t]).some(e=>typeof e==`string`&&Ti(e).some(e=>n.includes(e)))){o.push(`args`);break}}o.length>0&&(i[t]=o)}return{activeVariableNames:[...n],variableHits:i}},qi=(e,t,n)=>{if(!n||!t.query)return{...t,resultKeys:[],activeResultIndex:0};let r=[];for(let n of e.nodeOrder){let i=e.nodesByInstanceKey[n],a=!1;a=t.mode===`id`?i.ref.displayId===t.query:[i.name,i.desc??``,i.path??``,...i.input??[],...i.output??[],...Object.values(i.args??{}).flatMap(e=>Array.isArray(e)?e.map(Vi):[Vi(e)])].some(e=>Hi(e,t.query,t.caseSensitive)),a&&r.push(n)}return{...t,resultKeys:r,activeResultIndex:r.length===0?0:Math.min(t.activeResultIndex,r.length-1)}},Ji=e=>e.graph?qi(e.graph,{query:e.query,mode:e.mode,caseSensitive:e.caseSensitive,focusOnly:e.focusOnly,resultKeys:[],activeResultIndex:e.activeResultIndex},e.tree):{query:e.query,mode:e.mode,caseSensitive:e.caseSensitive,focusOnly:e.focusOnly,resultKeys:[],activeResultIndex:0},J=function(e){return e[e.SUCCESS=2]=`SUCCESS`,e[e.FAILURE=1]=`FAILURE`,e[e.RUNNING=0]=`RUNNING`,e[e.SUCCESS_ZERO=5]=`SUCCESS_ZERO`,e[e.FAILURE_ZERO=4]=`FAILURE_ZERO`,e}(J||{}),Yi=(e,t)=>{t&&(t.desc!==void 0&&(e.desc=t.desc),t.input!==void 0&&(e.input=t.input),t.output!==void 0&&(e.output=t.output),t.args!==void 0&&(e.args={...e.args??{},...t.args}),t.debug!==void 0&&(e.debug=t.debug),t.disabled!==void 0&&(e.disabled=t.disabled))},Xi=(e,t)=>{if(t?.args?.length){e.args||={};for(let n of t.args)e.args[n.name]===void 0&&n.default!==void 0&&(e.args[n.name]=n.default)}},Zi=(e,t,n)=>{let r=si(e);for(let n of[...t].reverse())Yi(r,n.overrides[e.uuid]);let i=si(r);return Yi(r,n[e.uuid]),{value:r,subtreeOriginal:i}},Qi=e=>!!(e&&typeof e==`object`&&`error`in e),$i=(e,t)=>{let n=0;return t.get(e)?.status?.forEach(e=>{switch(e){case`success`:n|=1<<J.SUCCESS;break;case`failure`:n|=1<<J.FAILURE;break;case`running`:n|=1<<J.RUNNING;break}}),n},ea=(e,t)=>{let n=t>>J.SUCCESS&1,r=t>>J.FAILURE&1;return n===0&&(e|=1<<J.SUCCESS_ZERO),r===0&&(e|=1<<J.FAILURE_ZERO),e|=t,e},ta=(e,t,n,r)=>{let i=r.get(t);if(!i?.status?.length)return e|n;let a=n>>J.SUCCESS&1,o=n>>J.FAILURE&1,s=n>>J.RUNNING&1,c=n>>J.SUCCESS_ZERO&1,l=n>>J.FAILURE_ZERO&1;return i.status.forEach(t=>{switch(t){case`!success`:e|=o<<J.SUCCESS;break;case`!failure`:e|=a<<J.FAILURE;break;case`|success`:e|=a<<J.SUCCESS;break;case`|failure`:e|=o<<J.FAILURE;break;case`|running`:e|=s<<J.RUNNING;break;case`&success`:c?e&=~(1<<J.SUCCESS):e|=a<<J.SUCCESS;break;case`&failure`:l?e&=~(1<<J.FAILURE):e|=o<<J.FAILURE;break}}),e},na=(e,t,n)=>{let r=$i(e,n);if(t.length===0)return r;let i=0;for(let e of t)e!==void 0&&(i=ea(i,e));return ta(r,e,i,n)},ra=e=>{let t=br(e.nodeDefs),n=(r,i)=>{let a=r.path?Pn(r.path):void 0,o=a?i.subtreeStack.includes(a):!1,s=a&&!o?e.subtreeSources[a]:void 0,c=s&&!Qi(s)?s:null,l=!!(a&&c),u=r,d,f=i.sourceTreePath,p,m=i.overrideSourceChain;if(r.path&&!a)d=`invalid-subtree`;else if(a&&o)d=`cyclic-subtree`;else if(Qi(s))d=`invalid-subtree`;else if(a&&!c)d=`missing-subtree`;else if(l&&c){let t=a;if(!t)throw Error(`unreachable subtree path state`);u=si(c.root),u.path=t,f=t,m=[...i.overrideSourceChain,c];let n=Zi(u,m,e.persistedTree.overrides);u=n.value,p=n.subtreeOriginal}else if(i.sourceTreePath){f=i.sourceTreePath;let t=Zi(u,i.overrideSourceChain,e.persistedTree.overrides);u=t.value,p=t.subtreeOriginal}else u=si(u);let h=t.get(u.name)??null;Xi(u,h),p&&Xi(p,h);let g=l&&c?{subtreeStack:[...i.subtreeStack,a],overrideSourceChain:[...i.overrideSourceChain,c],sourceTreePath:a,insideExternalSubtree:!0}:i.sourceTreePath?{subtreeStack:[...i.subtreeStack],overrideSourceChain:m,sourceTreePath:i.sourceTreePath,insideExternalSubtree:!0}:{subtreeStack:[],overrideSourceChain:[],sourceTreePath:null,insideExternalSubtree:!1},_=(l&&c?c.root.children??[]:d||a&&!c?[]:u.children??[]).map(e=>n(e,g));return u.children=_.map(e=>e.data),u.$status=na(u.name,_.filter(e=>!e.data.disabled).map(e=>e.data.$status),t),{data:u,children:_,structuralStableId:r.uuid,sourceStableId:u.uuid,sourceTreePath:f??null,subtreeStack:l?[...i.subtreeStack,a]:[...i.subtreeStack],subtreeNode:i.insideExternalSubtree,subtreeEditable:!i.insideExternalSubtree||e.subtreeEditable,subtreeOriginal:p,resolutionError:d}};return n(e.persistedTree.root,{subtreeStack:[],overrideSourceChain:[],sourceTreePath:null,insideExternalSubtree:!1})},ia=(e,t)=>{let n={},r=[],i={},a=1,o=(e,s,c)=>{let l=String(a);a+=1;let u=l,d=e.children.map(e=>o(e,u,c+1));return e.subtreeNode||(i[e.structuralStableId]=l),n[u]={ref:{instanceKey:u,displayId:l,structuralStableId:e.structuralStableId,sourceStableId:e.sourceStableId,sourceTreePath:e.sourceTreePath,subtreeStack:[...e.subtreeStack]},parentKey:s,childKeys:d,depth:c,renderedIdLabel:`${t}${l}`,name:e.data.name,desc:e.data.desc,args:e.data.args,input:e.data.input,output:e.data.output,children:e.data.children,debug:e.data.debug,disabled:e.data.disabled,path:e.data.path,$status:e.data.$status,subtreeNode:e.subtreeNode,subtreeEditable:e.subtreeEditable,subtreeOriginal:e.subtreeOriginal,resolutionError:e.resolutionError},r.push(u),u};return{graph:{rootKey:o(e,null,0),nodesByInstanceKey:n,nodeOrder:r},mainTreeDisplayIdsByStableId:i}},aa=e=>ia(ra({persistedTree:e.persistedTree,subtreeSources:e.subtreeSources,nodeDefs:e.nodeDefs,subtreeEditable:e.subtreeEditable}),e.persistedTree.prefix??``),oa=()=>({open:!1,mode:`content`,query:``,caseSensitive:!1,focusOnly:!0,results:[],index:0}),sa=(e,t)=>{e.setState(e=>({...e,search:{...e.search,...t}}))},ca=e=>{e.setState(e=>({...e,search:oa()}))},la=()=>({activeVariableNames:[],selectionVisualHint:null,search:oa()}),ua=()=>he(()=>la()),da=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),fa=e=>{if(e.length===0)return null;let t={};for(let n of e)t[n]=!0;return t},pa=e=>{let t=null,n=0,r=0,i=null,a=null,o=t=>{e.appHooks.getMessage().error(t)},s=t=>{e.appHooks.getMessage().success(t)},c=t=>U(br(e.workspaceStore.getState().nodeDefs),t),l=t=>{e.selectionStore.setState(e=>({...e,...t(e)}))},u=t=>{e.graphUiStore.setState(e=>({...e,...t(e)}))},d=()=>{let t=e.workspaceStore.getState().filePath;return{selectedTree:t?{filePath:t}:null,selectedNodeKey:null,selectedNodeRef:null,selectedNodeSnapshot:null}},f=n=>{let r=e.documentStore.getState().persistedTree;if(!r||!t)return null;let i=t.nodesByInstanceKey[n];if(!i)return null;let a=i.ref.sourceTreePath===null&&!i.subtreeNode?mi(r.root,i.ref.structuralStableId):null,o=i.subtreeNode?se(i.args):a?.args?se(a.args):void 0;return{ref:i.ref,data:{uuid:i.ref.sourceStableId,id:i.ref.displayId,name:i.name,desc:i.desc,args:o,input:i.input,output:i.output,debug:i.debug,disabled:i.disabled,path:i.path},effectiveArgs:i.args?oi(i.args):void 0,prefix:r.prefix,activeChildCount:i.childKeys.reduce((e,n)=>{let r=t?.nodesByInstanceKey[n];return e+(r&&!r.disabled?1:0)},0),disabled:!i.subtreeEditable,subtreeNode:i.subtreeNode,subtreeEditable:i.subtreeEditable,subtreeOriginal:i.subtreeOriginal,resolutionError:i.resolutionError}},p=e=>{if(!t)return null;let n=t.nodesByInstanceKey[e];return n?{selectedTree:null,selectedNodeKey:n.ref.instanceKey,selectedNodeRef:n.ref,selectedNodeSnapshot:f(n.ref.instanceKey)}:null},m=e=>({selectedTree:null,selectedNodeKey:null,selectedNodeRef:e,selectedNodeSnapshot:null}),h=(e,t)=>e.sourceTreePath===t.sourceTreePath&&da(e.subtreeStack,t.subtreeStack),g=e=>{if(!t)return null;let n=t.nodesByInstanceKey[e.instanceKey];if(n&&n.ref.structuralStableId===e.structuralStableId&&n.ref.sourceStableId===e.sourceStableId&&h(n.ref,e))return n;let r=Object.values(t.nodesByInstanceKey);return r.find(t=>t.ref.structuralStableId===e.structuralStableId&&t.ref.sourceStableId===e.sourceStableId&&h(t.ref,e))||r.find(t=>t.ref.sourceStableId===e.sourceStableId&&h(t.ref,e))||r.find(t=>t.ref.structuralStableId===e.structuralStableId&&h(t.ref,e))||(e.sourceTreePath===null&&e.subtreeStack.length===0?r.find(t=>t.ref.structuralStableId===e.structuralStableId)??null:null)},_=e=>{let t=g(e);return t?p(t.ref.instanceKey)??{}:m(e)},v=()=>e.graphUiStore.getState().activeVariableNames.length===0?!1:(u(()=>({activeVariableNames:[]})),!0),y=()=>{l(()=>d()),e.workspaceStore.setState(e=>({...e,selectedNodeFieldVisibility:ce()}))},b=()=>{u(e=>e.selectionVisualHint?{selectionVisualHint:null}:{})},x=()=>e.graphUiStore.getState().selectionVisualHint??{selectedNodeKey:e.selectionStore.getState().selectedNodeKey},S=async t=>{u(()=>({selectionVisualHint:{selectedNodeKey:t}})),await e.graphAdapter.applySelection({selectedNodeKey:t})},C=e=>{i=e},w=()=>{let e=i;return i=null,e},T=()=>{e.graphUiStore.setState(()=>la())},E=async()=>{if(!a||!t)return!1;let n=g(a);return n?(a=null,await e.graphAdapter.focusNode(n.ref.instanceKey),!0):!1},D=t=>{if(b(),t.kind===`tree`){y();return}l(()=>m(t.ref)),e.workspaceStore.setState(e=>({...e,selectedNodeFieldVisibility:ce()}))},ee=e=>{if(b(),e.kind===`tree`){y();return}l(()=>_(e.ref)),de()},te=async e=>{a=e,await E()},O=()=>{let n=e.selectionStore.getState().selectedNodeRef;return!n||!t?null:t.nodesByInstanceKey[n.instanceKey]??null},ne=e=>!!(e?.subtreeNode||e?.path),re=e=>{if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`invalid clipboard node`);let t=e;if(typeof t.name!=`string`||!t.name.trim())throw Error(`invalid clipboard node`);let n={uuid:typeof t.uuid==`string`&&t.uuid?t.uuid:typeof t.$id==`string`&&t.$id?t.$id:dr(),id:typeof t.id==`string`?t.id:``,name:t.name,desc:typeof t.desc==`string`?t.desc:void 0,args:t.args&&typeof t.args==`object`&&!Array.isArray(t.args)?oi(t.args):void 0,input:Array.isArray(t.input)?t.input.map(e=>String(e??``)):void 0,output:Array.isArray(t.output)?t.output.map(e=>String(e??``)):void 0,children:Array.isArray(t.children)?t.children.map(e=>re(e)):void 0,debug:typeof t.debug==`boolean`?t.debug:void 0,disabled:typeof t.disabled==`boolean`?t.disabled:void 0,path:typeof t.path==`string`&&t.path.trim()?Pn(t.path)??void 0:void 0};return n.path&&(n.children=void 0),n},ie=async()=>{try{let e=await navigator.clipboard.readText();return e.trim()?re(JSON.parse(e)):null}catch(t){return e.hostAdapter.log(`warn`,`[v2] clipboard read failed: ${String(t)}`),o(I.t(`node.pasteDataError`)),null}},ae=(e,n)=>{if(!t)return!1;let r=t.nodesByInstanceKey[n];for(;r?.parentKey;){if(r.parentKey===e)return!0;r=t.nodesByInstanceKey[r.parentKey]}return!1},oe=(e,n)=>{let r=(e,i)=>{if(!t)return null;let a=t.nodesByInstanceKey[e];if(!a)return null;let o={uuid:i?a.ref.structuralStableId:a.ref.sourceStableId,id:a.ref.displayId,name:a.name,desc:a.desc,args:a.args?oi(a.args):void 0,input:a.input?[...a.input]:void 0,output:a.output?[...a.output]:void 0,debug:a.debug,disabled:a.disabled,path:i&&n?.clearPathOnRoot?void 0:a.path,children:void 0};return a.childKeys.length>0&&(o.children=a.childKeys.map(e=>r(e,!1)).filter(e=>!!e)),o};return r(e,!0)},k=()=>{let t=e.documentStore.getState().persistedTree;return t?fi(t):null},se=e=>e?oi(e):void 0,ce=()=>({args:{},input:{},output:{}}),le=()=>{let e=O();return e?{treePath:e.ref.sourceTreePath,node:{uuid:e.ref.sourceStableId,id:e.renderedIdLabel,name:e.name,desc:e.desc,args:se(e.args),input:e.input?[...e.input]:void 0,output:e.output?[...e.output]:void 0,debug:e.debug,disabled:e.disabled,path:e.path,children:[]}}:null},ue=(e,t)=>{let n=br(t),r=[];for(let t of e.nodeOrder){let i=e.nodesByInstanceKey[t],a=U(n,i.name);(a?.args?.some(e=>e.checker?.trim())||a?.input?.some((e,t)=>!!W(e,a.input,t).checker)||a?.output?.some((e,t)=>!!W(e,a.output,t).checker))&&r.push({instanceKey:i.ref.instanceKey,treePath:i.ref.sourceTreePath,node:{uuid:i.ref.sourceStableId,id:i.renderedIdLabel,name:i.name,desc:i.desc,args:se(i.args),input:i.input?[...i.input]:void 0,output:i.output?[...i.output]:void 0,debug:i.debug,disabled:i.disabled,path:i.path,children:[]}})}return r},A=async(t,r)=>{let i=k(),a=r.filePath,o=ue(t,r.nodeDefs),s=++n;if(!i||!a||o.length===0)return e.workspaceStore.setState(e=>({...e,nodeFieldDiagnostics:{}})),{};let c=await e.hostAdapter.validateNodeFields(i,a,o);if(s!==n)return e.workspaceStore.getState().nodeFieldDiagnostics;c.error&&e.hostAdapter.log(`warn`,`[v2] node check validation failed: ${c.error}`);let l={};for(let e of c.diagnostics)(l[e.instanceKey]||=[]).push(e);return e.workspaceStore.setState(e=>({...e,nodeFieldDiagnostics:l})),l},de=async()=>{if(!e.hostAdapter.resolveNodeFieldVisibility)return ce();let t=k(),n=e.workspaceStore.getState().filePath,i=le(),a=++r;if(!t||!n||!i)return e.workspaceStore.setState(e=>({...e,selectedNodeFieldVisibility:ce()})),ce();let o=await e.hostAdapter.resolveNodeFieldVisibility(t,n,i);return a===r?(o.error&&e.hostAdapter.log(`warn`,`[v2] node field visibility failed: ${o.error}`),e.workspaceStore.setState(e=>({...e,selectedNodeFieldVisibility:o.visibility})),o.visibility):e.workspaceStore.getState().selectedNodeFieldVisibility},j=t=>{let n=e.workspaceStore.getState().filePath||void 0;try{return fi(di(t,n))}catch{return null}},fe=e=>{let t=k();return t?j(e)===t:!1},M=async()=>{if(!t)return;e.selectionStore.getState();let n=e.graphUiStore.getState(),r=e.workspaceStore.getState();await e.graphAdapter.applySelection(x());let i=Ki(t,r.nodeDefs,n.activeVariableNames);await e.graphAdapter.applyHighlights(i);let a=Ji({graph:t,query:n.search.query,mode:n.search.mode,caseSensitive:n.search.caseSensitive,focusOnly:n.search.focusOnly,activeResultIndex:n.search.index,tree:e.documentStore.getState().persistedTree});sa(e.graphUiStore,{results:a.resultKeys,index:a.activeResultIndex}),await e.graphAdapter.applySearch(a)},pe=async()=>{let n=e.selectionStore.getState();if(!t||!n.selectedNodeRef){await e.graphAdapter.applySelection({selectedNodeKey:null});return}let r=g(n.selectedNodeRef);if(!r){l(()=>_(n.selectedNodeRef)),await e.graphAdapter.applySelection({selectedNodeKey:null});return}l(()=>p(r.ref.instanceKey)??{}),await e.graphAdapter.applySelection({selectedNodeKey:r.ref.instanceKey})},me=async n=>{let r=e.documentStore.getState().persistedTree,i=e.workspaceStore.getState();if(!r)return;let a=aa({persistedTree:r,subtreeSources:i.subtreeSources,nodeDefs:i.nodeDefs,subtreeEditable:i.settings.subtreeEditable});t=a.graph;let o=await A(a.graph,i),s=w();await e.graphAdapter.render(Gi(a.graph,i.nodeDefs,i.settings.nodeColors,{usingVars:i.usingVars,usingGroups:i.usingGroups,checkExpr:i.settings.checkExpr,nodeFieldDiagnostics:o}),s?{anchorNodeKey:s}:void 0),n?.preserveSelection?await pe():await e.graphAdapter.applySelection({selectedNodeKey:e.selectionStore.getState().selectedNodeKey}),await M(),await de(),await E()},he=async()=>{let t=e.documentStore.getState().persistedTree;if(!t)return;let n=await _i({root:t.root,readContent:async t=>(await e.hostAdapter.readFile(t)).content});e.workspaceStore.setState(e=>({...e,subtreeSources:n}))},ge=t=>{e.documentStore.setState(e=>({...e,persistedTree:t})),e.workspaceStore.setState(e=>({...e,usingGroups:fa(t.group)}))};return{deps:e,getResolvedGraph:()=>t,notifyError:o,notifySuccess:s,getNodeDef:c,clearActiveVariableFocus:v,getCurrentGraphSelectionKey:()=>x().selectedNodeKey,showSelectionVisualHint:S,setNextGraphRenderAnchor:C,resetGraphUiState:T,stageHostSelectionState:D,applyHostSelectionState:ee,revealNode:te,getSelectedResolvedNode:O,isSubtreeStructureLocked:ne,readClipboardNode:ie,isDescendantInstance:ae,buildPersistedNodeFromResolved:oe,applyVisualState:M,rebuildGraph:me,syncReachableSubtreeSources:he,getSerializedCurrentTree:k,matchesCurrentDocumentSnapshot:fe,applyDocumentTree:async(e,t)=>{if(ge(e),t?.syncSubtreeSources!==!1&&await he(),t?.rebuildGraph!==!1){await me({preserveSelection:t?.preserveSelection??!0});return}t?.applyVisualState&&await M()}}},ma=e=>{let{deps:t}=e;return{async initFromHost(n){let r=di(n.content,n.filePath);t.workspaceStore.setState(e=>({...e,filePath:n.filePath,workdir:n.workdir,nodeDefs:n.nodeDefs,groupDefs:xr(n.nodeDefs),allFiles:n.allFiles,settings:n.settings,usingGroups:fa(r.group)})),e.resetGraphUiState(),e.stageHostSelectionState(n.selection),await e.applyDocumentTree(r,{preserveSelection:!0}),bi(t.documentStore,n.documentSession)},async applyDocumentSnapshot(n){bi(t.documentStore,n.documentSession);let r=e.matchesCurrentDocumentSnapshot(n.content);if(!r&&n.syncKind===`reload`&&e.resetGraphUiState(),r){e.applyHostSelectionState(n.selection),await e.applyVisualState();return}e.stageHostSelectionState(n.selection);let i=t.workspaceStore.getState().filePath||void 0,a=di(n.content,i);await e.applyDocumentTree(a,{preserveSelection:!0})},async applyNodeDefs(n){t.workspaceStore.setState(e=>({...e,nodeDefs:n,groupDefs:xr(n)})),await e.rebuildGraph({preserveSelection:!0})},async applyHostVars(n){let r=t.workspaceStore.getState(),i=n.allFiles??r.allFiles,a=!V(r.usingVars,n.usingVars),o=!V(r.allFiles,i),s=!V(r.importDecls,n.importDecls),c=!V(r.subtreeDecls,n.subtreeDecls);!a&&!o&&!s&&!c||(t.workspaceStore.setState(e=>({...e,usingVars:n.usingVars,allFiles:n.allFiles??e.allFiles,importDecls:n.importDecls,subtreeDecls:n.subtreeDecls})),a&&await e.rebuildGraph({preserveSelection:!0}))},async markSubtreeChanged(){await e.syncReachableSubtreeSources(),await e.rebuildGraph({preserveSelection:!0})},async dismissReloadConflict(){yi(t.documentStore)},async undo(){t.hostAdapter.undo()},async redo(){t.hostAdapter.redo()},async refreshGraph(t){await e.rebuildGraph({preserveSelection:t?.preserveSelection??!0})},async saveDocument(){let n=t.documentStore.getState().persistedTree;if(!n)return;if(vi(n.version,`2.2.0`)>0){t.hostAdapter.log(`warn`,`[v2] refusing to save newer file version: ${n.version}`);return}let r=await t.hostAdapter.saveDocument();r.success||e.notifyError(r.error??`Save failed`)},async revertDocument(){let n=await t.hostAdapter.revertDocument();n.success||e.notifyError(n.error??`Revert failed`)},async buildDocument(e){t.hostAdapter.sendBuild(e)}}},ha=e=>{let{hasDocument:t,intent:n,source:r,target:i,isDescendant:a}=e;return!t||!r||!i?{allowed:!1,reason:`missing-context`}:r.ref.instanceKey===i.ref.instanceKey?{allowed:!1,reason:`same-node`}:r.subtreeNode?{allowed:!1,reason:`move-subtree-denied`}:i.subtreeNode?{allowed:!1,reason:`drop-subtree-internal-denied`}:r.parentKey===null?{allowed:!1,reason:`move-root-denied`}:(n.position===`before`||n.position===`after`)&&i.parentKey===null?{allowed:!1,reason:`drop-around-root-denied`}:n.position===`child`&&i.ref.sourceTreePath!==null&&!i.subtreeNode?{allowed:!1,reason:`add-child-to-subtree-ref-denied`}:a(r.ref.instanceKey,i.ref.instanceKey)?{allowed:!1,reason:`move-into-descendant-denied`}:{allowed:!0}},ga=async(e,t)=>{let n=await e.deps.hostAdapter.mutateDocument(t);return n.success||e.notifyError(n.error??`Document mutation failed`),n},_a=(e,t)=>{let n=e.deps.selectionStore.getState().selectedNodeSnapshot,r=n?{data:si(n.data),subtreeNode:n.subtreeNode,subtreeOriginal:n.subtreeOriginal?si(n.subtreeOriginal):void 0}:t.currentNodeSnapshot,i=r?.data.path&&!t.data.path?e.buildPersistedNodeFromResolved(t.target.instanceKey,{clearPathOnRoot:!0})??void 0:t.detachedSubtreeRoot;return{...t,currentNodeSnapshot:r,detachedSubtreeRoot:i}},va=(e,t)=>e.getResolvedGraph()?.nodesByInstanceKey[t]??null,ya=e=>({instanceKey:e.sourceStableId,displayId:``,structuralStableId:e.sourceStableId,sourceStableId:e.sourceStableId,sourceTreePath:null,subtreeStack:[]}),ba=(e,t)=>{let n=t.parentKey;if(!n)return null;let r=[...(e.getResolvedGraph()?.nodesByInstanceKey[n]?.childKeys??[]).filter(e=>e!==t.ref.instanceKey),n];return e.deps.graphAdapter.pickNearestNodeAnchor?.(t.ref.instanceKey,r)??n},xa=e=>{switch(e){case`move-subtree-denied`:return I.t(`node.moveSubtreeDenied`);case`drop-subtree-internal-denied`:return I.t(`node.dropSubtreeInternalDenied`);case`move-root-denied`:return I.t(`node.moveRootDenied`);case`drop-around-root-denied`:return I.t(`node.dropAroundRootDenied`);case`add-child-to-subtree-ref-denied`:return I.t(`node.addChildToSubtreeRefDenied`);case`move-into-descendant-denied`:return I.t(`node.moveIntoDescendantDenied`);case`missing-context`:case`same-node`:return null}},Sa=(e,t)=>{let n=e.deps.documentStore.getState().persistedTree,r=va(e,t.source.instanceKey),i=va(e,t.target.instanceKey),a=ha({hasDocument:!!n,intent:t,source:r,target:i,isDescendant:(t,n)=>e.isDescendantInstance(t,n)});if(!a.allowed){let e=xa(a.reason);if(e)throw Error(e);return!1}return!0},Ca=e=>{let{deps:t}=e,n=async(n,r)=>{let i=Pn(n);if(!i){e.notifyError(I.t(`validation.invalidJsonPath`,{path:n}));return}(await t.hostAdapter.readFile(i,{openIfSubtree:!0,openSelection:r?.openSelection})).content===null&&e.notifyError(I.t(`node.subtreeOpenFailed`,{path:i}))};return{async updateTreeMeta(n){t.documentStore.getState().persistedTree&&await ga(e,{type:`updateTreeMeta`,payload:n})},async updateNode(n){t.documentStore.getState().persistedTree&&await ga(e,{type:`updateNode`,payload:_a(e,n)})},async performDrop(t){if(Sa(e,t)){e.setNextGraphRenderAnchor(t.target.instanceKey);try{(await ga(e,{type:`performDrop`,payload:t})).success||e.setNextGraphRenderAnchor(null)}catch(t){throw e.setNextGraphRenderAnchor(null),t}}},async copyNode(){let n=e.getSelectedResolvedNode();if(!n){e.notifyError(I.t(`node.noNodeSelected`));return}let r=e.buildPersistedNodeFromResolved(n.ref.instanceKey,{clearPathOnRoot:!0});if(r)try{await navigator.clipboard.writeText(pt(r,{indent:2}))}catch(e){t.hostAdapter.log(`warn`,`[v2] clipboard write failed: ${String(e)}`)}},async pasteNode(){let t=e.getSelectedResolvedNode();if(!t){e.notifyError(I.t(`node.noNodeSelected`));return}if(e.isSubtreeStructureLocked(t)){e.notifyError(I.t(`node.editSubtreeDenied`));return}let n=await e.readClipboardNode();n&&await ga(e,{type:`pasteNode`,payload:{target:t.ref,snapshot:n}})},async insertNode(){let t=e.getSelectedResolvedNode();if(!t){e.notifyError(I.t(`node.noNodeSelected`));return}if(e.isSubtreeStructureLocked(t)){e.notifyError(I.t(`node.editSubtreeDenied`));return}e.setNextGraphRenderAnchor(t.ref.instanceKey);try{(await ga(e,{type:`insertNode`,payload:{target:t.ref}})).success||e.setNextGraphRenderAnchor(null)}catch(t){throw e.setNextGraphRenderAnchor(null),t}},async replaceNode(){let t=e.getSelectedResolvedNode();if(!t){e.notifyError(I.t(`node.noNodeSelected`));return}if(e.isSubtreeStructureLocked(t)){e.notifyError(I.t(`node.editSubtreeDenied`));return}let n=await e.readClipboardNode();n&&await ga(e,{type:`replaceNode`,payload:{target:t.ref,snapshot:n}})},async deleteNode(){let t=e.getSelectedResolvedNode();if(!t)return;if(t.parentKey===null){e.notifyError(I.t(`node.deleteRootNodeDenied`));return}if(t.subtreeNode){e.notifyError(I.t(`node.editSubtreeDenied`));return}let n=ba(e,t);e.setNextGraphRenderAnchor(n);try{(await ga(e,{type:`deleteNode`,payload:{target:t.ref}})).success||e.setNextGraphRenderAnchor(null)}catch(t){throw e.setNextGraphRenderAnchor(null),t}},openSubtreePath:n,async openSelectedSubtree(r){let i=r??t.selectionStore.getState().selectedNodeRef,a=e.getResolvedGraph();if(!i||!a)return;let o=a.nodesByInstanceKey[i.instanceKey],s=i.subtreeStack.length>0?i.subtreeStack[i.subtreeStack.length-1]:void 0,c=o?.path??s;c&&await n(c,{openSelection:ya(i)})},async saveSelectedAsSubtree(){let t=e.getSelectedResolvedNode();if(!t){e.notifyError(I.t(`node.noNodeSelected`));return}if(t.parentKey===null){e.notifyError(I.t(`node.subtreeSaveRootError`));return}if(e.isSubtreeStructureLocked(t)){e.notifyError(I.t(`node.editSubtreeDenied`));return}let n=e.buildPersistedNodeFromResolved(t.ref.instanceKey,{clearPathOnRoot:!0});if(!n)return;let r=n.name?.trim()||`subtree`;await ga(e,{type:`saveSelectedAsSubtree`,payload:{target:t.ref,subtreeRoot:n,suggestedBaseName:r}})}}},wa=e=>{let{deps:t}=e,n={async selectTree(){let n=e.clearActiveVariableFocus(),r=e.getCurrentGraphSelectionKey()!==null;t.hostAdapter.selectTree(),!(!n&&!r)&&(r&&await e.showSelectionVisualHint(null),n&&await e.applyVisualState())},async selectNode(n,r){let i=e.getResolvedGraph();if(!i)return;let a=i.nodesByInstanceKey[n];if(!a)return;let o=!!r?.clearVariableFocus&&e.clearActiveVariableFocus(),s=e.getCurrentGraphSelectionKey()!==a.ref.instanceKey;t.hostAdapter.selectNode(a.ref),s&&await e.showSelectionVisualHint(a.ref.instanceKey),o&&await e.applyVisualState()},async revealNode(t){await e.revealNode(t)},async focusVariable(n){t.graphUiStore.setState(e=>({...e,activeVariableNames:[...n]})),await e.applyVisualState()},async openSearch(n){sa(t.graphUiStore,{open:!0,mode:n}),await e.applyVisualState()},async updateSearch(r){sa(t.graphUiStore,{query:r,index:0}),await e.applyVisualState();let{results:i}=t.graphUiStore.getState().search;i.length>0&&(await n.selectNode(i[0],{force:!0}),await t.graphAdapter.focusNode(i[0]))},async nextSearchResult(){let r=t.graphUiStore.getState().search;if(r.results.length===0)return;let i=(r.index+1)%r.results.length;sa(t.graphUiStore,{index:i}),await e.applyVisualState();let a=t.graphUiStore.getState().search.results[i];a&&(await n.selectNode(a,{force:!0}),await t.graphAdapter.focusNode(a))},async prevSearchResult(){let r=t.graphUiStore.getState().search;if(r.results.length===0)return;let i=(r.index+r.results.length-1)%r.results.length;sa(t.graphUiStore,{index:i}),await e.applyVisualState();let a=t.graphUiStore.getState().search.results[i];a&&(await n.selectNode(a,{force:!0}),await t.graphAdapter.focusNode(a))}};return n},Ta=e=>{let t=pa(e);return{...ma(t),...wa(t),...Ca(t)}},Ea=()=>({selectedTree:null,selectedNodeKey:null,selectedNodeRef:null,selectedNodeSnapshot:null}),Da=()=>he(()=>Ea()),Oa=()=>{if(typeof document>`u`)return`dark`;let e=document.body?.classList;return e?.contains(`vscode-light`)||e?.contains(`vscode-high-contrast-light`)?`light`:e?.contains(`vscode-dark`)||e?.contains(`vscode-high-contrast`)?`dark`:window.matchMedia?.(`(prefers-color-scheme: light)`)?.matches?`light`:`dark`},ka=e=>{typeof document>`u`||(document.documentElement.setAttribute(`data-theme`,e),document.body?.setAttribute(`data-theme`,e))},Aa=e=>e===`inspector-sidebar`?`inspector-sidebar`:`editor`,ja=()=>typeof window>`u`?`editor`:Aa(window.__B3_WEBVIEW_KIND__),Ma=(e,t)=>{e.setState(e=>({...e,settings:{...e.settings,theme:t},themeVersion:e.themeVersion+1}))},Na=(e,t)=>{e.setState(e=>({...e,settings:{...e.settings,...t}}))},Pa=()=>({filePath:``,workdir:``,nodeDefs:[],groupDefs:[],allFiles:[],settings:{allowNewFunction:!1,checkExpr:!0,subtreeEditable:!0,language:`zh`,theme:Oa(),inspectorMode:`sidebar`},themeVersion:0,usingVars:null,usingGroups:null,importDecls:[],subtreeDecls:[],subtreeSources:{},nodeFieldDiagnostics:{},selectedNodeFieldVisibility:{args:{},input:{},output:{}}}),Fa=()=>he(()=>Pa()),Ia=e(E()),La=e(C()),Ra=e=>Ne(e)===`zh`?La.default:Ia.default,za=e=>Error(`${e} is not available before the Ant Design app hooks are bound`),Ba=()=>{let e=null;return{bind(t){e=t},reset(){e=null},getMessage(){if(!e)throw za(`message`);return e.message},getNotification(){if(!e)throw za(`notification`);return e.notification},getModal(){if(!e)throw za(`modal`);return e.modal}}},Va=(e=ja())=>{let t=Si(),n=Fa(),r=Da(),i=ua(),a=$n(),o=Cn(),s=Ba();return{webviewKind:e,documentStore:t,workspaceStore:n,selectionStore:r,graphUiStore:i,controller:Ta({documentStore:t,workspaceStore:n,selectionStore:r,graphUiStore:i,hostAdapter:a,graphAdapter:o,appHooks:s}),graphAdapter:o,hostAdapter:a,appHooks:s}},Ha=(0,P.createContext)(null),Ua=({runtime:e,children:t})=>(0,F.jsx)(Ha.Provider,{value:e,children:t}),Y=()=>{let e=(0,P.useContext)(Ha);if(!e)throw Error(`V2 runtime is not available`);return e},Wa=()=>Y().webviewKind,Ga=e=>Te(Y().documentStore,e),X=e=>Te(Y().workspaceStore,e),Ka=e=>Te(Y().selectionStore,e),qa=e=>Te(Y().graphUiStore,e),Ja=()=>({theme:X(e=>e.settings.theme),language:X(e=>e.settings.language),hasDocument:Ga(e=>e.persistedTree!==null)}),Ya=()=>{let{webviewKind:e}=Y();return{theme:X(e=>e.settings.theme),language:X(e=>e.settings.language),themeVersion:X(e=>e.themeVersion),webviewKind:e}},Xa=e=>e.documentPresent?e.selectedNode?`node`:e.selectedNodeRef?`node-pending`:`tree`:`skeleton`,Za=(e,t)=>!!(e||(t?.subtreeStack.length??0)>0),Qa=(0,P.createContext)({readOnly:!1}),$a=({children:e,readOnly:t=!1})=>(0,F.jsx)(Qa.Provider,{value:{readOnly:t},children:e}),eo=()=>(0,P.useContext)(Qa),to=(e,t)=>String(t?.label??``).toUpperCase().includes(e.toUpperCase()),no=e=>e.closest(`.b3-inspector`)??document.body,ro=({active:e,onReset:t,children:n})=>{let{t:r}=N(),{readOnly:i}=eo();return!e||i?(0,F.jsx)(F.Fragment,{children:n}):(0,F.jsxs)(`div`,{className:`b3-override-bar`,children:[(0,F.jsx)(w,{title:r(`override.resetTitle`),okText:r(`reset`),cancelText:r(`cancel`),placement:`right`,onConfirm:t,getPopupContainer:no,children:(0,F.jsx)(`div`,{className:`b3-override-rail`})}),n]})},io=({children:e})=>(0,F.jsx)(ne,{className:`b3-section-divider`,titlePlacement:`start`,orientation:`horizontal`,children:(0,F.jsx)(`h4`,{className:`b3-section-title`,children:e})}),ao=({text:e,required:t})=>(0,F.jsxs)(`span`,{className:`b3-form-label`,children:[(0,F.jsxs)(`span`,{className:`b3-form-label-text`,children:[t?(0,F.jsx)(`span`,{className:`b3-form-required-mark`,children:`*`}):null,e]}),(0,F.jsx)(`span`,{className:`b3-form-label-colon`,children:`:`})]}),Z=(e,t=!1)=>({label:(0,F.jsx)(ao,{text:e,required:t}),colon:!1,htmlFor:void 0}),oo=Z,so=({value:e,disabled:t=!1,onChange:n,onRemove:r,onSubmit:i,onFocusVariable:a})=>{let{t:o}=N(),[s,c]=(0,P.useState)(e??{name:``,desc:``});(0,P.useEffect)(()=>{c(e??{name:``,desc:``})},[e]);let l=()=>{n?.(s),i?.()};return(0,F.jsxs)(u,{gap:4,align:`start`,className:`b3-var-row`,children:[(0,F.jsxs)(re.Compact,{block:!0,className:`b3-var-row-compact`,children:[(0,F.jsxs)(`div`,{className:`b3-var-counter`,onClick:()=>{s.name&&a?.(s.name)},children:[(0,F.jsx)(d,{}),(0,F.jsx)(`span`,{children:s.count??0})]}),(0,F.jsx)(g,{disabled:t,value:s.name,placeholder:o(`tree.vars.name`),onChange:e=>c(t=>({...t,name:e.target.value})),onBlur:l}),(0,F.jsx)(g,{disabled:t,value:s.desc,placeholder:o(`tree.vars.desc`),onChange:e=>c(t=>({...t,desc:e.target.value})),onBlur:l})]}),t?(0,F.jsx)(`div`,{className:`b3-row-spacer`}):(0,F.jsx)(D,{className:`b3-inline-remove`,onClick:r})]})},co=e=>{switch(e.code){case`invalid-variable-name`:return I.t(`node.invalidVariableName`);case`undefined-variable`:return I.t(`node.undefinedVariable`,{variable:e.variable});case`invalid-expression`:return I.t(`node.invalidExpression`);case`group-not-enabled`:return I.t(`node.groupNotEnabled`,{group:e.groups.join(`, `)});case`required-arg`:return I.t(`fieldRequired`,{field:e.label});case`required-input`:case`required-output`:return I.t(`fieldRequired`,{field:e.label});case`missing-oneof-input`:return I.t(`validation.missingOneofInput`,{input:e.inputLabel});case`oneof-conflict`:return I.t(`validation.oneof`,{left:e.argName,right:e.inputLabel});case`custom-arg-check`:return`${e.argName}: ${e.message}`;case`invalid-arg-value`:return e.expected===`integer`?I.t(`validation.integer`,{field:e.label}):e.expected===`number`?I.t(`validation.number`,{field:e.label}):e.expected===`array`?I.t(`validation.jsonArray`,{name:e.argName}):I.t(`node.invalidValue`);case`invalid-arg-option`:case`unknown-arg-type`:return I.t(`node.invalidValue`);case`invalid-children`:return I.t(`node.invalidChildren`);case`missing-node-def`:return I.t(`node.notFound`,{name:e.nodeName});default:return I.t(`node.invalidValue`)}},lo=V,uo=e=>e?e.children===void 0||e.children===-1?I.t(`node.children.unlimited`):String(e.children):`-`,fo=(e,t)=>{let n=Ei(e,t,`input`);return n?co(n):null},po=(e,t,n)=>{let r=Di(e,t,n);return r?co(r):null},mo=(e,t)=>{let n=wr(e),r=K(e);return G(e)?cr(e)?Array.isArray(t)?t:t===void 0?r?[]:void 0:[]:t===void 0?r?``:void 0:JSON.stringify(t,null,2):ar(n)?t===void 0?r?!1:void 0:t:cr(e)?t:sr(n)?t===void 0?r?``:void 0:JSON.stringify(t,null,2):t===void 0?r?``:void 0:t},ho=(e,t)=>{let n=wr(e);if(t==null)return;if(G(e)){if(cr(e)){let n=Array.isArray(t)?t:[];return n.length===0&&K(e)?void 0:n}let n=String(t).trim();if(!n)return K(e)?void 0:[];let r=JSON.parse(n);if(!Array.isArray(r))throw Error(I.t(`validation.jsonArray`,{name:e.name}));return r}if(ar(n))return t===`__unset__`?void 0:!!t;if(cr(e))return t===`__unset__`?void 0:t;if(nr(n)||rr(n))return t===``?K(e)?void 0:t:Number(t);if(sr(n)){let n=String(t).trim();return n?JSON.parse(n):K(e)?void 0:{}}let r=String(t);if(!(!r.trim()&&K(e)))return r},go=e=>{let{arg:t,rawValue:n,usingVars:r,checkExpr:i}=e,a=wr(t),o=ho(t,n);if(o===void 0)return null;let s=Li({arg:t,value:o,args:{[t.name]:o},validateOptions:!1});return s.length?co(s[0]):or(a)?po((Array.isArray(o)?o:[o]).filter(e=>typeof e==`string`),r,i):null},_o=new Map,vo=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),yo=(e,t)=>e.structuralStableId===t.structuralStableId&&e.sourceStableId===t.sourceStableId&&e.sourceTreePath===t.sourceTreePath&&vo(e.subtreeStack,t.subtreeStack),bo=(e,t)=>({...e,ref:t,effectiveArgs:e.effectiveArgs?{...e.effectiveArgs}:void 0,data:{...e.data,id:t.displayId}}),xo=(e,t)=>!e||!t||!yo(e.ref,t)?null:bo(e.snapshot,t),So=(e,t,n)=>{_o.set(e,{ref:t,snapshot:bo(n,t)})},Co=(e,t)=>{!e||!t.selectedNodeRef||!t.selectedNodeSnapshot||So(e,t.selectedNodeRef,t.selectedNodeSnapshot)},wo=(e,t)=>e?xo(_o.get(e),t):null,To=/^[\[{'"0-9+\-.]/,Eo=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/,Do=e=>e.startsWith(`"`)||e.startsWith(`'`),Oo=e=>{let t=e??``,n=t.trim();if(!n)return``;if(n===`true`)return!0;if(n===`false`)return!1;if(Eo.test(n)){let e=Number(n);if(!Number.isFinite(e))throw Error(`invalid tree custom value`);return e}if(Do(n)){let e;try{e=ot.default.parse(n)}catch{throw Error(`invalid tree custom value`)}if(typeof e!=`string`)throw Error(`invalid tree custom value`);return e}if(n.startsWith(`{`)||n.startsWith(`[`)||To.test(n))throw Error(`invalid tree custom value`);return t},ko=e=>{try{let t=Oo(e);return typeof t==`boolean`?`boolean`:typeof t==`number`?`number`:`string`}catch{return`invalid`}},Ao=e=>{let t={};for(let n of e??[]){let e=n.key?.trim();e&&(t[e]=Oo(n.value))}return t},jo=(e,t)=>!!(e&&t&&yo(e.ref,t.ref)),Q=e=>({name:e.data.name,desc:e.data.desc,path:e.data.path,debug:e.data.debug?!0:void 0,disabled:e.data.disabled?!0:void 0,input:e.data.input?[...e.data.input]:void 0,output:e.data.output?[...e.data.output]:void 0,args:e.data.args?{...e.data.args}:void 0}),Mo=(e,t)=>e===t?!0:!e||!t?!e&&!t:e.length===t.length?e.every((e,n)=>e===t[n]):!1,No=(e,t)=>{if(!e)return e;let n=Object.entries(e);if(n.length===0)return e;let r=new Set((t?.args??[]).map(e=>e.name));if(r.size===0)return;let i=n.filter(([e])=>r.has(e));return i.length===n.length?e:i.length>0?Object.fromEntries(i):void 0},Po=(e,t)=>{if(!t)return t;if(!e?.length)return;if(t.length===0)return t;let n=Uo(e,e.map((n,r)=>{let i=Ho(t,r,W(n,e,r).variadic);return Array.isArray(i)?[...i]:i}),t)??[],r=n.length>t.length?n.slice(0,t.length):n;return Mo(t,r)?t:r},Fo=(e,t)=>!jo(e,t)||!e?`replace`:e.data.name===t.data.name?`patch`:`patch-and-clear-scoped-fields`,Io=e=>e.readOnly?!0:e.pendingSelectedNodeSnapshot?!jo(e.previousSelectedNode,e.nextSelectedNode):!1,Lo=e=>e.effectiveArgs??e.data.args,Ro=(e,t,n)=>({...Q(e),name:t,input:Po(n?.input,e.data.input),output:Po(n?.output,e.data.output),args:No(e.data.args,n)}),zo=(e,t,n,r)=>{if(!e?.length)return t;let i=e.map((n,r)=>Ho(t,r,W(e[r]??``,e,r).variadic));return i[r]=(Array.isArray(n)?n:[])[r],Uo(e,i,t)},Bo=(e,t,n,r,i)=>{if(!i){let i=ho(n,r.args?.[n.name]),a=e?.[n.name],o=t?.[n.name];if(lo(i,a)||lo(i,o)&&lo(a,void 0))return e}let a={...e??{}},o=ho(n,r.args?.[n.name]);return o===void 0?delete a[n.name]:a[n.name]=o,Object.keys(a).length>0?a:void 0},Vo=(e,t)=>{if(!e||!(t in e))return e;let n={...e};return delete n[t],Object.keys(n).length>0?n:void 0},Ho=(e,t,n)=>n?e?.slice(t)??[]:e?.[t]??``,Uo=(e,t,n)=>{if(!e?.length)return n;let r=Array.isArray(t)?t:[],i=[];return e.forEach((t,n)=>{let a=r[n];if(W(e[n]??``,e,n).variadic){let e=Array.isArray(a)?a:[];i.push(...e.filter(e=>typeof e==`string`))}else i.push(typeof a==`string`?a:``)}),i},Wo=(e,t,n)=>{let r=Lo(t);return{id:`${t.ref.displayId} (${t.data.uuid})`,type:e?.type??n,children:uo(e),group:e?.group??[],name:t.data.name,desc:t.data.desc??e?.desc??``,path:t.data.path??``,debug:!!t.data.debug,disabled:!!t.data.disabled,args:Object.fromEntries((e?.args??[]).map(e=>[e.name,mo(e,r?.[e.name])]).filter(([,e])=>e!==void 0)),inputSlots:(e?.input??[]).map((n,r)=>Ho(t.data.input,r,W(e?.input?.[r]??``,e?.input,r).variadic)),outputSlots:(e?.output??[]).map((n,r)=>Ho(t.data.output,r,W(e?.output?.[r]??``,e?.output,r).variadic)),rawNodeJson:JSON.stringify(t.data??{},null,2)}},Go=(e,t)=>({name:e.name,desc:e.desc??``,prefix:e.prefix??``,export:e.export!==!1,group:e.group,vars:e.variables.locals.map(e=>({...e,count:t[e.name]??0})),importRefs:e.variables.imports.map(e=>({path:e})),customRows:Object.entries(e.custom).map(([e,t])=>({key:e,value:ct(t)}))}),Ko=e=>({desc:e.desc?.trim()||void 0,prefix:e.prefix??``,export:e.export!==!1,group:e.group??[],variables:{imports:(e.importRefs??[]).map(e=>e.path?.trim()).filter(e=>!!e),locals:(e.vars??[]).filter(e=>e.name?.trim()).map(e=>({name:e.name.trim(),desc:e.desc.trim()}))}}),qo=(e,t)=>e.filter(e=>t[e.name]!==!1),Jo=(e,t)=>e.filter(e=>t[e.name]===!1).map(e=>e.name),Yo=(e,t,n)=>{if(!e)return e;let r=Jo(t,n).filter(t=>t in e);if(r.length===0)return e;let i={...e};return r.forEach(e=>{delete i[e]}),Object.keys(i).length>0?i:void 0},Xo=(e,t)=>e.map((e,t)=>t).filter(e=>t[e]===!1),Zo=(e,t)=>e===t?!0:!e||!t?!e&&!t:e.length===t.length?e.every((e,n)=>e===t[n]):!1,Qo=(e,t,n)=>{let r=Xo(t,n);if(r.length===0)return e;let i=[...t],a=i.map((t,n)=>{let r=W(t,i,n).variadic,a=Ho(e,n,r);return Array.isArray(a)?[...a]:a});r.forEach(e=>{a[e]=W(i[e]??``,i,e).variadic?[]:``});let o=Uo(i,a,e);return Zo(e,o)?e:o},$o=(e,t,n)=>{let r=U(n,t.name);r&&(t.input?.forEach(t=>{t&&(e[t]=(e[t]??0)+1)}),t.output?.forEach(t=>{t&&(e[t]=(e[t]??0)+1)}),r.args?.forEach(n=>{if(!or(wr(n)))return;let r=t.args?.[n.name];(Array.isArray(r)?r:[r]).forEach(t=>{typeof t!=`string`||!t||Ti(t).forEach(t=>{e[t]=(e[t]??0)+1})})}))},es=(e,t)=>{let n={};if(!e)return n;for(let r of e.nodeOrder){let i=e.nodesByInstanceKey[r];i&&$o(n,i,t)}return n},ts=e=>{if(!e.document)return{};let t=aa({persistedTree:e.document,subtreeSources:e.subtreeSources,nodeDefs:e.nodeDefs,subtreeEditable:e.subtreeEditable}).graph;return es(t,e.nodeDefMap)},ns=(e,t,n)=>{let r=[],i=new Set;return Ci(e)?(Object.values(e).forEach(e=>{i.has(e.name)||(i.add(e.name),r.push({label:`${e.name} (${e.desc})`,value:e.name}))}),r):(t&&ni(t,e=>{let t=U(n,e.name),a=t?.input?.length&&t.input.length>0?W(t.input[t.input.length-1]??``,t.input,t.input.length-1):null,o=t?.output?.length&&t.output.length>0?W(t.output[t.output.length-1]??``,t.output,t.output.length-1):null;e.input?.forEach((e,n)=>{if(!e||i.has(e))return;let o=t?.input?.length&&n>=t.input.length&&a?.variadic?t.input[t.input.length-1]:t?.input?.[n]??`input`;i.add(e),r.push({label:`${e} (${W(o).label})`,value:e})}),e.output?.forEach((e,n)=>{if(!e||i.has(e))return;let a=t?.output?.length&&n>=t.output.length&&o?.variadic?t.output[t.output.length-1]:t?.output?.[n]??`output`;i.add(e),r.push({label:`${e} (${W(a).label})`,value:e})})}),r)},rs=()=>{let e=Ga(e=>e.persistedTree),t=Ga(e=>e.alertReload),n=Ga(e=>e.pendingExternalContent),r=X(e=>e.filePath),i=Ka(e=>e.selectedNodeRef);return{document:e,alertReload:t,pendingExternalContent:n,selectedNode:Ka(e=>e.selectedNodeSnapshot)??wo(r,i),selectedNodeRef:i}},is=()=>{let e=Ga(e=>e.persistedTree),t=X(e=>e.filePath),n=Ka(e=>e.selectedNodeRef),r=Ka(e=>e.selectedNodeSnapshot),i=r??wo(t,n),a=X(e=>e.nodeDefs),o=X(e=>e.usingVars),s=X(e=>e.usingGroups),c=X(e=>e.allFiles),l=X(e=>e.settings.checkExpr),u=X(e=>e.nodeFieldDiagnostics),d=X(e=>e.selectedNodeFieldVisibility);return{document:e,selectedNode:i,pendingSelectedNodeSnapshot:!r&&!!(n&&i),nodeDefs:a,usingVars:o,usingGroups:s,allFiles:c,checkExpr:l,nodeFieldDiagnostics:u,selectedNodeFieldVisibility:d}},as=()=>({document:Ga(e=>e.persistedTree),nodeDefs:X(e=>e.nodeDefs),groupDefs:X(e=>e.groupDefs),allFiles:X(e=>e.allFiles),importDecls:X(e=>e.importDecls),subtreeDecls:X(e=>e.subtreeDecls),subtreeSources:X(e=>e.subtreeSources),subtreeEditable:X(e=>e.settings.subtreeEditable)}),os=e=>{let{document:t,selectedNode:n,pendingSelectedNodeSnapshot:r,nodeDefs:i,usingVars:a,usingGroups:o,allFiles:s,checkExpr:c,nodeFieldDiagnostics:l,selectedNodeFieldVisibility:u}=is(),d=(0,P.useMemo)(()=>br(i),[i]),f=(0,P.useMemo)(()=>ns(a,t?.root??null,d),[a,t?.root,d]),p=h.useWatch(`name`,e),m=(p??n?.data.name??``).trim()||n?.data.name||``,g=U(d,m),_=n?.disabled??!1,v=qo(g?.args??[],n?u.args:{}),y=n?.subtreeOriginal;return{document:t,selectedNode:n,pendingSelectedNodeSnapshot:r,nodeDefs:i,usingVars:a,usingGroups:o,allFiles:s,checkExpr:c,nodeFieldDiagnostics:n?l[n.ref.instanceKey]??[]:[],nodeDefMap:d,variableOptions:f,watchedName:p,effectiveName:m,nodeDef:g,fieldEditDisabled:_,title:g?.desc||m,structuredArgs:v,hasStructuredArgs:v.length>0,shouldShowRawNodeJson:g===null,subtreeOriginal:y,canShowOverride:!!(n?.subtreeNode&&y),selectedNodeFieldVisibility:u}},ss=e=>{let{document:t,nodeDefs:n,groupDefs:r,allFiles:i,importDecls:a,subtreeDecls:o,subtreeSources:s,subtreeEditable:c}=as(),l=(0,P.useMemo)(()=>br(n),[n]),u=(0,P.useMemo)(()=>ts({document:t,subtreeSources:s,nodeDefs:n,nodeDefMap:l,subtreeEditable:c}),[t,s,n,l,c]);return{document:t,nodeDefs:n,groupDefs:r,allFiles:i,importDecls:a,subtreeDecls:o,nodeDefMap:l,variableUsageCount:u,currentImportRefs:h.useWatch(`importRefs`,e)??[],subtreeRows:(0,P.useMemo)(()=>o.map(e=>({...e,vars:e.vars.map(e=>({...e,count:u[e.name]??0}))})),[o,u]),importDeclByPath:(0,P.useMemo)(()=>{let e=new Map;return a.forEach(t=>{e.set(t.path,t.vars.map(e=>({...e,count:u[e.name]??0})))}),e},[a,u])}},cs=e=>{window.setTimeout(()=>{e()},0)},ls=new Set,us=e=>{let t=e.catch(()=>void 0).finally(()=>{ls.delete(t)});ls.add(t)},ds=async()=>{for(;ls.size>0;)await Promise.allSettled([...ls])},fs=async()=>{let e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&e.blur(),await new Promise(e=>{window.setTimeout(e,0)}),await new Promise(e=>{window.setTimeout(e,0)}),await ds()},ps=(e,t)=>[[e,t]];function ms({form:e,runtime:t,selectedNode:n,nodeDef:r,subtreeOriginal:i,fieldEditDisabled:a,effectiveReadOnly:o,canShowOverride:s}){let c=e=>{if(!r)return null;let t=W(r.input?.[e]??``,r.input,e).label;return r.args?.find(e=>e.oneof===t)??null},l=e=>{let t=c(e);return t?[...ps(`inputSlots`,e),[`args`,t.name]]:ps(`inputSlots`,e)},u=e=>{let t=[[`args`,e.name]];if(!e.oneof||!r?.input)return t;let n=r.input.findIndex((t,n)=>W(t,r.input,n).label===e.oneof);return n>=0&&t.push([`inputSlots`,n]),t},d=async(r,i)=>{if(o)return;if(r.length>0)try{await e.validateFields(r,{recursive:!0})}catch{return}let a=e.getFieldsValue(!0);try{us(t.controller.updateNode({target:n.ref,data:i(a)}))}catch(e){t.hostAdapter.log(`warn`,`[v2] node form submit failed: ${String(e)}`)}},f=(e,t)=>{cs(()=>{d(e,t)})},p=()=>{f([`name`],e=>Ro(n,String(e.name??n.data.name).trim()||n.data.name,r))},m=()=>{f([`desc`],e=>({...Q(n),desc:e.desc?.trim()||void 0}))},h=()=>{f([`debug`],e=>({...Q(n),debug:e.debug?!0:void 0}))},g=()=>{f([`disabled`],e=>({...Q(n),disabled:e.disabled?!0:void 0}))},_=()=>{f([`path`],e=>({...Q(n),path:n.subtreeNode||a?n.data.path:e.path?.trim()||void 0}))},v=(e,t,n,r=!1)=>s?r?!lo(e?.slice(n)??[],t?.slice(n)??[]):(e?.[n]??``)!==(t?.[n]??``):!1,y=(e,t=!1)=>v(n.data.input,i?.input,e,t),b=(e,t=!1)=>v(n.data.output,i?.output,e,t),x=e=>s&&_r({argName:e,currentArgs:n.data.args,originalArgs:i?.args,nodeDef:r}),S=e=>{f(l(e),t=>({...Q(n),input:zo(r?.input,n.data.input,t.inputSlots,e)}))},C=e=>{f(ps(`outputSlots`,e),t=>({...Q(n),output:zo(r?.output,n.data.output,t.outputSlots,e)}))},w=t=>{f(u(t),r=>({...Q(n),args:Bo(n.data.args,Lo(n),t,r,e.isFieldTouched([`args`,t.name]))}))},T=(t,n,r,i=!1)=>{if(e.setFieldValue([t,r],Ho(n,r,i)),t===`inputSlots`){S(r);return}C(r)};return{relatedArgForInput:c,commitName:p,commitDesc:m,commitDebug:h,commitDisabled:g,commitPath:_,isInputOverridden:y,isOutputOverridden:b,isArgOverridden:x,resetInputField:(e,t=!1)=>{T(`inputSlots`,i?.input,e,t)},resetOutputField:(e,t=!1)=>{T(`outputSlots`,i?.output,e,t)},resetArgField:t=>{e.setFieldValue([`args`,t.name],mo(t,i?.args?.[t.name])),f([[`args`,t.name]],e=>({...Q(n),args:Bo(n.data.args,Lo(n),t,e,!0)}))},resetArgToDefault:t=>{e.setFields([{name:[`args`,t.name],value:mo(t,t.default),touched:!1,errors:[],warnings:[]}]),f([],()=>({...Q(n),args:Vo(n.data.args,t.name)}))},resetDesc:()=>{e.setFieldValue(`desc`,i?.desc??``),m()},resetDebug:()=>{e.setFieldValue(`debug`,!!i?.debug),h()},resetDisabled:()=>{e.setFieldValue(`disabled`,!!i?.disabled),g()},commitInputField:S,commitOutputField:C,commitArgField:w}}var{TextArea:hs}=g,gs=({form:e,arg:t,nodeDef:n,currentArgValue:r,usingVars:a,checkExpr:o,nodeFieldDiagnostics:s,disabled:c,showDefaultReset:l,onCommit:d,onQueueCommit:_,onResetToDefault:v})=>{let{t:y}=N(),b=h.useWatch(`args`,e)??{},x=wr(t),S=(0,P.useMemo)(()=>Er(t,b)??[],[t,b]),C=!K(t),T={...Z(t.desc||t.name,C),required:C},E=(e,n)=>!l||c?(0,F.jsx)(h.Item,{...T,name:[`args`,t.name],valuePropName:n,rules:[{validator:D}],children:e}):(0,F.jsx)(h.Item,{...T,required:C,children:(0,F.jsxs)(u,{gap:4,align:`start`,className:`b3-field-with-action`,children:[(0,F.jsx)(`div`,{className:`b3-field-with-action-control`,children:(0,F.jsx)(h.Item,{noStyle:!0,name:[`args`,t.name],valuePropName:n,rules:[{validator:D}],children:e})}),(0,F.jsx)(w,{title:y(`reset.defaultConfirm`),okText:y(`reset`),cancelText:y(`cancel`),placement:`right`,onConfirm:v,getPopupContainer:no,children:(0,F.jsx)(m,{className:`b3-inline-reset`,title:y(`reset`),onMouseDown:e=>e.preventDefault()})})]})}),D=async(i,c)=>{let l=ji(t,c);if(l&&!C)return;if(l&&C)throw Error(y(`fieldRequired`,{field:t.desc||t.name}));let u=ho(t,c),d=go({arg:t,rawValue:c,usingVars:a,checkExpr:o});if(d)throw Error(d);let f=Ri({arg:t,argValue:u,inputValues:e.getFieldValue(`inputSlots`),inputDefs:n.input});if(f)throw Error(co(f));let p=s.find(e=>e.fieldKind===`arg`&&e.fieldName===t.name);if(p&&lo(u,r))throw Error(p.message)};return ar(x)?E((0,F.jsx)(p,{disabled:c,onChange:_}),`checked`):cr(t)?E((0,F.jsx)(i,{mode:G(t)?`multiple`:void 0,disabled:c,allowClear:!C,showSearch:!0,onChange:_,onBlur:d,options:S.map(e=>({label:`${e.name} (${String(e.value)})`,value:e.value})),filterOption:to})):G(t)||sr(x)?E((0,F.jsx)(hs,{autoSize:{minRows:1},disabled:c,placeholder:G(t)?y(`form.enterJsonArray`):y(`form.enterJsonValue`),onBlur:d})):nr(x)||rr(x)?E((0,F.jsx)(f,{style:{width:`100%`},disabled:c,precision:nr(x)?0:void 0,onBlur:d})):ir(x)?E((0,F.jsx)(hs,{autoSize:{minRows:1},disabled:c,onBlur:d})):E((0,F.jsx)(g,{disabled:c,onBlur:d}))},_s=({form:e,nodeDef:t,args:n,effectiveArgs:r,usingVars:i,checkExpr:a,nodeFieldDiagnostics:o,fieldEditDisabled:s,isOverridden:c,onReset:l,onResetToDefault:u,onCommit:d,onQueueCommit:f})=>{let{t:p}=N();return n.length===0?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:p(`node.args`)}),n.map(n=>(0,F.jsx)(ro,{active:c(n.name),onReset:()=>l(n),children:(0,F.jsx)(gs,{form:e,arg:n,nodeDef:t,currentArgValue:r?.[n.name],usingVars:i,checkExpr:a,nodeFieldDiagnostics:o,disabled:s,showDefaultReset:n.default!==void 0,onCommit:()=>d(n),onQueueCommit:()=>f(n),onResetToDefault:()=>u(n)})},`arg-${n.name}`))]})},vs=({form:e,fieldName:t,slotDefs:r,slot:i,index:a,usingVars:o,variableOptions:s,fieldEditDisabled:d,fieldKind:f,currentSlotValue:p,nodeFieldDiagnostics:m,isOverridden:g,onReset:_,onCommit:v,onQueueCommit:y,getRelatedArg:b})=>{let{t:x}=N(),S=W(i,r,a),C=S.label,w=S.variadic,T=b?.(a)??null,E=async(n,i)=>{let s=fo(i,o);if(s)throw Error(s);if(T){let t=Ri({arg:T,argValue:e.getFieldValue([`args`,T.name]),inputValues:e.getFieldValue(`inputSlots`),inputDefs:r});if(t)throw Error(co(t))}let c=m.find(e=>e.fieldKind===f&&e.fieldIndex===a),l=w?e.getFieldValue([t,a])??[]:typeof i==`string`?i:``;if(c&&lo(l,p??``))throw Error(c.message)};return w?(0,F.jsx)(ro,{active:g(a,!0),onReset:()=>_(a,!0),children:(0,F.jsx)(h.Item,{...Z(C,S.required),children:(0,F.jsx)(h.List,{name:[t,a],children:(e,{add:t,remove:r},{errors:i})=>(0,F.jsxs)(`div`,{className:`b3-list-block`,children:[e.map(e=>(0,F.jsxs)(u,{gap:4,align:`start`,children:[(0,F.jsx)(h.Item,{name:e.name,style:{width:`100%`,marginBottom:2},validateTrigger:[`onChange`,`onBlur`],rules:[{validator:E}],children:(0,F.jsx)(l,{disabled:d,options:s,filterOption:to,onBlur:v})}),(0,F.jsx)(D,{className:`b3-inline-remove`,onClick:()=>{r(e.name),y()}})]},e.key)),(0,F.jsxs)(h.Item,{style:{marginBottom:0,marginTop:4},children:[(0,F.jsx)(n,{type:`dashed`,block:!0,icon:(0,F.jsx)(c,{}),onClick:()=>t(``),children:x(`add`)}),(0,F.jsx)(h.ErrorList,{errors:i})]})]})})})}):(0,F.jsx)(ro,{active:g(a),onReset:()=>_(a),children:(0,F.jsx)(h.Item,{...Z(C,S.required),name:[t,a],rules:[{required:S.required,message:x(`fieldRequired`,{field:C})},{validator:E}],children:(0,F.jsx)(l,{disabled:d,options:s,filterOption:to,onBlur:v})})})},ys=({form:e,title:t,fieldName:n,slotDefs:r,usingVars:i,variableOptions:a,fieldEditDisabled:o,visibility:s,currentSlots:c,nodeFieldDiagnostics:l,isOverridden:u,onReset:d,onCommit:f,onQueueCommit:p,getRelatedArg:m})=>r?.length?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:t}),r.map((e,t)=>({slot:e,index:t})).filter(({index:e})=>s?.[e]!==!1).map(({slot:t,index:s})=>{let h=W(t,r,s);return(0,F.jsx)(vs,{form:e,fieldName:n,slotDefs:r,slot:t,index:s,usingVars:i,variableOptions:a,fieldEditDisabled:o,fieldKind:n===`inputSlots`?`input`:`output`,currentSlotValue:Ho(c,s,h.variadic),nodeFieldDiagnostics:l,isOverridden:u,onReset:d,onCommit:()=>f(s,h.variadic),onQueueCommit:()=>p(s,h.variadic),getRelatedArg:m},`${n}-${s}`)})]}):null,{TextArea:bs}=g,xs=({selectedNode:e,nodeDefs:t,nodeDef:n,nodeDefMap:r,usingGroups:a,allFiles:o,fieldEditDisabled:s,readOnly:c,canShowOverride:u,showNodeDoc:d,subtreeOriginal:f,onCommitName:m,onQueueCommitName:_,onCommitDesc:v,onQueueCommitDebug:y,onQueueCommitDisabled:b,onCommitPath:x,onQueueCommitPath:S,onResetDesc:C,onResetDebug:w,onResetDisabled:T})=>{let{t:E}=N(),D=()=>{switch(e.resolutionError){case`missing-subtree`:return E(`node.subtreeMissing`,{path:e.data.path??``});case`invalid-subtree`:return E(`node.subtreeInvalid`,{path:e.data.path??``});case`cyclic-subtree`:return E(`node.subtreeCyclic`,{path:e.data.path??``});default:return null}};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h.Item,{...Z(E(`node.id`)),children:(0,F.jsxs)(re.Compact,{block:!0,className:`b3-node-identity-field`,children:[(0,F.jsx)(g,{disabled:!0,value:e.ref.displayId,title:e.ref.displayId,className:`b3-node-identity-id`}),(0,F.jsx)(g,{disabled:!0,value:e.data.uuid,title:e.data.uuid,className:`b3-node-identity-uuid`,style:{width:`100%`}})]})}),(0,F.jsx)(h.Item,{...Z(E(`node.type`)),name:`type`,children:(0,F.jsx)(g,{disabled:!0})}),n?.group?.length?(0,F.jsx)(h.Item,{...Z(E(`node.group`)),name:`group`,rules:[{validator:async()=>{if(!n.group?.some(e=>a?.[e]))throw Error(E(`node.groupNotEnabled`,{group:n.group}))}}],children:(0,F.jsx)(i,{mode:`multiple`,disabled:!0,options:n.group.map(e=>({label:e,value:e}))})}):null,(0,F.jsx)(h.Item,{...Z(E(`node.children`)),name:`children`,rules:[{validator:async()=>{if(n?.children!==void 0&&n.children!==-1&&e.activeChildCount!==n.children)throw Error(E(`node.invalidChildren`))}}],children:(0,F.jsx)(g,{disabled:!0})}),(0,F.jsx)(h.Item,{...Z(E(`node.name`)),name:`name`,rules:[{validator:async(t,n)=>{let i=String(n??``).trim();if(!i)throw Error(E(`node.notFound`,{name:e.data.name}));if(i!==e.data.name&&!U(r,i))throw Error(E(`node.notFound`,{name:i||e.data.name}))}}],children:(0,F.jsx)(l,{disabled:c||s,options:t.map(e=>({label:`${e.name} (${e.desc})`,value:e.name})),filterOption:to,onBlur:m,onSelect:_})}),(0,F.jsx)(ro,{active:u&&(e.data.desc??``)!==(f?.desc??``),onReset:C,children:(0,F.jsx)(h.Item,{...Z(E(`node.desc`)),name:`desc`,children:(0,F.jsx)(bs,{autoSize:{minRows:1},disabled:c||s,onBlur:v})})}),(0,F.jsx)(ro,{active:u&&!!e.data.debug!=!!f?.debug,onReset:w,children:(0,F.jsx)(h.Item,{...oo(E(`node.debug`)),name:`debug`,valuePropName:`checked`,children:(0,F.jsx)(p,{disabled:c||s&&!e.data.path,onChange:y})})}),(0,F.jsx)(ro,{active:u&&!!e.data.disabled!=!!f?.disabled,onReset:T,children:(0,F.jsx)(h.Item,{...oo(E(`node.disabled`)),name:`disabled`,valuePropName:`checked`,children:(0,F.jsx)(p,{disabled:c||s&&!e.data.path,onChange:b})})}),(0,F.jsx)(h.Item,{...Z(E(`node.subtree`)),name:`path`,rules:[{validator:async()=>{let e=D();if(e)throw Error(e)}}],children:(0,F.jsx)(l,{disabled:c||s||e.subtreeNode,options:o.map(e=>({label:e,value:e})),filterOption:to,onBlur:x,onSelect:S})}),d&&n?.doc?(0,F.jsx)(Se,{className:`b3-markdown`,children:n.doc}):null]})},Ss=({visible:e})=>{let{t}=N();return e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:t(`node.jsonData`)}),(0,F.jsx)(h.Item,{name:`rawNodeJson`,className:`b3-node-json-form-item`,children:(0,F.jsx)(bs,{autoSize:{minRows:12,maxRows:24},className:`b3-node-json-view`,readOnly:!0})})]}):null},Cs=()=>{let e=Y(),{t}=N(),{readOnly:r}=eo(),{nodeJsonVisible:i}=ke(),[a]=h.useForm(),{selectedNode:o,pendingSelectedNodeSnapshot:s,nodeDefs:c,usingVars:l,usingGroups:u,allFiles:d,checkExpr:f,nodeFieldDiagnostics:p,selectedNodeFieldVisibility:m,nodeDefMap:g,variableOptions:_,nodeDef:v,fieldEditDisabled:y,structuredArgs:b,hasStructuredArgs:x,shouldShowRawNodeJson:C,subtreeOriginal:w,canShowOverride:T}=os(a),E=(0,P.useRef)(null),D=Io({readOnly:r,pendingSelectedNodeSnapshot:s,previousSelectedNode:E.current,nextSelectedNode:o}),ee=o?Fo(E.current,o):`replace`,te=()=>{a.setFieldValue(`args`,{}),a.setFieldValue(`inputSlots`,[]),a.setFieldValue(`outputSlots`,[])};if((0,P.useEffect)(()=>{if(!o){E.current=null;return}let e=Wo(U(g,o.data.name),o,t(`node.unknownType`));ee===`replace`?(a.resetFields(),te()):ee===`patch-and-clear-scoped-fields`&&te(),a.setFieldsValue(e),E.current=o},[a,g,o,t]),(0,P.useEffect)(()=>{if(!o)return;let e=String(a.getFieldValue(`name`)??o.data.name).trim();if(!e||e===o.data.name)return;let n=Wo(v,o,t(`node.unknownType`));a.setFieldValue(`args`,{}),a.setFieldValue(`inputSlots`,[]),a.setFieldValue(`outputSlots`,[]),a.resetFields([`type`,`children`,`group`]),a.setFieldsValue({type:n.type,children:n.children,group:n.group,args:n.args,inputSlots:n.inputSlots,outputSlots:n.outputSlots})},[a,v,o,t]),(0,P.useEffect)(()=>{if(!o||D)return;let e=window.setTimeout(()=>{a.validateFields({recursive:!0}).catch(()=>void 0)},100);return()=>window.clearTimeout(e)},[f,a,p,v,D,o,u,l]),(0,P.useEffect)(()=>{if(!o||D)return;let t=U(g,o.data.name),n=Jo(t?.args??[],m.args),r=Xo(t?.input??[],m.input),i=Xo(t?.output??[],m.output);if(n.length===0&&r.length===0&&i.length===0)return;a.setFields([...n.map(e=>({name:[`args`,e],value:void 0,touched:!1,errors:[],warnings:[]})),...r.map(e=>({name:[`inputSlots`,e],value:W(t?.input?.[e]??``,t?.input,e).variadic?[]:``,touched:!1,errors:[],warnings:[]})),...i.map(e=>({name:[`outputSlots`,e],value:W(t?.output?.[e]??``,t?.output,e).variadic?[]:``,touched:!1,errors:[],warnings:[]}))]);let s=Yo(o.data.args,t?.args??[],m.args),c=Qo(o.data.input,t?.input??[],m.input),l=Qo(o.data.output,t?.output??[],m.output);s===o.data.args&&c===o.data.input&&l===o.data.output||us(e.controller.updateNode({target:o.ref,data:{...Q(o),args:s,input:c,output:l}}))},[D,a,g,e.controller,o,m]),!o)return null;let O=C||i,{relatedArgForInput:ne,commitName:re,commitDesc:ie,commitDebug:ae,commitDisabled:oe,commitPath:k,isInputOverridden:se,isOutputOverridden:ce,isArgOverridden:le,resetInputField:ue,resetOutputField:A,resetArgField:de,resetArgToDefault:j,resetDesc:fe,resetDebug:M,resetDisabled:pe,commitInputField:me,commitOutputField:he,commitArgField:ge}=ms({form:a,runtime:e,selectedNode:o,nodeDef:v,subtreeOriginal:w,fieldEditDisabled:y,effectiveReadOnly:D,canShowOverride:T}),_e=Za(o.data.path,o.ref);return(0,F.jsx)(`div`,{className:`b3-inspector-content`,children:(0,F.jsxs)(h,{form:a,className:`b3-inspector-form`,labelCol:{flex:`110px`,xs:{flex:`110px`}},wrapperCol:{flex:`1 1 0%`,xs:{flex:`1 1 0%`}},labelAlign:`right`,requiredMark:!1,children:[(0,F.jsx)(xs,{selectedNode:o,nodeDefs:c,nodeDef:v,nodeDefMap:g,usingGroups:u,allFiles:d,fieldEditDisabled:y,readOnly:D,canShowOverride:T,showNodeDoc:!O,subtreeOriginal:w,onCommitName:re,onQueueCommitName:re,onCommitDesc:ie,onQueueCommitDebug:ae,onQueueCommitDisabled:oe,onCommitPath:k,onQueueCommitPath:k,onResetDesc:fe,onResetDebug:M,onResetDisabled:pe}),(0,F.jsx)(ys,{form:a,title:t(`node.inputVariable`),fieldName:`inputSlots`,slotDefs:O?void 0:v?.input,usingVars:l,variableOptions:_,fieldEditDisabled:D||y,visibility:m.input,currentSlots:o.data.input,nodeFieldDiagnostics:p,isOverridden:se,onReset:ue,onCommit:me,onQueueCommit:me,getRelatedArg:ne}),!O&&x&&v?(0,F.jsx)(_s,{form:a,nodeDef:v,args:b,effectiveArgs:Lo(o),usingVars:l,checkExpr:f,nodeFieldDiagnostics:p,fieldEditDisabled:D||y,isOverridden:le,onReset:de,onResetToDefault:j,onCommit:ge,onQueueCommit:ge}):(0,F.jsx)(Ss,{visible:O}),(0,F.jsx)(ys,{form:a,title:t(`node.outputVariable`),fieldName:`outputSlots`,slotDefs:O?void 0:v?.output,usingVars:l,variableOptions:_,fieldEditDisabled:D||y,visibility:m.output,currentSlots:o.data.output,nodeFieldDiagnostics:p,isOverridden:ce,onReset:A,onCommit:he,onQueueCommit:he}),_e?(0,F.jsx)(n,{type:`primary`,htmlType:`button`,block:!0,icon:(0,F.jsx)(S,{}),className:`b3-node-subtree-button`,onClick:()=>void e.controller.openSelectedSubtree(o.ref),children:t(`editSubtree`)}):null]},o.ref.instanceKey)})},{TextArea:ws}=g,Ts=e=>{switch(e){case`number`:return`symbol-numeric`;case`boolean`:return`symbol-boolean`;case`invalid`:return`error`;default:return`symbol-string`}},Es=({groupDefs:e,readOnly:t,commitFields:n,queueCommitFields:r})=>{let{t:a}=N();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h.Item,{...Z(a(`tree.name`)),name:`name`,children:(0,F.jsx)(g,{disabled:!0})}),(0,F.jsx)(h.Item,{...Z(a(`tree.desc`)),name:`desc`,children:(0,F.jsx)(ws,{autoSize:{minRows:1},disabled:t,onBlur:()=>n([`desc`])})}),(0,F.jsx)(h.Item,{...Z(a(`tree.prefix`)),name:`prefix`,children:(0,F.jsx)(g,{disabled:t,onBlur:()=>n([`prefix`])})}),(0,F.jsx)(h.Item,{...oo(a(`tree.export`)),name:`export`,valuePropName:`checked`,children:(0,F.jsx)(p,{disabled:t,onChange:()=>r([`export`])})}),e.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:a(`tree.group`)}),(0,F.jsx)(h.Item,{name:`group`,children:(0,F.jsx)(i,{mode:`multiple`,disabled:t,placeholder:a(`tree.group.placeholder`),options:e.map(e=>({label:e,value:e})),onChange:()=>r([`group`])})})]}):null]})},Ds=({onFocusVariable:e,readOnly:t,commitVars:r,queueCommitVars:i})=>{let{t:a}=N();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:a(`tree.vars.local`)}),(0,F.jsx)(h.List,{name:`vars`,children:(r,{add:o,remove:s},{errors:l})=>(0,F.jsxs)(`div`,{className:`b3-list-block`,children:[r.map(n=>(0,F.jsx)(h.Item,{name:n.name,style:{marginBottom:2},validateTrigger:[`onChange`,`onBlur`],rules:[{validator:async(e,t)=>{if(!t?.name||!wi(t.name))throw Error(a(`tree.vars.invalidName`));if(!t.desc?.trim())throw Error(a(`validation.variableDescriptionRequired`))}}],children:(0,F.jsx)(so,{disabled:t,onSubmit:i,onRemove:()=>{s(n.name),i()},onFocusVariable:t?void 0:e})},n.key)),(0,F.jsxs)(h.Item,{style:{marginBottom:0,marginTop:4},children:[(0,F.jsx)(n,{type:`dashed`,block:!0,disabled:t,icon:(0,F.jsx)(c,{}),onClick:()=>o({name:``,desc:``}),children:a(`tree.vars.add`)}),(0,F.jsx)(h.ErrorList,{errors:l})]})]})})]})},Os=({rows:e,onOpenSubtree:t,onFocusVariable:n,readOnly:r})=>{let{t:i}=N();return e.length===0?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:i(`tree.vars.subtree`)}),(0,F.jsx)(`div`,{className:`b3-list-block`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`b3-decl-group`,children:[(0,F.jsxs)(u,{gap:4,align:`center`,className:`b3-subtree-path-row`,children:[(0,F.jsx)(h.Item,{style:{flex:1,marginBottom:0},children:(0,F.jsx)(g,{value:e.path,disabled:!0})}),r?null:(0,F.jsx)(S,{className:`b3-inline-action`,onClick:()=>t(e.path)})]}),(0,F.jsx)(`div`,{className:`b3-decl-vars`,children:e.vars.map(t=>(0,F.jsx)(so,{value:t,disabled:!0,onFocusVariable:r?void 0:n},`${e.path}:${t.name}`))})]},e.path))})]})},ks=({allFiles:e,currentImportRefs:t,importDeclByPath:r,onFocusVariable:i,readOnly:a,commitImportRefs:o,queueCommitImportRefs:s})=>{let{t:d}=N();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:d(`tree.vars.imports`)}),(0,F.jsx)(h.List,{name:`importRefs`,children:(f,{add:p,remove:m},{errors:g})=>(0,F.jsxs)(`div`,{className:`b3-list-block`,children:[f.map(n=>{let c=t[n.name]?.path?.trim()??``,d=c?r.get(c)??[]:[];return(0,F.jsxs)(`div`,{className:`b3-decl-group`,children:[(0,F.jsxs)(u,{gap:4,align:`center`,className:`b3-subtree-path-row`,children:[(0,F.jsx)(h.Item,{name:[n.name,`path`],style:{flex:1,marginBottom:0},children:(0,F.jsx)(l,{disabled:a,options:e.map(e=>({label:e,value:e})),filterOption:to,onBlur:o,onSelect:s})}),a?null:(0,F.jsx)(D,{className:`b3-inline-remove-compact`,onClick:()=>{m(n.name),s()}})]}),(0,F.jsx)(`div`,{className:`b3-decl-vars`,children:d.map(e=>(0,F.jsx)(so,{value:e,disabled:!0,onFocusVariable:a?void 0:i},`${c}:${e.name}`))})]},n.key)}),(0,F.jsxs)(h.Item,{style:{marginBottom:0,marginTop:4},children:[(0,F.jsx)(n,{type:`dashed`,block:!0,disabled:a,icon:(0,F.jsx)(c,{}),onClick:()=>p({path:``}),children:d(`tree.import.add`)}),(0,F.jsx)(h.ErrorList,{errors:g})]})]})})]})},As=({value:e,disabled:t=!1,onChange:n,onRemove:r,onSubmit:i})=>{let{t:a}=N(),[o,s]=P.useState(e??{key:``,value:``}),c=ko(o.value),l=(()=>{switch(c){case`number`:return a(`tree.custom.type.number`);case`boolean`:return a(`tree.custom.type.boolean`);case`invalid`:return a(`tree.custom.type.invalid`);default:return a(`tree.custom.type.string`)}})();(0,P.useEffect)(()=>{s(e??{key:``,value:``})},[e]);let d=()=>{n?.(o),i?.()};return(0,F.jsxs)(u,{gap:4,align:`start`,className:`b3-var-row`,children:[(0,F.jsxs)(re.Compact,{block:!0,className:`b3-var-row-compact`,children:[(0,F.jsx)(O,{title:l,children:(0,F.jsx)(`div`,{className:`b3-custom-type-badge is-${c}`,children:(0,F.jsx)(`span`,{className:`codicon codicon-${Ts(c)}`,"aria-hidden":`true`})})}),(0,F.jsx)(g,{disabled:t,value:o.key,placeholder:a(`tree.custom.key`),onChange:e=>s(t=>({...t,key:e.target.value})),onBlur:d}),(0,F.jsx)(g,{disabled:t,value:o.value,placeholder:a(`tree.custom.value`),onChange:e=>s(t=>({...t,value:e.target.value})),onBlur:d})]}),t?(0,F.jsx)(`div`,{className:`b3-row-spacer`}):(0,F.jsx)(D,{className:`b3-inline-remove`,onClick:r})]})},js=({form:e,readOnly:t,queueCommitCustomRows:r})=>{let{t:i}=N();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(io,{children:i(`tree.custom`)}),(0,F.jsx)(h.List,{name:`customRows`,children:(a,{add:o,remove:s},{errors:l})=>(0,F.jsxs)(`div`,{className:`b3-list-block`,children:[a.map(n=>(0,F.jsx)(h.Item,{name:n.name,style:{marginBottom:2},validateTrigger:[`onChange`,`onBlur`],rules:[{validator:async(t,n)=>{let r=n?.key?.trim();if(!r)throw Error(i(`validation.customKeyRequired`));if((e.getFieldValue(`customRows`)??[]).filter(e=>e?.key?.trim()===r).length>1)throw Error(i(`validation.customKeyDuplicate`,{key:r}));try{Ao([{key:r,value:n?.value??``}])}catch{throw Error(i(`validation.customValueInvalid`))}}}],children:(0,F.jsx)(As,{disabled:t,onSubmit:r,onRemove:()=>{s(n.name),r()}})},n.key)),(0,F.jsxs)(h.Item,{style:{marginBottom:0,marginTop:4},children:[(0,F.jsx)(n,{type:`dashed`,block:!0,disabled:t,icon:(0,F.jsx)(c,{}),onClick:()=>o({key:``,value:``}),children:i(`tree.custom.add`)}),(0,F.jsx)(h.ErrorList,{errors:l})]})]})})]})},Ms=()=>{let e=Y(),t=Wa(),{readOnly:n}=eo(),[r]=h.useForm(),{document:i,groupDefs:a,allFiles:o,variableUsageCount:s,currentImportRefs:c,subtreeRows:l,importDeclByPath:u}=ss(r);if((0,P.useEffect)(()=>{i&&r.setFieldsValue(Go(i,s))},[i,r,s]),!i)return null;let d=n=>{if(t===`inspector-sidebar`){e.hostAdapter.requestFocusVariable([n]);return}e.controller.focusVariable([n])},f=t=>{e.controller.openSubtreePath(t)},p=async t=>{if(n)return;try{await r.validateFields(t,{recursive:!0})}catch{return}let a=r.getFieldsValue(!0),o=Ko(Go(i,s));switch(t[0]){case`desc`:o.desc=a.desc?.trim()||void 0;break;case`prefix`:o.prefix=a.prefix??``;break;case`export`:o.export=a.export!==!1;break;case`group`:o.group=a.group??[];break;case`vars`:o.variables.locals=(a.vars??[]).filter(e=>e.name?.trim()).map(e=>({name:e.name.trim(),desc:e.desc.trim()}));break;case`importRefs`:o.variables.imports=(a.importRefs??[]).map(e=>e.path?.trim()).filter(e=>!!e);break;case`customRows`:o.custom=Ao(a.customRows??[]);break;default:return}us(e.controller.updateTreeMeta(o))},m=e=>{cs(()=>{p(e)})};return(0,F.jsx)(`div`,{className:`b3-inspector-content`,children:(0,F.jsxs)(h,{form:r,className:`b3-inspector-form`,labelCol:{flex:`110px`,xs:{flex:`110px`}},wrapperCol:{flex:`1 1 0%`,xs:{flex:`1 1 0%`}},labelAlign:`right`,requiredMark:!1,children:[(0,F.jsx)(Es,{groupDefs:a,readOnly:n,commitFields:p,queueCommitFields:m}),(0,F.jsx)(Ds,{onFocusVariable:d,readOnly:n,commitVars:()=>void p([`vars`]),queueCommitVars:()=>m([`vars`])}),(0,F.jsx)(Os,{rows:l,onOpenSubtree:f,onFocusVariable:d,readOnly:n}),(0,F.jsx)(ks,{allFiles:o,currentImportRefs:c,importDeclByPath:u,onFocusVariable:d,readOnly:n,commitImportRefs:()=>void p([`importRefs`]),queueCommitImportRefs:()=>m([`importRefs`])}),(0,F.jsx)(js,{form:r,readOnly:n,queueCommitCustomRows:()=>m([`customRows`])})]})})},Ns=()=>(0,F.jsxs)(`div`,{className:`b3-inspector-skeleton-row`,children:[(0,F.jsx)(s.Input,{active:!0,size:`small`,className:`b3-inspector-skeleton-label`}),(0,F.jsx)(s.Input,{active:!0,size:`small`,block:!0,className:`b3-inspector-skeleton-field`})]}),Ps=()=>(0,F.jsx)(`div`,{className:`b3-inspector b3-inspector-skeleton`,children:(0,F.jsx)(Fs,{})}),Fs=()=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`b3-inspector-header`,children:(0,F.jsx)(s.Input,{active:!0,size:`small`,className:`b3-inspector-skeleton-title`})}),(0,F.jsxs)(`div`,{className:`b3-inspector-content b3-inspector-skeleton-content`,children:[(0,F.jsx)(Ns,{}),(0,F.jsx)(Ns,{}),(0,F.jsx)(Ns,{}),(0,F.jsx)(s.Input,{active:!0,size:`small`,className:`b3-inspector-skeleton-section`}),(0,F.jsx)(Ns,{}),(0,F.jsx)(Ns,{})]})]}),Is=({pendingExternalContent:e,onReload:r,onDismiss:i})=>{let{t:a}=N();return(0,F.jsx)(t,{type:`warning`,showIcon:!0,title:a(`editor.externalChangeConflict`),className:`b3-inspector-banner`,action:(0,F.jsxs)(u,{gap:8,children:[(0,F.jsx)(n,{size:`small`,type:`primary`,disabled:!e,onClick:r,children:a(`editor.reloadFromDisk`)}),(0,F.jsx)(n,{size:`small`,onClick:i,children:a(`editor.dismissConflict`)})]})})},Ls=[{command:`behavior3.build`,titleKey:`inspector.embeddedToolbar.build`,codicon:`build`},{command:`behavior3.toggleEditorMode`,titleKey:`inspector.embeddedToolbar.toggleEditorMode`,codicon:`edit-code`},{command:`behavior3.toggleInspectorNodeJson`,titleKey:`inspector.embeddedToolbar.toggleInspectorNodeJson`,codicon:`code`},{command:`behavior3.createProject`,titleKey:`inspector.embeddedToolbar.createProject`,codicon:`new-folder`}],Rs=()=>{let e=Y(),{t}=N();return(0,F.jsx)(`div`,{className:`b3-inspector-header b3-inspector-header-embedded`,children:(0,F.jsxs)(`div`,{className:`b3-inspector-header-row b3-inspector-header-toolbar-row`,children:[(0,F.jsx)(b.Text,{className:`b3-inspector-header-title`,children:`BEHAVIOR3`}),(0,F.jsx)(u,{align:`center`,gap:2,className:`b3-inspector-toolbar-actions`,children:Ls.map(r=>(0,F.jsx)(O,{title:t(r.titleKey),children:(0,F.jsx)(n,{type:`text`,size:`small`,className:`b3-inspector-toolbar-button`,icon:(0,F.jsx)(`span`,{className:`codicon codicon-${r.codicon} b3-inspector-toolbar-codicon`,"aria-hidden":`true`}),"aria-label":t(r.titleKey),onClick:()=>e.hostAdapter.executeInspectorHostCommand(r.command)})},r.command))})]})})},zs=()=>{let e=Y(),{document:t,alertReload:n,pendingExternalContent:r,selectedNode:i,selectedNodeRef:a}=rs(),o=X(e=>e.settings.inspectorMode),s=Xa({documentPresent:!!t,selectedNode:i,selectedNodeRef:a});return s===`skeleton`?(0,F.jsx)(Ps,{}):(0,F.jsxs)(`div`,{className:`b3-inspector`,children:[o===`embedded`?(0,F.jsx)(Rs,{}):null,n?(0,F.jsx)(Is,{pendingExternalContent:r,onReload:()=>void e.controller.revertDocument(),onDismiss:()=>void e.controller.dismissReloadConflict()}):null,s===`node`?(0,F.jsx)(Cs,{}):null,s===`node-pending`?(0,F.jsx)(`div`,{className:`b3-inspector-skeleton`,children:(0,F.jsx)(Fs,{})}):null,s===`tree`?(0,F.jsx)(Ms,{}):null]})},Bs=e=>{if(!(typeof document>`u`))for(let t of[document.body,document.documentElement]){if(!t)continue;let n=getComputedStyle(t).getPropertyValue(e).trim();if(n)return n}},$=(e,t)=>{for(let t of e){let e=Bs(t);if(e)return e}return t},Vs=(e,t)=>{let n=$(e,`${t}px`),r=Number.parseFloat(n);return Number.isFinite(r)?r:t},Hs=e=>Math.max(26,Math.round(e*2+2)),Us=(e,t)=>{let n=e===`dark`,r=t===`inspector-sidebar`;return{elevatedBg:$(r?[`--vscode-sideBarSectionHeader-background`,`--vscode-editorWidget-background`,`--vscode-sideBar-background`]:[`--vscode-editorWidget-background`,`--vscode-sideBarSectionHeader-background`,`--vscode-sideBar-background`],n?`#161b22`:`#f6f8fa`),inputBg:$([`--vscode-input-background`,`--vscode-editorWidget-background`,`--vscode-sideBar-background`],n?`#161b22`:`#ffffff`),inputBorder:$([`--vscode-input-border`,`--vscode-panel-border`,`--vscode-sideBar-border`],n?`#30363d`:`#d0d7de`),overlayBg:$([`--vscode-editorWidget-background`,`--vscode-quickInput-background`,`--vscode-input-background`,`--vscode-sideBarSectionHeader-background`,`--vscode-sideBar-background`],n?`#161b22`:`#ffffff`),overlayBorder:$([`--vscode-editorWidget-border`,`--vscode-widget-border`,`--vscode-input-border`,`--vscode-panel-border`,`--vscode-sideBar-border`],n?`#30363d`:`#d0d7de`),panelBorder:$(r?[`--vscode-sideBarSectionHeader-border`,`--vscode-sideBar-border`,`--vscode-panel-border`,`--vscode-editorWidget-border`]:[`--vscode-sideBar-border`,`--vscode-panel-border`,`--vscode-editorWidget-border`],n?`#30363d`:`#d0d7de`),text:$([`--vscode-foreground`],n?`#e6edf3`:`#1f2328`),textSecondary:$([`--vscode-descriptionForeground`,`--vscode-foreground`],n?`#8b949e`:`#57606a`),textTertiary:$([`--vscode-disabledForeground`,`--vscode-descriptionForeground`],n?`#6e7681`:`#6e7781`),textLink:$([`--vscode-textLink-foreground`,`--vscode-focusBorder`,`--vscode-button-background`],n?`#58a6ff`:`#0969da`),focusBorder:$([`--vscode-focusBorder`,`--vscode-textLink-foreground`,`--vscode-button-background`],n?`#2f81f7`:`#0969da`),buttonBg:$([`--vscode-button-background`,`--vscode-textLink-foreground`],n?`#238636`:`#0969da`),buttonFg:$([`--vscode-button-foreground`,`--vscode-editor-background`],`#ffffff`),buttonHoverBg:$([`--vscode-button-hoverBackground`,`--vscode-button-background`],n?`#2ea043`:`#1f6feb`),listHoverBg:$([`--vscode-list-hoverBackground`,`--vscode-toolbar-hoverBackground`,`--vscode-editorHoverWidget-background`],n?`#30363d`:`#eaeef2`),listSelectedBg:$([`--vscode-list-activeSelectionBackground`,`--vscode-list-inactiveSelectionBackground`,`--vscode-button-background`],n?`#2f81f7`:`#0969da`),listSelectedFg:$([`--vscode-list-activeSelectionForeground`,`--vscode-button-foreground`,`--vscode-foreground`],`#ffffff`),error:$([`--vscode-errorForeground`,`--vscode-inputValidation-errorForeground`],n?`#f85149`:`#cf222e`),warning:$([`--vscode-editorWarning-foreground`,`--vscode-problemsWarningIcon-foreground`,`--vscode-notificationsWarningIcon-foreground`],n?`#d29922`:`#9a6700`)}},Ws=e=>`0 0 0 1px ${e}`,Gs=e=>`0 0 0 1px ${e}`,Ks=(e,t)=>{let n=Us(e,t),r=Vs([`--vscode-font-size`,`--vscode-editor-font-size`],13),i=Hs(r);return{cssVar:{},algorithm:e===`dark`?ee.darkAlgorithm:ee.defaultAlgorithm,token:{fontSize:r,controlHeight:i,controlHeightSM:Math.max(22,i-4),controlHeightLG:i+4,colorPrimary:n.buttonBg,colorInfo:n.buttonBg,colorLink:n.textLink,colorError:n.error,colorWarning:n.warning,colorBgElevated:n.elevatedBg,colorBorder:n.panelBorder,colorBorderDisabled:n.panelBorder,colorBorderSecondary:n.panelBorder,colorText:n.text,colorTextSecondary:n.textSecondary,colorTextTertiary:n.textTertiary,colorTextPlaceholder:n.textTertiary,colorFillTertiary:n.listHoverBg,boxShadowSecondary:`none`,borderRadius:4},components:{Tree:{borderRadius:0},Tabs:{horizontalMargin:`0`},Layout:{headerColor:n.text,lightTriggerColor:n.text},Input:{colorBgContainer:n.inputBg,colorBorder:n.inputBorder,addonBg:n.elevatedBg,activeBg:n.inputBg,hoverBg:n.inputBg,hoverBorderColor:n.focusBorder,activeBorderColor:n.focusBorder,activeShadow:Ws(n.focusBorder),errorActiveShadow:Ws(n.error),warningActiveShadow:Ws(n.warning)},InputNumber:{colorBgContainer:n.inputBg,colorBorder:n.inputBorder,addonBg:n.elevatedBg,activeBg:n.inputBg,hoverBg:n.inputBg,hoverBorderColor:n.focusBorder,activeBorderColor:n.focusBorder,activeShadow:Ws(n.focusBorder),errorActiveShadow:Ws(n.error),warningActiveShadow:Ws(n.warning),handleBg:n.inputBg,handleBorderColor:n.panelBorder,handleHoverColor:n.focusBorder},Select:{colorBgContainer:n.inputBg,colorBgElevated:n.overlayBg,colorBorder:n.inputBorder,boxShadowSecondary:Gs(n.overlayBorder),selectorBg:n.inputBg,clearBg:n.inputBg,hoverBorderColor:n.focusBorder,activeBorderColor:n.focusBorder,activeOutlineColor:n.focusBorder,optionSelectedBg:n.listSelectedBg,optionSelectedColor:n.listSelectedFg,optionSelectedFontWeight:500,optionActiveBg:n.listHoverBg,multipleItemBg:n.listHoverBg,multipleItemBorderColor:n.panelBorder,multipleSelectorBgDisabled:n.elevatedBg,multipleItemColorDisabled:n.textTertiary,multipleItemBorderColorDisabled:n.panelBorder},Button:{defaultShadow:`none`,primaryShadow:`none`,dangerShadow:`none`,defaultColor:n.text,defaultBorderColor:n.panelBorder,defaultHoverBg:n.listHoverBg,defaultHoverColor:n.text,defaultHoverBorderColor:n.focusBorder,defaultActiveBg:n.listHoverBg,defaultActiveColor:n.text,defaultActiveBorderColor:n.focusBorder,primaryColor:n.buttonFg,solidTextColor:n.buttonFg,textTextColor:n.text,textTextHoverColor:n.text,textTextActiveColor:n.text,textHoverBg:n.listHoverBg,linkHoverBg:`transparent`},Form:{labelColor:n.textSecondary,labelRequiredMarkColor:n.error},Dropdown:{motionDurationMid:`0.1s`}}}},qs=(e,t=0,n=`editor`)=>Ks(e,n),Js=new Set([`textbox`,`combobox`,`searchbox`,`spinbutton`]),Ys=(e,t)=>typeof e.tagName==`string`&&e.tagName.toUpperCase()===t,Xs=e=>{let t=e.getAttribute?.(`role`)?.toLowerCase();return!!(t&&Js.has(t))},Zs=e=>!!e.closest?.([`.ant-select`,`.ant-select-dropdown`,`.ant-picker`,`.ant-picker-dropdown`,`.ant-input-number`,`.ant-input-affix-wrapper`,`.ant-mentions`,`.ant-mentions-dropdown`].join(`,`)),Qs=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return Ys(t,`INPUT`)||Ys(t,`TEXTAREA`)||!!t.isContentEditable||Xs(t)||Zs(t)},$s=()=>({selectedNode:Ka(e=>e.selectedNodeSnapshot),selectedNodeRef:Ka(e=>e.selectedNodeRef),searchOpen:qa(e=>e.search.open),rootStableId:Ga(e=>e.persistedTree?.root.uuid??null)}),ec=(...e)=>e.filter(Boolean).join(` `),tc=({focusToken:e,onClose:t})=>{let r=Y(),{t:i}=N(),a=qa(e=>e.search),o=(0,P.useRef)(null);if((0,P.useEffect)(()=>{if(!a.open)return;let e=requestAnimationFrame(()=>{o.current?.focus()});return()=>cancelAnimationFrame(e)},[e,a.mode,a.open]),!a.open)return null;let s=()=>{r.controller.updateSearch(a.query)};return(0,F.jsx)(u,{className:`b3-search-overlay`,children:(0,F.jsxs)(u,{className:`b3-search-box`,children:[(0,F.jsx)(g,{ref:o,size:`small`,className:`b3-search-input`,value:a.query,placeholder:a.mode===`id`?i(`jumpNode`):i(`searchNode`),onChange:e=>{r.controller.updateSearch(e.target.value)},onKeyDownCapture:e=>{e.code===z.Enter?(e.preventDefault(),r.controller.nextSearchResult()):(e.ctrlKey||e.metaKey)&&e.code===`KeyF`?(e.preventDefault(),r.controller.openSearch(`content`)):(e.ctrlKey||e.metaKey)&&e.code===`KeyG`&&(e.preventDefault(),r.controller.openSearch(`id`)),e.stopPropagation()},suffix:(0,F.jsxs)(u,{gap:2,className:`b3-search-suffix`,children:[a.mode===`id`?null:(0,F.jsx)(n,{type:`text`,size:`small`,className:ec(`b3-search-filter`,a.caseSensitive&&`b3-search-filter-selected`),icon:(0,F.jsx)(we,{style:{width:`18px`,height:`18px`}}),onClick:()=>{sa(r.graphUiStore,{caseSensitive:!a.caseSensitive}),s()}}),(0,F.jsx)(n,{type:`text`,size:`small`,className:ec(`b3-search-filter`,a.focusOnly&&`b3-search-filter-selected`),icon:(0,F.jsx)(be,{}),onClick:()=>{sa(r.graphUiStore,{focusOnly:!a.focusOnly}),s()}})]})},a.mode),(0,F.jsx)(`div`,{className:`b3-search-counter`,children:a.results.length>0?`${a.index+1}/${a.results.length}`:``}),a.mode===`id`?null:(0,F.jsx)(n,{icon:(0,F.jsx)(_,{}),type:`text`,size:`small`,style:{width:`30px`},disabled:a.results.length===0,onClick:()=>void r.controller.nextSearchResult()}),a.mode===`id`?null:(0,F.jsx)(n,{icon:(0,F.jsx)(T,{}),type:`text`,size:`small`,style:{width:`30px`},disabled:a.results.length===0,onClick:()=>void r.controller.prevSearchResult()}),(0,F.jsx)(n,{icon:(0,F.jsx)(v,{}),type:`text`,size:`small`,style:{width:`30px`},onClick:()=>{ca(r.graphUiStore),r.controller.updateSearch(``),t?.()}})]})})},nc={[z.Copy]:`copy`,[z.Replace]:`replace`,[z.Paste]:`paste`,[z.Insert]:`insert`,[z.Enter]:`insert`,[z.Delete]:`delete`,[z.Backspace]:`delete`,[z.Undo]:`undo`,[z.Redo]:`redo`},rc=()=>{let e=Y(),{message:t}=r.useApp(),{t:n}=N(),i=e.graphAdapter,a=(0,P.useRef)(null),o=(0,P.useRef)(null),[s,c]=(0,P.useState)(0),{selectedNode:l,selectedNodeRef:d,searchOpen:f,rootStableId:p}=$s(),m=!!(l?.subtreeNode||l?.data.path),h=!!(l&&p&&d?.structuralStableId&&d.structuralStableId===p),g=Za(l?.data.path,d),_=(0,P.useMemo)(()=>{let e=(e,t)=>(0,F.jsxs)(u,{justify:`space-between`,gap:24,style:{minWidth:180},children:[(0,F.jsx)(`span`,{children:e}),(0,F.jsx)(`span`,{children:t??``})]}),t=e=>(0,F.jsx)(`span`,{className:`codicon codicon-${e} b3-context-menu-icon`,"aria-hidden":`true`}),r=(t,n,r,i,a)=>({key:t,icon:r,label:e(n,i),disabled:a});return[r(`copy`,n(`copy`),t(`copy`),L?`⌘+C`:`Ctrl+C`,!l),r(`paste`,n(`paste`),t(`files`),L?`⌘+V`:`Ctrl+V`,!l||m),r(`replace`,n(`replace`),t(`replace-all`),L?`⇧+⌘+V`:`Ctrl+Shift+V`,!l||m),r(`insert`,n(`insertNode`),t(`insert`),L?`⏎`:`Enter`,!l||m),r(`delete`,n(`deleteNode`),t(`trash`),L?`⌫`:`Delete`,!l||l.subtreeNode||h),g?r(`openSubtree`,n(`editSubtree`),t(`folder-opened`)):null,r(`saveAsSubtree`,n(`saveAsSubtree`),t(`save-as`),void 0,!l||m||h)].filter(Boolean)},[g,h,l,m,n]),v=async t=>{switch(t){case`copy`:await e.controller.copyNode();break;case`paste`:await e.controller.pasteNode();break;case`replace`:await e.controller.replaceNode();break;case`insert`:await e.controller.insertNode();break;case`delete`:await e.controller.deleteNode();break;case`openSubtree`:await e.controller.openSelectedSubtree();break;case`saveAsSubtree`:await e.controller.saveSelectedAsSubtree();break;default:break}};return Le([z.SearchNode,z.JumpNode],null,(t,n)=>{Qs(t.target)||(t.preventDefault(),t.stopPropagation(),c(e=>e+1),e.controller.openSearch(n===z.JumpNode?`id`:`content`))}),Le([z.Copy,z.Replace,z.Paste,z.Insert,z.Enter,z.Delete,z.Backspace,z.Undo,z.Redo],null,(t,n)=>{if(Qs(t.target))return;t.preventDefault(),t.stopPropagation();let r=nc[n];if(r)switch(r){case`copy`:e.controller.copyNode();break;case`paste`:e.controller.pasteNode();break;case`replace`:e.controller.replaceNode();break;case`insert`:e.controller.insertNode();break;case`delete`:e.controller.deleteNode();break;case`undo`:e.controller.undo();break;case`redo`:e.controller.redo();break;default:break}}),(0,P.useEffect)(()=>{let n=a.current;if(n)return i.mount(n,{onCanvasSelected:()=>void e.controller.selectTree(),onNodeSelected:(t,n)=>void e.controller.selectNode(t.instanceKey,{force:n?.force,clearVariableFocus:n?.clearVariableFocus}),onNodeDoubleClicked:t=>void e.controller.openSelectedSubtree(t),onVariableHotspotClicked:(t,n)=>void e.controller.focusVariable(n.variableNames),onDropCommitted:async n=>{try{await e.controller.performDrop(n)}catch(e){t.error(e instanceof Error?e.message:String(e))}}}),()=>i.unmount()},[i,t,e.controller]),(0,F.jsxs)(`div`,{ref:o,className:`b3-graph-shell`,tabIndex:-1,children:[f?(0,F.jsx)(tc,{focusToken:s,onClose:()=>o.current?.focus({preventScroll:!0})}):null,(0,F.jsx)(te,{menu:{items:_,onClick:({key:e})=>void v(String(e))},trigger:[`contextMenu`],children:(0,F.jsx)(`div`,{ref:a,className:`b3-graph`,tabIndex:-1})})]})},ic=()=>{let e=Y(),t=r.useApp();return(0,P.useLayoutEffect)(()=>(e.appHooks.bind({message:t.message,modal:t.modal,notification:t.notification}),()=>{e.appHooks.reset()}),[t.message,t.modal,t.notification,e]),null},{Content:ac,Sider:oc}=x,sc=()=>{let e=Y(),{message:t}=r.useApp(),{toggleNodeJsonVisible:n}=ke(),{t:i}=N(),{theme:a,language:o,hasDocument:s}=Ja(),c=X(e=>e.settings.inspectorMode);return(0,P.useEffect)(()=>{let r=t=>{Ma(e.workspaceStore,t)},i=()=>{Co(e.workspaceStore.getState().filePath,e.selectionStore.getState())},a=e=>{let n=e.message.trim()||I.t(e.success?`build.success`:`build.failed`);e.success?t.success(n):t.error(n)},o=e.hostAdapter.connect(t=>{switch(t.type){case`init`:(async()=>{await Pe(t.payload.settings.language),await e.controller.initFromHost(t.payload),i()})();return;case`documentSnapshotChanged`:(async()=>{await e.controller.applyDocumentSnapshot(t.snapshot),i()})();return;case`focusVariable`:e.controller.focusVariable(t.names);return;case`focusNode`:e.controller.revealNode(t.target);return;case`themeChanged`:r(t.theme),e.controller.refreshGraph({preserveSelection:!0});return;case`settingLoaded`:(async()=>{t.settings?.language&&await Pe(t.settings.language),Na(e.workspaceStore,t.settings??{}),await e.controller.applyNodeDefs(t.nodeDefs)})();return;case`varDeclLoaded`:e.controller.applyHostVars(t.payload);return;case`subtreeFileChanged`:e.controller.markSubtreeChanged();return;case`inspectorContextCleared`:return;case`toggleInspectorNodeJson`:if(!e.selectionStore.getState().selectedNodeRef)return;n();return;case`buildResult`:a(t);return}});return e.hostAdapter.sendReady(),o},[t,e]),(0,P.useEffect)(()=>{let t=()=>{if(typeof document>`u`||document.visibilityState!==`visible`)return;let t=e.graphUiStore.getState().selectionVisualHint?.selectedNodeKey??e.selectionStore.getState().selectedNodeKey;if(t){e.controller.selectNode(t,{force:!0});return}e.selectionStore.getState().selectedTree&&e.controller.selectTree()},n=()=>{document.visibilityState===`visible`&&t()};return window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,n)}},[e]),(0,P.useLayoutEffect)(()=>{ka(a)},[a]),(0,P.useEffect)(()=>{Pe(o)},[o]),(0,F.jsx)(x,{className:`b3-shell`,children:(0,F.jsxs)(x,{className:`b3-body`,children:[(0,F.jsx)(ac,{className:`b3-content`,children:s?(0,F.jsx)(rc,{}):(0,F.jsx)(u,{className:`b3-loading`,justify:`center`,align:`center`,children:(0,F.jsx)(b.Text,{type:`secondary`,children:i(`editor.loading`)})})}),c===`embedded`?(0,F.jsx)(oc,{width:380,className:`b3-sider b3-sider-embedded`,children:(0,F.jsx)($a,{children:(0,F.jsx)(zs,{})})}):null]})})},cc=()=>{let{theme:e,language:t,themeVersion:n,webviewKind:i}=Ya();return(0,F.jsx)(y,{locale:Ra(t),theme:qs(e,n,i),children:(0,F.jsx)(r,{style:{height:`100%`},children:(0,F.jsxs)(Oe,{children:[(0,F.jsx)(ic,{}),(0,F.jsx)(sc,{})]})})})},lc=e=>{e.documentStore.setState(()=>xi()),e.selectionStore.setState(()=>Ea()),e.graphUiStore.setState(()=>la()),e.workspaceStore.setState(e=>({...Pa(),settings:e.settings,themeVersion:e.themeVersion}))},uc=()=>{let e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&e.blur()},dc=async(e,t)=>{await Pe(t.settings.language),await e.controller.initFromHost(t)},fc=(e,t)=>{e.workspaceStore.setState(e=>({...e,usingVars:t.usingVars,allFiles:t.allFiles??e.allFiles,importDecls:t.importDecls,subtreeDecls:t.subtreeDecls}))},pc=e=>{let{selectedNodeRef:t}=e.selectionStore.getState();return t?{kind:`node`,ref:t}:{kind:`tree`}},mc=e=>{e.graphUiStore.setState(e=>({...e,activeVariableNames:[]})),uc(),window.setTimeout(()=>{uc(),window.setTimeout(()=>{uc()},0)},0)},hc=(e,t)=>!V(pc(e),t),gc=()=>{let e=Y(),{toggleNodeJsonVisible:t}=ke(),n=(0,P.useRef)(null);return(0,P.useEffect)(()=>{let r=t=>{Co(t??e.workspaceStore.getState().filePath,e.selectionStore.getState())},i=e.hostAdapter.connect(i=>{switch(i.type){case`init`:(async()=>{n.current=i.payload.filePath;let t=hc(e,i.payload.selection);await dc(e,i.payload),r(i.payload.filePath),t&&mc(e)})();return;case`documentSnapshotChanged`:(async()=>{let t=hc(e,i.snapshot.selection);await e.controller.applyDocumentSnapshot(i.snapshot),r(n.current),t&&mc(e)})();return;case`varDeclLoaded`:fc(e,i.payload);return;case`settingLoaded`:(async()=>{i.settings?.language&&await Pe(i.settings.language),e.workspaceStore.setState(e=>({...e,nodeDefs:i.nodeDefs,groupDefs:xr(i.nodeDefs),settings:{...e.settings,...i.settings}}))})();return;case`themeChanged`:e.workspaceStore.setState(e=>({...e,settings:{...e.settings,theme:i.theme},themeVersion:e.themeVersion+1}));return;case`inspectorContextCleared`:n.current=null,lc(e);return;case`toggleInspectorNodeJson`:t();return;case`subtreeFileChanged`:case`buildResult`:return}});return e.hostAdapter.sendReady(),i},[e]),null},_c=()=>{let e=Y(),{t}=N(),n=X(e=>e.settings.theme),r=X(e=>e.settings.inspectorMode),i=Ga(e=>e.persistedTree!==null);return(0,P.useLayoutEffect)(()=>{ka(n)},[n]),(0,P.useEffect)(()=>{let t=t=>{if(t.defaultPrevented||!i||t.isComposing)return;if((t.metaKey||t.ctrlKey)&&!t.altKey&&t.code===`KeyS`){t.preventDefault(),t.stopPropagation(),(async()=>{await fs(),await e.controller.saveDocument()})();return}let n=(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&t.code===`KeyZ`,r=(t.metaKey||t.ctrlKey)&&!t.altKey&&(L&&t.shiftKey&&t.code===`KeyZ`||!L&&!t.shiftKey&&t.code===`KeyY`);!n&&!r||Qs(t.target)||(t.preventDefault(),t.stopPropagation(),(async()=>{await fs(),n?await e.controller.undo():await e.controller.redo()})())};return window.addEventListener(`keydown`,t,!0),()=>{window.removeEventListener(`keydown`,t,!0)}},[i,e]),r===`embedded`?(0,F.jsx)(u,{className:`b3-inspector-empty`,justify:`center`,align:`center`,children:(0,F.jsx)(b.Text,{type:`secondary`,children:t(`inspector.embeddedModeNotice`)})}):i?(0,F.jsx)($a,{children:(0,F.jsx)(zs,{})}):(0,F.jsx)(u,{className:`b3-inspector-empty`,justify:`center`,align:`center`,children:(0,F.jsx)(b.Text,{type:`secondary`,children:t(`inspector.noActiveDocument`)})})},vc=()=>{let{theme:e,language:t,themeVersion:n,webviewKind:i}=Ya();return(0,F.jsx)(y,{locale:Ra(t),theme:qs(e,n,i),children:(0,F.jsx)(r,{style:{height:`100%`},children:(0,F.jsxs)(Oe,{children:[(0,F.jsx)(ic,{}),(0,F.jsx)(gc,{}),(0,F.jsx)(_c,{})]})})})},yc=({runtime:e})=>(0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(Ua,{runtime:e,children:(0,F.jsx)(vc,{})})}),bc=ja(),xc=Va(bc);document.documentElement.setAttribute(`data-webview-kind`,bc),document.body?.setAttribute(`data-webview-kind`,bc),ka(Oa()),Ee.createRoot(document.getElementById(`root`)).render(bc===`inspector-sidebar`?(0,F.jsx)(yc,{runtime:xc}):(0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(Ua,{runtime:xc,children:(0,F.jsx)(cc,{})})}));
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="stylesheet" href="./codicons/codicon.css" />
7
7
  <title>Behavior3 Editor</title>
8
- <script type="module" crossorigin src="./assets/editor-BPxOdZMY.js"></script>
8
+ <script type="module" crossorigin src="./assets/editor-DQTG2Z7M.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-BYbx6iT9.js">
10
10
  <link rel="modulepreload" crossorigin href="./assets/graph-vendor-ww5KcpJ-.js">
11
11
  <link rel="modulepreload" crossorigin href="./assets/ui-vendor-CpXf__no.js">
@@ -196,6 +196,19 @@
196
196
  "runtime.nodeCheckRuntimeHasErrors": "Checker runtime has errors.",
197
197
  "runtime.invalidSavedSubtreePath": "Host returned an invalid saved subtree path.",
198
198
  "runtime.unsupportedDocumentMutation": "Unsupported document mutation.",
199
+ "runtime.visibleHookNotRegistered": "Visible '{{name}}' is not registered.",
200
+ "runtime.visibleHookFailed": "Visible '{{name}}' failed: {{error}}",
201
+ "runtime.visibleExpressionDisabled": "Visible expression is disabled; enable settings.allowNewFunction.",
202
+ "runtime.visibleExpressionCompileFailed": "Visible expression failed to compile: {{error}}",
203
+ "runtime.visibleExpressionFailed": "Visible expression failed: {{error}}",
204
+ "runtime.visibleExpressionUnknownArg": "Visible expression referenced args.{{property}}, but '{{property}}' is not in the defined arg scope (defined args: {{definedArgs}}).",
205
+ "runtime.visibleExpressionNoArgs": "Visible expression referenced args.{{property}}, but this node defines no args.",
206
+ "runtime.visibleExpressionUnknownSlotIndex": "Visible expression referenced {{fieldKind}}[{{index}}], but {{definedScope}}.",
207
+ "runtime.visibleExpressionInvalidSlotProperty": "Visible expression referenced {{fieldKind}}.{{property}}, but {{fieldKind}} only supports defined numeric slot indices.",
208
+ "runtime.visibleSlotScopeNone": "this node defines no {{fieldKind}} slots",
209
+ "runtime.visibleSlotScopeIndex": "the defined {{fieldKind}} index is {{start}}",
210
+ "runtime.visibleSlotScopeRange": "the defined {{fieldKind}} indices are {{start}}..{{end}}",
211
+ "runtime.visibleSlotScopeRangeVariadic": "the defined {{fieldKind}} indices are {{start}}..{{end}}+",
199
212
 
200
213
  "override.resetTitle": "Reset this override?",
201
214
 
@@ -195,6 +195,19 @@
195
195
  "runtime.nodeCheckRuntimeHasErrors": "checker 运行时存在错误。",
196
196
  "runtime.invalidSavedSubtreePath": "宿主返回了无效的 subtree 保存路径。",
197
197
  "runtime.unsupportedDocumentMutation": "不支持此文档修改。",
198
+ "runtime.visibleHookNotRegistered": "visible “{{name}}” 未注册。",
199
+ "runtime.visibleHookFailed": "visible “{{name}}” 执行失败:{{error}}",
200
+ "runtime.visibleExpressionDisabled": "visible 表达式已禁用;请启用 settings.allowNewFunction。",
201
+ "runtime.visibleExpressionCompileFailed": "visible 表达式编译失败:{{error}}",
202
+ "runtime.visibleExpressionFailed": "visible 表达式执行失败:{{error}}",
203
+ "runtime.visibleExpressionUnknownArg": "visible 表达式引用了 args.{{property}},但 “{{property}}” 不在已定义的参数范围内(已定义参数:{{definedArgs}})。",
204
+ "runtime.visibleExpressionNoArgs": "visible 表达式引用了 args.{{property}},但当前节点未定义参数。",
205
+ "runtime.visibleExpressionUnknownSlotIndex": "visible 表达式引用了 {{fieldKind}}[{{index}}],但{{definedScope}}。",
206
+ "runtime.visibleExpressionInvalidSlotProperty": "visible 表达式引用了 {{fieldKind}}.{{property}},但 {{fieldKind}} 仅支持已定义的数字槽位索引。",
207
+ "runtime.visibleSlotScopeNone": "当前节点未定义{{fieldKind}}槽位",
208
+ "runtime.visibleSlotScopeIndex": "已定义的{{fieldKind}}槽位索引只有 {{start}}",
209
+ "runtime.visibleSlotScopeRange": "已定义的{{fieldKind}}槽位索引范围是 {{start}}..{{end}}",
210
+ "runtime.visibleSlotScopeRangeVariadic": "已定义的{{fieldKind}}槽位索引范围是 {{start}}..{{end}}+",
198
211
 
199
212
  "override.resetTitle": "重置此覆盖?",
200
213
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vscode-behavior3",
3
3
  "displayName": "%extension.displayName%",
4
4
  "description": "%extension.description%",
5
- "version": "2.5.1",
5
+ "version": "2.6.0",
6
6
  "publisher": "codetypess",
7
7
  "repository": {
8
8
  "type": "git",
@@ -180,6 +180,8 @@ export type BuildEnv = {
180
180
  workdir: string;
181
181
  nodeDefs: ReadonlyMap<string, NodeDef>;
182
182
  logger: BuildLogger;
183
+ allowNewFunction?: boolean;
184
+ language?: string;
183
185
  };
184
186
 
185
187
  export type NodeFieldCheckResult = string | string[] | null | undefined;
@@ -87,6 +87,7 @@ export const hasArgOptions = (arg: NodeArg) => arg.options !== undefined;
87
87
  /** `.b3-workspace` file shape. Extension build only reads `settings`; `files` is optional (desktop may still use it). */
88
88
  export interface WorkspaceModel {
89
89
  settings: {
90
+ allowNewFunction?: boolean;
90
91
  checkExpr?: boolean;
91
92
  buildScript?: string;
92
93
  checkScripts?: string[];