From 10736917940c071efe7833f85bb59211a4aa43d4 Mon Sep 17 00:00:00 2001 From: barsdeveloper Date: Mon, 27 Jan 2025 22:29:52 +0200 Subject: [PATCH] Link direction and minor fixes --- .vscode/launch.json | 35 ----------- dist/ueblueprint.js | 63 +++++++++---------- dist/ueblueprint.min.js | 4 +- js/element/LinkElement.js | 8 +-- js/element/PinElement.js | 15 +++-- js/template/LinkTemplate.js | 16 ++--- js/template/node/KnotNodeTemplate.js | 18 +++--- js/template/pin/BoolPinTemplate.js | 4 +- js/template/pin/LinearColorPinTemplate.js | 3 +- ...> mirroredExportPathInnerRenaming.spec.js} | 29 --------- tests/mirroredExportPathRenaming.spec.js | 30 +++++++++ 11 files changed, 94 insertions(+), 131 deletions(-) delete mode 100755 .vscode/launch.json rename tests/{mirroredExportPath.spec.js => mirroredExportPathInnerRenaming.spec.js} (86%) create mode 100644 tests/mirroredExportPathRenaming.spec.js diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100755 index 0b69d9d..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch index.html", - "type": "firefox", - "request": "launch", - "reAttach": true, - "file": "${workspaceFolder}/index.html" - }, - { - "name": "Launch localhost", - "type": "firefox", - "request": "launch", - "reAttach": true, - "url": "http://localhost/index.html", - "webRoot": "${workspaceFolder}" - }, - { - "name": "Attach", - "type": "firefox", - "request": "attach" - }, - { - "name": "Launch WebExtension", - "type": "firefox", - "request": "launch", - "reAttach": true, - "addonPath": "${workspaceFolder}" - } - ] -} \ No newline at end of file diff --git a/dist/ueblueprint.js b/dist/ueblueprint.js index 353ddd7..925fd1f 100755 --- a/dist/ueblueprint.js +++ b/dist/ueblueprint.js @@ -7677,14 +7677,14 @@ class LinkTemplate extends IFromToPositionedTemplate { const to = this.element.targetX; // Switch actual input/output pins if allowed and makes sense - if (isOriginAKnot && (!targetPin || isTargetAKnot)) { + if (isOriginAKnot && !targetPin) { if (originPin?.isInputLoosely() && to > from + Configuration.distanceThreshold) { this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin(); } else if (originPin?.isOutputLoosely() && to < from - Configuration.distanceThreshold) { this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin(); } } - if (isTargetAKnot && (!originPin || isOriginAKnot)) { + if (isTargetAKnot && !originPin) { if (targetPin?.isInputLoosely() && to < from - Configuration.distanceThreshold) { this.element.target = /** @type {KnotPinTemplate} */(targetPin.template).getoppositePin(); } else if (targetPin?.isOutputLoosely() && to > from + Configuration.distanceThreshold) { @@ -7694,16 +7694,11 @@ class LinkTemplate extends IFromToPositionedTemplate { // Switch visual input/output pins if allowed and makes sense if (originPin && targetPin) { - let directionsCheckedKnot; - if (originPin?.isKnot()) { - // The target end has moved and origin end is a knot - directionsCheckedKnot = originPin.nodeElement; - } else if (targetPin?.isKnot()) { - // The origin end has moved and target end is a knot - directionsCheckedKnot = targetPin.nodeElement; + if (originPin.isKnot() && originPin.hasUpdated) { + /** @type {KnotNodeTemplate} */(originPin.nodeElement.template).checkSwtichDirectionsVisually(); } - if (directionsCheckedKnot && directionsCheckedKnot.hasUpdated) { - /** @type {KnotNodeTemplate} */(directionsCheckedKnot.template).checkSwtichDirectionsVisually(); + if (targetPin.isKnot() && targetPin.hasUpdated) { + /** @type {KnotNodeTemplate} */(targetPin.nodeElement.template).checkSwtichDirectionsVisually(); } } @@ -8164,12 +8159,12 @@ class LinkElement extends IFromToPositionedElement { this.origin = pin; } - /** @param {NodeElement} pin */ - getOtherPin(pin) { - if (this.origin?.nodeElement === pin) { + /** @param {NodeElement} node */ + getOtherPin(node) { + if (this.origin?.nodeElement === node) { return this.target } - if (this.target?.nodeElement === pin) { + if (this.target?.nodeElement === node) { return this.origin } } @@ -9858,25 +9853,27 @@ class KnotNodeTemplate extends NodeTemplate { } checkSwtichDirectionsVisually() { - let leftPinsLocation = 0; + let leftPinsDelta = 0; let leftPinsCount = 0; - let rightPinsLocation = 0; + let rightPinsDelta = 0; let rightPinsCount = 0; + const location = this.outputPin.getLinkLocation()[0]; const links = this.getAllConnectedLinks(); for (const link of links) { const pin = link.getOtherPin(this.element); + const delta = pin.getLinkLocation()[0] - location; if (pin?.isInput()) { - rightPinsLocation += pin.getLinkLocation()[0]; + rightPinsDelta += delta; ++rightPinsCount; } else if (pin?.isOutput()) { - leftPinsLocation += pin.getLinkLocation()[0]; + leftPinsDelta += delta; ++leftPinsCount; } } - leftPinsLocation /= leftPinsCount; - rightPinsLocation /= rightPinsCount; - if ((rightPinsLocation < leftPinsLocation) != this.switchDirectionsVisually) { - this.switchDirectionsVisually = rightPinsLocation < leftPinsLocation; + leftPinsDelta /= leftPinsCount; + rightPinsDelta /= rightPinsCount; + if ((rightPinsDelta < leftPinsDelta) != this.switchDirectionsVisually) { + this.switchDirectionsVisually = rightPinsDelta < leftPinsDelta; } } } @@ -12210,7 +12207,9 @@ class BoolPinTemplate extends PinTemplate { renderInput() { return x` - + ` } } @@ -12991,7 +12990,8 @@ class LinearColorPinTemplate extends PinTemplate { renderInput() { return x` - @@ -13432,9 +13432,7 @@ class PinElement extends IElement { /** @type {PinElement} */ let result = this; if (ignoreKnots) { - if (ignoreKnots) { - return this.#traverseKnots(result)?.isOutput() - } + return this.#traverseKnots(result)?.isOutput() } return result.entity.isOutput() } @@ -13510,12 +13508,11 @@ class PinElement extends IElement { const pinReference = this.createPinReference(); if ( this.isLinked - && ( - this.isInput(true) - || this.isOutput(true) && (this.entity.isExecution() || targetPinElement.entity.isExecution()) - ) - && !this.getLinks().some(ref => pinReference.equals(ref)) + && this.entity.isExecution() + && this.isOutput(true) + && this.getLinks().some(ref => !pinReference.equals(ref)) ) { + if (this.isKnot()) ; this.unlinkFromAll(); } if (this.entity.linkTo(targetPinElement.getNodeElement().getNodeName(), targetPinElement.entity)) { diff --git a/dist/ueblueprint.min.js b/dist/ueblueprint.min.js index 4f3f188..d12782f 100755 --- a/dist/ueblueprint.min.js +++ b/dist/ueblueprint.min.js @@ -20,7 +20,7 @@ const E=globalThis,C=E.trustedTypes,N=C?C.createPolicy("lit-html",{createHTML:e= * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -class re extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const s=i?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=i?.renderBefore??null;s._$litPart$=r=new W(t.insertBefore(M(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return _}}re._$litElement$=!0,re.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:re});const ne=globalThis.litElementPolyfillSupport;ne?.({LitElement:re}),(globalThis.litElementVersions??=[]).push("4.1.1");class ae{static VERSION="2.0.0";static nodeColors={black:n``,blue:n``,darkBlue:n``,darkerBlue:n``,darkTurquoise:n``,gray:n``,green:n``,intenseGreen:n``,lime:n``,red:n``,turquoise:n``,violet:n``,yellow:n``};static alphaPattern="repeating-conic-gradient(#7c8184 0% 25%, #c2c3c4 0% 50%) 50% / 10px 10px";static colorDragEventName="ueb-color-drag";static colorPickEventName="ueb-color-pick";static colorWindowEventName="ueb-color-window";static colorWindowName="Color Picker";static defaultCommentHeight=96;static defaultCommentWidth=400;static distanceThreshold=20;static dragEventName="ueb-drag";static dragGeneralEventName="ueb-drag-general";static edgeScrollThreshold=50;static editTextEventName={begin:"ueb-edit-text-begin",end:"ueb-edit-text-end"};static expandGridSize=400;static focusEventName={begin:"blueprint-focus",end:"blueprint-unfocus"};static fontSize=n``;static gridExpandThreshold=.25;static gridLineWidth=1;static gridSet=8;static gridShrinkThreshold=4;static gridSize=16;static hexColorRegex=/^\s*#(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})([0-9a-fA-F]{2})?|#(?[0-9a-fA-F])(?[0-9a-fA-F])(?[0-9a-fA-F])\s*$/;static indentation=" ";static keysSeparator=/[\.\(\)]/;static knotOffset=[-ae.gridSize,-.5*ae.gridSize];static lineTracePattern=/LineTrace(Single|Multi)(\w*)/;static linkCurveHeight=15;static linkCurveWidth=80;static linkMinWidth=100;static nameRegexSpaceReplacement=new RegExp("^K2(?:[Nn]ode)?_|(?<=[a-z])(?=[A-Z0-9])|(?<=[A-Z])(?{const r=100-e,n=s?i-e+50:50,a=s?r+t-e:r-t+e;return`M ${e} 0 C ${t.toFixed(2)} 0, ${i.toFixed(2)} 0, ${n.toFixed(2)} 50 S ${a.toFixed(2)} 100, ${r.toFixed(3)} 100`};static maxZoom=7;static minZoom=-12;static mouseClickButton=0;static mouseRightClickButton=2;static mouseWheelZoomThreshold=80;static nodeDragEventName="ueb-node-drag";static nodeDragGeneralEventName="ueb-node-drag-general";static nodeTitle=(e,t)=>`${e}_${t}`;static nodeRadius=8;static nodeReflowEventName="ueb-node-reflow";static paths={actorBoundEvent:"/Script/BlueprintGraph.K2Node_ActorBoundEvent",addDelegate:"/Script/BlueprintGraph.K2Node_AddDelegate",ambientSound:"/Script/Engine.AmbientSound",asyncAction:"/Script/BlueprintGraph.K2Node_AsyncAction",blueprint:"/Script/Engine.Blueprint",blueprintGameplayTagLibrary:"/Script/GameplayTags.BlueprintGameplayTagLibrary",blueprintMapLibrary:"/Script/Engine.BlueprintMapLibrary",blueprintSetLibrary:"/Script/Engine.BlueprintSetLibrary",callArrayFunction:"/Script/BlueprintGraph.K2Node_CallArrayFunction",callDelegate:"/Script/BlueprintGraph.K2Node_CallDelegate",callFunction:"/Script/BlueprintGraph.K2Node_CallFunction",clearDelegate:"/Script/BlueprintGraph.K2Node_ClearDelegate",comment:"/Script/UnrealEd.EdGraphNode_Comment",commutativeAssociativeBinaryOperator:"/Script/BlueprintGraph.K2Node_CommutativeAssociativeBinaryOperator",componentBoundEvent:"/Script/BlueprintGraph.K2Node_ComponentBoundEvent",createDelegate:"/Script/BlueprintGraph.K2Node_CreateDelegate",customEvent:"/Script/BlueprintGraph.K2Node_CustomEvent",doN:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:Do N",doOnce:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:DoOnce",dynamicCast:"/Script/BlueprintGraph.K2Node_DynamicCast",eAttachmentRule:"/Script/Engine.EAttachmentRule",edGraph:"/Script/Engine.EdGraph",eDrawDebugTrace:"/Script/Engine.EDrawDebugTrace",eMaterialSamplerType:"/Script/Engine.EMaterialSamplerType",eNiagara_Float4Channel:"/Niagara/Enums/ENiagara_Float4Channel.ENiagara_Float4Channel",enum:"/Script/CoreUObject.Enum",enumLiteral:"/Script/BlueprintGraph.K2Node_EnumLiteral",eSamplerSourceMode:"/Script/Engine.ESamplerSourceMode",eSearchCase:"/Script/CoreUObject.ESearchCase",eSearchDir:"/Script/CoreUObject.ESearchDir",eSpawnActorCollisionHandlingMethod:"/Script/Engine.ESpawnActorCollisionHandlingMethod",eTextureMipValueMode:"/Script/Engine.ETextureMipValueMode",eTraceTypeQuery:"/Script/Engine.ETraceTypeQuery",event:"/Script/BlueprintGraph.K2Node_Event",eWorldPositionIncludedOffsets:"/Script/Engine.EWorldPositionIncludedOffsets",executionSequence:"/Script/BlueprintGraph.K2Node_ExecutionSequence",flipflop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:FlipFlop",forEachElementInEnum:"/Script/BlueprintGraph.K2Node_ForEachElementInEnum",forEachLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForEachLoop",forEachLoopWithBreak:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForEachLoopWithBreak",forLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoop",forLoopWithBreak:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoopWithBreak",functionEntry:"/Script/BlueprintGraph.K2Node_FunctionEntry",functionResult:"/Script/BlueprintGraph.K2Node_FunctionResult",gameplayTag:"/Script/GameplayTags.GameplayTag",getInputAxisKeyValue:"/Script/BlueprintGraph.K2Node_GetInputAxisKeyValue",ifThenElse:"/Script/BlueprintGraph.K2Node_IfThenElse",inputAxisKeyEvent:"/Script/BlueprintGraph.K2Node_InputAxisKeyEvent",inputDebugKey:"/Script/InputBlueprintNodes.K2Node_InputDebugKey",inputKey:"/Script/BlueprintGraph.K2Node_InputKey",inputVectorAxisEvent:"/Script/BlueprintGraph.K2Node_InputVectorAxisEvent",isValid:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:IsValid",kismetArrayLibrary:"/Script/Engine.KismetArrayLibrary",kismetMathLibrary:"/Script/Engine.KismetMathLibrary",knot:"/Script/BlueprintGraph.K2Node_Knot",linearColor:"/Script/CoreUObject.LinearColor",literal:"/Script/BlueprintGraph.K2Node_Literal",macro:"/Script/BlueprintGraph.K2Node_MacroInstance",makeArray:"/Script/BlueprintGraph.K2Node_MakeArray",makeMap:"/Script/BlueprintGraph.K2Node_MakeMap",makeSet:"/Script/BlueprintGraph.K2Node_MakeSet",makeStruct:"/Script/BlueprintGraph.K2Node_MakeStruct",materialExpressionComponentMask:"/Script/Engine.MaterialExpressionComponentMask",materialExpressionConstant:"/Script/Engine.MaterialExpressionConstant",materialExpressionConstant2Vector:"/Script/Engine.MaterialExpressionConstant2Vector",materialExpressionConstant3Vector:"/Script/Engine.MaterialExpressionConstant3Vector",materialExpressionConstant4Vector:"/Script/Engine.MaterialExpressionConstant4Vector",materialExpressionFunctionInput:"/Script/Engine.MaterialExpressionFunctionInput",materialExpressionLogarithm:"/Script/InterchangeImport.MaterialExpressionLogarithm",materialExpressionLogarithm10:"/Script/Engine.MaterialExpressionLogarithm10",materialExpressionLogarithm2:"/Script/Engine.MaterialExpressionLogarithm2",materialExpressionMaterialFunctionCall:"/Script/Engine.MaterialExpressionMaterialFunctionCall",materialExpressionSquareRoot:"/Script/Engine.MaterialExpressionSquareRoot",materialExpressionSubtract:"/Script/Engine.MaterialExpressionSubtract",materialExpressionTextureCoordinate:"/Script/Engine.MaterialExpressionTextureCoordinate",materialExpressionTextureSample:"/Script/Engine.MaterialExpressionTextureSample",materialExpressionWorldPosition:"/Script/Engine.MaterialExpressionWorldPosition",materialGraphNode:"/Script/UnrealEd.MaterialGraphNode",materialGraphNodeComment:"/Script/UnrealEd.MaterialGraphNode_Comment",metasoundEditorGraphExternalNode:"/Script/MetasoundEditor.MetasoundEditorGraphExternalNode",multiGate:"/Script/BlueprintGraph.K2Node_MultiGate",niagaraBool:"/Script/Niagara.NiagaraBool",niagaraClipboardContent:"/Script/NiagaraEditor.NiagaraClipboardContent",niagaraDataInterfaceCollisionQuery:"/Script/Niagara.NiagaraDataInterfaceCollisionQuery",niagaraDataInterfaceCurlNoise:"/Script/Niagara.NiagaraDataInterfaceCurlNoise",niagaraDataInterfaceVolumeTexture:"/Script/Niagara.NiagaraDataInterfaceVolumeTexture",niagaraFloat:"/Script/Niagara.NiagaraFloat",niagaraInt32:"/Script/Niagara.NiagaraInt32",niagaraNodeConvert:"/Script/NiagaraEditor.NiagaraNodeConvert",niagaraNodeFunctionCall:"/Script/NiagaraEditor.NiagaraNodeFunctionCall",niagaraNodeInput:"/Script/NiagaraEditor.NiagaraNodeInput",niagaraNodeOp:"/Script/NiagaraEditor.NiagaraNodeOp",niagaraParameterMap:"/Script/Niagara.NiagaraParameterMap",niagaraPosition:"/Script/Niagara.NiagaraPosition",pawn:"/Script/Engine.Pawn",pcgEditorGraphNode:"/Script/PCGEditor.PCGEditorGraphNode",pcgEditorGraphNodeInput:"/Script/PCGEditor.PCGEditorGraphNodeInput",pcgEditorGraphNodeOutput:"/Script/PCGEditor.PCGEditorGraphNodeOutput",pcgHiGenGridSizeSettings:"/Script/PCG.PCGHiGenGridSizeSettings",pcgSubgraphSettings:"/Script/PCG.PCGSubgraphSettings",promotableOperator:"/Script/BlueprintGraph.K2Node_PromotableOperator",quat4f:"/Script/CoreUObject.Quat4f",removeDelegate:"/Script/BlueprintGraph.K2Node_RemoveDelegate",reverseForEachLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ReverseForEachLoop",rotator:"/Script/CoreUObject.Rotator",select:"/Script/BlueprintGraph.K2Node_Select",self:"/Script/BlueprintGraph.K2Node_Self",slateBlueprintLibrary:"/Script/UMG.SlateBlueprintLibrary",spawnActorFromClass:"/Script/BlueprintGraph.K2Node_SpawnActorFromClass",switchEnum:"/Script/BlueprintGraph.K2Node_SwitchEnum",switchGameplayTag:"/Script/GameplayTagsEditor.GameplayTagsK2Node_SwitchGameplayTag",switchInteger:"/Script/BlueprintGraph.K2Node_SwitchInteger",switchName:"/Script/BlueprintGraph.K2Node_SwitchName",switchString:"/Script/BlueprintGraph.K2Node_SwitchString",timeline:"/Script/BlueprintGraph.K2Node_Timeline",timeManagementBlueprintLibrary:"/Script/TimeManagement.TimeManagementBlueprintLibrary",transform:"/Script/CoreUObject.Transform",userDefinedEnum:"/Script/Engine.UserDefinedEnum",variableGet:"/Script/BlueprintGraph.K2Node_VariableGet",variableSet:"/Script/BlueprintGraph.K2Node_VariableSet",vector:"/Script/CoreUObject.Vector",vector2D:"/Script/CoreUObject.Vector2D",vector2f:"/Script/CoreUObject.Vector2f",vector3f:"/Script/CoreUObject.Vector3f",vector4f:"/Script/CoreUObject.Vector4f",whileLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:WhileLoop"};static pinInputWrapWidth=145;static removeEventName="ueb-element-delete";static scale={[-12]:.133333,[-11]:.166666,[-10]:.2,[-9]:.233333,[-8]:.266666,[-7]:.3,[-6]:.333333,[-5]:.375,[-4]:.5,[-3]:.675,[-2]:.75,[-1]:.875,0:1,1:1.25,2:1.375,3:1.5,4:1.675,5:1.75,6:1.875,7:2};static smoothScrollTime=1e3;static stringEscapedCharacters=/["\\]/g;static subObjectAttributeNamePrefix="#SubObject";static subObjectAttributeNameFromEntity=(e,t=!1)=>this.subObjectAttributeNamePrefix+(!t&&e.Class?`_${e.Class.type}`:"")+"_"+e.Name;static subObjectAttributeNameFromReference=(e,t=!1)=>this.subObjectAttributeNamePrefix+(t?"":"_"+e.type)+"_"+e.path;static subObjectAttributeNameFromName=e=>this.subObjectAttributeNamePrefix+"_"+e;static switchTargetPattern=/\/Script\/[\w\.\/\:]+K2Node_Switch([A-Z]\w+)+/;static trackingMouseEventName={begin:"ueb-tracking-mouse-begin",end:"ueb-tracking-mouse-end"};static unescapedBackslash=/(?<=(?:[^\\]|^)(?:\\\\)*)\\(?!\\)/;static windowApplyEventName="ueb-window-apply";static windowApplyButtonText="OK";static windowCancelEventName="ueb-window-cancel";static windowCancelButtonText="Cancel";static windowCloseEventName="ueb-window-close";static CommonEnums={[this.paths.eAttachmentRule]:["KeepRelative","KeepWorld","SnapToTarget"],[this.paths.eDrawDebugTrace]:["None","ForOneFrame","ForDuration","Persistent"],[this.paths.eMaterialSamplerType]:["Color","Grayscale","Alpha","Normal","Masks","Distance Field Font","Linear Color","Linear Grayscale","Data","External","Virtual Color","Virtual Grayscale","Virtual Alpha","Virtual Normal","Virtual Mask","Virtual Linear Color","Virtual Linear Grayscal"],[this.paths.eNiagara_Float4Channel]:[["NewEnumerator0","R"],["NewEnumerator1","G"],["NewEnumerator2","B"],["NewEnumerator3","A"]],[this.paths.eSamplerSourceMode]:["From texture asset","Shared: Wrap","Shared: Clamp","Hidden"],[this.paths.eSearchCase]:["CaseSensitive","IgnoreCase"],[this.paths.eWorldPositionIncludedOffsets]:["Absolute World Position (Including Material Shader Offsets)","Absolute World Position (Excluding Material Shader Offsets)","Camera Relative World Position (Including Material Shader Offsets)","Camera Relative World Position (Excluding Material Shader Offsets)"],[this.paths.eSearchDir]:["FromStart","FromEnd"],[this.paths.eSpawnActorCollisionHandlingMethod]:[["Undefined","Default"],["AlwaysSpawn","Always Spawn, Ignore Collisions"],["AdjustIfPossibleButAlwaysSpawn","Try To Adjust Location, But Always Spawn"],["AdjustIfPossibleButDontSpawnIfColliding","Try To Adjust Location, Don't Spawn If Still Colliding"],["DontSpawnIfColliding","Do Not Spawn"]],[this.paths.eTextureMipValueMode]:["None (use computed mip level)","MipLevel (absolute, 0 is full resolution)","MipBias (relative to the computed mip level)","Derivative (explicit derivative to compute mip level)"],[this.paths.eTraceTypeQuery]:[["TraceTypeQuery1","Visibility"],["TraceTypeQuery2","Camera"]]};static ModifierKeys=["Ctrl","Shift","Alt","Meta"];static rgba=["R","G","B","A"];static Keys={Backspace:"Backspace",Tab:"Tab",LeftControl:"ControlLeft",RightControl:"ControlRight",LeftShift:"ShiftLeft",RightShift:"ShiftRight",LeftAlt:"AltLeft",RightAlt:"AltRight",Enter:"Enter",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Space:"Space",PageUp:"PageUp",PageDown:"PageDown",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",PrintScreen:"PrintScreen",Insert:"Insert",Delete:"Delete",Zero:"Digit0",One:"Digit1",Two:"Digit2",Three:"Digit3",Four:"Digit4",Five:"Digit5",Six:"Digit6",Seven:"Digit7",Eight:"Digit8",Nine:"Digit9",A:"KeyA",B:"KeyB",C:"KeyC",D:"KeyD",E:"KeyE",F:"KeyF",G:"KeyG",H:"KeyH",I:"KeyI",K:"KeyK",L:"KeyL",M:"KeyM",N:"KeyN",O:"KeyO",P:"KeyP",Q:"KeyQ",R:"KeyR",S:"KeyS",T:"KeyT",U:"KeyU",V:"KeyV",W:"KeyW",X:"KeyX",Y:"KeyY",Z:"KeyZ",NumPadZero:"Numpad0",NumPadOne:"Numpad1",NumPadTwo:"Numpad2",NumPadThree:"Numpad3",NumPadFour:"Numpad4",NumPadFive:"Numpad5",NumPadSix:"Numpad6",NumPadSeven:"Numpad7",NumPadEight:"Numpad8",NumPadNine:"Numpad9",Multiply:"NumpadMultiply",Add:"NumpadAdd",Subtract:"NumpadSubtract",Decimal:"NumpadDecimal",Divide:"NumpadDivide",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",NumLock:"NumLock",ScrollLock:"ScrollLock"}}class oe{static clamp(e,t=-1/0,i=1/0){return Math.min(Math.max(e,t),i)}static getScale(e){const t=e.blueprint?.getScale()??getComputedStyle(e).getPropertyValue("--ueb-scale");return""!=t?parseFloat(t):1}static minDecimals(e,t=1,i=1e-8){const s=e*10**t;return Math.abs(s%1)>i?e.toString():e.toFixed(t)}static roundDecimals(e,t=1){const i=10**t;return Math.round(e*i)/i}static printExponential(e){if(e==Number.POSITIVE_INFINITY)return"inf";if(e==Number.NEGATIVE_INFINITY)return"-inf";const t=Math.round(e);if(t>=1e3){const i=Math.floor(Math.log10(t));return`${Math.round(e/10**(i-2))/100}e+${i<10?"0":""}${i}`}return 0==Math.floor(e)?e.toString():this.roundDecimals(e,Math.max(0,3-Math.floor(e).toString().length)).toString()}static approximatelyEqual(e,t,i=1e-8){return!(Math.abs(e-t)>i)}static convertLocation(e,t,i=!1){const s=i?1:1/oe.getScale(t),r=t.getBoundingClientRect();return[Math.round((e[0]-r.x)*s),Math.round((e[1]-r.y)*s)]}static isSerialized(e,t){return e.attributes?.[t]?.serialized??e.constructor.attributes?.[t]?.serialized??!1}static objectGet(e,t,i=void 0){if(void 0!==e){if(!(t instanceof Array))throw new TypeError("UEBlueprint: Expected keys to be an array");return 0!=t.length&&t[0]in e&&void 0!==e[t[0]]?1==t.length?e[t[0]]:oe.objectGet(e[t[0]],t.slice(1),i):i}}static objectSet(e,t,i,s=Object){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");if(1==t.length){if(t[0]in e||void 0===e[t[0]])return e[t[0]]=i,!0}else if(t.length>0)return e[t[0]]instanceof Object||(e[t[0]]=new s),oe.objectSet(e[t[0]],t.slice(1),i,s);return!1}static snapToGrid(e,t,i){return 1===i?[e,t]:[i*Math.floor(e/i),i*Math.floor(t/i)]}static mergeArrays(e=[],t=[],i=(e,t)=>e==t,s=e=>{}){let r=[];e=[...e],t=[...t];e:for(;;){for(let n=0;n(s(e),e))),...e.splice(0,1)),t.shift();continue e}break e}return r.push(...e),r.push(...t.filter((e=>!r.some((t=>i(t,e))))).map(((e,t)=>(s(e),e)))),r}static escapeNewlines(e){return e.replaceAll("\n","\\n").replaceAll("\t","\\t")}static escapeString(e,t=!0){let i=e.replaceAll(new RegExp(`(${ae.stringEscapedCharacters.source})`,"g"),"\\$1");return t&&(i=i.replaceAll("\n","\\n").replaceAll("\t","\\t")),i}static unescapeString(e){return e.replaceAll(new RegExp(ae.unescapedBackslash.source+"t","g"),"\t").replaceAll(new RegExp(ae.unescapedBackslash.source+"n","g"),"\n").replaceAll(new RegExp(`\\\\(${ae.stringEscapedCharacters.source})`,"g"),"$1")}static clearHTMLWhitespace(e){return e.replaceAll(" "," ").replaceAll(/|
/g,"\n").replaceAll(/(\)/g,"")}static encodeHTMLWhitespace(e){return e.replaceAll(" "," ")}static capitalFirstLetter(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}static formatStringName(e=""){return e.replace(/^\s*b(?=[A-Z])/,"").replaceAll(ae.nameRegexSpaceReplacement," ").trim().split(" ").map((e=>oe.capitalFirstLetter(e))).join(" ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLowerCase()}static getNameFromPath(e,t=!1){const i=t?/([^\.\/]+?)(?:_\d+)$/:/([^\.\/]+)$/;return e.match(i)?.[1]??""}static getPolarCoordinates(e,t,i=!1){let s=Math.atan2(t,e);return i&&s<0&&(s=2*Math.PI+s),[Math.sqrt(e*e+t*t),s]}static getCartesianCoordinates(e,t){return[e*Math.cos(t),e*Math.sin(t)]}static range(e=0,t=0,i=(t>=e?1:-1)){return Array.from({length:Math.ceil((t-e)/i)},((t,s)=>e+s*i))}static getFirstWordOrder(e){return new RegExp(/\s*/.source+e.join(/[^\n]+\n\s*/.source)+/\s*/.source)}static paste(e,t){const i=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});i.clipboardData.setData("text",t),e.dispatchEvent(i)}static async copy(e){const t=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});e.dispatchEvent(t)}static animate(e,t,i,s,r=e=>{},n=e=>{const t=e**3.5;return t/(t+(1-e)**3.5)}){let a;const o=l=>{void 0===a&&(a=l);let c=(l-a)/i;oe.approximatelyEqual(c,1)||c>1?c=1:r(requestAnimationFrame(o));const u=e+(t-e)*n(c);s(u)};r(requestAnimationFrame(o))}}class le extends re{#e;get blueprint(){return this.#e}set blueprint(e){this.#e=e}#t;get entity(){return this.#t}set entity(e){this.#t=e}#i;get template(){return this.#i}isInitialized=!1;isSetup=!1;inputObjects=[];initialize(e,t){this.requestUpdate(),this.#t=e,this.#i=t,this.#i.initialize(this),this.isConnected&&this.updateComplete.then((()=>this.setup())),this.isInitialized=!0}connectedCallback(){super.connectedCallback(),this.blueprint=this.closest("ueb-blueprint"),this.isInitialized&&(this.requestUpdate(),this.updateComplete.then((()=>this.setup())))}disconnectedCallback(){super.disconnectedCallback(),this.isSetup&&this.updateComplete.then((()=>this.cleanup())),this.acknowledgeDelete()}createRenderRoot(){return this}setup(){this.template.setup(),this.isSetup=!0}cleanup(){this.template.cleanup(),this.isSetup=!1}willUpdate(e){super.willUpdate(e),this.template.willUpdate(e)}update(e){super.update(e),this.template.update(e)}render(){return this.template.render()}firstUpdated(e){super.firstUpdated(e),this.template.firstUpdated(e),this.template.inputSetup()}updated(e){super.updated(e),this.template.updated(e)}acknowledgeDelete(){let e=new CustomEvent(ae.removeEventName);this.dispatchEvent(e)}isSameGraph(e){return this.blueprint&&this.blueprint==e?.blueprint}}class ce{static arrayPin=z``;static branchNode=z``;static breakStruct=z``;static cast=z``;static close=z``;static convert=z``;static correct=z``;static delegate=z``;static doN=z``;static doOnce=z``;static enum=z``;static event=z``;static execPin=z``;static expandIcon=z``;static flipflop=z``;static forEachLoop=z``;static functionSymbol=z``;static gamepad=z``;static genericPin=z``;static keyboard=z``;static loop=z``;static macro=z``;static mapPin=z``;static makeArray=z``;static makeMap=z``;static makeSet=z``;static makeStruct=z``;static metasoundFunction=z``;static mouse=z``;static node=z``;static operationPin=z``;static pcgStackPin=z``;static pcgPin=z``;static pcgParamPin=z``;static pcgSpatialPin=z``;static plusCircle=z``;static questionMark=z``;static referencePin=z``;static reject=z``;static setPin=z``;static select=z``;static sequence=z``;static sound=z``;static spawnActor=z``;static staticPin=z``;static switch=z``;static timer=z``;static touchpad=z``}class ue{static makeSuccess(e,t,i=null,s=0){return{status:!0,value:t,position:e,bestParser:i,bestPosition:s}}static makeFailure(e=0,t=null,i=0){return{status:!1,value:null,position:e,bestParser:t,bestPosition:i}}static makeContext(e=null,t=""){return{parsernostrum:e,input:t,highlighted:null}}static makePathNode(e,t=0,i=null){return{parent:i,current:e,index:t}}}class he{static indentation=" ";static highlight="Last valid parser";Self;static frame(e,t="",i=""){t=e?"[ "+t+" ]":"";let s=e.split("\n");const r=Math.max(...s.map((e=>e.length))),n=r";const r=this.isVisited(i),n=this.isHighlighted(e,i);let a=r?"<...>":this.doToString(e,n?"":t,i,s);return n&&(a=he.frame(a,he.highlight,t)),a}doToString(e,t,i,s){return`${this.constructor.name} does not implement toString()`}}class pe extends he{#s;get value(){return this.#s}constructor(e){super(),this.#s=e}parse(e,t,i,s){i=this.makePath(i,s);const r=t+this.#s.length,n=e.input.substring(t,r);return this.#s===n?ue.makeSuccess(r,this.#s,i,r):ue.makeFailure()}doToString(e,t,i,s){return`"${this.value.replaceAll("\n","\\n").replaceAll('"','\\"')}"`}}class de extends he{static instance=new de;parse(e,t,i,s){return i=this.makePath(i,s),ue.makeSuccess(t,"",i,0)}doToString(e,t,i,s){return""}}class me extends he{#r;get parsers(){return this.#r}constructor(...e){super(),this.#r=e}parse(e,t,i,s){i=this.makePath(i,s);const r=ue.makeSuccess(0,"");for(let s=0;sr.bestPosition&&(r.bestParser=n.bestParser,r.bestPosition=n.bestPosition),n.status)return r.value=n.value,r.position=n.position,r}return r.status=!1,r.value=null,r}doToString(e,t,i,s){if(2===this.#r.length&&this.#r[1]instanceof de){let s=this.#r[0].toString(e,t,i,0);return this.#r[0]instanceof pe||(s="<"+s+">"),s+="?",s}const r=t+he.indentation;let n="ALT<\n"+r+this.#r.map(((t,s)=>t.toString(e,r+" ".repeat(0===s?0:he.indentation.length-2),i,s))).join("\n"+r+"| ")+"\n"+t+">";return n}}class ge extends he{#n;get parser(){return this.#n}#a;constructor(e,t){super(),this.#n=e,this.#a=t}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#n.parse(e,t,i,0);if(!r.status)return r;const n=this.#a(r.value,e.input,r.position).getParser().parse(e,r.position,i,0);return r.bestPosition>n.bestPosition&&(n.bestParser=r.bestParser,n.bestPosition=r.bestPosition),n}doToString(e,t,i,s){return this.#n.toString(e,t,i,0)+" => chained"}}class be extends he{static instance=new be;parse(e,t,i,s){return ue.makeFailure()}doToString(e,t,i,s){return""}}class ve extends he{#n;get parser(){return this.#n}#o="";constructor(e,t){super(),this.#n=e,this.#o=t}makePath(e,t){return e}parse(e,t,i,s){return this.parse=this.#n.parse.bind(this.#n),this.parse(e,t,i,s)}doToString(e,t,i,s){let r=this.#n.toString(e,"",i,s);return r=he.frame(r,this.#o,t),r}}class fe extends he{#n;#l;constructor(e){super(),this.#n=e}makePath(e,t){return e}isHighlighted(e,t){if(super.isHighlighted(e,t)){const i={parent:t,parser:this.#l,index:0};e.highlighted=e.highlighted instanceof he?this.#l:i}return!1}resolve(){return this.#l||(this.#l=this.#n().getParser()),this.#l}parse(e,t,i,s){return this.resolve(),this.parse=this.#l.parse.bind(this.#l),this.parse(e,t,i,s)}doToString(e,t,i,s){return this.resolve(),this.doToString=this.#l.toString.bind(this.#l),this.doToString(e,t,i,s)}}class ye extends he{#n;get parser(){return this.#n}#c;get type(){return this.#c}static Type={NEGATIVE_AHEAD:"?!",NEGATIVE_BEHIND:"?String.raw`[^${e}\\]*(?:\\.[^${e}\\]*)*`;static#m=/[-\+]?(?:\d*\.)?\d+/;static common={number:new RegExp(this.#m.source+String.raw`(?!\.)`),numberInteger:/[\-\+]?\d+(?!\.\d)/,numberNatural:/\d+/,numberExponential:new RegExp(this.#m.source+String.raw`(?:[eE][\+\-]?\d+)?(?!\.)`),numberUnit:/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/,numberByte:/0*(?:25[0-5]|2[0-4]\d|1?\d?\d)(?!\d|\.)/,whitespace:/\s+/,whitespaceOpt:/\s*/,whitespaceInline:/[^\S\n]+/,whitespaceInlineOpt:/[^\S\n]*/,whitespaceMultiline:/\s*?\n\s*/,doubleQuotedString:new RegExp(`"(${this.#d('"')})"`),singleQuotedString:new RegExp(`'(${this.#d("'")})'`),backtickQuotedString:new RegExp("`("+this.#d("`")+")`")};constructor(e,t){super(),this.#u=e,this.#h=new RegExp(`^(?:${e.source})`,e.flags),this.#p=t}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#h.exec(e.input.substring(t));r&&(t+=r[0].length);return r?ue.makeSuccess(t,this.#p(r),i,t):ue.makeFailure()}doToString(e,t,i,s){let r="/"+this.#u.source+"/";const n=Object.entries(we.common).find((([e,t])=>t.source===this.#u.source))?.[0];return n&&(r="P."+n),r}}class Se extends he{#n;get parser(){return this.#n}#g;get mapper(){return this.#g}constructor(e,t){super(),this.#n=e,this.#g=t}isHighlighted(e,t){if(super.isHighlighted(e,t)){const i={parent:t,parser:this.#n,index:0};e.highlighted=e.highlighted instanceof he?this.#n:i}return!1}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#n.parse(e,t,i,0);return r.status&&(r.value=this.#g(r.value)),r}doToString(e,t,i,s){let r=this.#n.toString(e,t,i,0);if(this.#n instanceof we&&Object.values(we.common).includes(this.#n.regexp))return this.#n.regexp===we.common.numberInteger&&this.#g===BigInt?"P.numberBigInteger":r;let n=this.#g.toString();return(n.length>60||n.includes("\n"))&&(n="(...) => { ... }"),r+=` -> map<${n}>`,r}}class Ee extends we{static#g=e=>e;constructor(e){super(e,Ee.#g)}}class Ce extends we{constructor(e,t=0){super(e,(e=>e[t]))}}class Ne extends he{#r;get parsers(){return this.#r}constructor(...e){super(),this.#r=e}parse(e,t,i,s){i=this.makePath(i,s);const r=new Array(this.#r.length),n=ue.makeSuccess(t,r);for(let t=0;tn.bestPosition&&(n.bestParser=s.bestParser,n.bestPosition=s.bestPosition),!s.status){n.status=!1,n.value=null;break}n.value[t]=s.value,n.position=s.position}return n}doToString(e,t,i,s){const r=t+he.indentation,n="SEQ<\n"+r+this.#r.map(((t,s)=>t.toString(e,r,i,s))).join("\n"+r)+"\n"+t+">";return n}}class xe extends he{#n;get parser(){return this.#n}#b;get min(){return this.#b}#v;get max(){return this.#v}constructor(e,t=0,i=Number.POSITIVE_INFINITY){if(super(),t>i)throw new Error("Min is greater than max");this.#n=e,this.#b=t,this.#v=i}parse(e,t,i,s){i=this.makePath(i,s);const r=ue.makeSuccess(t,[],i);for(let t=0;tr.bestPosition&&(r.bestParser=s.bestParser,r.bestPosition=s.bestPosition),!s.status){te;static#y=([e,t])=>t;static#w=([e,t])=>[e,...t];static#S=e=>e instanceof Array?e.join(""):e;static number=this.reg(we.common.number).map(Number);static numberInteger=this.reg(we.common.numberInteger).map(Number);static numberBigInteger=this.reg(this.numberInteger.getParser().parser.regexp).map(BigInt);static numberNatural=this.reg(we.common.numberNatural).map(Number);static numberExponential=this.reg(we.common.numberExponential).map(Number);static numberUnit=this.reg(we.common.numberUnit).map(Number);static numberByte=this.reg(we.common.numberByte).map(Number);static whitespace=this.reg(we.common.whitespace);static whitespaceOpt=this.reg(we.common.whitespaceOpt);static whitespaceInline=this.reg(we.common.whitespaceInline);static whitespaceInlineOpt=this.reg(we.common.whitespaceInlineOpt);static whitespaceMultiline=this.reg(we.common.whitespaceMultiline);static doubleQuotedString=this.reg(we.common.doubleQuotedString,1);static singleQuotedString=this.reg(we.common.singleQuotedString,1);static backtickQuotedString=this.reg(we.common.backtickQuotedString,1);constructor(e,t=!1){this.#n=e}static#E(e){const t=[];for(;e;)t.push(e),e=e.parent;t.reverse();let i=new Map;for(let e=1;ei<=s||i>e))),i.set(t[e].current,s),t.splice(s+1,e-s),e=s):i.set(t[e].current,e)}return t[t.length-1]}getParser(){return this.#n}run(e){const t=this.#n.parse(ue.makeContext(this,e),0,ue.makePathNode(),0);return t.position!==e.length&&(t.status=!1),t}parse(e,t=!0){const i=this.run(e);if(i.status)return i.value;const s=[Math.ceil(30),Math.floor(30)],r=Pe.lineColumnFromOffset(e,i.bestPosition);let n=i.bestPosition;const a=e.replaceAll(/^(\s)+|\s{6,}|\s*?\n\s*/g,((e,t,s)=>{let r=t?"...":" ... ";return s<=i.bestPosition&&(i.bestPosition0&&(u="..."+u,c+=3),s[1]e.getParser()))))}static alt(...e){return new this(new me(...e.map((e=>e.getParser()))))}static lookahead(e){return new this(new ye(e.getParser(),ye.Type.POSITIVE_AHEAD))}static lazy(e){return new this(new fe(e))}times(e,t=e){return new Pe(new xe(this.#n,e,t))}many(){return this.times(0,Number.POSITIVE_INFINITY)}atLeast(e){return this.times(e,Number.POSITIVE_INFINITY)}atMost(e){return this.times(0,e)}opt(e=""){let t=Pe.success();return""!==e&&(t=t.map((()=>e))),Pe.alt(this,t)}sepBy(e,t=1,i=!1){let s=Pe.seq(this,Pe.seq(e,this).map(Pe.#y).atLeast(t-1),...i?[e.opt([])]:[]).map(Pe.#w);return 0===t&&(s=s.opt([])),s}skipSpace(){return Pe.seq(this,Pe.whitespaceOpt).map(Pe.#f)}map(e){return new Pe(new Se(this.#n,e))}chain(e){return new Pe(new ge(this.#n,e))}assert(e){return this.chain(((t,i,s)=>e(t,i,s)?Pe.success().map((()=>t)):Pe.failure()))}join(e=""){return this.map(Pe.#S)}label(e=""){return new Pe(new ve(this.#n,e))}toString(e="",t=!1,i=null){i instanceof Pe&&(i=i.getParser());const s=ue.makeContext(this,"");s.highlighted=i;const r=ue.makePathNode();return(t?"\n"+e:"")+this.#n.toString(s,e,r)}}class ke{static same=e=>e;static notWrapped=(e,t)=>t;static defaultWrapped=(e,t)=>`${e.#C}(${t})`;static wrap=this.defaultWrapped;static attributeSeparator=",";static keySeparator="=";static printKey=e=>e;static grammar=Pe.lazy((()=>this.createGrammar()));static unknownEntityGrammar;static unknownEntity;static attributes={};static lookbehind="";static default;static nullable=!1;static ignored=!1;static serialized=!1;static expected=!1;static inlined=!1;static quoted;static silent=!1;static trailing=!1;#N;get keys(){return this.#N??Object.keys(this)}set keys(e){this.#N=[...new Set(e)]}#C=this.constructor.lookbehind;get lookbehind(){return this.#C.trim()}set lookbehind(e){this.#C=e}#x=this.constructor.ignored;get ignored(){return this.#x}set ignored(e){this.#x=e}#P=this.constructor.inlined;get inlined(){return this.#P}set inlined(e){this.#P=e}#k;get quoted(){return this.#k??this.constructor.quoted??!1}set quoted(e){this.#k=e}#L;get trailing(){return this.#L??this.constructor.trailing??!1}set trailing(e){this.#L=e}constructor(e={}){const t=this.constructor.attributes,i=oe.mergeArrays(Object.keys(e),Object.entries(t).filter((([e,t])=>void 0!==t.default)).map((([e,t])=>e)));for(const s of i){if(void 0!==e[s]){e[s].constructor===Object&&(e[s]=new(void 0!==t[s]?t[s]:ke.unknownEntity)(e[s]));const i=t[s];if(this[s]=e[s],i?.compute){const t=i.compute(this).grammar.run(e[s].toString());t.status&&(this[s]=t.value)}continue}const i=t[s];void 0===i.default||(this[s]=i.default(i))}}static createGrammar(){return this.unknownEntityGrammar}static actualClass(){let e=this;for(;!e.name;)e=Object.getPrototypeOf(e);return e}static className(){return this.actualClass().name}static asUniqueClass(e=!1){let t=this;return(this.name.length||e)&&(t=class extends(this){},t.grammar=t.createGrammar()),t}static withLookbehind(e){const t=this.asUniqueClass();return t.lookbehind=e,t}static withDefault(e=e=>new e){const t=this.asUniqueClass();return t.default=e,t}static flagNullable(e=!0){const t=this.asUniqueClass();return t.nullable=e,t}static flagIgnored(e=!0){const t=this.asUniqueClass();return t.ignored=e,t}static flagSerialized(e=!0){const t=this.asUniqueClass();return t.serialized=e,t}static flagInlined(e=!0){const t=this.asUniqueClass();return t.inlined=e,t}static flagQuoted(e=!0){const t=this.asUniqueClass();return t.quoted=e,t}static flagSilent(e=!0){const t=this.asUniqueClass();return t.silent=e,t}static flagTrailing(e=!0){const t=this.asUniqueClass();return t.trailing=e,t}static asSerializedString(e){return`"${e.replaceAll(/(?<=(?:[^\\]|^)(?:\\\\)*?)"/g,'\\"')}"`}showProperty(e){let t=this[e];const i=t.constructor;if(i.silent&&void 0!==i.default){void 0===i["#default"]&&(i["#default"]=i.default(i));const e=i["#default"];return!t.equals(e)}return!0}listenAttribute(e,t){const i=Object.getOwnPropertyDescriptor(this,e),s=i.set;s?(i.set=e=>{s(e),t(e)},Object.defineProperties(this,{[e]:i})):i.value&&Object.defineProperties(this,{["#"+e]:{value:i.value,writable:!0,enumerable:!1},[e]:{enumerable:!0,get(){return this["#"+e]},set(i){t(i),this["#"+e]=i}}})}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i!==this.constructor;let l="",c=!0;const u=this instanceof ke?this.keys:Object.keys(this);for(const a of u){const o=this[a],u=o?.constructor;if(void 0===o||this instanceof ke&&!this.showProperty(a))continue;c?c=!1:l+=n;let h=this instanceof Array?`(${a})`:a;if(h.length&&(i.attributes[a]?.quoted||o.quoted)&&(h=`"${h}"`),o.inlined){const a="ArrayEntity"===u.className()?e=>s(`${h}${e}`):e=>s(`${h}.${e}`);l+=o.serialize(e,t,void 0,a,r,n,i.notWrapped);continue}h=s(h),h.length&&(l+=(n.includes("\n")?t:"")+h+r);let p=o?.serialize(e,t);l+=p}return this instanceof ke&&(o&&i.trailing||this.trailing)&&l.length&&(l+=n),a(this,l)}serialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){this.constructor;let o=this instanceof Array?ke.prototype.doSerialize.bind(this)(e,t,i,s,r,n,a):this.doSerialize(e,t,i,s,r,n,a);return i.serialized&&(o=ke.asSerializedString(o)),o}equals(e){if(!(e instanceof ke))return!1;const t=Object.keys(this),i=Object.keys(e),s=this.constructor.actualClass(),r=e.constructor.actualClass();if(!(t.length===i.length&&this.lookbehind==e.lookbehind&&(e instanceof s||this instanceof r)))return!1;for(let s=0;s{},toAttribute:(e,t)=>!0===e?"true":!1===e?"false":""};#A=!0;get uppercase(){return this.#A}set uppercase(e){this.#A=e}static createGrammar(){return Pe.regArray(/(true)|(True)|(false)|(False)/).map((e=>{const t=e[1]??e[2]?new this(!0):new this(!1);return t.uppercase=void 0!==(e[2]??e[4]),t})).label("BooleanEntity")}constructor(e=!1){super(),this.value=e}serialize(e=!1,t="",i=this.constructor){let s=this.value?this.#A?"True":"true":this.#A?"False":"false";return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}}class Ae{static#M=new Map;static registerElement(e,t){Ae.#M.set(e,t)}static getConstructor(e){return Ae.#M.get(e)}}class Me extends ke{static alternatives=[];static className(){let e=super.className();return this.alternatives.length&&(e+=".accepting("+this.alternatives.map((e=>e.className())).join(", ")+")"),e}static createGrammar(){const e=this.alternatives.map((e=>e.grammar));return 0==this.alternatives.length||e.includes(this.unknownEntityGrammar)?this.unknownEntityGrammar:Pe.alt(...e)}static accepting(...e){const t=this.asUniqueClass();return t.alternatives=e,t.grammar=t.createGrammar(),t}}class Ie{static numberRegexSource=Pe.number.getParser().parser.regexp.source;static separatedBy=(e,t,i=1)=>new RegExp(e+"(?:"+t+e+")"+(1===i?"*":2===i?"+":`{${i},}`));static Regex=class{static HexDigit=/[0-9a-fA-F]/;static InsideString=/(?:[^"\\]|\\.)*/;static InsideSingleQuotedString=/(?:[^'\\]|\\.)*/;static Integer=/[\-\+]?\d+(?!\d|\.)/;static Number=/[-\+]?(?:\d*\.)?\d+(?!\d|\.)/;static RealUnit=/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/;static Word=Ie.separatedBy("[a-zA-Z]","_");static Symbol=/[a-zA-Z_]\w*/;static DotSeparatedSymbols=Ie.separatedBy(this.Symbol.source,"\\.");static MultipleWordsSymbols=Ie.separatedBy(this.Symbol.source,"(?:\\.|\\ +)");static PathFragment=Ie.separatedBy(this.Symbol.source,"[\\.:]");static PathSpaceFragment=Ie.separatedBy(this.Symbol.source,"[\\.:\\ ]");static Path=new RegExp(`(?:\\/${this.PathFragment.source}){2,}`)};static null=Pe.reg(/\(\s*\)/).map((()=>null));static true=Pe.reg(/true/i).map((()=>!0));static false=Pe.reg(/false/i).map((()=>!1));static number=Pe.regArray(new RegExp(`(${Pe.number.getParser().parser.regexp.source})|(\\+?inf)|(-inf)`)).map((([e,t,i,s])=>t?Number(t):i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY));static bigInt=Pe.reg(new RegExp(Pe.number.getParser().parser.regexp.source)).map(BigInt).map((e=>void 0!==e[2]?Number.POSITIVE_INFINITY:void 0!==e[3]?Number.NEGATIVE_INFINITY:Number(e[1])));static naturalNumber=Pe.lazy((()=>Pe.reg(/\d+/).map(Number)));static string=Pe.doubleQuotedString.map((e=>oe.unescapeString(e)));static colorValue=Pe.numberByte;static word=Pe.reg(Ie.Regex.Word);static symbol=Pe.reg(Ie.Regex.Symbol);static symbolQuoted=Pe.reg(new RegExp('"('+Ie.Regex.Symbol.source+')"'),1);static attributeName=Pe.reg(Ie.Regex.DotSeparatedSymbols);static attributeNameQuoted=Pe.reg(new RegExp('"('+Ie.Regex.InsideString.source+')"'),1);static guid=Pe.reg(new RegExp(`${Ie.Regex.HexDigit.source}{32}`));static commaSeparation=Pe.reg(/\s*,\s*(?!\))/);static commaOrSpaceSeparation=Pe.reg(/\s*,\s*(?!\))|\s+/);static equalSeparation=Pe.reg(/\s*=\s*/);static hexColorChannel=Pe.reg(new RegExp(Ie.Regex.HexDigit.source+"{2}"));static getAttribute(e,[t,...i]){const s=e?.attributes?.[t];if(s){if(s.prototype instanceof Me)for(const e of s.alternatives){const t=this.getAttribute(e,i);if(t)return t}return i.length>0?this.getAttribute(s,i):s}}static createAttributeGrammar(e,t=this.attributeName,i=this.equalSeparation,s=(e,t,i)=>{}){return Pe.seq(t,i).chain((([t,i])=>{const r=t.split(ae.keysSeparator),n=this.getAttribute(e,r),a=n?n.grammar:ke.unknownEntityGrammar,o=r.length>1;return a.map((e=>t=>{oe.objectSet(t,r,e),r.reduce(((e,t,i)=>(e[t].inlined=o&&i{let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),s.trailing=void 0!==i,s})).chain((t=>{(e.lookbehind instanceof Array||e.lookbehind!==r)&&(e=e.withLookbehind(r));const s=Object.keys(t),n=Object.keys(e.attributes);return null!=i?Pe.success().assert((e=>s.filter((e=>n.includes(e))).length/n.length>=i)).map((()=>new e(t))):Pe.success().map((()=>new e(t)))}))}}class Te extends ke{static grammar=this.createGrammar();constructor(e=0){super(),this.value=e}static createGrammar(){return Pe.number.map((e=>new this(e)))}serialize(e=!1,t="",i=this.constructor){let s=this.value.toFixed(6);return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}toString(){return this.value.toString()}}class Oe extends ke{static attributes={...super.attributes,R:Te.withDefault(),G:Te.withDefault(),B:Te.withDefault(),A:Te.withDefault((e=>new e(1)))};static grammar=this.createGrammar();#I=new Te;get H(){return this.#I}set H(e){this.#I=e}#T=new Te;get S(){return this.#T}set S(e){this.#T=e}#O=new Te;get V(){return this.#O}set V(e){this.#O=e}constructor(e){super(e),e instanceof Array&&(e={R:e[0]??0,G:e[1]??0,B:e[2]??0,A:e[3]??1}),this.R,this.G,this.B,this.A,this.#D()}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,.5).label("LinearColorEntity")}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}static getWhite(){return new Oe({R:new Te(1),G:new Te(1),B:new Te(1)})}static getLinearColorFromHexGrammar(){const e=/[0-9a-fA-F]/;return Pe.regArray(new RegExp("#("+e.source+"{2})("+e.source+"{2})("+e.source+"{2})("+e.source+"{2})?")).map((([e,t,i,s,r])=>new this({R:parseInt(t,16)/255,G:parseInt(i,16)/255,B:parseInt(s,16)/255,A:parseInt(r??"FF",16)/255})))}static getLinearColorRGBListGrammar(){return Pe.seq(Pe.numberByte,Ie.commaSeparation,Pe.numberByte,Ie.commaSeparation,Pe.numberByte).map((([e,t,i,s,r])=>new this({R:e/255,G:i/255,B:r/255,A:1})))}static getLinearColorRGBGrammar(){return Pe.seq(Pe.reg(/rgb\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorRGBAGrammar(){return Pe.seq(Pe.reg(/rgba\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorFromAnyFormat(){return Pe.alt(this.getLinearColorFromHexGrammar(),this.getLinearColorRGBAGrammar(),this.getLinearColorRGBGrammar(),this.getLinearColorRGBListGrammar())}#D(){const e=this.R.value,t=this.G.value,i=this.B.value;if(oe.approximatelyEqual(e,t)&&oe.approximatelyEqual(e,i)&&oe.approximatelyEqual(t,i))return this.S.value=0,void(this.V.value=e);const s=Math.max(e,t,i),r=Math.min(e,t,i),n=s-r;let a;switch(s){case r:a=0;break;case e:a=(t-i)/n+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){return[this.H.value,this.S.value,this.V.value,this.A.value]}toNumber(){return(Math.round(255*this.R.value)<<24)+(Math.round(255*this.G.value)<<16)+(Math.round(255*this.B.value)<<8)+Math.round(255*this.A.value)}toArray(){return[this.R.value,this.G.value,this.B.value,this.A.value]}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#D()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=Oe.sRGBtoLinear((e>>8&255)/255),this.G.value=Oe.sRGBtoLinear((e>>16&255)/255),this.R.value=Oe.sRGBtoLinear((e>>24&255)/255),this.#D()}toString(){return Oe.printLinearColor(this)}}class De extends ke{static type;constructor(e=null){super();const t=this.constructor;e??=void 0!==t.default?t.default(t).getter:e,this.getter=e}static createGrammar(e=this.type?.grammar??Pe.lazy((()=>this.unknownEntityGrammar))){return this.type?.grammar.map((e=>new this((()=>e))))}static withDefault(e=e=>new e((()=>new e.type))){return super.withDefault(e)}static of(e){const t=this.asUniqueClass();return t.type=e,t.grammar=t.createGrammar(),t}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){return this.getter().serialize(e,t,i.type,s,r,n,a)}equals(e){return e instanceof De&&(e=e.getter?.()),this.getter?.().equals(e)}valueOf(e){return this.getter(e).valueOf()}toString(){return this.getter().toString()}}class $e extends ke{static numberRegexSource=String.raw`${Ie.numberRegexSource}(?<=(?:\.(\d*0+))?)`;static grammar=this.createGrammar();static precision;#$;get precision(){return this.constructor.precision??this.#$}set precision(e){this.#$=e}_value;get value(){return this._value}set value(e){-0===e&&(e=0),this._value=e}constructor(e=0,t=null){super(),this.value=Number(e),null!==t&&(this.#$=Number(t))}static createGrammar(){return Pe.regArray(new RegExp(`(?${this.numberRegexSource})|(?\\+?inf)|(?-inf)`)).map((({2:e,groups:{n:t,posInf:i,negInf:s}})=>new this(t?Number(t):i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,e?.length))).label("NumberEntity")}static withPrecision(e=0){const t=this.asUniqueClass();return t.precision=e,t}static printNumber(e){return e==Number.POSITIVE_INFINITY?"inf":e==Number.NEGATIVE_INFINITY?"-inf":oe.minDecimals(e)}serialize(e=!1,t="",i=this.constructor){if(this.value===Number.POSITIVE_INFINITY)return"+inf";if(this.value===Number.NEGATIVE_INFINITY)return"-inf";const s=i.precision??this.precision;let r=void 0!==s?this.value.toFixed(s):this.value.toString();return i.serialized&&(r=`"${r}"`),r}valueOf(){return this.value}toString(){return this.value.toString()}}class Ve extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault(),Z:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y,this.Z}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("VectorEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf(),this.Z.valueOf()]}}const Be=ae.paths,Re=/\/Script\/SequencerScripting\.MovieSceneScripting(.+)Channel/,Ge={A_AccentGrave:"à",Add:"Num +",C_Cedille:"ç",Decimal:"Num .",Divide:"Num /",E_AccentAigu:"é",E_AccentGrave:"è",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",Gamepad_Special_Left_X:"Touchpad Button X Axis",Gamepad_Special_Left_Y:"Touchpad Button Y Axis",Mouse2D:"Mouse XY 2D-Axis",Multiply:"Num *",Section:"§",Subtract:"Num -",Tilde:"`"},He={"Boolean::LogicAnd":"Logic AND","Boolean::LogicEq":"==","Boolean::LogicNEq":"!=","Boolean::LogicNot":"Logic NOT","Boolean::LogicOr":"Logic OR","Integer::BitAnd":"Bitwise AND","Integer::BitLShift":"Bitwise Left Shift","Integer::BitNot":"Bitwise NOT","Integer::BitOr":"Bitwise OR","Integer::BitRShift":"Bitwise Right Shift","Integer::BitXOr":"Bitwise XOR","Integer::EnumEq":"==","Integer::EnumNEq":"!=","Matrix::MatrixMultiply":"Multiply (Matrix * Matrix)","Matrix::MatrixVectorMultiply":"Multiply (Matrix * Vector4)",...Object.fromEntries(Object.entries({Add:"+",ArcCosine:"ArcCosine","ArcCosine(Degrees)":"ArcCos(D)","ArcCosine(Radians)":"ArcCos(R)",ArcSine:"ArcSine","ArcSine(Degrees)":"ArcSin(D)","ArcSine(Radians)":"ArcSin(R)","ArcTangent(Degrees)":"ArcTan(D)","ArcTangent(Radians)":"ArcTan(R)",CmpEQ:"==",CmpGE:">=",CmpGT:">",CmpLE:"<=",CmpLT:"<",CmpNEQ:"!=","Cosine(Degrees)":"Cos(D)","Cosine(Radians)":"Cos(R)",DegreesToRadians:"DegToRad",DistancePos:"Distance",Div:String.fromCharCode(247),FMod:"%",FModFast:"Modulo Fast",Length:"Len",Madd:`(A${String.fromCharCode(10799)}B)+C`,Mul:String.fromCharCode(10799),Negate:"-A",OneMinus:"1-A",PI:String.fromCharCode(960),RadiansToDegrees:"RadToDeg","Rand Float":"Random Float","Rand Integer":"Random Integer",Rand:"Random",Rcp:"Reciprocal",RSqrt:"Rcp Sqrt","Sine(Degrees)":"Sin(D)","Sine(Radians)":"Sin(R)",Subtract:"-","Tangent(Degrees)":"Tan(D)","Tangent(Radians)":"Tan(R)",TWO_PI:`2 ${String.fromCharCode(960)}`}).map((([e,t])=>["Numeric::"+e,t])))};function ze(e=""){switch(e=e.toLowerCase()){case"zero":return 0;case"one":return 1;case"two":return 2;case"three":return 3;case"four":return 4;case"five":return 5;case"six":return 6;case"seven":return 7;case"eight":return 8;case"nine":return 9}}function _e(e){let t;switch(e.getType()){case Be.addDelegate:t??="Bind Event to ";case Be.clearDelegate:t??="Unbind all Events from ";case Be.removeDelegate:return t??="Unbind Event from ",t+oe.formatStringName(e.DelegateReference?.MemberName?.toString().replace(/Delegate$/,"")??"None");case Be.asyncAction:if(e.ProxyFactoryFunctionName)return oe.formatStringName(e.ProxyFactoryFunctionName?.toString());case Be.actorBoundEvent:case Be.componentBoundEvent:return`${oe.formatStringName(e.DelegatePropertyName?.toString())} (${e.ComponentPropertyName?.toString()??"Unknown"})`;case Be.callDelegate:return`Call ${e.DelegateReference?.MemberName?.toString()??"None"}`;case Be.createDelegate:return"Create Event";case Be.customEvent:if(e.CustomFunctionName)return e.CustomFunctionName?.toString();case Be.dynamicCast:return e.TargetType?`Cast To ${e.TargetType?.getName()}`:"Bad cast node";case Be.enumLiteral:return`Literal enum ${e.Enum?.getName()}`;case Be.event:return`Event ${(e.EventReference?.MemberName?.toString()??"").replace(/^Receive/,"")}`;case Be.executionSequence:return"Sequence";case Be.forEachElementInEnum:return`For Each ${e.Enum?.getName()}`;case Be.forEachLoopWithBreak:return"For Each Loop with Break";case Be.functionEntry:return"UserConstructionScript"===e.FunctionReference?.MemberName?.toString()?"Construction Script":e.FunctionReference?.MemberName?.toString();case Be.functionResult:return"Return Node";case Be.ifThenElse:return"Branch";case Be.makeStruct:if(e.StructType)return`Make ${e.StructType.getName()}`;case Be.materialExpressionComponentMask:{const t=e.getMaterialSubobject();if(t)return`Mask ( ${ae.rgba.filter((e=>!0===t[e].getter().value)).map((e=>e+" ")).join("")})`}case Be.materialExpressionConstant:t??=[e.getCustomproperties().find((e=>"Value"==e.PinName.toString()))?.DefaultValue];case Be.materialExpressionConstant2Vector:t??=[e.getCustomproperties().find((e=>"X"==e.PinName?.toString()))?.DefaultValue,e.getCustomproperties().find((e=>"Y"==e.PinName?.toString()))?.DefaultValue];case Be.materialExpressionConstant3Vector:case Be.materialExpressionConstant4Vector:if(!t){const i=e.getCustomproperties().find((e=>"Constant"==e.PinName?.toString()))?.DefaultValue;t=i instanceof Ve?[i.X,i.Y,i.Z].map((e=>e.valueOf())):i instanceof Oe?[i.R,i.G,i.B,i.A].map((e=>e.valueOf())):[]}if(t?.length>0)return t.map((e=>oe.printExponential(e))).join(",");t=void 0;break;case Be.materialExpressionFunctionInput:{const t=e.getMaterialSubobject();return`Input ${t?.InputName??"In"} (${t?.InputType?.value.match(/^.+?_(\w+)$/)?.[1]??"Vector3"})`}case Be.materialExpressionLogarithm:return"Ln";case Be.materialExpressionLogarithm10:return"Log10";case Be.materialExpressionLogarithm2:return"Log2";case Be.materialExpressionMaterialFunctionCall:const i=e.getMaterialSubobject()?.MaterialFunction;if(i)return i.getName();break;case Be.materialExpressionSquareRoot:return"Sqrt";case Be.materialExpressionSubtract:const s=e.getMaterialSubobject();if(s)return`Subtract(${s.ConstA??"1"},${s.ConstB??"1"})`;case Be.metasoundEditorGraphExternalNode:{const t=e.ClassName?.Name;if(t)return"Add"===t?"+":t}case Be.niagaraNodeConvert:return`Make ${(e.AutowireMakeType?.ClassStructOrEnum??"").toString().match(/(?:Niagara)?(\w+)['"]*$/)?.[1]??""}`;case Be.pcgEditorGraphNodeInput:return"Input";case Be.pcgEditorGraphNodeOutput:return"Output";case Be.spawnActorFromClass:let r=e.getCustomproperties().find((e=>"ReturnValue"==e.PinName.toString()))?.PinType?.PinSubCategoryObject?.getName();return"Actor"===r&&(r=null),`SpawnActor ${oe.formatStringName(r??"NONE")}`;case Be.switchEnum:return`Switch on ${e.Enum?.getName()??"Enum"}`;case Be.switchInteger:return"Switch on Int";case Be.variableGet:return"";case Be.variableSet:return"SET"}const i=e.getClass();let s=e.switchTarget();if(s)return"E"!==s[0]&&(s=oe.formatStringName(s)),`Switch on ${s}`;if(e.isComment())return e.NodeComment.toString();const r=e.getHIDAttribute();if(r){const e=r.toString();let t=function(e){let t=Ge[e];if(t)return t;if(t=ze(e)?.toString(),t)return t;const i=e.match(/NumPad([a-zA-Z]+)/);return i&&(t=ze(i[1]).toString(),t)?"Num "+t:void 0}(e)??oe.formatStringName(e);return i===Be.inputDebugKey?t="Debug Key "+t:i===Be.getInputAxisKeyValue&&(t="Get "+t),t}if(i===Be.macro)return oe.formatStringName(e.MacroGraphReference?.getMacroName());const n=e.getMaterialSubobject();if(n){let e=_e(n);return e=e.match(/Material Expression (.+)/)?.[1]??e,e}if(e.isPcg()&&e.getPcgSubobject()){let t=e.getPcgSubobject();return t.NodeTitle?t.NodeTitle.toString():_e(t)}const a=e.getSubgraphObject();if(a)return a.Graph.getName();const o=e.getSettingsObject();if(o){if(o.ExportPath?.valueOf()?.type===Be.pcgHiGenGridSizeSettings)return`Grid Size: ${o.HiGenGridSize?.toString().match(/\d+/)?.[0]?.concat("00")??o.HiGenGridSize?.toString().match(/^\w+$/)?.[0]??"256"}`;if(o.BlueprintElementInstance)return oe.formatStringName(o.BlueprintElementType.getName());if(o.Operation){const e=o.Name?.toString().match(/PCGMetadata(\w+)Settings_\d+/);if(e)return oe.formatStringName(e[1]+": "+o.Operation)}const e=o.getSubgraphObject();if(e&&e.Graph)return e.Graph.getName()}let l,c=e.FunctionReference?.MemberName?.toString();if(c){const t=e.FunctionReference.MemberParent?.path??"";switch(c){case"AddKey":let e=t.match(Re);if(e)return`Add Key (${oe.formatStringName(e[1])})`;case"Concat_StrStr":return"Append"}const i=c.match(ae.lineTracePattern);if(i)return"Line Trace"+("Multi"===i[1]?" Multi ":" ")+(""===i[2]?"By Channel":oe.formatStringName(i[2]));switch(t){case Be.blueprintGameplayTagLibrary:case Be.kismetMathLibrary:case Be.slateBlueprintLibrary:case Be.timeManagementBlueprintLibrary:const e=c.match(/[BF]([A-Z]\w+)/);switch(e&&(c=e[1]),c){case"Abs":return"ABS";case"BooleanAND":return"AND";case"BooleanNAND":return"NAND";case"BooleanOR":return"OR";case"Exp":return"e";case"LineTraceSingle":return"Line Trace By Channel";case"Max":case"MaxInt64":return"MAX";case"Min":case"MinInt64":return"MIN";case"Not_PreBool":return"NOT";case"Sin":return"SIN";case"Sqrt":return"SQRT";case"Square":return"^2";case"CrossProduct2D":return"cross";case"Vector4_CrossProduct3":return"cross3";case"DotProduct2D":case"Vector4_DotProduct":return"dot";case"Vector4_DotProduct3":return"dot3"}if(c.startsWith("Add_"))return"+";if(c.startsWith("And_"))return"&";if(c.startsWith("Conv_"))return"";if(c.startsWith("Cross_"))return"cross";if(c.startsWith("Divide_"))return String.fromCharCode(247);if(c.startsWith("Dot_"))return"dot";if(c.startsWith("EqualEqual_"))return"==";if(c.startsWith("Greater_"))return">";if(c.startsWith("GreaterEqual_"))return">=";if(c.startsWith("Less_"))return"<";if(c.startsWith("LessEqual_"))return"<=";if(c.startsWith("Multiply_"))return String.fromCharCode(10799);if(c.startsWith("Not_"))return"~";if(c.startsWith("NotEqual_"))return"!=";if(c.startsWith("Or_"))return"|";if(c.startsWith("Percent_"))return"%";if(c.startsWith("Subtract_"))return"-";if(c.startsWith("Xor_"))return"^";break;case Be.blueprintSetLibrary:{const e=c.match(/Set_(\w+)/);if(e)return oe.formatStringName(e[1]).toUpperCase()}break;case Be.blueprintMapLibrary:{const e=c.match(/Map_(\w+)/);if(e)return oe.formatStringName(e[1]).toUpperCase()}break;case Be.kismetArrayLibrary:{const e=c.match(/Array_(\w+)/);if(e)return e[1].toUpperCase()}}return oe.formatStringName(c)}return e.OpName?He[e.OpName.toString()]??oe.formatStringName(e.OpName.toString().replaceAll(/(?:^\w+(?this.unknownEntityGrammar))){return this.inlined?e:Pe.seq(Pe.reg(/\(\s*/),e.sepBy(Ie.commaSeparation).opt(),Pe.reg(/\s*(,\s*)?\)/,1)).map((([e,t,i])=>{t=t instanceof Array?t:[];let s=this;return void 0!==i!==s.trailing&&(s=s.flagTrailing(void 0!==i)),new s(t)})).label(`ArrayEntity of ${this.type?.className()??"unknown values"}`)}static flagInlined(e=!0){const t=this.asUniqueClass();return t.inlined=e,t.grammar=t.createGrammar(),t}static of(e){const t=this.asUniqueClass();return t.type=e,t.grammar=t.createGrammar(),t}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){if(i.inlined)return super.serialize.bind(this.values,e,t,i,s,r,n,a)();let o=this.values.map((t=>t?.serialize(e))).join(i.attributeSeparator);return this.trailing&&(o+=i.attributeSeparator),`(${o})`}valueOf(){return this.values}equals(e){if(!(e instanceof Fe)||this.values.length!==e.values.length)return!1;for(let t=0;tje=e.default)).catch():je=window.crypto;class Ue extends ke{static grammar=this.createGrammar();static generateGuid(){let e=new Uint32Array(4);je.getRandomValues(e);let t="";return e.forEach((e=>{t+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),t}constructor(e=Ue.generateGuid()){super(),this.value=e}static createGrammar(){return Pe.reg(/[0-9A-F]{32}/i).map((e=>new this(e))).label("GuidEntity")}serialize(e=!1,t="",i=this.constructor){let s=this.value;return i.serialized&&(s=`"${s}"`),s}toString(){return this.value}}class Ke extends $e{static grammar=this.createGrammar();get value(){return super.value}set value(e){(e=Math.trunc(e))>=1<<31&&e<-(1<<31)&&(e=Math.floor(e),super.value=e)}static createGrammar(){return Pe.numberInteger.map((e=>new this(e)))}}class Ye extends Ke{static grammar=this.createGrammar();get value(){return super.value}set value(e){e=Math.round(oe.clamp(e,0)),super.value=e}static createGrammar(){return Pe.numberNatural.map((e=>new this(e)))}}const qe={Any:n``,"Any[]":n``,audio:n``,blue:n``,bool:n``,byte:n``,class:n``,default:n``,delegate:n``,enum:n``,exec:n``,float:n``,green:n``,int:n``,int32:n``,int64:n``,interface:n``,name:n``,object:n``,Param:n``,"Param[]":n``,Point:n``,"Point[]":n``,real:n``,red:n``,string:n``,struct:n``,Surface:n``,"Surface[]":n``,text:n``,time:n``,Volume:n``,"Volume[]":n``,wildcard:n``,[ae.paths.linearColor]:n``,[ae.paths.niagaraBool]:n``,[ae.paths.niagaraDataInterfaceCollisionQuery]:n``,[ae.paths.niagaraDataInterfaceCurlNoise]:n``,[ae.paths.niagaraDataInterfaceVolumeTexture]:n``,[ae.paths.niagaraFloat]:n``,[ae.paths.niagaraInt32]:n``,[ae.paths.niagaraPosition]:n``,[ae.paths.quat4f]:n``,[ae.paths.rotator]:n``,[ae.paths.transform]:n``,[ae.paths.vector]:n``,[ae.paths.vector2f]:n``,[ae.paths.vector3f]:n``,[ae.paths.vector4f]:n``},Xe=n``;function Ze(e){let t,i=e.PinFriendlyName?e.PinFriendlyName.toString():oe.formatStringName(e.PinName?.toString()??"");return(t=e.PinToolTip?.toString().match(/\s*(.+?(?=\n)|.+\S)\s*/))&&t[1].toLowerCase()===i.toLowerCase()?t[1]:(i=i.replace(/^Module\./,""),i)}class We extends Ke{static grammar=this.createGrammar();get value(){return super.value}set value(e){(e=Math.trunc(e))>=0&&e<256&&(super.value=e)}createGrammar(){return Pe.numberByte.map((e=>new this(e)))}}class Qe extends ke{static grammar=this.createGrammar();static escapedCharacters=/['"\\]/g;static unescapedBackslash=/(?<=(?:[^\\]|^)(?:\\\\)*)\\(?!\\)/;constructor(e=""){super(),this.value=e}static createGrammar(){return Pe.doubleQuotedString.map((e=>new this(Qe.unescape(e)))).label("StringEntity")}static escape(e,t=!0){let i=e.replaceAll(new RegExp(`(${Qe.escapedCharacters.source})`,"g"),"\\$1");return t&&(i=i.replaceAll("\n","\\n").replaceAll("\t","\\t")),i}static unescape(e){return e.replaceAll(new RegExp(Qe.unescapedBackslash.source+"t","g"),"\t").replaceAll(new RegExp(Qe.unescapedBackslash.source+"n","g"),"\n").replaceAll(new RegExp(`\\\\(${Qe.escapedCharacters.source})`,"g"),"$1")}doSerialize(e=!1){let t=`"${Qe.escape(this.value)}"`;return e&&(t=Qe.escape(t,!1)),t}valueOf(){return this.value}toString(){return this.value}}class Je extends ke{static grammar=this.createGrammar();static f;static createGrammar(){return Qe.grammar}static from(e){const t=this.asUniqueClass();return t.f=e,t}static compute(e){return this.f(e)}}class et extends ke{static attributeConverter={fromAttribute:(e,t)=>new this(e),toAttribute:(e,t)=>e.toString()};static grammar=this.createGrammar();static createGrammar(){return Ie.symbol.map((e=>new this(e))).label("SymbolEntity")}constructor(e=""){super(),this.value=e}serialize(e=!1,t="",i=this.constructor){let s=this.value;return i.serialized&&(s=`"${s}"`),s}toString(){return this.value}}class tt extends et{static grammar=this.createGrammar();static createGrammar(){return Ie.symbol.map((e=>new this(e)))}}class it extends tt{static grammar=this.createGrammar();static createGrammar(){return Pe.reg(Ie.Regex.InsideString).map((e=>new this(e)))}}class st extends ke{static lookbehind="INVTEXT";static grammar=this.createGrammar();constructor(e=""){super(),this.value=e}static createGrammar(){return Pe.alt(Pe.seq(Pe.reg(new RegExp(`${this.lookbehind}\\s*\\(`)),Pe.doubleQuotedString,Pe.reg(/\s*\)/)).map((([e,t,i])=>t)),Pe.reg(new RegExp(this.lookbehind)).map((()=>""))).map((e=>new this(e))).label("InvariantTextEntity")}doSerialize(){return this.lookbehind+'("'+this.value+'")'}valueOf(){return this.value}toString(){return this.value}}class rt extends ke{static attributeSeparator=", ";static printKey=e=>"";static lookbehind="NSLOCTEXT";static attributes={...super.attributes,namespace:Qe.withDefault(),key:Qe.withDefault(),value:Qe.withDefault()};static grammar=this.createGrammar();constructor(e={}){super(e),this.namespace,this.key,this.value}static createGrammar(){return Pe.regArray(new RegExp(String.raw`${rt.lookbehind}\s*\(`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*,`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*,`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*`+String.raw`(?,\s+)?`+String.raw`\)`,"m")).map((({groups:{namespace:e,key:t,value:i,trailing:s}})=>new this({namespace:new this.attributes.namespace(oe.unescapeString(e)),key:new this.attributes.namespace(oe.unescapeString(t)),value:new this.attributes.namespace(oe.unescapeString(i)),trailing:void 0!==s}))).label("LocalizedTextEntity")}toString(){return oe.capitalFirstLetter(this.value.valueOf())}}class nt extends ke{static attributeSeparator=", ";static lookbehind=["LOCGEN_FORMAT_NAMED","LOCGEN_FORMAT_ORDERED"];static grammar=this.createGrammar();constructor(e){super(),this.values=e}static createGrammar(){return Pe.lazy((()=>Pe.seq(Pe.reg(new RegExp(String.raw`(${this.lookbehind.join("|")})\s*\(\s*`),1),Pe.alt(...[Qe,rt,st,nt].map((e=>e.grammar))).sepBy(Pe.reg(/\s*\,\s*/)),Pe.reg(/\s*\)/)).map((([e,t])=>{const i=new this(t);return i.lookbehind=e,i})))).label("FormatTextEntity")}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i.attributeSeparator;return this.lookbehind+"("+this.values.map((t=>t.serialize(e))).join(o)+(i.trailing?o:"")+")"}toString(){const e=this.values?.[0]?.toString();if(!e)return"";const t=this.values.slice(1).map((e=>e?.valueOf()));return"LOCGEN_FORMAT_NAMED"==this.lookbehind?e.replaceAll(/\{([a-zA-Z]\w*)\}/g,((e,i)=>{const s=t.indexOf(i)+1;return s>0&&s{const s=Number(i);return s=-(1n<<63n)&&e<1n<<63n&&(this._value=e)}constructor(e=0n){super(),this.value=BigInt(e)}static createGrammar(){return Pe.numberBigInteger.map((e=>new this(e)))}serialize(e=!1,t="",i=this.constructor){let s=this.value.toString();return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}toString(){return this.value.toString()}}class ot extends ke{static typeReference=Pe.reg(new RegExp(Ie.Regex.Path.source+"|"+Ie.symbol.getParser().regexp.source));static fullReferenceGrammar=this.createFullReferenceGrammar();static grammar=this.createGrammar();#c;get type(){return this.#c}set type(e){this.#c=e}#V;get path(){return this.#V}set path(e){this.#B="",this.#V=e}#R;get full(){return this.#R}set full(e){this.#R=e}#B="";constructor(e="None",t="",i=(e.includes("/")||t?(e,t)=>`"${e+(t?`'${t}'`:"")}"`:(e,t)=>e)){super(),this.#c=e,this.#V=t,this.#R=i}static createGrammar(){return Pe.alt(this.createFullReferenceSerializedGrammar(),this.createFullReferenceGrammar(),this.createTypeReferenceGrammar()).label("ObjectReferenceEntity")}static createFullReferenceGrammar(){return Pe.regArray(new RegExp("("+this.typeReference.getParser().regexp.source+")(?:"+`'"(${Ie.Regex.InsideString.source})"'|`+`'(${Ie.Regex.InsideSingleQuotedString.source})')`)).map((([e,t,i,s])=>{let r=!!i,n=r?["'\"","\"'"]:["'","'"];return new this(t,r?i:s,((e,t)=>e+n[0]+t+n[1]))}))}static createFullReferenceSerializedGrammar(){return Pe.regArray(new RegExp('"('+Ie.Regex.InsideString.source+"?)(?:'("+Ie.Regex.InsideSingleQuotedString.source+"?)')?\"")).map((([e,t,i])=>new this(t,i,((e,t)=>`"${e}${t?`'${t}'`:""}"`))))}static createTypeReferenceGrammar(){return this.typeReference.map((e=>new this(e,"",((e,t)=>e))))}static createNoneInstance(){return new this("None")}getName(e=!1){return this.#B?this.#B:e?oe.getNameFromPath(this.path.replace(/_C$/,""),e):this.#B=oe.getNameFromPath(this.path.replace(/_C$/,""),e)}doSerialize(e=!1){let t=this.full(this.type,this.path);return e&&(t=oe.escapeString(t,!1)),t}equals(e){return e instanceof ot&&(this.type==e.type&&this.path==e.path)}toString(){return this.full(this.type,this.path)}}class lt extends ke{static grammar=this.createGrammar();constructor(e=null,t=null){super(),this.objectName=e,this.pinGuid=t}static createGrammar(){return Pe.seq(et.grammar,Pe.whitespace,Ue.grammar).map((([e,t,i])=>new this(e,i))).label("PinReferenceEntity")}doSerialize(){return this.objectName.serialize()+" "+this.pinGuid.serialize()}}class ct extends ke{static attributes={...super.attributes,MemberParent:ot,MemberName:Qe,MemberGuid:Ue};static grammar=this.createGrammar();constructor(e){super(e),this.MemberParent,this.MemberName,this.MemberGuid}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,0,0)}}class ut extends ke{static attributes={...super.attributes,PinCategory:Qe.withDefault(),PinSubCategory:Qe,PinSubCategoryObject:ot,PinSubCategoryMemberReference:ct,ContainerType:et,bIsReference:Le,bIsConst:Le,bIsWeakPointer:Le,bIsUObjectWrapper:Le,bSerializeAsSinglePrecisionFloat:Le};static grammar=this.createGrammar();constructor(e={}){super(e),this.PinCategory,this.PinSubCategory,this.PinSubCategoryObject,this.PinSubCategoryMemberReference,this.ContainerType,this.bIsReference,this.bIsConst,this.bIsWeakPointer,this.bIsUObjectWrapper,this.bIsUObjectWrapper,this.bSerializeAsSinglePrecisionFloat}static createGrammar(){return Ie.createEntityGrammar(this).label("PinTypeEntity")}copyTypeFrom(e){for(const t of this.keys)void 0!==e[t]&&(this[t]=e[t])}}class ht extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("Vector2DEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf()]}}class pt extends ht{static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(/X\s*=\s*/.source+"(?"+Ie.numberRegexSource+")\\s+"+/Y\s*=\s*/.source+"(?"+Ie.numberRegexSource+")")).map((({groups:{x:e,y:t}})=>new this({X:new ht.attributes.X(e),Y:new ht.attributes.Y(t)}))),ht.grammar.map((e=>new this({X:e.X,Y:e.Y})))).label("RBSerializationVector2DEntity")}}class dt extends ke{static attributes={...super.attributes,R:$e.withDefault(),P:$e.withDefault(),Y:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.R,this.P,this.Y}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("RotatorEntity")}getRoll(){return this.R}getPitch(){return this.P}getYaw(){return this.Y}}class mt extends dt{static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`)).map((([e,t,i,s,r,n,a])=>new this({R:new dt.attributes.R(n,a?.length),P:new dt.attributes.P(t,i?.length),Y:new dt.attributes.Y(s,r?.length)}))),dt.grammar.map((e=>new this({R:e.R,P:e.P,Y:e.Y})))).label("SimpleSerializationRotatorEntity")}doSerialize(){const e=this.constructor.attributeSeparator;return this.P.serialize()+e+this.Y.serialize()+e+this.R.serialize()+(this.trailing?e:"")}}class gt extends ht{static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`)).map((([e,t,i,s,r])=>new this({X:new ht.attributes.X(t,i?.length),Y:new ht.attributes.Y(s,r?.length)}))),ht.grammar.map((e=>new this({X:e.X,Y:e.Y})))).label("SimpleSerializationVector2DEntity")}doSerialize(){const e=this.constructor.attributeSeparator;return this.X.serialize()+e+this.Y.serialize()+(this.trailing?e:"")}}class bt extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault(),Z:$e.withDefault(),W:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y,this.Z,this.W}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("Vector4DEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf(),this.Z.valueOf(),this.W.valueOf()]}}class vt extends bt{static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`)).map((([e,t,i,s,r])=>new this({X:new bt.attributes.X(t),Y:new bt.attributes.Y(i),Z:new bt.attributes.Z(s),W:new bt.attributes.W(r)}))),bt.grammar)}}class ft extends Ve{static allowShortSerialization=!1;static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+(this.allowShortSerialization?"(?:":"")+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+(this.allowShortSerialization?")?":""))).map((([e,t,i,s,r,n,a])=>new this({X:new Ve.attributes.X(t,i?.length),Y:new Ve.attributes.Y(s,r?.length),Z:new Ve.attributes.Z(n,a?.length)}))),Ve.grammar.map((e=>new this({X:e.X,Y:e.Y,Z:e.Z}))))}static flagAllowShortSerialization(e=!0){const t=this.asUniqueClass();return e!==t.allowShortSerialization&&(t.allowShortSerialization=e,t.grammar=t.createGrammar()),t}doSerialize(){const e=this.constructor.attributeSeparator;return this.X.serialize()+e+this.Y.serialize()+e+this.Z.serialize()+(this.trailing?e:"")}}class yt extends ke{static lookbehind="Pin";static#G={bool:Le,byte:We,enum:tt,exec:Qe,float:$e,int:Ke,int64:at,name:Qe,real:$e,string:Qe,[ae.paths.linearColor]:Oe,[ae.paths.niagaraBool]:Le,[ae.paths.niagaraFloat]:$e,[ae.paths.niagaraPosition]:Ve,[ae.paths.rotator]:dt,[ae.paths.vector]:Ve,[ae.paths.vector2D]:ht,[ae.paths.vector4f]:bt};static#H={enum:it,rg:pt,[ae.paths.niagaraPosition]:ft.flagAllowShortSerialization(),[ae.paths.rotator]:mt,[ae.paths.vector]:ft,[ae.paths.vector2D]:gt,[ae.paths.vector3f]:ft,[ae.paths.vector4f]:vt};static attributes={PinId:Ue.withDefault(),PinName:Qe.withDefault(),PinFriendlyName:Me.accepting(rt,nt,st,Qe),PinToolTip:Qe,Direction:Qe,PinType:ut.withDefault().flagInlined(),LinkedTo:Fe.of(lt).withDefault().flagSilent(),SubPins:Fe.of(lt),ParentPin:lt,DefaultValue:Je.from((e=>e.getEntityType(!0)?.flagSerialized()??Qe)),AutogeneratedDefaultValue:Qe,DefaultObject:ot,PersistentGuid:Ue,bHidden:Le,bNotConnectable:Le,bDefaultValueIsReadOnly:Le,bDefaultValueIsIgnored:Le,bAdvancedView:Le,bOrphanedPin:Le};static grammar=this.createGrammar();#z=!1;set recomputesNodeTitleOnChange(e){this.#z=e}get recomputesNodeTitleOnChange(){return this.#z}#_=null;get objectEntity(){try{return this.#_}catch(e){return null}}set objectEntity(e){this.#_=e}#F;get pinIndex(){return this.#F}set pinIndex(e){this.#F=e}constructor(e={}){super(e),this.PinId,this.PinName,this.PinFriendlyName,this.PinToolTip,this.Direction,this.PinType,this.LinkedTo,this.DefaultValue,this.AutogeneratedDefaultValue,this.DefaultObject,this.PersistentGuid,this.bHidden,this.bNotConnectable,this.bDefaultValueIsReadOnly,this.bDefaultValueIsIgnored,this.bAdvancedView,this.bOrphanedPin,this.objectEntity}static createGrammar(){return Ie.createEntityGrammar(this)}static fromLegacyObject(e){return new yt(e)}getType(){const e=this.PinType.PinCategory?.toString().toLocaleLowerCase();if(["struct","class","object","type","statictype"].includes(e))return this.PinType.PinSubCategoryObject?.path;if(this.isEnum())return"enum";if(this.objectEntity?.isPcg()){const e=this.objectEntity.getPcgSubobject(),t=this.isInput()?e.InputPins?.valueOf()[this.pinIndex]:e.OutputPins?.valueOf()[this.pinIndex];if(t){const i=e[ae.subObjectAttributeNameFromReference(t,!0)];let s=i.Properties?.AllowedTypes?.toString()??"";if(""==s&&(s=this.PinType.PinCategory??"",""==s&&(s="Any")),s)return!1!==i.Properties.bAllowMultipleData?.valueOf()&&!1!==i.Properties.bAllowMultipleConnections?.valueOf()&&(s+="[]"),s}}if("optional"===e){const e=this.PinType.PinSubCategory?.toString();switch(e){case"red":return"real";case"rg":return"rg";case"rgb":return ae.paths.vector;case"rgba":return ae.paths.linearColor;default:return e}}return e}getEntityType(e=!1){const t=this.getType(),i=yt.#G[t],s=yt.#H[t];return e&&void 0!==s?s:i}pinTitle(){return Ze(this)}copyTypeFrom(e){this.PinType=e.PinType}getDefaultValue(e=!1){return void 0===this.DefaultValue&&e&&(this.DefaultValue=new(this.getEntityType(!0))),this.DefaultValue}isEnum(){const e=this.PinType.PinSubCategoryObject?.type;return e===ae.paths.enum||e===ae.paths.userDefinedEnum||"enum"===e?.toLowerCase()}isExecution(){return"exec"===this.PinType.PinCategory.toString()||this.getType()===ae.paths.niagaraParameterMap}isHidden(){return this.bHidden?.valueOf()}isInput(){return!this.isHidden()&&"EGPD_Output"!=this.Direction?.toString()}isOutput(){return!this.isHidden()&&"EGPD_Output"==this.Direction?.toString()}isLinked(){return this.LinkedTo?.length>0}linkTo(e,t){const i=this.LinkedTo.values?.some((i=>i.objectName.toString()==e&&i.pinGuid.toString()==t.PinId.toString()));return!i&&(this.LinkedTo.values.push(new lt(new et(e),t.PinId)),!0)}unlinkFrom(e,t){const i=this.LinkedTo.values?.findIndex((i=>i.objectName.toString()==e&&i.pinGuid.toString()==t.PinId.toString()));return i>=0&&(this.LinkedTo.values.splice(i,1),0===this.LinkedTo.length&&void 0===yt.attributes.LinkedTo.default&&(this.LinkedTo.values=[]),!0)}getSubCategory(){return this.PinType.PinSubCategoryObject?.path}pinColor(){return function(e){if("mask"===e.PinType.PinCategory?.toString()){const t=qe[e.PinType.PinSubCategory?.toString()];if(t)return t}else if("optional"===e.PinType.PinCategory?.toString())return Xe;const t=e.getType();return qe[t]??qe[e.PinType.PinCategory?.toString().toLowerCase()]??(t.startsWith("/Script/Niagara.")?qe.struct:qe.default)}(this)}}const wt=e=>e.PinName?.toString().match(/^\s*([A-Z])\s*$/)?.[1]?.charCodeAt(0)-"A".charCodeAt(0);class St extends ke{static attributes={...super.attributes,MacroGraph:ot,GraphBlueprint:ot,GraphGuid:Ue};static grammar=this.createGrammar();constructor(e){super(e),this.MacroGraph,this.GraphBlueprint,this.GraphGuid}static createGrammar(){return Ie.createEntityGrammar(this)}getMacroName(){const e=this.MacroGraph.path.search(":");return this.MacroGraph.path.substring(e+1)}}class Et extends ke{static grammar=this.createGrammar();static createGrammar(){return Pe.reg(new RegExp(String.raw`\(${Pe.whitespaceInlineOpt.getParser().regexp.source}\)`)).map((e=>new this)).label("NullEntity")}serialize(e=!1,t="",i=this.constructor){let s="()";return i.serialized&&(s=`"${s}"`),s}}class Ct extends ke{static attributes={...super.attributes,ScriptVariable:ot,OriginalChangeId:Ue};static grammar=this.createGrammar();constructor(e={}){super(e),this.ScriptVariable,this.OriginalChangeId}static createGrammar(){return Ie.createEntityGrammar(this).label("ScriptVariableEntity")}}class Nt extends yt{static attributes={...super.attributes,PinId:Ue};static grammar=this.createGrammar();static createGrammar(){return Pe.seq(Pe.reg(new RegExp(`(${Ie.Regex.Symbol.source}\\s*)?\\(\\s*`),1),Ie.createAttributeGrammar(this).sepBy(Ie.commaSeparation),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{e??="";let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),new this(s)})).label("UnknownPinEntity")}}class xt extends ke{static attributes={...super.attributes,MemberScope:Qe,MemberName:Qe.withDefault(),MemberGuid:Ue,bSelfContext:Le};static grammar=this.createGrammar();constructor(e){super(e),this.MemberScope,this.MemberName,this.MemberGuid,this.bSelfContext}static createGrammar(){return Ie.createEntityGrammar(this).label("VariableReferenceEntity")}}class Pt extends ke{#j=!1;get exported(){return this.#j}set exported(e){this.#j=e}static#U=/^(\w+?)(?:_(\d+))?$/;static printKey=e=>e.startsWith(ae.subObjectAttributeNamePrefix)?"":e;static attributeSeparator="\n";static wrap=this.notWrapped;static trailing=!0;static attributes={...super.attributes,Class:ot,Name:Qe,Archetype:ot,ExportPath:De.of(ot),ObjectRef:ot,BlueprintElementType:ot,BlueprintElementInstance:ot,ConstA:De.of($e),ConstB:De.of($e),PinTags:Fe.of(Et).flagInlined(),PinNames:Fe.of(Qe).flagInlined(),AxisKey:et,InputAxisKey:et,InputName:Qe,InputType:et,NumAdditionalInputs:Ye,bIsPureFunc:Le,bIsConstFunc:Le,bIsCaseSensitive:Le,VariableReference:xt,SelfContextInfo:et,DelegatePropertyName:Qe,DelegateOwnerClass:ot,ComponentPropertyName:Qe,EventReference:ct,FunctionReference:ct,FunctionScript:ot,CustomFunctionName:Qe,TargetType:ot,MacroGraphReference:St,Enum:ot,EnumEntries:Fe.of(Qe).flagInlined(),InputKey:et,OpName:Qe,CachedChangeId:Ue,FunctionDisplayName:Qe,AddedPins:Fe.of(Nt).withDefault().flagInlined().flagSilent(),ChangeId:Ue,MaterialFunction:ot,bOverrideFunction:Le,bInternalEvent:Le,bConsumeInput:Le,bExecuteWhenPaused:Le,bOverrideParentBinding:Le,bControl:Le,bAlt:Le,bShift:Le,bCommand:Le,CommentColor:Oe,bCommentBubbleVisible_InDetailsPanel:Le,bColorCommentBubble:Le,ProxyFactoryFunctionName:Qe,ProxyFactoryClass:ot,ProxyClass:ot,StructType:ot,MaterialExpression:ot,MaterialExpressionComment:ot,MoveMode:et,TimelineName:Qe,TimelineGuid:Ue,SizeX:De.of(Ke),SizeY:De.of(Ke),Text:De.of(Qe),ParameterName:Qe,ExpressionGUID:Ue,MaterialExpressionEditorX:De.of(Ke),MaterialExpressionEditorY:De.of(Ke),MaterialExpressionGuid:Ue,NodeTitle:Qe,NodeTitleColor:Oe,PositionX:De.of(Ke),PositionY:De.of(Ke),SettingsInterface:ot,PCGNode:ot,HiGenGridSize:et,Operation:et,NodePosX:Ke,NodePosY:Ke,NodeHeight:Ke,NodeWidth:Ke,Graph:ot,SubgraphInstance:Qe,InputPins:Fe.of(ot).flagInlined(),OutputPins:Fe.of(ot).flagInlined(),bExposeToLibrary:Le,bCanRenameNode:Le,bCommentBubblePinned:Le,bCommentBubbleVisible:Le,NodeComment:Qe,AdvancedPinDisplay:et,DelegateReference:xt,EnabledState:et,NodeGuid:Ue,ErrorType:Ke,ErrorMsg:Qe,ScriptVariables:Fe.flagInlined().of(Ct),Node:De.of(ot),ExportedNodes:Qe,CustomProperties:Fe.of(Me.accepting(yt,Nt)).withDefault().flagSilent()};static customPropertyGrammar=Pe.seq(Pe.reg(/CustomProperties\s+/),this.attributes.CustomProperties.type.grammar).map((([e,t])=>e=>{(e.CustomProperties??=new this.attributes.CustomProperties).values.push(t)}));static inlinedArrayEntryGrammar=Pe.seq(Pe.alt(Ie.symbolQuoted.map((e=>[e,!0])),Ie.symbol.map((e=>[e,!1]))),Pe.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`),1).map(Number)).chain((([[e,t],i])=>(this.attributes[e]?.grammar??ke.unknownEntityGrammar).map((s=>r=>{if(void 0===r[e]){let i=Fe;t!=i.quoted&&(i=i.flagQuoted(t)),i.inlined||(i=i.flagInlined()),r[e]=new i}r[e].values[i]=s}))));static grammar=this.createGrammar();static grammarMultipleObjects=Pe.seq(Pe.whitespaceOpt,this.grammar,Pe.seq(Pe.whitespace,this.grammar).map((([e,t])=>t)).many(),Pe.whitespaceOpt).map((([e,t,i,s])=>[t,...i]));constructor(e={}){if("NodePosX"in e!="NodePosY"in e){const t=Object.entries(e),[i,s]="NodePosX"in e?["NodePosY",Object.keys(e).indexOf("NodePosX")+1]:["NodePosX",Object.keys(e).indexOf("NodePosY")];t.splice(s,0,[i,new Ke(0)]),e=Object.fromEntries(t)}super(e),this.CustomProperties,this.AddedPins,this.AdvancedPinDisplay,this.Archetype,this.AxisKey,this.bIsPureFunc,this.BlueprintElementInstance,this.BlueprintElementType,this.Class,this.CommentColor,this.ComponentPropertyName,this.ConstA,this.ConstB,this.CustomFunctionName,this.DelegatePropertyName,this.DelegateReference,this.EnabledState,this.Enum,this.EnumEntries,this.EventReference,this.ExportedNodes,this.ExportPath,this.FunctionDisplayName,this.FunctionReference,this.FunctionScript,this.Graph,this.HiGenGridSize,this.InputAxisKey,this.InputKey,this.InputName,this.InputPins,this.InputType,this.MacroGraphReference,this.MaterialExpression,this.MaterialExpressionComment,this.MaterialExpressionEditorX,this.MaterialExpressionEditorY,this.MaterialFunction,this.Name,this.Node,this.NodeComment,this.NodeHeight,this.NodePosX,this.NodePosY,this.NodeTitle,this.NodeTitleColor,this.NodeWidth,this.NumAdditionalInputs,this.ObjectRef,this.Operation,this.OpName,this.OutputPins,this.ParameterName,this.PCGNode,this.PinNames,this.PinTags,this.PositionX,this.PositionY,this.ProxyFactoryFunctionName,this.ScriptVariables,this.SettingsInterface,this.SizeX,this.SizeY,this.StructType,this.SubgraphInstance,this.TargetType,this.Text,this.Text,this.VariableReference,this.Pins instanceof Fe&&this.Pins.valueOf().forEach((e=>{const t=this[ae.subObjectAttributeNameFromReference(e,!0)];if(t){const e=yt.fromLegacyObject(t);e.LinkedTo=new yt.attributes.LinkedTo,this.getCustomproperties(!0).push(e),this.CustomProperties.ignored=!0}}));const t=this.getMaterialSubobject();if(t){const e=t;if(void 0!==e.SizeX&&(e.SizeX.getter=()=>this.NodeWidth),e.SizeY&&(e.SizeY.getter=()=>this.NodeHeight),e.Text&&(e.Text.getter=()=>this.NodeComment),e.MaterialExpressionEditorX&&(e.MaterialExpressionEditorX.getter=()=>this.NodePosX),e.MaterialExpressionEditorY&&(e.MaterialExpressionEditorY.getter=()=>this.NodePosY),this.getType()===ae.paths.materialExpressionComponentMask){const t=ae.rgba.map((e=>{const t=this.getPinEntities().find((t=>t.PinName.toString()===e));return t.recomputesNodeTitleOnChange=!0,t}));e.keys=[...ae.rgba,...e.keys];const i=De.of(Le).withDefault().flagSilent();e.R=new i((()=>t[0].DefaultValue)),e.G=new i((()=>t[1].DefaultValue)),e.B=new i((()=>t[2].DefaultValue)),e.A=new i((()=>t[3].DefaultValue))}else if(this.getType()===ae.paths.materialExpressionSubtract){const t=De.of($e.withPrecision(6)).withDefault((()=>new De((()=>new $e(1))))).flagSilent(),i=this.getCustomproperties().find((e=>"A"===e.PinName?.toString())),s=this.getCustomproperties().find((e=>"B"===e.PinName?.toString()));(i||s)&&(e.keys=["ConstA","ConstB",...e.keys],i&&(i.recomputesNodeTitleOnChange=!0,e.ConstA=new t((()=>i.DefaultValue))),s&&(s.recomputesNodeTitleOnChange=!0,e.ConstB=new t((()=>s.DefaultValue))))}}const i=this.getPcgSubobject();i&&(i.PositionX&&(i.PositionX.getter=()=>this.NodePosX),i.PositionY&&(i.PositionY.getter=()=>this.NodePosY),i.getSubobjects().forEach((e=>{if(void 0!==e.Node){const t=e.Node.getter();t.type===this.PCGNode.type&&t.path===`${this.Name}.${this.PCGNode.path}`&&(e.Node.getter=()=>new ot(this.PCGNode.type,`${this.Name}.${this.PCGNode.path}`,t.full))}})));let s=0,r=0;this.getCustomproperties().forEach(((e,t)=>{e.objectEntity=this,e.pinIndex=e.isInput()?s++:e.isOutput()?r++:t})),this.mirrorNameInExportPaths()}static createGrammar(){return Pe.seq(Pe.reg(/Begin +Object/),Pe.seq(Pe.whitespace,Pe.alt(this.createSubObjectGrammar(),this.customPropertyGrammar,Ie.createAttributeGrammar(this,Pe.reg(Ie.Regex.MultipleWordsSymbols)),Ie.createAttributeGrammar(this,Ie.attributeNameQuoted,void 0,((e,t,i)=>{oe.objectSet(e,[...t,"quoted"],!0)})),this.inlinedArrayEntryGrammar)).map((([e,t])=>t)).many(),Pe.reg(/\s+End +Object/)).map((([e,t,i])=>{const s={};return t.forEach((e=>e(s))),new this(s)})).label("ObjectEntity")}static createSubObjectGrammar(){return Pe.lazy((()=>this.grammar)).map((e=>t=>{e.trailing=!1,t[ae.subObjectAttributeNameFromEntity(e)]=e}))}mirrorNameInExportPaths(e=this.Name?.toString()){if(!e)return;const t=[this];for(let i=0;i{const t=n.valueOf();return new r.type(t.type,t.path.replace(e,this.Name?.toString()??""),t.full)}))}}#K;getClass(){if(!this.#K&&(this.#K=(this.Class?.path?this.Class.path:this.Class?.type)??this.ExportPath?.valueOf()?.type??"",this.#K&&!this.#K.startsWith("/"))){let e=Object.values(ae.paths).find((e=>e.endsWith("."+this.#K)));e&&(this.#K=e)}return this.#K}getType(){const e=this.MacroGraphReference?.MacroGraph?.path;return e||(this.MaterialExpression?this.MaterialExpression.type:this.getClass())}getObjectName(e=!1){return e?this.getNameAndCounter()[0]:this.Name.toString()}getNameAndCounter(){const e=this.getObjectName().match(Pt.#U);return e?[e[1]??"",parseInt(e[2]??"0")]:["",0]}getCounter(){return this.getNameAndCounter()[1]}getNodeWidth(){return this.NodeWidth??this.isComment()?ae.defaultCommentWidth:void 0}setNodeWidth(e){this.NodeWidth||(this.NodeWidth=new Ke),this.NodeWidth.value=e}getNodeHeight(){return this.NodeHeight??this.isComment()?ae.defaultCommentHeight:void 0}setNodeHeight(e){this.NodeHeight||(this.NodeHeight=new Ke),this.NodeHeight.value=e}getNodePosX(){return this.NodePosX?.value??0}setNodePosX(e){this.NodePosX||(this.NodePosX=new Ke),this.NodePosX.value=Math.round(e)}getNodePosY(){return this.NodePosY?.value??0}setNodePosY(e){this.NodePosY||(this.NodePosY=new Ke),this.NodePosY.value=Math.round(e)}getCustomproperties(e=!1){return this.CustomProperties.values}getPinEntities(){return this.getCustomproperties().filter((e=>e.constructor===yt))}getSubobjects(){return Object.keys(this).filter((e=>e.startsWith(ae.subObjectAttributeNamePrefix))).flatMap((e=>[this[e],...this[e].getSubobjects()]))}switchTarget(){const e=this.getClass().match(ae.switchTargetPattern);if(e)return e[1]}isEvent(){switch(this.getClass()){case ae.paths.actorBoundEvent:case ae.paths.componentBoundEvent:case ae.paths.customEvent:case ae.paths.event:case ae.paths.inputAxisKeyEvent:case ae.paths.inputVectorAxisEvent:return!0}return!1}isComment(){switch(this.getClass()){case ae.paths.comment:case ae.paths.materialGraphNodeComment:return!0}return!1}isMaterial(){const e=this.getClass();return e.startsWith("/Script/Engine.MaterialExpression")||e.startsWith("/Script/InterchangeImport.MaterialExpression")||e.startsWith("/Script/UnrealEd.MaterialGraph")}getMaterialSubobject(){const e=this.MaterialExpression??this.MaterialExpressionComment;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}isPcg(){return this.getClass()===ae.paths.pcgEditorGraphNode||null!=this.getPcgSubobject()}isNiagara(){return this.Class&&(this.Class.type?this.Class.type:this.Class.path)?.startsWith("/Script/NiagaraEditor.")}getPcgSubobject(){const e=this.PCGNode;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}getSettingsObject(){const e=this.SettingsInterface;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}getSubgraphObject(){const e=this.SubgraphInstance;return e?this[ae.subObjectAttributeNameFromName(e)]:null}isDevelopmentOnly(){const e=this.getClass();return"DevelopmentOnly"===this.EnabledState?.toString()||e.includes("Debug",Math.max(0,e.lastIndexOf(".")))}getHIDAttribute(){return this.InputKey??this.AxisKey??this.InputAxisKey}getDelegatePin(){return this.getCustomproperties().find((e=>"delegate"===e.PinType.PinCategory.toString()))}nodeColor(){return function(e){switch(e.getType()){case ae.paths.materialExpressionConstant2Vector:case ae.paths.materialExpressionConstant3Vector:case ae.paths.materialExpressionConstant4Vector:return ae.nodeColors.yellow;case ae.paths.materialExpressionFunctionInput:case ae.paths.materialExpressionTextureCoordinate:case ae.paths.materialExpressionWorldPosition:case ae.paths.pcgEditorGraphNodeInput:case ae.paths.pcgEditorGraphNodeOutput:return ae.nodeColors.red;case ae.paths.makeStruct:return ae.nodeColors.darkBlue;case ae.paths.materialExpressionMaterialFunctionCall:return ae.nodeColors.blue;case ae.paths.materialExpressionTextureSample:return ae.nodeColors.darkTurquoise;case ae.paths.niagaraNodeInput:switch(e.Usage?.toString()){case"Attribute":return ae.nodeColors.intenseGreen;case"Parameter":default:return ae.nodeColors.red;case"RapidIterationParameter":return ae.nodeColors.black;case"SystemConstant":case"TranslatorConstant":return ae.nodeColors.gray}}switch(e.getClass()){case ae.paths.callFunction:return e.bIsPureFunc?.valueOf()?ae.nodeColors.green:ae.nodeColors.blue;case ae.paths.niagaraNodeFunctionCall:return ae.nodeColors.darkerBlue;case ae.paths.dynamicCast:return ae.nodeColors.turquoise;case ae.paths.inputDebugKey:case ae.paths.inputKey:return ae.nodeColors.red;case ae.paths.createDelegate:case ae.paths.enumLiteral:case ae.paths.makeArray:case ae.paths.makeMap:case ae.paths.materialGraphNode:case ae.paths.select:return ae.nodeColors.green;case ae.paths.executionSequence:case ae.paths.ifThenElse:case ae.paths.macro:case ae.paths.multiGate:return ae.nodeColors.gray;case ae.paths.functionEntry:case ae.paths.functionResult:return ae.nodeColors.violet;case ae.paths.timeline:return ae.nodeColors.yellow}if(e.switchTarget())return ae.nodeColors.lime;if(e.isEvent())return ae.nodeColors.red;if(e.isComment())return(e.CommentColor?e.CommentColor:Oe.getWhite()).toDimmedColor().toCSSRGBValues();const t=e.getPcgSubobject();if(t){if(t.NodeTitleColor)return t.NodeTitleColor.toDimmedColor(.1).toCSSRGBValues();switch(e.PCGNode?.getName(!0)){case"Branch":case"Select":return ae.nodeColors.intenseGreen}}return e.bIsPureFunc?.valueOf()?ae.nodeColors.green:e.Input?.Name?ae.nodeColors.gray:ae.nodeColors.blue}(this)}nodeIcon(){return function(e){if(e.isMaterial()||e.isPcg()||e.isNiagara())return null;switch(e.getType()){case ae.paths.addDelegate:case ae.paths.asyncAction:case ae.paths.callDelegate:case ae.paths.clearDelegate:case ae.paths.createDelegate:case ae.paths.functionEntry:case ae.paths.functionResult:case ae.paths.removeDelegate:return ce.node;case ae.paths.customEvent:return ce.event;case ae.paths.doN:return ce.doN;case ae.paths.doOnce:return ce.doOnce;case ae.paths.dynamicCast:return ce.cast;case ae.paths.enumLiteral:return ce.enum;case ae.paths.event:return ce.event;case ae.paths.executionSequence:case ae.paths.multiGate:return ce.sequence;case ae.paths.flipflop:return ce.flipflop;case ae.paths.forEachElementInEnum:case ae.paths.forLoop:case ae.paths.forLoopWithBreak:case ae.paths.whileLoop:return ce.loop;case ae.paths.forEachLoop:case ae.paths.forEachLoopWithBreak:return ce.forEachLoop;case ae.paths.ifThenElse:return ce.branchNode;case ae.paths.isValid:return ce.questionMark;case ae.paths.makeArray:return ce.makeArray;case ae.paths.makeMap:return ce.makeMap;case ae.paths.makeSet:return ce.makeSet;case ae.paths.makeStruct:return ce.makeStruct;case ae.paths.metasoundEditorGraphExternalNode:return ce.metasoundFunction;case ae.paths.select:return ce.select;case ae.paths.spawnActorFromClass:return ce.spawnActor;case ae.paths.timeline:return ce.timer}if(e.switchTarget())return ce.switch;if(_e(e).startsWith("Break"))return ce.breakStruct;if(e.getClass()===ae.paths.macro)return ce.macro;const t=e.getHIDAttribute()?.toString();return t?t.includes("Mouse")?ce.mouse:t.includes("Gamepad_Special")?ce.keyboard:t.includes("Gamepad")||t.includes("Steam")?ce.gamepad:t.includes("Touch")?ce.touchpad:ce.keyboard:e.getDelegatePin()?ce.event:e.ObjectRef?.type===ae.paths.ambientSound?ce.sound:ce.functionSymbol}(this)}additionalPinInserter(){return function(e){let t,i,s,r,n;switch(e.getType()){case ae.paths.commutativeAssociativeBinaryOperator:case ae.paths.promotableOperator:switch(n=e.FunctionReference?.MemberName?.toString(),n){default:if(!(n?.startsWith("Add_")||n?.startsWith("Subtract_")||n?.startsWith("Multiply_")||n?.startsWith("Divide_")))break;case"And_Int64Int64":case"And_IntInt":case"BMax":case"BMin":case"BooleanAND":case"BooleanNAND":case"BooleanOR":case"Concat_StrStr":case"FMax":case"FMin":case"Max":case"MaxInt64":case"Min":case"MinInt64":case"Or_Int64Int64":case"Or_IntInt":t??=()=>e.getPinEntities().filter((e=>e.isInput())),i??=wt,s??=(i,s=-1,r=-1)=>{const n=String.fromCharCode(i>=0?i:r+"A".charCodeAt(0)+1);return e.NumAdditionalInputs=new Ye(t().length-1),n}}break;case ae.paths.executionSequence:r??="Then";case ae.paths.multiGate:r??="Out",t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName?.toString().match(new RegExp(String.raw`^\s*${r}[_\s]+(\d+)\s*$`,"i"))?.[1]),s??=(e,t=-1,i=-1,s)=>`${r} ${e>=0?e:t>0?`${r} 0`:i+1}`;break;case ae.paths.switchInteger:t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName?.toString().match(/^\s*(\d+)\s*$/)?.[1]),s??=(e,t=-1,i=-1,s)=>(e<0?i+1:e).toString();break;case ae.paths.switchGameplayTag:s??=(t,i=-1,s=-1,r)=>{const n=`Case_${t>=0?t:i>0?"0":s+1}`;return e.PinNames??=new Fe,e.PinNames.valueOf().push(new Qe(n)),delete e.PinTags.valueOf()[e.PinTags.length-1],e.PinTags.valueOf()[e.PinTags.length]=null,n};case ae.paths.switchName:case ae.paths.switchString:t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName.toString().match(/^\s*Case[_\s]+(\d+)\s*$/i)?.[1]),s??=(t,i=-1,s=-1,r)=>{const n=`Case_${t>=0?t:i>0?"0":s+1}`;return e.PinNames??=new Fe,e.PinNames.valueOf().push(new Qe(n)),n}}if(t)return()=>{let r=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,a=[];const o=t().reduce(((e,t)=>{const s=i(t);if(isNaN(s)){if(void 0===e)return t}else if(a.push(s),r=Math.min(s,r),s>n)return n=s,t;return e}),void 0);if(r!==Number.MAX_SAFE_INTEGER&&n!==Number.MIN_SAFE_INTEGER||(r=void 0,n=void 0),!o)return null;a.sort(((e,t)=>e{const t=e-l>1;return l=e,t}));const u=new yt(o);return u.PinId=new Ue,u.PinName=new Qe(s(c,r,n,u)),u.PinToolTip=void 0,u.DefaultValue&&(u.DefaultValue=new u.DefaultValue.constructor),e.getCustomproperties(!0).push(u),u}}(this)}showProperty(e){switch(e){case"Class":case"Name":case"Archetype":case"ExportPath":case"CustomProperties":return!1}return super.showProperty(e)}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i!==this.constructor,l=t+ae.indentation,c=this.trailing;this.trailing=!0;const u=super.doSerialize(e,l,i,s,r,n,a);return this.trailing=c,t+"Begin Object"+(this.Class?.type||this.Class?.path?` Class${r}${this.Class.serialize(e)}`:"")+(this.Name?` Name${r}${this.Name.serialize(e)}`:"")+(this.Archetype?` Archetype${r}${this.Archetype.serialize(e)}`:"")+(this.ExportPath?.valueOf()?.type||this.ExportPath?.valueOf()?.path?` ExportPath${r}${this.ExportPath.serialize(e)}`:"")+n+u+(!0!==i.attributes.CustomProperties.ignored&&!0!==this.CustomProperties.ignored?this.getCustomproperties().map((t=>l+s("CustomProperties ")+t.serialize(e)+n)).join(""):"")+t+"End Object"+(o&&i.trailing||this.trailing?n:"")}}class kt extends Pt{constructor(e={},t=void 0){e.Class=new ot(ae.paths.knot),e.Name=new Pt.attributes.Name("K2Node_Knot");const i=new yt({PinName:new yt.attributes.PinName("InputPin")}),s=new yt({PinName:new yt.attributes.PinName("OutputPin"),Direction:new yt.attributes.Direction("EGPD_Output")});t&&(i.copyTypeFrom(t),s.copyTypeFrom(t)),e.CustomProperties=new Pt.attributes.CustomProperties([i,s]),super(e)}}class Lt{#Y;get target(){return this.#Y}#e;get blueprint(){return this.#e}consumeEvent;options;listenHandler=()=>this.listenEvents();unlistenHandler=()=>this.unlistenEvents();constructor(e,t,i={}){i.consumeEvent??=!1,i.listenOnFocus??=!1,i.unlistenOnTextEdit??=!1,this.#Y=e,this.#e=t,this.consumeEvent=i.consumeEvent,this.options=i}setup(){this.options.listenOnFocus&&(this.blueprint.addEventListener(ae.focusEventName.begin,this.listenHandler),this.blueprint.addEventListener(ae.focusEventName.end,this.unlistenHandler)),this.options.unlistenOnTextEdit&&(this.blueprint.addEventListener(ae.editTextEventName.begin,this.unlistenHandler),this.blueprint.addEventListener(ae.editTextEventName.end,this.listenHandler)),this.blueprint.focused&&this.listenEvents()}cleanup(){this.unlistenEvents(),this.blueprint.removeEventListener(ae.focusEventName.begin,this.listenHandler),this.blueprint.removeEventListener(ae.focusEventName.end,this.unlistenHandler),this.blueprint.removeEventListener(ae.editTextEventName.begin,this.unlistenHandler),this.blueprint.removeEventListener(ae.editTextEventName.end,this.listenHandler)}listenEvents(){}unlistenEvents(){}}class At extends ke{static attributes={...super.attributes,ActionName:Qe,bShift:Le,bCtrl:Le,bAlt:Le,bCmd:Le,Key:et};static grammar=this.createGrammar();constructor(e){super(e),this.ActionName,this.bShift,this.bCtrl,this.bAlt,this.bCmd,this.Key}static createGrammar(){return Pe.alt(et.grammar.map((e=>new this({Key:e}))),Ie.createEntityGrammar(this))}}class Mt extends Lt{static#q=e=>{};#X;pressedKey="";constructor(e,t,i={},s=Mt.#q,r=Mt.#q){i.activationKeys??=[],i.consumeEvent??=!0,i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,i.activationKeys instanceof Array||(i.activationKeys=[i.activationKeys]),i.activationKeys=i.activationKeys.map((e=>{if(e instanceof At)return e;if(e.constructor===String){const t=At.grammar.run(e);if(t.status)return t.value}throw new Error("Unexpected key value")})),super(e,t,i),this.onKeyDown=s,this.onKeyUp=r,this.#X=this.options.activationKeys??[];let n=this;this.keyDownHandler=e=>{n.#X.some((t=>(e=>e.bShift?.valueOf()||"LeftShift"==e.Key.valueOf()||"RightShift"==e.Key.valueOf())(t)==e.shiftKey&&(e=>e.bCtrl?.valueOf()||"LeftControl"==e.Key.valueOf()||"RightControl"==e.Key.valueOf())(t)==e.ctrlKey&&(e=>e.bAlt?.valueOf()||"LeftAlt"==e.Key.valueOf()||"RightAlt"==e.Key.valueOf())(t)==e.altKey&&ae.Keys[t.Key.value]==e.code))&&(this.consumeEvent&&(e.preventDefault(),e.stopImmediatePropagation()),this.pressedKey=e.code,n.fire(),document.removeEventListener("keydown",n.keyDownHandler),document.addEventListener("keyup",n.keyUpHandler))},this.keyUpHandler=e=>{n.#X.some((t=>t.bShift?.valueOf()&&"Shift"==e.key||t.bCtrl?.valueOf()&&"Control"==e.key||t.bAlt?.valueOf()&&"Alt"==e.key||t.bCmd?.valueOf()&&"Meta"==e.key||ae.Keys[t.Key.value]==e.code))&&(this.consumeEvent&&e.stopImmediatePropagation(),n.unfire(),this.pressedKey="",document.removeEventListener("keyup",this.keyUpHandler),document.addEventListener("keydown",this.keyDownHandler))}}listenEvents(){document.addEventListener("keydown",this.keyDownHandler)}unlistenEvents(){document.removeEventListener("keydown",this.keyDownHandler)}fire(){this.onKeyDown(this)}unfire(){this.onKeyUp(this)}}class It extends Lt{#Z=[0,0];get location(){return this.#Z}#W;get enablerKey(){return this.#W}#Q=!0;get enablerActivated(){return this.#Q}constructor(e,t,i={}){i.ignoreTranslateCompensate??=!1,i.ignoreScale??=!1,i.movementSpace??=t.getGridDOMElement()??document.documentElement,super(e,t,i),this.movementSpace=i.movementSpace,i.enablerKey&&(this.#W=i.enablerKey,this.#W.onKeyDown=()=>this.#Q=!0,this.#W.onKeyUp=()=>this.#Q=!1,this.#W.consumeEvent=!1,this.#W.listenEvents(),this.#Q=!1)}setLocationFromEvent(e){let t=oe.convertLocation([e.clientX,e.clientY],this.movementSpace,this.options.ignoreScale);return t=this.options.ignoreTranslateCompensate?t:this.blueprint.compensateTranslation(t[0],t[1]),this.#Z=[...t],this.#Z}}class Tt extends It{static#q=e=>{};#J=e=>{if(this.blueprint.setFocused(!0),!this.enablerKey||this.enablerActivated)if(e.button===this.options.clickButton)this.options.strictTarget&&e.target!==e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),document.addEventListener("mouseup",this.#ee),this.setLocationFromEvent(e),this.clickedPosition[0]=this.location[0],this.clickedPosition[1]=this.location[1],this.blueprint.mousePosition[0]=this.location[0],this.blueprint.mousePosition[1]=this.location[1],this.clicked(this.clickedPosition));else this.options.exitAnyButton||this.#ee(e)};#ee=e=>{this.options.exitAnyButton&&e.button!=this.options.clickButton||(this.consumeEvent&&e.stopImmediatePropagation(),document.removeEventListener("mouseup",this.#ee),this.unclicked())};clickedPosition=[0,0];constructor(e,t,i={},s=Tt.#q,r=Tt.#q){i.clickButton??=ae.mouseClickButton,i.consumeEvent??=!0,i.exitAnyButton??=!0,i.strictTarget??=!1,super(e,t,i),this.onClick=s,this.onUnclick=r,this.listenEvents()}listenEvents(){this.target.addEventListener("mousedown",this.#J),this.options.clickButton===ae.mouseRightClickButton&&this.target.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.target.removeEventListener("mousedown",this.#J)}clicked(e){this.onClick(this)}unclicked(e){this.onUnclick(this)}}class Ot extends It{static ignoreDbClick=e=>{};#te=e=>{this.options.strictTarget&&e.target!==e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),this.clickedPosition=this.setLocationFromEvent(e),this.blueprint.mousePosition=[...this.clickedPosition],this.dbclicked(this.clickedPosition))};#ie;get onDbClick(){return this.#ie}set onDbClick(e){this.#ie=e}clickedPosition=[0,0];constructor(e,t,i={},s=Ot.ignoreDbClick){i.consumeEvent??=!0,i.strictTarget??=!1,super(e,t,i),this.#ie=s,this.listenEvents()}listenEvents(){this.target.addEventListener("dblclick",this.#te)}unlistenEvents(){this.target.removeEventListener("dblclick",this.#te)}dbclicked(e){this.onDbClick(e)}}class Dt{static deleteNodes="Delete";static duplicateNodes="(bCtrl=True,Key=D)";static enableLinkDelete="LeftAlt";static enableZoomIn=["LeftControl","RightControl"];static selectAllNodes="(bCtrl=True,Key=A)"}class $t{element;get blueprint(){return this.element.blueprint}#se=[];get inputObjects(){return this.#se}initialize(e){this.element=e}createInputObjects(){return[]}setup(){this.#se.forEach((e=>e.setup()))}cleanup(){this.#se.forEach((e=>e.cleanup()))}willUpdate(e){}update(e){}render(){return z``}firstUpdated(e){}updated(e){}inputSetup(){this.#se=this.createInputObjects()}}class Vt extends $t{update(e){super.update(e);const[t,i,s,r]=[Math.round(this.element.originX),Math.round(this.element.originY),Math.round(this.element.targetX),Math.round(this.element.targetY)],[n,a,o,l]=[Math.min(t,s),Math.min(i,r),Math.abs(t-s),Math.abs(i-r)];(e.has("originX")||e.has("targetX"))&&(this.element.style.left=`${n}px`,this.element.style.width=`${o}px`),(e.has("originY")||e.has("targetY"))&&(this.element.style.top=`${a}px`,this.element.style.height=`${l}px`)}}class Bt extends Vt{static sigmoidPositive(e,t=3.7,i=1.1){return 1-Math.exp(-((e/i)**t))}static decreasingValue(e,t){const i=-e*t[0]**2,s=t[1]-i/t[0];return e=>i/e+s}static clampedLine=e=>Math.min(Math.max(0,e),1);static c1DecreasingValue=Bt.decreasingValue(-.15,[100,15]);static c2DecreasingValue=Bt.decreasingValue(-.05,[500,130]);static c2Clamped=e=>-40*Bt.clampedLine(e/200)+80;#re=`ueb-id-${Math.floor(1e12*Math.random())}`;#ne=e=>{const t=new kt({},this.element.origin.entity),i=Ae.getConstructor("ueb-node").newObject(t);i.setLocation(...this.blueprint.snapToGrid(...e));const s=i.template;this.blueprint.addGraphElement(i);const r=this.element.getInputPin(),n=this.element.getOutputPin();this.element.origin=null,this.element.target=null;const a=Ae.getConstructor("ueb-link").newObject(n,s.inputPin);this.blueprint.addGraphElement(a),this.element.origin=s.outputPin,this.element.target=r};#ae(e){const t=this.element.origin,i=this.element.target,s=t?.isKnot(),r=i?.isKnot(),n=this.element.originX,a=this.element.targetX;if(!s||i&&!r||(t?.isInputLoosely()&&a>n+ae.distanceThreshold||t?.isOutputLoosely()&&an+ae.distanceThreshold)&&(this.element.target=i.template.getoppositePin()),t&&i){let e;t?.isKnot()?e=t.nodeElement:i?.isKnot()&&(e=i.nodeElement),e&&e.hasUpdated&&e.template.checkSwtichDirectionsVisually()}let o=t?.isOutputVisually()==i?.isOutputVisually();const l=Math.max(Math.abs(this.element.originX-this.element.targetX),1),c=Math.max(Math.abs(this.element.originY-this.element.targetY),1),u=Math.max(l,ae.linkMinWidth),h=l/u,p=this.element.originatesFromInput?this.element.originX{e[0]+=ae.knotOffset[0],e[1]+=ae.knotOffset[1],e=oe.snapToGrid(e[0],e[1],ae.gridSize),this.#ne(e)})),new Tt(e,this.blueprint,{enablerKey:new Mt(this.blueprint,this.blueprint,{activationKeys:Dt.enableLinkDelete})},(()=>this.blueprint.removeGraphElement(this.element)))]}willUpdate(e){super.willUpdate(e);const t=(e.get("originX")??this.element.originX)-this.element.originX,i=(e.get("originY")??this.element.originY)-this.element.originY,s=(e.get("targetX")??this.element.targetX)-this.element.targetX,r=(e.get("targetY")??this.element.targetY)-this.element.targetY;t==s&&i==r||this.#ae(e)}update(e){super.update(e);const t=this.element.getOutputPin(!0);t&&this.element.style.setProperty("--ueb-link-color-rgb",Oe.printLinearColor(t.color)),this.element.style.setProperty("--ueb-start-percentage",`${Math.round(this.element.startPercentage)}%`),this.element.style.setProperty("--ueb-link-start",`${Math.round(this.element.startPixels)}`);const i=(this.element.originY>this.element.targetY?-1:1)*(this.element.originatesFromInput?-1:1)*(this.element.origin?.isInputVisually()&&this.element.target?.isInputVisually()?-1:1),s=this.element.origin?.isInputVisually()&&this.element.target?.isInputVisually()?-1:1;this.element.style.setProperty("--ueb-link-scale-y",`${i}`),this.element.style.setProperty("--ueb-link-scale-x",`${s}`)}render(){return z` ${this.element.linkMessageIcon||this.element.linkMessageText?z``:F}`}}class Rt extends le{static properties={...super.properties,originX:{type:Number,attribute:!1},originY:{type:Number,attribute:!1},targetX:{type:Number,attribute:!1},targetY:{type:Number,attribute:!1}};constructor(){super(),this.originX=0,this.originY=0,this.targetX=0,this.targetY=0}setBothLocations([e,t]){this.originX=e,this.originY=t,this.targetX=e,this.targetY=t}addOriginLocation(e,t){this.originX+=e,this.originY+=t}addTargetLocation(e,t){this.targetX+=e,this.targetY+=t}}class Gt extends Rt{static properties={...super.properties,dragging:{type:Boolean,attribute:"data-dragging",converter:Le.booleanConverter,reflect:!0},originNode:{type:String,attribute:"data-origin-node",reflect:!0},originPin:{type:String,attribute:"data-origin-pin",reflect:!0},targetNode:{type:String,attribute:"data-target-node",reflect:!0},targetPin:{type:String,attribute:"data-target-pin",reflect:!0},originatesFromInput:{type:Boolean,attribute:"data-from-input",converter:Le.booleanConverter,reflect:!0},svgPathD:{type:String,attribute:!1},linkMessageIcon:{type:String,attribute:!1},linkMessageText:{type:String,attribute:!1}};#oe;get origin(){return this.#oe}set origin(e){this.#le(e,!1)}#Y;get target(){return this.#Y}set target(e){this.#le(e,!0)}#ce=()=>this.remove();#ue=e=>this.addOriginLocation(...e.detail.value);#he=e=>this.addTargetLocation(...e.detail.value);#pe=e=>{this.origin.isKnot()&&(this.originatesFromInput=this.origin.isInputVisually()),this.setOriginLocation()};#de=e=>this.setTargetLocation();linkMessageIcon=F;linkMessageText=F;pathElement;constructor(){super(),this.dragging=!1,this.originNode="",this.originPin="",this.targetNode="",this.targetPin="",this.originatesFromInput=!1,this.startPercentage=0,this.svgPathD="",this.startPixels=0}static newObject(e,t){const i=new Gt;return i.initialize(e,t),i}initialize(e,t){super.initialize({},new Bt),e&&(this.origin=e,t||(this.targetX=this.originX,this.targetY=this.originY)),t&&(this.target=t,e||(this.originX=this.targetX,this.originY=this.targetY))}#le(e,t){const i=()=>t?this.target:this.origin;if(i()!=e){if(i()){const e=i().getNodeElement();e.removeEventListener(ae.removeEventName,this.#ce),e.removeEventListener(ae.nodeDragEventName,t?this.#he:this.#ue),e.removeEventListener(ae.nodeReflowEventName,t?this.#de:this.#pe),this.#me()}if(t?(this.#Y=e,this.targetNode=e?.nodeElement.nodeTitle,this.targetPin=e?.pinId.toString()):(this.#oe=e,this.originNode=e?.nodeElement.nodeTitle,this.originPin=e?.pinId.toString()),i()){const e=i().getNodeElement();e.addEventListener(ae.removeEventName,this.#ce),e.addEventListener(ae.nodeDragEventName,t?this.#he:this.#ue),e.addEventListener(ae.nodeReflowEventName,t?this.#de:this.#pe),t?this.setTargetLocation():(this.setOriginLocation(),this.originatesFromInput=this.origin.isInputVisually()),this.#ge()}}}#ge(){this.origin&&this.target&&(this.origin.linkTo(this.target),this.target.linkTo(this.origin))}#me(){this.origin&&this.target&&(this.origin.unlinkFrom(this.target,!1),this.target.unlinkFrom(this.origin,!1))}cleanup(){super.cleanup(),this.#me(),this.origin=null,this.target=null}setOriginLocation(e=null,t=!0){if(null==e){const i=this;if(t&&(!this.hasUpdated||!this.origin.hasUpdated))return void Promise.all([this.updateComplete,this.origin.updateComplete]).then((()=>i.setOriginLocation(null,!1)));e=this.origin.template.getLinkLocation()}const[i,s]=e;this.originX=i,this.originY=s}setTargetLocation(e=null,t=!0){if(null==e){const i=this;if(t&&(!this.hasUpdated||!this.target.hasUpdated))return void Promise.all([this.updateComplete,this.target.updateComplete]).then((()=>i.setTargetLocation(null,!1)));e=this.target.template.getLinkLocation()}this.targetX=e[0],this.targetY=e[1]}getInputPin(e=!1){return this.origin?.isInput()?this.origin:this.target?.isInput()?this.target:e?this.origin??this.target:void 0}setInputPin(e){this.origin?.isInput()&&(this.origin=e),this.target=e}getOutputPin(e=!1){return this.origin?.isOutput()?this.origin:this.target?.isOutput()?this.target:e?this.origin??this.target:void 0}setOutputPin(e){this.target?.isOutput()&&(this.target=e),this.origin=e}getOtherPin(e){return this.origin?.nodeElement===e?this.target:this.target?.nodeElement===e?this.origin:void 0}startDragging(){this.dragging=!0}finishDragging(){this.dragging=!1}removeMessage(){this.linkMessageIcon=F,this.linkMessageText=F}setMessageConvertType(){this.linkMessageIcon=ce.convert,this.linkMessageText=z`Convert ${this.origin.pinType} to ${this.target.pinType}.`}setMessageCorrect(){this.linkMessageIcon=ce.correct,this.linkMessageText=F}setMessageReplace(){this.linkMessageIcon=ce.correct,this.linkMessageText=F}setMessageDirectionsIncompatible(){this.linkMessageIcon=ce.reject,this.linkMessageText=z`Directions are not compatbile.`}setMessagePlaceNode(){this.linkMessageIcon=F,this.linkMessageText=z`Place a new node.`}setMessageReplaceLink(){this.linkMessageIcon=ce.correct,this.linkMessageText=z`Replace existing input connections.`}setMessageReplaceOutputLink(){this.linkMessageIcon=ce.correct,this.linkMessageText=z`Replace existing output connections.`}setMessageSameNode(){this.linkMessageIcon=ce.reject,this.linkMessageText=z`Both are on the same node.`}setMessageTypesIncompatible(e,t){this.linkMessageIcon=ce.reject,this.linkMessageText=z`${oe.capitalFirstLetter(e.pinType)} is not compatible with ${oe.capitalFirstLetter(t.pinType)}.`}}class Ht extends le{static properties={...super.properties,locationX:{type:Number,attribute:!1},locationY:{type:Number,attribute:!1},sizeX:{type:Number,attribute:!1},sizeY:{type:Number,attribute:!1}};static dragEventName=ae.dragEventName;static dragGeneralEventName=ae.dragGeneralEventName;constructor(){super(),this.locationX=0,this.locationY=0,this.sizeX=0,this.sizeY=0}computeSizes(){const e=this.getBoundingClientRect();this.sizeX=this.blueprint.scaleCorrect(e.width),this.sizeY=this.blueprint.scaleCorrect(e.height)}firstUpdated(e){super.firstUpdated(e),this.computeSizes()}setLocation(e,t,i=!0){const s=e-this.locationX,r=t-this.locationY;if(this.locationX=e,this.locationY=t,this.blueprint&&i){const e=new CustomEvent(this.constructor.dragEventName,{detail:{value:[s,r]},bubbles:!1,cancelable:!0});this.dispatchEvent(e)}}addLocation(e,t,i=!0){this.setLocation(this.locationX+e,this.locationY+t,i)}acknowledgeDrag(e){const t=new CustomEvent(this.constructor.dragGeneralEventName,{detail:{value:e},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}snapToGrid(){const e=oe.snapToGrid(this.locationX,this.locationY,ae.gridSize);this.locationX==e[0]&&this.locationY==e[1]||this.setLocation(e[0],e[1])}topBoundary(e=!1){return this.template.topBoundary(e)}rightBoundary(e=!1){return this.template.rightBoundary(e)}bottomBoundary(e=!1){return this.template.bottomBoundary(e)}leftBoundary(e=!1){return this.template.leftBoundary(e)}}class zt extends It{#J=e=>{if(this.blueprint.setFocused(!0),e.button===this.options.clickButton)this.options.strictTarget&&e.target!=e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),this.#be.addEventListener("mousemove",this.#ve),document.addEventListener("mouseup",this.#ee),this.setLocationFromEvent(e),this.clickedPosition[0]=this.location[0],this.clickedPosition[1]=this.location[1],this.blueprint.mousePosition[0]=this.location[0],this.blueprint.mousePosition[1]=this.location[1],this.target instanceof Ht&&(this.clickedOffset=[this.clickedPosition[0]-this.target.locationX,this.clickedPosition[1]-this.target.locationY]),this.clicked(this.clickedPosition));else this.options.exitAnyButton||this.#ee(e)};#ve=e=>{this.consumeEvent&&e.stopImmediatePropagation(),this.#be.removeEventListener("mousemove",this.#ve),this.#be.addEventListener("mousemove",this.#fe);const t=this.getEvent(ae.trackingMouseEventName.begin);this.#ye=0==this.target.dispatchEvent(t),this.setLocationFromEvent(e),this.lastLocation=oe.snapToGrid(this.clickedPosition[0],this.clickedPosition[1],this.stepSize),this.startDrag(this.location),this.started=!0,this.#fe(e)};#fe=e=>{this.consumeEvent&&e.stopImmediatePropagation();const t=this.setLocationFromEvent(e),i=[e.movementX,e.movementY];if(this.dragTo(t,i),this.#ye&&(this.blueprint.mousePosition=t),this.options.scrollGraphEdge){const e=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=this.blueprint.scaleCorrect(ae.edgeScrollThreshold),r=this.blueprint.template.gridLeftVisibilityBoundary()+s,n=this.blueprint.template.gridRightVisibilityBoundary()-s;let a=0;t[0]n&&(a=t[0]-n);const o=this.blueprint.template.gridTopVisibilityBoundary()+s,l=this.blueprint.template.gridBottomVisibilityBoundary()-s;let c=0;t[1]l&&(c=t[1]-l),a=oe.clamp(this.blueprint.scaleCorrectReverse(a)**3*e*.6,-20,20),c=oe.clamp(this.blueprint.scaleCorrectReverse(c)**3*e*.6,-20,20),this.blueprint.scrollDelta(a,c)}};#ee=e=>{if(!this.options.exitAnyButton||e.button==this.options.clickButton){if(this.consumeEvent&&e.stopImmediatePropagation(),this.#be.removeEventListener("mousemove",this.#ve),this.#be.removeEventListener("mousemove",this.#fe),document.removeEventListener("mouseup",this.#ee),this.started&&this.endDrag(),this.unclicked(),this.#ye){const e=this.getEvent(ae.trackingMouseEventName.end);this.target.dispatchEvent(e),this.#ye=!1}this.started=!1}};#ye=!1;#be;#we;get draggableElement(){return this.#we}clickedOffset=[0,0];clickedPosition=[0,0];lastLocation=[0,0];started=!1;stepSize=1;constructor(e,t,i={}){i.clickButton??=ae.mouseClickButton,i.consumeEvent??=!0,i.draggableElement??=e,i.exitAnyButton??=!0,i.moveEverywhere??=!1,i.movementSpace??=t?.getGridDOMElement(),i.repositionOnClick??=!1,i.scrollGraphEdge??=!1,i.strictTarget??=!1,super(e,t,i),this.stepSize=Number(i.stepSize??ae.gridSize),this.#be=this.options.moveEverywhere?document.documentElement:this.movementSpace,this.#we=this.options.draggableElement,this.listenEvents()}listenEvents(){super.listenEvents(),this.#we.addEventListener("mousedown",this.#J),this.options.clickButton===ae.mouseRightClickButton&&this.#we.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){super.unlistenEvents(),this.#we.removeEventListener("mousedown",this.#J)}getEvent(e){return new CustomEvent(e,{detail:{tracker:this},bubbles:!0,cancelable:!0})}clicked(e){}startDrag(e){}dragTo(e,t){}endDrag(){}unclicked(e){}}class _t extends zt{clicked(e){this.options.repositionOnClick&&(this.target.setLocation(...this.stepSize>1?oe.snapToGrid(e[0],e[1],this.stepSize):e),this.clickedOffset=[0,0])}dragTo(e,t){const i=[this.target.locationX??this.lastLocation[0],this.target.locationY??this.lastLocation[1]],[s,r]=this.stepSize>1?[oe.snapToGrid(e[0],e[1],this.stepSize),oe.snapToGrid(i[0],i[1],this.stepSize)]:[e,i];0==(t=[s[0]-this.lastLocation[0],s[1]-this.lastLocation[1]])[0]&&0==t[1]||(t[0]+=r[0]-i[0],t[1]+=r[1]-i[1],this.dragAction(s,t),this.lastLocation=s)}dragAction(e,t){this.target.setLocation(e[0]-this.clickedOffset[0],e[1]-this.clickedOffset[1])}}class Ft extends _t{#Se;#Ee;#Ce;#Ne;constructor(e,t,i={}){super(e,t,i),i.onClicked&&(this.#Se=i.onClicked),i.onStartDrag&&(this.#Ee=i.onStartDrag),i.onDrag&&(this.#Ce=i.onDrag),i.onEndDrag&&(this.#Ne=i.onEndDrag)}clicked(e){super.clicked(e),this.#Se?.()}startDrag(){super.startDrag(),this.#Ee?.()}dragAction(e,t){this.#Ce?.(e,t)}endDrag(){super.endDrag(),this.#Ne?.()}}class jt extends _t{constructor(e,t,i={}){super(e,t,i),this.draggableElement.classList.add("ueb-draggable")}startDrag(){this.target.selected||(this.blueprint.unselectAll(),this.target.setSelected(!0))}dragAction(e,t){this.target.acknowledgeDrag(t)}unclicked(){this.started?(this.blueprint.getNodes(!0).forEach((e=>e.boundComments.filter((t=>!e.isInsideComment(t))).forEach((t=>e.unbindFromComment(t))))),this.blueprint.getCommentNodes().forEach((e=>e.template.manageNodesBind()))):(this.blueprint.unselectAll(),this.target.setSelected(!0))}}class Ut extends $t{getDraggableElement(){return this.element}createDraggableObject(){const e=this.getDraggableElement();return new _t(this.element,this.blueprint,{draggableElement:e})}createInputObjects(){return[...super.createInputObjects(),this.createDraggableObject(),new Mt(this.element,this.blueprint,{activationKeys:[ae.Keys.ArrowUp,ae.Keys.ArrowRight,ae.Keys.ArrowDown,ae.Keys.ArrowLeft]},(e=>e.target.acknowledgeDrag([e.pressedKey===ae.Keys.ArrowLeft?-ae.gridSize:e.pressedKey===ae.Keys.ArrowRight?ae.gridSize:0,e.pressedKey===ae.Keys.ArrowUp?-ae.gridSize:e.pressedKey===ae.Keys.ArrowDown?ae.gridSize:0])))]}topBoundary(e=!1){return this.element.locationY}rightBoundary(e=!1){return this.element.locationX+this.element.sizeX}bottomBoundary(e=!1){return this.element.locationY+this.element.sizeY}leftBoundary(e=!1){return this.element.locationX}centerInViewport(){const e=Math.min(this.blueprint.template.viewportSize[0]/10,this.blueprint.template.viewportSize[1]/10),t=this.leftBoundary()-this.blueprint.template.gridLeftVisibilityBoundary(),i=this.blueprint.template.gridRightVisibilityBoundary()-this.rightBoundary();let s=Math.max((t+i)/2,e);const r=this.topBoundary()-this.blueprint.template.gridTopVisibilityBoundary(),n=this.blueprint.template.gridBottomVisibilityBoundary()-this.bottomBoundary();let a=Math.max((r+n)/2,e);this.blueprint.scrollDelta(t-s,r-a,!0)}}class Kt extends Ut{update(e){super.update(e),e.has("locationX")&&(this.element.style.left=`${this.element.locationX}px`),e.has("locationY")&&(this.element.style.top=`${this.element.locationY}px`)}}class Yt extends Kt{getDraggableElement(){return this.element}createDraggableObject(){return new jt(this.element,this.blueprint,{draggableElement:this.getDraggableElement(),scrollGraphEdge:!0})}firstUpdated(e){super.firstUpdated(e),this.element.selected&&!this.element.listeningDrag&&this.element.setSelected(!0)}}class qt extends Yt{static nodeStyleClasses=["ueb-node-style-default"];#xe;pinInserter;inputContainer;outputContainer;pinElement;addPinHandler=()=>{const e=this.pinInserter?.();e&&(this.defaultPin&&this.defaultPin.isInput()===e.isInput()?this.defaultPin.before(this.createPinElement(e)):(e.isInput()?this.inputContainer:this.outputContainer).appendChild(this.createPinElement(e)),this.element.acknowledgeReflow())};toggleAdvancedDisplayHandler=()=>{this.element.toggleShowAdvancedPinDisplay(),this.element.requestUpdate(),this.element.updateComplete.then((()=>this.element.acknowledgeReflow()))};createPinElement(e){const t=Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element);return this.pinInserter&&!this.defaultPin&&"Default"===t.getPinName()&&(this.defaultPin=t,this.defaultPin.classList.add("ueb-node-variadic-default")),t}initialize(e){super.initialize(e),this.#xe=function(e){switch(e.getType()){case ae.paths.addDelegate:case ae.paths.clearDelegate:case ae.paths.callDelegate:case ae.paths.removeDelegate:return null}const t=e.getPinEntities().find((e=>!e.isHidden()&&"self"===e.PinName?.toString()&&"Target"===Ze(e)));if(t){const i=e.FunctionReference?.MemberParent?.getName()??t.PinType?.PinSubCategoryObject?.getName()??"Untitled";return i.length>0?`Target is ${oe.formatStringName(i)}`:null}return null}(e.entity),this.element.classList.add(...this.constructor.nodeStyleClasses),this.element.style.setProperty("--ueb-node-color",this.getColor().cssText),this.pinInserter=this.element.entity.additionalPinInserter(),this.pinInserter&&this.element.classList.add("ueb-node-is-variadic")}getColor(){return this.element.entity.nodeColor()}render(){return z`
${this.renderTop()}
${this.pinInserter?z`
Add pin ${ce.plusCircle}
`:F} ${this.element.entity.isDevelopmentOnly()?z`
Development Only
`:F} ${this.element.advancedPinDisplay?z`
${ce.expandIcon}
`:F}
`}renderNodeIcon(){return this.element.entity.nodeIcon()}renderNodeName(){return this.element.nodeDisplayName}renderTop(){const e=this.renderNodeIcon(),t=this.renderNodeName();return z`
${e?z`
${e}
`:F} ${t?z`
${t} ${this.#xe?z`
${this.#xe}
`:F}
`:F}
`}firstUpdated(e){super.firstUpdated(e),this.inputContainer=this.element.querySelector(".ueb-node-inputs"),this.outputContainer=this.element.querySelector(".ueb-node-outputs"),this.setupPins(),this.element.updateComplete.then((()=>this.element.acknowledgeReflow()))}setupPins(){this.element.nodeNameElement=this.element.querySelector(".ueb-node-name-text");let e=!1,t=!1;for(const i of this.getPinElements())i!==this.defaultPin&&(i.isInput()?(this.inputContainer.appendChild(i),e=!0):i.isOutput()&&(this.outputContainer.appendChild(i),t=!0));this.defaultPin&&(this.defaultPin.isInput()?this.inputContainer:this.outputContainer).appendChild(this.defaultPin),e&&this.element.classList.add("ueb-node-has-inputs"),t&&this.element.classList.add("ueb-node-has-outputs")}getPinElements(){return this.element.getPinElements()}createPinElements(){return this.element.getPinEntities().filter((e=>!e.isHidden())).map((e=>this.createPinElement(e)))}getAllConnectedLinks(){const e=this.element.nodeTitle,t=`ueb-link[data-origin-node="${e}"],ueb-link[data-target-node="${e}"]`;return[...this.blueprint.querySelectorAll(t)]}}class Xt extends qt{#Pe=document.createElement("div");#ke=document.createElement("div");#Le=document.createElement("div");#Ae=document.createElement("div");#Me=document.createElement("div");#Ie=document.createElement("div");#Te=document.createElement("div");#Oe=document.createElement("div");initialize(e){super.initialize(e),this.element.classList.add("ueb-resizeable"),this.#Pe.classList.add("ueb-resizeable-top"),this.#ke.classList.add("ueb-resizeable-right"),this.#Le.classList.add("ueb-resizeable-bottom"),this.#Ae.classList.add("ueb-resizeable-left"),this.#Me.classList.add("ueb-resizeable-top-right"),this.#Ie.classList.add("ueb-resizeable-bottom-right"),this.#Te.classList.add("ueb-resizeable-bottom-left"),this.#Oe.classList.add("ueb-resizeable-top-left")}update(e){super.update(e),this.element.sizeX>=0&&e.has("sizeX")&&(this.element.style.width=`${this.element.sizeX}px`),this.element.sizeY>=0&&e.has("sizeY")&&(this.element.style.height=`${this.element.sizeY}px`)}firstUpdated(e){super.firstUpdated(e),this.element.append(this.#Pe,this.#ke,this.#Le,this.#Ae,this.#Me,this.#Ie,this.#Te,this.#Oe)}createInputObjects(){return[...super.createInputObjects(),new Ft(this.#Pe,this.blueprint,{onDrag:(e,t)=>{t[1]=e[1]-this.element.topBoundary(),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#ke,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),this.setSizeX(this.element.sizeX+t[0])},onEndDrag:()=>this.endResize()}),new Ft(this.#Le,this.blueprint,{onDrag:(e,t)=>{t[1]=e[1]-this.element.bottomBoundary(),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Ae,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#Me,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),t[1]=e[1]-this.element.topBoundary(),this.setSizeX(this.element.sizeX+t[0]),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#Ie,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),t[1]=e[1]-this.element.bottomBoundary(),this.setSizeX(this.element.sizeX+t[0]),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Te,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),t[1]=e[1]-this.element.bottomBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Oe,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),t[1]=e[1]-this.element.topBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()})]}setSizeX(e){return this.element.setNodeWidth(e),!0}setSizeY(e){return this.element.setNodeHeight(e),!0}endResize(){}}class Zt extends Xt{#De=0;initialize(e){super.initialize(e),e.classList.add("ueb-node-style-comment","ueb-node-resizeable"),e.sizeX=25*ae.gridSize,e.sizeY=6*ae.gridSize,super.initialize(e)}getDraggableElement(){return this.element.querySelector(".ueb-node-top")}render(){return z`
`}firstUpdated(e){super.firstUpdated(e);const t=this.getDraggableElement().getBoundingClientRect();this.#De=t.height}manageNodesBind(){let e=this.blueprint.getNodes();for(let t of e)t.topBoundary()>=this.element.topBoundary()&&t.rightBoundary()<=this.element.rightBoundary()&&t.bottomBoundary()<=this.element.bottomBoundary()&&t.leftBoundary()>=this.element.leftBoundary()?t.bindToComment(this.element):t.unbindFromComment(this.element)}setSizeX(e){return(e=Math.round(e))>=2*ae.gridSize&&(this.element.setNodeWidth(e),!0)}setSizeY(e){return(e=Math.round(e))>=2*ae.gridSize&&(this.element.setNodeHeight(e),!0)}endResize(){this.manageNodesBind()}topBoundary(e=!1){return this.element.locationY}rightBoundary(e=!1){return this.element.locationX+this.element.sizeX}bottomBoundary(e=!1){return e?this.element.locationY+this.#De:super.bottomBoundary()}leftBoundary(e=!1){return this.element.locationX}}class Wt extends zt{#$e;#Ve=null;#Be=e=>{if(!this.enteredPin){this.linkValid=!1,this.enteredPin=e.target;const t=this.link.origin??this.target,i=this.enteredPin,s=t.isOutput()?t:i;t.isKnot()||i.isKnot()?(this.link.setMessageCorrect(),this.linkValid=!0):t.getNodeElement()===i.getNodeElement()?this.link.setMessageSameNode():t.isOutput()===i.isOutput()?this.link.setMessageDirectionsIncompatible():this.blueprint.getLinks(t,i).length?(this.link.setMessageReplaceLink(),this.linkValid=!0):"exec"===s.entity.getType()&&s.isLinked?(this.link.setMessageReplaceOutputLink(),this.linkValid=!0):"object"==t.entity.PinType.PinCategory.valueOf()&&"object"==i.entity.PinType.PinCategory.valueOf()||t.pinType==i.pinType?(this.link.setMessageCorrect(),this.linkValid=!0):(this.link.setMessageTypesIncompatible(t,i),this.linkValid=!1)}};#Re=e=>{this.enteredPin==e.target&&(this.enteredPin=null,this.linkValid=!1,this.link?.setMessagePlaceNode())};link;enteredPin;linkValid=!1;constructor(e,t,i={}){i.scrollGraphEdge??=!0,super(e,t,i)}startDrag(e){this.target.isKnot()&&(this.#Ve=this.target),this.link=Ae.getConstructor("ueb-link").newObject(this.target,null),this.blueprint.template.linksContainerElement.prepend(this.link),this.link.setMessagePlaceNode(),this.#$e=this.blueprint.querySelectorAll("ueb-pin"),this.#$e.forEach((e=>{e!=this.target&&(e.addEventListener("mouseenter",this.#Be),e.addEventListener("mouseleave",this.#Re))})),this.link.startDragging(),this.link.setTargetLocation(e)}dragTo(e,t){this.link.setTargetLocation(e)}endDrag(){if(this.#$e.forEach((e=>{e.removeEventListener("mouseenter",this.#Be),e.removeEventListener("mouseleave",this.#Re)})),this.#$e=null,this.enteredPin&&this.linkValid){if(this.#Ve){const e=this.#Ve!==this.link.origin?this.link.origin:this.enteredPin;if(this.#Ve.isInput()&&e.isInput()||this.#Ve.isOutput()&&e.isOutput()){const e=this.#Ve.template.getoppositePin();this.#Ve===this.link.origin?this.link.origin=e:this.enteredPin=e}}else this.enteredPin.isKnot()&&(this.#Ve=this.enteredPin,this.link.origin.isOutput()&&(this.enteredPin=this.enteredPin.template.getoppositePin()));this.link.origin.getLinks().find((e=>e.equals(this.enteredPin.createPinReference())))?this.link.remove():(this.blueprint.addGraphElement(this.link),this.link.target=this.enteredPin)}else this.link.remove();this.enteredPin=null,this.link.removeMessage(),this.link.finishDragging(),this.link=null,this.#Ve=null}}class Qt extends qt{#Ge=!1;#He=!1;displayName="";static nodeStyleClasses=["ueb-node-style-glass"];initialize(e){super.initialize(e),this.displayName=this.element.nodeDisplayName}render(){return z`
${this.displayName?z`
${this.displayName}
`:F} ${this.#Ge?z`
`:F} ${this.#He?z`
`:F} ${this.pinInserter?z`
Add pin ${ce.plusCircle}
`:F}
`}createPinElements(){return this.element.getPinEntities().filter((e=>!e.isHidden())).map((e=>{this.#Ge||=e.isInput(),this.#He||=e.isOutput();return Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element)}))}}class Jt extends Qt{static nodeStyleClasses=["ueb-node-style-metasound","ueb-node-style-operation"]}class ei extends Qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-conversion"]}class ti extends Qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-operation"]}class ii extends $t{static canWrapInput=!0;#ze;get iconElement(){return this.#ze}#_e;get wrapperElement(){return this.#_e}isNameRendered=!0;initialize(e){if(super.initialize(e),this.element.nodeElement){const e=this.element.nodeElement.template;this.isNameRendered=!(e instanceof ei||e instanceof ti||e instanceof Jt)}}setup(){super.setup(),this.element.nodeElement=this.element.closest("ueb-node");const e=this.element.nodeElement.template;(e instanceof ei||e instanceof ti)&&(this.isNameRendered=!1,this.element.requestUpdate())}createInputObjects(){return[new Wt(this.element,this.blueprint,{moveEverywhere:!0,draggableElement:this.getClickableElement()})]}render(){const e=z`
${this.renderIcon()}
`,t=z`
${this.isNameRendered?this.renderName():F} ${this.isInputRendered()?this.renderInput():z``}
`;return z`
${this.element.isInput()?z`${e}${t}`:z`${t}${e}`}
`}renderIcon(){if(this.element.nodeElement.entity.isPcg())switch(this.element.entity.getType()){case"Any":return ce.pcgPin;case"Param":case"Param[]":return ce.pcgParamPin;case"Spatial":case"Spatial[]":return ce.pcgSpatialPin;case"Any[]":case"Point[]":case"Surface[]":case"Volume[]":if(this.element.isOutput())return ce.pcgPin;case"Point":case"Surface":case"Volume":return ce.pcgStackPin}switch(this.element.entity.PinType.ContainerType?.toString()){case"Array":return ce.arrayPin;case"Set":return ce.setPin;case"Map":return ce.mapPin}return"delegate"===this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase()?ce.delegate:this.element.nodeElement?.template instanceof ti?ce.operationPin:"statictype"===this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase()?ce.staticPin:ce.genericPin}renderName(){let e=this.element.getPinDisplayName();const t=this.element.nodeElement,i=this.element.getPinName();return t.getType()==ae.paths.makeStruct&&i==t.entity.StructType.getName()&&(e=i),z`${e}`}isInputRendered(){return this.element.isInput()&&!this.element.entity.bDefaultValueIsIgnored?.valueOf()&&!this.element.entity.PinType.bIsReference?.valueOf()}renderInput(){return z``}updated(e){if(super.updated(e),this.element.isInput()&&e.has("isLinked")){const e=this.element.nodeElement;this.element.requestUpdate(),this.element.updateComplete.then((()=>e.acknowledgeReflow()))}}firstUpdated(e){super.firstUpdated(e),this.element.style.setProperty("--ueb-pin-color-rgb",this.element.entity.pinColor().cssText),this.#ze=this.element.querySelector(".ueb-pin-icon svg")??this.element,this.#_e=this.element.querySelector(".ueb-pin-wrapper")}getLinkLocation(e=!1){const t=(this.#ze??this.element).getBoundingClientRect(),i=[this.element.isInputVisually()!=e?t.left:t.right+1,(t.top+t.bottom)/2],s=oe.convertLocation(i,this.blueprint.template.gridElement);return this.blueprint.compensateTranslation(s[0],s[1])}getClickableElement(){return this.#_e??this.element}getAllConnectedLinks(){if(!this.element.isLinked)return[];const e=this.element.nodeElement.nodeTitle,t=this.element.pinId,i=`ueb-link[data-origin-node="${e}"][data-origin-pin="${t}"],ueb-link[data-target-node="${e}"][data-target-pin="${t}"]`;return[...this.blueprint.querySelectorAll(i)]}}class si extends ii{render(){return z`
${this.renderIcon()}
`}}class ri extends qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-event"];#Fe;firstUpdated(e){super.firstUpdated(e),this.element.querySelector(".ueb-node-top").appendChild(this.createDelegatePinElement())}renderTop(){const e=this.renderNodeIcon(),t=this.renderNodeName(),i=this.element.getType()===ae.paths.customEvent&&(this.element.entity.CustomFunctionName||this.element.entity.FunctionReference.MemberParent);return z`
${e?z`
${e}
`:F} ${t?z`
${t} ${i?z`
Custom Event
`:F}
`:F}
`}getPinElements(){return this.element.getPinElements().filter((e=>"delegate"!==e.entity.PinType.PinCategory?.toString()))}createDelegatePinElement(){return this.#Fe||(this.#Fe=Ae.getConstructor("ueb-pin").newObject(this.element.getPinEntities().find((e=>!e.isHidden()&&"delegate"===e.PinType.PinCategory?.toString())),new si,this.element),this.#Fe.template.isNameRendered=!1),this.#Fe}createPinElements(){return[this.createDelegatePinElement(),...this.element.getPinEntities().filter((e=>!e.isHidden()&&"delegate"!==e.PinType.PinCategory?.toString())).map((e=>Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element)))]}}class ni extends si{render(){return this.element.isOutput()?super.render():z``}getoppositePin(){const e=this.element.nodeElement.template;return this.element.isOutput()?e.inputPin:e.outputPin}getLinkLocation(e=!1){return this.element.isInput()?this.getoppositePin().getLinkLocation(!e):super.getLinkLocation(e)}}class ai extends qt{#je=!1;get switchDirectionsVisually(){return this.#je}set switchDirectionsVisually(e){this.#je!=e&&(this.#je=e,this.element.acknowledgeReflow())}#Ue;get inputPin(){return this.#Ue}#Ke;get outputPin(){return this.#Ke}initialize(e){super.initialize(e),this.element.classList.add("ueb-node-style-minimal")}render(){return z`
`}setupPins(){for(const e of this.getPinElements())this.element.querySelector(".ueb-node-border").appendChild(e)}createPinElements(){const e=this.element.getPinEntities().filter((e=>!e.isHidden())),t=e[e[0].isInput()?0:1],i=e[e[0].isOutput()?0:1],s=Ae.getConstructor("ueb-pin");return[this.#Ue=s.newObject(t,new ni,this.element),this.#Ke=s.newObject(i,new ni,this.element)]}checkSwtichDirectionsVisually(){let e=0,t=0,i=0,s=0;const r=this.getAllConnectedLinks();for(const n of r){const r=n.getOtherPin(this.element);r?.isInput()?(i+=r.getLinkLocation()[0],++s):r?.isOutput()&&(e+=r.getLinkLocation()[0],++t)}e/=t,i/=s,i!e.entity.isHidden()&&!e.entity.isExecution()));this.element.style.setProperty("--ueb-node-color",e.getColor().cssText)}}const ci=["Boolean::LogicEq","Boolean::LogicNEq","Integer::EnumNEq","Integer::EnumEq",...["Abs","Add","ArcCosine(Degrees)","ArcCosine(Radians)","ArcSine(Degrees)","ArcSine(Radians)","ArcTangent(Degrees)","ArcTangent(Radians)","Ceil","CmpEQ","CmpGE","CmpGT","CmpLE","CmpLT","CmpNEQ","Cosine(Degrees)","Cosine(Radians)","DegreesToRadians","Div","Dot","Exp","Exp2","Floor","FMod","Frac","Length","Lerp","Log","Log2","Madd","Max","Min","Mul","Negate","Normalize","OneMinus","PI","RadiansToDegrees","Rcp","RcpFast","Round","RSqrt","Sign","Sine(Degrees)","Sine(Radians)","Sqrt","Step","Subtract","Tangent(Degrees)","Tangent(Radians)","Trunc","TWO_PI"].map((e=>"Numeric::"+e)),"Vector3::Cross"],ui=ae.paths;function hi(e){if(e.getClass()===ui.callFunction||e.getClass()===ui.commutativeAssociativeBinaryOperator||e.getClass()===ui.callArrayFunction){const t=e.FunctionReference?.MemberParent?.path??"",i=e.FunctionReference?.MemberName?.toString();if(i&&(t===ui.kismetMathLibrary||t===ui.kismetArrayLibrary)){if(i.startsWith("Conv_"))return ei;if(i.startsWith("Add_")||i.startsWith("And_")||i.startsWith("Boolean")||i.startsWith("Cross_")||i.startsWith("Dot_")||i.startsWith("Not_")||i.startsWith("Or_")||i.startsWith("Percent_")||i.startsWith("Xor_"))return ti;switch(i){case"Abs":case"Array_Add":case"Array_AddUnique":case"Array_Identical":case"BMax":case"BMin":case"CrossProduct2D":case"DotProduct2D":case"Exp":case"FMax":case"FMin":case"GetPI":case"Max":case"MaxInt64":case"Min":case"MinInt64":case"Sqrt":case"Square":case"Vector4_CrossProduct3":case"Vector4_DotProduct":case"Vector4_DotProduct3":case"Acos":case"Asin":case"Cos":case"DegAcos":case"DegCos":case"DegSin":case"DegTan":case"Sin":case"Tan":return ti}}if(t===ui.blueprintSetLibrary)return ti;if(t===ui.blueprintMapLibrary)return ti}switch(e.getClass()){case ui.comment:case ui.materialGraphNodeComment:return Zt;case ui.createDelegate:return qt;case ui.metasoundEditorGraphExternalNode:return"Add"==e.ClassName?.Name?Jt:oi;case ui.niagaraNodeOp:if(ci.includes(e.OpName?.toString()))return ti;break;case ui.promotableOperator:return ti;case ui.knot:return ai;case ui.literal:case ui.self:case ui.variableGet:case ui.variableSet:return li}return e.isEvent()?ri:qt}class pi extends Ht{static properties={...super.properties,selected:{type:Boolean,attribute:"data-selected",reflect:!0,converter:Le.booleanConverter}};dragHandler=e=>this.addLocation(...e.detail.value);constructor(){super(),this.selected=!1,this.listeningDrag=!1}setup(){super.setup(),this.setSelected(this.selected)}cleanup(){super.cleanup(),this.blueprint.removeEventListener(ae.nodeDragGeneralEventName,this.dragHandler)}setSelected(e=!0){this.selected=e,this.blueprint&&(this.selected?(this.listeningDrag=!0,this.blueprint.addEventListener(ae.nodeDragGeneralEventName,this.dragHandler)):(this.blueprint.removeEventListener(ae.nodeDragGeneralEventName,this.dragHandler),this.listeningDrag=!1))}}class di extends pi{static properties={...pi.properties,typePath:{type:String,attribute:"data-type",reflect:!0},nodeTitle:{type:String,attribute:"data-title",reflect:!0},advancedPinDisplay:{type:String,attribute:"data-advanced-display",converter:et.attributeConverter,reflect:!0},enabledState:{type:String,attribute:"data-enabled-state",reflect:!0},nodeDisplayName:{type:String,attribute:!1},pureFunction:{type:Boolean,converter:Le.booleanConverter,attribute:"data-pure-function",reflect:!0}};static dragEventName=ae.nodeDragEventName;static dragGeneralEventName=ae.nodeDragGeneralEventName;get blueprint(){return super.blueprint}set blueprint(e){super.blueprint=e,this.#Ye.forEach((t=>t.blueprint=e))}#qe;get nodeNameElement(){return this.#qe}set nodeNameElement(e){this.#qe=e}#Ye=[];boundComments=[];#Xe=!1;#Ze=e=>{this.selected||this.#Xe||(this.#Xe=!0,this.requestUpdate(),this.updateComplete.then((()=>this.#Xe=!1)),this.addLocation(...e.detail.value))};static fromSerializedObject(e){e=e.trim();let t=Pt.grammar.parse(e);return di.newObject(t)}static newObject(e=new Pt,t=new(hi(e))){const i=new di;return i.initialize(e,t),i}#We(e){for(let t of this.getPinElements())for(let i of t.getLinks())this.blueprint.getPin(i).redirectLink(t,new lt(new et(e),t.entity.PinId))}initialize(e=new Pt,t=new(hi(e))){this.typePath=e.getType(),this.nodeTitle=e.getObjectName(),this.advancedPinDisplay=e.AdvancedPinDisplay?.toString(),this.enabledState=e.EnabledState,this.nodeDisplayName=_e(e),this.pureFunction=e.bIsPureFunc?.valueOf(),this.dragLinkObjects=[],super.initialize(e,t),this.#Ye=this.template.createPinElements(),super.setLocation(this.entity.getNodePosX(),this.entity.getNodePosY()),this.entity.NodeWidth&&this.entity.NodeHeight?(this.sizeX=this.entity.NodeWidth.value,this.sizeY=this.entity.NodeHeight.value):this.updateComplete.then((()=>this.computeSizes())),e.listenAttribute("Name",(t=>{this.#We(t?.toString()),this.nodeTitle=t?.toString(),this.nodeDisplayName=_e(e)}))}async getUpdateComplete(){let e=await super.getUpdateComplete();for(const t of this.getPinElements())e&&=await t.updateComplete;return e}bindToComment(e){e==this||this.boundComments.includes(e)||(e.addEventListener(ae.nodeDragEventName,this.#Ze),this.boundComments.push(e))}unbindFromComment(e){const t=this.boundComments.indexOf(e);t>=0&&(e.removeEventListener(ae.nodeDragEventName,this.#Ze),this.boundComments[t]=this.boundComments[this.boundComments.length-1],this.boundComments.pop())}isInsideComment(e){return this.topBoundary()>=e.topBoundary()&&this.rightBoundary()<=e.rightBoundary()&&this.bottomBoundary()<=e.bottomBoundary()&&this.leftBoundary()>=e.leftBoundary()}getType(){return this.entity.getType()}getNodeName(){return this.entity.getObjectName()}computeNodeDisplayName(){this.nodeDisplayName=_e(this.entity)}setNodeWidth(e){this.entity.setNodeWidth(e),this.sizeX=e,this.acknowledgeReflow()}setNodeHeight(e){this.entity.setNodeHeight(e),this.sizeY=e,this.acknowledgeReflow()}sanitizeLinks(e=[]){this.getPinElements().forEach((t=>t.sanitizeLinks(e)))}getPinElements(){return this.#Ye}getPinEntities(){return this.entity.getPinEntities()}setLocation(e=0,t=0,i=!0){this.entity.setNodePosX(e),this.entity.setNodePosY(t),super.setLocation(e,t,i)}acknowledgeReflow(){this.requestUpdate(),this.updateComplete.then((()=>this.computeSizes()));let e=new CustomEvent(ae.nodeReflowEventName);this.dispatchEvent(e)}setShowAdvancedPinDisplay(e){this.entity.AdvancedPinDisplay=new et(e?"Shown":"Hidden"),this.advancedPinDisplay=this.entity.AdvancedPinDisplay}toggleShowAdvancedPinDisplay(){this.setShowAdvancedPinDisplay("Shown"!=this.entity.AdvancedPinDisplay?.toString())}}class mi extends Pt{#Qe=new Map;#Je=[];get objectEntities(){return this.#Je}static attributes={...super.attributes,ScriptVariables:super.attributes.ScriptVariables.asUniqueClass(!0).withDefault()};constructor(...e){super(...e),this.Name||(this.Name=new this.constructor.attributes.Name("Blueprint"))}getHomonymObjectEntity(e){const t=e.getObjectName();return this.#Je.find((e=>e.getObjectName()==t))}takeFreeName(e){e=e.replace(/_\d+$/,"");const t=(this.#Qe.get(e)??-1)+1;return this.#Qe.set(e,t),ae.nodeTitle(e,t)}updateNameIndex(e){const t=e.match(/(.+)_(\d+)$/);if(t){e=t[1];const i=Number(t[2]);this.#Qe.set(e,Math.max(i,this.#Qe.get(e)??0))}}addObjectEntity(e){if(!this.#Je.includes(e)){this.#Je.push(e);const[t,i]=e.getNameAndCounter();return this.#Qe.set(t,Math.max(this.#Qe.get(t)??0,i)),!0}return!1}removeObjectEntity(e){const t=this.#Je.indexOf(e);if(t>=0){const e=this.#Je.pop();return t{let i=this[ae.subObjectAttributeNameFromReference(e,t)];i.Name.value=s,i.Name=i.Name})),e.path.replace(i,s),s}variableName(e){return this[ae.subObjectAttributeNameFromReference(e.ScriptVariable,!0)]?.Variable?.Name?.toString()}variableIndex(e){let t=0;for(const i of this.ScriptVariables?.valueOf()){if(e==this.variableName(i))return t;++t}}mergeWith(e){if(0===(e.ScriptVariables?.length??0))return this;const t=this.ScriptVariables.valueOf().map((e=>e.ScriptVariable.getName()));let i=oe.mergeArrays(this.ScriptVariables.valueOf(),e.ScriptVariables.valueOf(),((e,t)=>this.variableName(e)==this.variableName(t)),(i=>{let s=i.ScriptVariable.getName();t.includes(s)&&(s=this.renameScriptVariable(i.ScriptVariable,e)),this.updateNameIndex(s)}));if(i.length===this.ScriptVariables.length)return this;i.reverse();const s=this.constructor,r=i.concat(i).map(((t,s)=>{const r=ae.subObjectAttributeNameFromReference(t.ScriptVariable,s>=i.length),n=this[r]??e[r];return n?[r,n]:null})).filter((e=>e));r.push(...Object.entries(this).filter((([e,t])=>!e.startsWith(ae.subObjectAttributeNamePrefix)&&"ExportedNodes"!==e)),["ScriptVariables",new s.attributes.ScriptVariables(i.reverse())]);const n=new mi(Object.fromEntries(r));return n.mirrorNameInExportPaths(e.Name?.toString()),n.#Qe=this.#Qe,n.#Je=this.#Je,n}getVariablesAttributesReferringTo(...e){let t=new Set(...e.flatMap((e=>e.getPinEntities())).map((e=>e.PinName.toString())));return this.ScriptVariables.valueOf().map((e=>{const t=ae.subObjectAttributeNameFromReference(e.ScriptVariable,!1),i=ae.subObjectAttributeNameFromReference(e.ScriptVariable,!0);return{simple:[t,this[t]],full:[i,this[i]],variable:e}})).filter((e=>t.has(e.full?.Variable?.Name))).reduce(((e,t)=>(e.simple.push([t.simple[0],t.simple[1]]),e.full.push([t.full[0],t.full[1]]),e.ScriptVariables.push(t.variable),e)),{simple:[],full:[],ScriptVariables:[]}),{}}}class gi extends Pt{constructor(e,t){const i=ae.paths.niagaraClipboardContent,s=e.takeFreeName("NiagaraClipboardContent"),r=`/Engine/Transient.${s}`,n=new Set;let a="";for(const i of t)i.exported&&(i.getPinEntities().map((t=>e.variableIndex(t.PinName.toString()))).filter((e=>null!=e)).forEach((e=>n.add(e))),a+=i.serialize());const o=e.ScriptVariables.valueOf().filter(((e,t)=>n.has(t))),l=o.concat(o).map(((t,i)=>{const s=ae.subObjectAttributeNameFromReference(t.ScriptVariable,i>=o.length);return[s,e[s]]}));super({Class:new ot(i),Name:new Qe(s),...Object.fromEntries(l),ExportPath:new ot(i,r),ScriptVariables:new gi.attributes.ScriptVariables(o),ExportedNodes:new Qe(btoa(a))})}}class bi extends Lt{#et;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#et=()=>s.copied()}listenEvents(){window.addEventListener("copy",this.#et)}unlistenEvents(){window.removeEventListener("copy",this.#et)}copied(){const e=this.blueprint.getSerializedText();return navigator.clipboard.writeText(e),e}}class vi extends Lt{#tt;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#tt=()=>s.cut()}listenEvents(){window.addEventListener("cut",this.#tt)}unlistenEvents(){window.removeEventListener("cut",this.#tt)}cut(){this.blueprint.template.getCopyInputObject().copied(),this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0))}}class fi extends Lt{#it;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#it=e=>s.pasted(e.clipboardData.getData("Text"))}listenEvents(){window.addEventListener("paste",this.#it)}unlistenEvents(){window.removeEventListener("paste",this.#it)}pasted(e){let t=0,i=0,s=0,r=Pt.grammarMultipleObjects.parse(e).map((e=>{let r=Ae.getConstructor("ueb-node").newObject(e);return t+=r.locationY,i+=r.locationX,++s,r}));t/=s,i/=s,r.length>0&&this.blueprint.unselectAll();let n=this.blueprint.mousePosition;for(const e of r)e.addLocation(n[0]-i,n[1]-t),e.snapToGrid(),e.setSelected(!0);return this.blueprint.addGraphElement(...r),r}}class yi extends It{static#q=e=>{};#st=0;get variation(){return this.#st}#rt=e=>{this.enablerKey&&!this.enablerActivated||(e.preventDefault(),this.#st=e.deltaY,this.setLocationFromEvent(e),this.wheel())};#nt=e=>e.preventDefault();constructor(e,t,i={},s=yi.#q){i.listenOnFocus=!0,i.strictTarget??=!1,super(e,t,i),this.strictTarget=i.strictTarget,this.onWheel=s}listenEvents(){this.movementSpace.addEventListener("wheel",this.#rt,!1),this.movementSpace.parentElement?.addEventListener("wheel",this.#nt)}unlistenEvents(){this.movementSpace.removeEventListener("wheel",this.#rt,!1),this.movementSpace.parentElement?.removeEventListener("wheel",this.#nt)}wheel(){this.onWheel(this)}}class wi extends yi{#at=0;#ot=!1;get enableZoonIn(){return this.#ot}set enableZoonIn(e){e!=this.#ot&&(this.#ot=e)}wheel(){if(this.#at+=-this.variation,Math.abs(this.#at)0||(e+=Math.sign(this.#at),this.blueprint.setZoom(e,this.location),this.#at=0)}}class Si extends Mt{#lt;constructor(e,t,i={}){i.activationKeys=Dt.enableZoomIn,super(e,t,i)}fire(){this.#lt=this.blueprint.template.getZoomInputObject(),this.#lt.enableZoonIn=!0}unfire(){this.#lt.enableZoonIn=!1}}class Ei extends zt{startDrag(){this.blueprint.scrolling=!0}dragTo(e,t){this.blueprint.scrollDelta(-t[0],-t[1])}endDrag(){this.blueprint.scrolling=!1}}class Ci extends It{#ct=null;#ut=e=>{e.preventDefault(),this.setLocationFromEvent(e),this.blueprint.mousePosition=[...this.location]};#ht=e=>{this.#ct||(e.preventDefault(),this.#ct=e.detail.tracker,this.unlistenMouseMove())};#pt=e=>{this.#ct==e.detail.tracker&&(e.preventDefault(),this.#ct=null,this.listenMouseMove())};constructor(e,t,i={}){i.listenOnFocus=!0,super(e,t,i)}listenMouseMove(){this.target.addEventListener("mousemove",this.#ut)}unlistenMouseMove(){this.target.removeEventListener("mousemove",this.#ut)}listenEvents(){this.listenMouseMove(),this.blueprint.addEventListener(ae.trackingMouseEventName.begin,this.#ht),this.blueprint.addEventListener(ae.trackingMouseEventName.end,this.#pt)}unlistenEvents(){this.unlistenMouseMove(),this.blueprint.removeEventListener(ae.trackingMouseEventName.begin,this.#ht),this.blueprint.removeEventListener(ae.trackingMouseEventName.end,this.#pt)}}class Ni extends zt{constructor(e,t,i={}){i.scrollGraphEdge??=!0,super(e,t,i),this.selectorElement=this.blueprint.template.selectorElement}startDrag(){this.selectorElement.beginSelect(this.clickedPosition)}dragTo(e,t){this.selectorElement.selectTo(e)}endDrag(){this.started&&this.selectorElement.endSelect()}unclicked(){this.started||this.blueprint.unselectAll()}}class xi extends Lt{#dt=e=>this.clickedSomewhere(e.target);constructor(e,t,i={}){i.listenOnFocus=!0,super(e,t,i),this.blueprint.focus&&document.addEventListener("click",this.#dt)}clickedSomewhere(e){e.closest("ueb-blueprint")||this.blueprint.setFocused(!1)}listenEvents(){document.addEventListener("click",this.#dt)}unlistenEvents(){document.removeEventListener("click",this.#dt)}}class Pi extends $t{static styleVariables={"--ueb-font-size":`${ae.fontSize}`,"--ueb-grid-expand":`${ae.expandGridSize}px`,"--ueb-grid-line-width":`${ae.gridLineWidth}px`,"--ueb-grid-set":`${ae.gridSet}`,"--ueb-grid-size":`${ae.gridSize}px`,"--ueb-link-min-width":`${ae.linkMinWidth}`,"--ueb-node-radius":`${ae.nodeRadius}px`};#mt=new ResizeObserver((e=>{const t=e.find((e=>e.target===this.viewportElement))?.devicePixelContentBoxSize?.[0];t&&(this.viewportSize[0]=t.inlineSize,this.viewportSize[1]=t.blockSize)}));#gt;#bt;#lt;headerElement;overlayElement;viewportElement;selectorElement;gridElement;linksContainerElement;nodesContainerElement;viewportSize=[0,0];#vt=()=>this.headerElement.classList.remove("ueb-zoom-changed");initialize(e){super.initialize(e),this.element.style.cssText=Object.entries(Pi.styleVariables).map((([e,t])=>`${e}:${t};`)).join("");const t=this.element.querySelector(":scope > template")?.content.textContent;t&&(this.element.requestUpdate(),this.element.updateComplete.then((()=>{this.blueprint.mousePosition=[Math.round(this.viewportSize[0]/2),Math.round(this.viewportSize[1]/2)],this.getPasteInputObject().pasted(t),this.blueprint.unselectAll()})))}setup(){super.setup(),this.#mt.observe(this.viewportElement,{box:"device-pixel-content-box"});const e=this.viewportElement.getBoundingClientRect();this.viewportSize[0]=e.width,this.viewportSize[1]=e.height,this.blueprint.nodes.length>0&&(this.blueprint.requestUpdate(),this.blueprint.updateComplete.then((()=>this.centerContentInViewport())))}cleanup(){super.cleanup(),this.#mt.unobserve(this.viewportElement)}createInputObjects(){const e=this.element.getGridDOMElement();return this.#gt=new bi(e,this.blueprint),this.#bt=new fi(e,this.blueprint),this.#lt=new wi(e,this.blueprint),[...super.createInputObjects(),this.#gt,this.#bt,this.#lt,new vi(e,this.blueprint),new Mt(e,this.blueprint,{activationKeys:Dt.duplicateNodes},(()=>this.blueprint.template.getPasteInputObject().pasted(this.blueprint.template.getCopyInputObject().copied()))),new Mt(e,this.blueprint,{activationKeys:Dt.deleteNodes},(()=>this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0)))),new Mt(e,this.blueprint,{activationKeys:Dt.selectAllNodes},(()=>this.blueprint.selectAll())),new Ni(e,this.blueprint,{clickButton:ae.mouseClickButton,exitAnyButton:!0,moveEverywhere:!0}),new Ei(e,this.blueprint,{clickButton:ae.mouseRightClickButton,exitAnyButton:!1,moveEverywhere:!0}),new xi(e,this.blueprint),new Ci(e,this.blueprint),new Si(e,this.blueprint)]}render(){return z`
Zoom ${0==this.blueprint.zoom?"1:1":(this.blueprint.zoom>0?"+":"")+this.blueprint.zoom}

UEBlueprint

A stand alone implementation of the UE's Blueprint visual language editor.

Version: ${ae.VERSION}
Author: barsdeveloper
License: MIT
https://github.com/barsdeveloper/ueblueprint

`}firstUpdated(e){super.firstUpdated(e),this.headerElement=this.blueprint.querySelector(".ueb-viewport-header"),this.overlayElement=this.blueprint.querySelector(".ueb-viewport-overlay"),this.viewportElement=this.blueprint.querySelector(".ueb-viewport-body"),this.selectorElement=this.blueprint.querySelector("ueb-selector"),this.gridElement=this.viewportElement.querySelector(".ueb-grid"),this.linksContainerElement=this.blueprint.querySelector("[data-links]"),this.linksContainerElement.append(...this.blueprint.getLinks()),this.nodesContainerElement=this.blueprint.querySelector("[data-nodes]"),this.nodesContainerElement.append(...this.blueprint.getNodes()),this.viewportElement.scroll(ae.expandGridSize,ae.expandGridSize)}willUpdate(e){super.willUpdate(e),this.headerElement&&e.has("zoom")&&(this.headerElement.classList.contains("ueb-zoom-changed")&&(this.headerElement.classList.remove("ueb-zoom-changed"),this.headerElement.offsetWidth),this.headerElement.classList.add("ueb-zoom-changed"),this.headerElement.addEventListener("animationend",this.#vt,{once:!0}))}updated(e){if(super.updated(e),(e.has("scrollX")||e.has("scrollY"))&&this.viewportElement.scroll(this.blueprint.scrollX,this.blueprint.scrollY),e.has("zoom")){this.blueprint.style.setProperty("--ueb-scale",this.blueprint.getScale());const t=e.get("zoom"),i=Math.min(t,this.blueprint.zoom),s=Math.max(t,this.blueprint.zoom),r=oe.range(i,s),n=e=>`ueb-zoom-${e}`;te<0)).map(n)),this.blueprint.classList.add(...r.filter((e=>e>0)).map(n))):(this.blueprint.classList.remove(...r.filter((e=>e>0)).map(n)),this.blueprint.classList.add(...r.filter((e=>e<0)).map(n)))}}getCommentNodes(e=!1){return this.blueprint.querySelectorAll(`ueb-node[data-type="${ae.paths.comment}"]${e?'[data-selected="true"]':""}, ueb-node[data-type="${ae.paths.materialGraphNodeComment}"]${e?'[data-selected="true"]':""}`)}getPin(e){return this.blueprint.querySelector(`ueb-node[data-title="${e.objectName}"] ueb-pin[data-id="${e.pinGuid}"]`)}getCopyInputObject(){return this.#gt}getPasteInputObject(){return this.#bt}getZoomInputObject(){return this.#lt}isPointVisible(e,t){return!1}gridTopVisibilityBoundary(){return this.blueprint.scaleCorrect(this.blueprint.scrollY)-this.blueprint.translateY}gridRightVisibilityBoundary(){return this.gridLeftVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[0])}gridBottomVisibilityBoundary(){return this.gridTopVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[1])}gridLeftVisibilityBoundary(){return this.blueprint.scaleCorrect(this.blueprint.scrollX)-this.blueprint.translateX}centerViewport(e=0,t=0,i=!0){const s=this.gridLeftVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[0]/2),r=this.gridTopVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[1]/2);this.blueprint.scrollDelta(this.blueprint.scaleCorrectReverse(e-s),this.blueprint.scaleCorrectReverse(t-r),i)}centerContentInViewport(e=!0){let t=0,i=0,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;const o=this.blueprint.getNodes();for(const e of o)t+=e.leftBoundary()+e.rightBoundary(),i+=e.topBoundary()+e.bottomBoundary(),s=Math.min(s,e.leftBoundary()),r=Math.max(r,e.rightBoundary()),n=Math.min(n,e.topBoundary()),a=Math.max(a,e.bottomBoundary());t=Math.round(r-s<=this.viewportSize[0]?(r+s)/2:t/(2*o.length)),i=Math.round(a-n<=this.viewportSize[1]?(a+n)/2:i/(2*o.length)),this.centerViewport(t,i,e)}}class ki extends le{static properties={selecting:{type:Boolean,attribute:"data-selecting",reflect:!0,converter:Le.booleanConverter},scrolling:{type:Boolean,attribute:"data-scrolling",reflect:!0,converter:Le.booleanConverter},focused:{type:Boolean,attribute:"data-focused",reflect:!0,converter:Le.booleanConverter},zoom:{type:Number,attribute:"data-zoom",reflect:!0},scrollX:{type:Number,attribute:!1},scrollY:{type:Number,attribute:!1},additionalX:{type:Number,attribute:!1},additionalY:{type:Number,attribute:!1},translateX:{type:Number,attribute:!1},translateY:{type:Number,attribute:!1}};static nodeBoundariesSupplier=e=>({primaryInf:e.leftBoundary(!0),primarySup:e.rightBoundary(!0),secondaryInf:e.topBoundary(!0),secondarySup:e.bottomBoundary(!0)});static nodeSelectToggleFunction=(e,t)=>{e.setSelected(t)};#ft=0;#yt=0;nodes=[];links=[];nodesNames=new Map;mousePosition=[0,0];waitingExpandUpdate=!1;constructor(){super(),this.selecting=!1,this.scrolling=!1,this.focused=!1,this.zoom=0,this.scrollX=ae.expandGridSize,this.scrollY=ae.expandGridSize,this.translateX=ae.expandGridSize,this.translateY=ae.expandGridSize,super.initialize(new mi,new Pi)}initialize(){}getGridDOMElement(){return this.template.gridElement}getScroll(){return[this.scrollX,this.scrollY]}setScroll(e,t){this.scrollX=e,this.scrollY=t}scrollDelta(e=0,t=0,i=!1,s=ae.smoothScrollTime){if(i){let i=[0,0];this.#ft&&cancelAnimationFrame(this.#ft),this.#yt&&cancelAnimationFrame(this.#yt),oe.animate(0,e,s,(e=>{this.scrollDelta(e-i[0],0,!1),i[0]=e}),(e=>this.#ft=e)),oe.animate(0,t,s,(e=>{this.scrollDelta(0,e-i[1],!1),i[1]=e}),(e=>this.#yt=e))}else{const i=[2*ae.expandGridSize,2*ae.expandGridSize];let s=this.getScroll(),r=[s[0]+e,s[1]+t],n=[0,0];for(let e=0;e<2;++e)r[e]i[e]-ae.gridExpandThreshold*ae.expandGridSize&&(n[e]=1);0==n[0]&&0==n[1]||this.seamlessExpand(n[0],n[1]),s=this.getScroll(),r=[s[0]+e,s[1]+t],this.setScroll(r[0],r[1])}}scrollCenter(e=!1){const t=this.getScroll(),i=[this.translateX-t[0],this.translateY-t[1]],s=this.getViewportSize().map((e=>e/2)),r=[i[0]-s[0],i[1]-s[1]];this.scrollDelta(r[0],r[1],e)}getViewportSize(){return[this.template.viewportElement.clientWidth,this.template.viewportElement.clientHeight]}getScrollMax(){return[this.template.viewportElement.scrollWidth-this.template.viewportElement.clientWidth,this.template.viewportElement.scrollHeight-this.template.viewportElement.clientHeight]}snapToGrid(e,t){return oe.snapToGrid(e,t,ae.gridSize)}seamlessExpand(e,t){e=Math.round(e),t=Math.round(t);let i=this.getScale();[e,t]=[-e*ae.expandGridSize,-t*ae.expandGridSize],0!=e&&(this.scrollX+=e,e/=i),0!=t&&(this.scrollY+=t,t/=i),this.translateX+=e,this.translateY+=t}progressiveSnapToGrid(e){return ae.expandGridSize*Math.round(e/ae.expandGridSize+.5*Math.sign(e))}getZoom(){return this.zoom}setZoom(e,t){if((e=oe.clamp(e,ae.minZoom,ae.maxZoom))==this.zoom)return;let i=this.getScale();if(this.zoom=e,t){t[0]+=this.translateX,t[1]+=this.translateY;let e=this.getScale()/i,s=[e*t[0],e*t[1]];this.scrollDelta((s[0]-t[0])*i,(s[1]-t[1])*i)}}getScale(){return ae.scale[this.getZoom()]}scaleCorrect(e){return e/this.getScale()}scaleCorrectReverse(e){return e*this.getScale()}compensateTranslation(e,t){return[e-=this.translateX,t-=this.translateY]}getNodes(e=!1){let t=this.nodes;return e&&(t=t.filter((e=>e.selected))),t}getCommentNodes(e=!1){let t=[...this.template.getCommentNodes(e)];return 0===t.length&&(t=this.nodes.filter((t=>t.getType()===ae.paths.comment&&(!e||t.selected)))),t}getPin(e){let t=this.template.getPin(e);return t&&t.nodeElement.getNodeName()==e.objectName.toString()||(t=[...this.nodes.find((t=>e.objectName.toString()==t.getNodeName()))?.getPinElements()??[]].find((t=>e.pinGuid.toString()==t.getPinId().toString()))),t}getLinks(e=null,t=null){if(null==e!=(null==t)){const i=e??t;return this.links.filter((e=>e.origin==i||e.target==i))}return null!=e&&null!=t?this.links.filter((i=>i.origin==e&&i.target==t||i.origin==t&&i.target==e)):this.links}getLink(e,t,i=!1){return this.links.find((s=>s.origin==e&&s.target==t||!i&&s.origin==t&&s.target==e))}selectAll(){this.getNodes().forEach((e=>ki.nodeSelectToggleFunction(e,!0)))}unselectAll(){this.getNodes().forEach((e=>ki.nodeSelectToggleFunction(e,!1)))}getSerializedText(){const e=this.blueprint.getNodes(!0).map((e=>e.entity));let t=!1,i=e.filter((e=>(t||=e.exported,!e.exported))).reduce(((e,t)=>e+t.serialize()),"");if(t){i=new gi(this.blueprint.entity,e).serialize()+i}return i}addGraphElement(...e){const t=e=>{const i=e.currentTarget;i.removeEventListener(ae.removeEventName,t);const[s,r]=i instanceof di?[this.nodes,i.entity]:i instanceof Gt?[this.links]:null,n=s?.indexOf(i);if(n>=0){const e=s.pop();ne.entity.exported=!0));continue}const s=this.entity.getHomonymObjectEntity(i.entity);if(s){const t=this.entity.takeFreeName(e);s.Name=new s.Name.constructor(t)}this.nodes.push(i),this.entity.addObjectEntity(i.entity),i.addEventListener(ae.removeEventName,t),this.template.nodesContainerElement?.appendChild(i)}else i instanceof Gt&&!this.links.includes(i)&&(this.links.push(i),i.addEventListener(ae.removeEventName,t),this.template.linksContainerElement&&!this.template.linksContainerElement.contains(i)&&this.template.linksContainerElement.appendChild(i));e.filter((e=>e instanceof di)).forEach((t=>t.sanitizeLinks(e))),e.filter((e=>e instanceof di&&e.getType()==ae.paths.comment)).forEach((e=>e.updateComplete.then((()=>e.template.manageNodesBind()))))}removeGraphElement(...e){for(let t of e){if(t.closest("ueb-blueprint")!==this)return;t.remove()}}setFocused(e=!0){if(this.focused==e)return;let t=new CustomEvent(e?ae.focusEventName.begin:ae.focusEventName.end);this.focused=e,this.focused||this.unselectAll(),this.dispatchEvent(t)}acknowledgeEditText(e){const t=new CustomEvent(e?ae.editTextEventName.begin:ae.editTextEventName.end);this.dispatchEvent(t)}}customElements.define("ueb-blueprint",ki);class Li extends Ut{#wt;get locationChangeCallback(){return this.#wt}set locationChangeCallback(e){this.#wt=e}movementSpace;movementSpaceSize=[0,0];firstUpdated(e){super.firstUpdated(e),this.movementSpace=this.element.parentElement}setup(){super.setup();const e=this.movementSpace.getBoundingClientRect();this.movementSpaceSize=[e.width,e.height]}createDraggableObject(){return new _t(this.element,this.blueprint,{draggableElement:this.movementSpace,ignoreTranslateCompensate:!0,moveEverywhere:!0,movementSpace:this.movementSpace,repositionOnClick:!0,stepSize:1})}adjustLocation(e,t){return this.locationChangeCallback?.(e,t),[e,t]}}class Ai extends Li{adjustLocation(e,t){const i=Math.round(this.movementSpaceSize[0]/2);e-=i,t=-(t-i);let[s,r]=oe.getPolarCoordinates(e,t);return s=Math.min(s,i),[e,t]=oe.getCartesianCoordinates(s,r),this.locationChangeCallback?.(e/i,t/i),[e=Math.round(e+i),t=Math.round(-t+i)]}}class Mi extends Ht{windowElement;setup(){super.setup(),this.windowElement=this.closest("ueb-window")}setLocation(e,t){super.setLocation(...this.template.adjustLocation(e,t))}}class Ii extends Mi{constructor(){super(),super.initialize({},new Ai)}static newObject(){return new Ii}initialize(){}}class Ti extends Li{adjustLocation(e,t){return e=oe.clamp(e,0,this.movementSpaceSize[0]),t=oe.clamp(t,0,this.movementSpaceSize[1]),this.locationChangeCallback?.(e/this.movementSpaceSize[0],1-t/this.movementSpaceSize[1]),[e,t]}}class Oi extends Mi{constructor(){super(),super.initialize({},new Ti)}static newObject(){return new Oi}initialize(){}}class Di extends zt{constructor(e,t,i={}){i.consumeEvent=!0,super(e,t,i)}}class $i extends $t{#St;#Et;#Ct=e=>this.element.selectedOption=e.target.selectedOptions[0].value;render(){return z` `}firstUpdated(e){super.firstUpdated(e),this.#St=this.element.querySelector("select:first-child"),this.#Et=this.element.querySelector("select:last-child");const t=new Event("input",{bubbles:!0});this.#St.dispatchEvent(t)}updated(e){super.updated(e);const t=this.#Et.getBoundingClientRect();this.element.style.setProperty("--ueb-dropdown-width",t.width+"px")}createInputObjects(){return[...super.createInputObjects(),new Di(this.element,this.blueprint)]}setSelectedValue(e){this.element.querySelector(`option[value="${e}"]`).defaultSelected=!0}getSelectedValue(){return this.#St.value}}class Vi extends le{static properties={...super.properties,options:{type:Object},selectedOption:{type:String}};constructor(){super(),super.initialize({},new $i),this.options=[],this.selectedOption=""}static newObject(e){return new Vi}initialize(){}getValue(){return this.template.getSelectedValue()}}class Bi extends $t{#Nt=()=>{this.blueprint.acknowledgeEditText(!0),this.element.selectOnFocus&&getSelection().selectAllChildren(this.element)};#xt=()=>{this.blueprint.acknowledgeEditText(!1),getSelection().removeAllRanges()};#Pt=e=>e.target.querySelectorAll("br").forEach((e=>e.remove()));#kt=e=>{"Enter"!=e.code||e.shiftKey||e.target.blur()};initialize(e){super.initialize(e),this.element.classList.add("ueb-pin-input-content"),this.element.setAttribute("role","textbox"),this.element.contentEditable="true"}firstUpdated(e){super.firstUpdated(e);const t=new Event("input",{bubbles:!0});this.element.dispatchEvent(t)}createInputObjects(){return[...super.createInputObjects(),new Di(this.element,this.blueprint)]}setup(){super.setup(),this.element.addEventListener("focus",this.#Nt),this.element.addEventListener("focusout",this.#xt),this.element.singleLine&&this.element.addEventListener("input",this.#Pt),this.element.blurOnEnter&&this.element.addEventListener("keydown",this.#kt)}cleanup(){super.cleanup(),this.element.removeEventListener("focus",this.#Nt),this.element.removeEventListener("focusout",this.#xt),this.element.removeEventListener("input",this.#Pt),this.element.removeEventListener("keydown",this.#kt)}}class Ri extends le{static properties={...super.properties,singleLine:{type:Boolean,attribute:"data-single-line",converter:Le.booleanConverter,reflect:!0},selectOnFocus:{type:Boolean,attribute:"data-select-focus",converter:Le.booleanConverter,reflect:!0},blurOnEnter:{type:Boolean,attribute:"data-blur-enter",converter:Le.booleanConverter,reflect:!0}};constructor(){super(),this.singleLine=!1,this.selectOnFocus=!0,this.blurOnEnter=!0,super.initialize({},new Bi)}static newObject(){return new Ri}initialize(){}}class Gi extends ii{#Lt;#At=()=>{const e=this.element.getDefaultValue(!0);e.value=this.#Lt.checked,this.element.setDefaultValue(e)};firstUpdated(e){super.firstUpdated(e),this.#Lt=this.element.querySelector(".ueb-pin-input")}setup(){super.setup(),this.#Lt?.addEventListener("change",this.#At)}cleanup(){super.cleanup(),this.#Lt?.removeEventListener("change",this.#At)}createInputObjects(){return[...super.createInputObjects(),new Di(this.#Lt,this.blueprint)]}renderInput(){return z``}}class Hi extends ii{static singleLineInput=!1;static selectOnFocus=!0;static saveEachInputChange=!1;#Mt;get inputWrapper(){return this.#Mt}#It;static stringFromInputToUE(e){return e.replace(/(?=\n\s*)\n$/,"")}static stringFromUEToInput(e){return e.replaceAll(/(?:\r|(?<=(?:^|[^\\])(?:\\\\)*)\\r)(?=\n)/g,"").replace(/(?<=\n\s*)$/,"\n")}#Tt=()=>this.setInputs(this.getInputs(),!0);#Ot=e=>this.#Dt(e.target);#Dt(e){if(this.element.querySelector(".ueb-pin-name")?.getBoundingClientRect().width<20)return;const t=this.blueprint.scaleCorrect(this.#Mt.getBoundingClientRect().width)+this.nameWidth,i=this.element.classList.contains("ueb-pin-input-wrap");!i&&t>ae.pinInputWrapWidth?this.element.classList.add("ueb-pin-input-wrap"):i&&t<=ae.pinInputWrapWidth&&this.element.classList.remove("ueb-pin-input-wrap")}firstUpdated(e){super.firstUpdated(e);this.constructor.canWrapInput&&this.isInputRendered()&&(this.element.addEventListener("input",this.#Ot),this.nameWidth=this.blueprint.scaleCorrect(this.element.querySelector(".ueb-pin-name")?.getBoundingClientRect().width??0)),this.#Mt=this.element.querySelector(".ueb-pin-input-wrapper"),this.#It=[...this.element.querySelectorAll("ueb-input")]}setup(){super.setup();const e=this.constructor;e.saveEachInputChange?this.element.addEventListener("input",this.#Tt):this.element.addEventListener("focusout",this.#Tt),e.canWrapInput&&this.isInputRendered()&&(this.element.addEventListener("input",this.#Ot),this.element.nodeElement.addEventListener(ae.nodeReflowEventName,this.#Ot))}cleanup(){super.cleanup(),this.element.nodeElement.removeEventListener(ae.nodeReflowEventName,this.#Ot),this.element.removeEventListener("input",this.#Ot),this.element.removeEventListener("input",this.#Tt),this.element.removeEventListener("focusout",this.#Tt)}getInput(){return this.getInputs().reduce(((e,t)=>e+t),"")}getInputs(){return this.#It.map((e=>oe.clearHTMLWhitespace(e.innerHTML)))}setInputs(e=[],t=!0){this.#It.forEach(this.constructor.singleLineInput?(t,i)=>t.innerText=e[i]:(t,i)=>t.innerText=e[i].replaceAll("\n","")),t&&this.setDefaultValue(e.map((e=>Hi.stringFromInputToUE(e))),e),this.element.requestUpdate(),this.element.nodeElement.acknowledgeReflow()}setDefaultValue(e=[],t=e){this.element.setDefaultValue(e.join(""))}renderInput(){const e=this.constructor,t=e.singleLineInput,i=e.selectOnFocus;return z`
`}}class zi extends ii{renderIcon(){return ce.execPin}renderName(){let e=this.element.entity.PinName?.toString();if(this.element.entity.PinFriendlyName)e=this.element.entity.PinFriendlyName.toString();else if("execute"===e||"then"===e)return z``;return z`${this.element.getPinDisplayName()}`}}class _i extends Hi{static singleLineInput=!0;setInputs(e=[],t=!1){if(e&&0!=e.length||(e=[this.getInput()]),super.setInputs(e,!1),t){let i=[];for(const s of e){let e=parseFloat(s);isNaN(e)&&(e=0,t=!1),i.push(e)}this.setDefaultValue(i,e)}}setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}}class Fi extends _i{renderInput(){return z`
`}} +class re extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const s=i?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=i?.renderBefore??null;s._$litPart$=r=new W(t.insertBefore(M(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return _}}re._$litElement$=!0,re.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:re});const ne=globalThis.litElementPolyfillSupport;ne?.({LitElement:re}),(globalThis.litElementVersions??=[]).push("4.1.1");class ae{static VERSION="2.0.0";static nodeColors={black:n``,blue:n``,darkBlue:n``,darkerBlue:n``,darkTurquoise:n``,gray:n``,green:n``,intenseGreen:n``,lime:n``,red:n``,turquoise:n``,violet:n``,yellow:n``};static alphaPattern="repeating-conic-gradient(#7c8184 0% 25%, #c2c3c4 0% 50%) 50% / 10px 10px";static colorDragEventName="ueb-color-drag";static colorPickEventName="ueb-color-pick";static colorWindowEventName="ueb-color-window";static colorWindowName="Color Picker";static defaultCommentHeight=96;static defaultCommentWidth=400;static distanceThreshold=20;static dragEventName="ueb-drag";static dragGeneralEventName="ueb-drag-general";static edgeScrollThreshold=50;static editTextEventName={begin:"ueb-edit-text-begin",end:"ueb-edit-text-end"};static expandGridSize=400;static focusEventName={begin:"blueprint-focus",end:"blueprint-unfocus"};static fontSize=n``;static gridExpandThreshold=.25;static gridLineWidth=1;static gridSet=8;static gridShrinkThreshold=4;static gridSize=16;static hexColorRegex=/^\s*#(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})(?[0-9a-fA-F]{2})([0-9a-fA-F]{2})?|#(?[0-9a-fA-F])(?[0-9a-fA-F])(?[0-9a-fA-F])\s*$/;static indentation=" ";static keysSeparator=/[\.\(\)]/;static knotOffset=[-ae.gridSize,-.5*ae.gridSize];static lineTracePattern=/LineTrace(Single|Multi)(\w*)/;static linkCurveHeight=15;static linkCurveWidth=80;static linkMinWidth=100;static nameRegexSpaceReplacement=new RegExp("^K2(?:[Nn]ode)?_|(?<=[a-z])(?=[A-Z0-9])|(?<=[A-Z])(?{const r=100-e,n=s?i-e+50:50,a=s?r+t-e:r-t+e;return`M ${e} 0 C ${t.toFixed(2)} 0, ${i.toFixed(2)} 0, ${n.toFixed(2)} 50 S ${a.toFixed(2)} 100, ${r.toFixed(3)} 100`};static maxZoom=7;static minZoom=-12;static mouseClickButton=0;static mouseRightClickButton=2;static mouseWheelZoomThreshold=80;static nodeDragEventName="ueb-node-drag";static nodeDragGeneralEventName="ueb-node-drag-general";static nodeTitle=(e,t)=>`${e}_${t}`;static nodeRadius=8;static nodeReflowEventName="ueb-node-reflow";static paths={actorBoundEvent:"/Script/BlueprintGraph.K2Node_ActorBoundEvent",addDelegate:"/Script/BlueprintGraph.K2Node_AddDelegate",ambientSound:"/Script/Engine.AmbientSound",asyncAction:"/Script/BlueprintGraph.K2Node_AsyncAction",blueprint:"/Script/Engine.Blueprint",blueprintGameplayTagLibrary:"/Script/GameplayTags.BlueprintGameplayTagLibrary",blueprintMapLibrary:"/Script/Engine.BlueprintMapLibrary",blueprintSetLibrary:"/Script/Engine.BlueprintSetLibrary",callArrayFunction:"/Script/BlueprintGraph.K2Node_CallArrayFunction",callDelegate:"/Script/BlueprintGraph.K2Node_CallDelegate",callFunction:"/Script/BlueprintGraph.K2Node_CallFunction",clearDelegate:"/Script/BlueprintGraph.K2Node_ClearDelegate",comment:"/Script/UnrealEd.EdGraphNode_Comment",commutativeAssociativeBinaryOperator:"/Script/BlueprintGraph.K2Node_CommutativeAssociativeBinaryOperator",componentBoundEvent:"/Script/BlueprintGraph.K2Node_ComponentBoundEvent",createDelegate:"/Script/BlueprintGraph.K2Node_CreateDelegate",customEvent:"/Script/BlueprintGraph.K2Node_CustomEvent",doN:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:Do N",doOnce:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:DoOnce",dynamicCast:"/Script/BlueprintGraph.K2Node_DynamicCast",eAttachmentRule:"/Script/Engine.EAttachmentRule",edGraph:"/Script/Engine.EdGraph",eDrawDebugTrace:"/Script/Engine.EDrawDebugTrace",eMaterialSamplerType:"/Script/Engine.EMaterialSamplerType",eNiagara_Float4Channel:"/Niagara/Enums/ENiagara_Float4Channel.ENiagara_Float4Channel",enum:"/Script/CoreUObject.Enum",enumLiteral:"/Script/BlueprintGraph.K2Node_EnumLiteral",eSamplerSourceMode:"/Script/Engine.ESamplerSourceMode",eSearchCase:"/Script/CoreUObject.ESearchCase",eSearchDir:"/Script/CoreUObject.ESearchDir",eSpawnActorCollisionHandlingMethod:"/Script/Engine.ESpawnActorCollisionHandlingMethod",eTextureMipValueMode:"/Script/Engine.ETextureMipValueMode",eTraceTypeQuery:"/Script/Engine.ETraceTypeQuery",event:"/Script/BlueprintGraph.K2Node_Event",eWorldPositionIncludedOffsets:"/Script/Engine.EWorldPositionIncludedOffsets",executionSequence:"/Script/BlueprintGraph.K2Node_ExecutionSequence",flipflop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:FlipFlop",forEachElementInEnum:"/Script/BlueprintGraph.K2Node_ForEachElementInEnum",forEachLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForEachLoop",forEachLoopWithBreak:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForEachLoopWithBreak",forLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoop",forLoopWithBreak:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ForLoopWithBreak",functionEntry:"/Script/BlueprintGraph.K2Node_FunctionEntry",functionResult:"/Script/BlueprintGraph.K2Node_FunctionResult",gameplayTag:"/Script/GameplayTags.GameplayTag",getInputAxisKeyValue:"/Script/BlueprintGraph.K2Node_GetInputAxisKeyValue",ifThenElse:"/Script/BlueprintGraph.K2Node_IfThenElse",inputAxisKeyEvent:"/Script/BlueprintGraph.K2Node_InputAxisKeyEvent",inputDebugKey:"/Script/InputBlueprintNodes.K2Node_InputDebugKey",inputKey:"/Script/BlueprintGraph.K2Node_InputKey",inputVectorAxisEvent:"/Script/BlueprintGraph.K2Node_InputVectorAxisEvent",isValid:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:IsValid",kismetArrayLibrary:"/Script/Engine.KismetArrayLibrary",kismetMathLibrary:"/Script/Engine.KismetMathLibrary",knot:"/Script/BlueprintGraph.K2Node_Knot",linearColor:"/Script/CoreUObject.LinearColor",literal:"/Script/BlueprintGraph.K2Node_Literal",macro:"/Script/BlueprintGraph.K2Node_MacroInstance",makeArray:"/Script/BlueprintGraph.K2Node_MakeArray",makeMap:"/Script/BlueprintGraph.K2Node_MakeMap",makeSet:"/Script/BlueprintGraph.K2Node_MakeSet",makeStruct:"/Script/BlueprintGraph.K2Node_MakeStruct",materialExpressionComponentMask:"/Script/Engine.MaterialExpressionComponentMask",materialExpressionConstant:"/Script/Engine.MaterialExpressionConstant",materialExpressionConstant2Vector:"/Script/Engine.MaterialExpressionConstant2Vector",materialExpressionConstant3Vector:"/Script/Engine.MaterialExpressionConstant3Vector",materialExpressionConstant4Vector:"/Script/Engine.MaterialExpressionConstant4Vector",materialExpressionFunctionInput:"/Script/Engine.MaterialExpressionFunctionInput",materialExpressionLogarithm:"/Script/InterchangeImport.MaterialExpressionLogarithm",materialExpressionLogarithm10:"/Script/Engine.MaterialExpressionLogarithm10",materialExpressionLogarithm2:"/Script/Engine.MaterialExpressionLogarithm2",materialExpressionMaterialFunctionCall:"/Script/Engine.MaterialExpressionMaterialFunctionCall",materialExpressionSquareRoot:"/Script/Engine.MaterialExpressionSquareRoot",materialExpressionSubtract:"/Script/Engine.MaterialExpressionSubtract",materialExpressionTextureCoordinate:"/Script/Engine.MaterialExpressionTextureCoordinate",materialExpressionTextureSample:"/Script/Engine.MaterialExpressionTextureSample",materialExpressionWorldPosition:"/Script/Engine.MaterialExpressionWorldPosition",materialGraphNode:"/Script/UnrealEd.MaterialGraphNode",materialGraphNodeComment:"/Script/UnrealEd.MaterialGraphNode_Comment",metasoundEditorGraphExternalNode:"/Script/MetasoundEditor.MetasoundEditorGraphExternalNode",multiGate:"/Script/BlueprintGraph.K2Node_MultiGate",niagaraBool:"/Script/Niagara.NiagaraBool",niagaraClipboardContent:"/Script/NiagaraEditor.NiagaraClipboardContent",niagaraDataInterfaceCollisionQuery:"/Script/Niagara.NiagaraDataInterfaceCollisionQuery",niagaraDataInterfaceCurlNoise:"/Script/Niagara.NiagaraDataInterfaceCurlNoise",niagaraDataInterfaceVolumeTexture:"/Script/Niagara.NiagaraDataInterfaceVolumeTexture",niagaraFloat:"/Script/Niagara.NiagaraFloat",niagaraInt32:"/Script/Niagara.NiagaraInt32",niagaraNodeConvert:"/Script/NiagaraEditor.NiagaraNodeConvert",niagaraNodeFunctionCall:"/Script/NiagaraEditor.NiagaraNodeFunctionCall",niagaraNodeInput:"/Script/NiagaraEditor.NiagaraNodeInput",niagaraNodeOp:"/Script/NiagaraEditor.NiagaraNodeOp",niagaraParameterMap:"/Script/Niagara.NiagaraParameterMap",niagaraPosition:"/Script/Niagara.NiagaraPosition",pawn:"/Script/Engine.Pawn",pcgEditorGraphNode:"/Script/PCGEditor.PCGEditorGraphNode",pcgEditorGraphNodeInput:"/Script/PCGEditor.PCGEditorGraphNodeInput",pcgEditorGraphNodeOutput:"/Script/PCGEditor.PCGEditorGraphNodeOutput",pcgHiGenGridSizeSettings:"/Script/PCG.PCGHiGenGridSizeSettings",pcgSubgraphSettings:"/Script/PCG.PCGSubgraphSettings",promotableOperator:"/Script/BlueprintGraph.K2Node_PromotableOperator",quat4f:"/Script/CoreUObject.Quat4f",removeDelegate:"/Script/BlueprintGraph.K2Node_RemoveDelegate",reverseForEachLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:ReverseForEachLoop",rotator:"/Script/CoreUObject.Rotator",select:"/Script/BlueprintGraph.K2Node_Select",self:"/Script/BlueprintGraph.K2Node_Self",slateBlueprintLibrary:"/Script/UMG.SlateBlueprintLibrary",spawnActorFromClass:"/Script/BlueprintGraph.K2Node_SpawnActorFromClass",switchEnum:"/Script/BlueprintGraph.K2Node_SwitchEnum",switchGameplayTag:"/Script/GameplayTagsEditor.GameplayTagsK2Node_SwitchGameplayTag",switchInteger:"/Script/BlueprintGraph.K2Node_SwitchInteger",switchName:"/Script/BlueprintGraph.K2Node_SwitchName",switchString:"/Script/BlueprintGraph.K2Node_SwitchString",timeline:"/Script/BlueprintGraph.K2Node_Timeline",timeManagementBlueprintLibrary:"/Script/TimeManagement.TimeManagementBlueprintLibrary",transform:"/Script/CoreUObject.Transform",userDefinedEnum:"/Script/Engine.UserDefinedEnum",variableGet:"/Script/BlueprintGraph.K2Node_VariableGet",variableSet:"/Script/BlueprintGraph.K2Node_VariableSet",vector:"/Script/CoreUObject.Vector",vector2D:"/Script/CoreUObject.Vector2D",vector2f:"/Script/CoreUObject.Vector2f",vector3f:"/Script/CoreUObject.Vector3f",vector4f:"/Script/CoreUObject.Vector4f",whileLoop:"/Engine/EditorBlueprintResources/StandardMacros.StandardMacros:WhileLoop"};static pinInputWrapWidth=145;static removeEventName="ueb-element-delete";static scale={[-12]:.133333,[-11]:.166666,[-10]:.2,[-9]:.233333,[-8]:.266666,[-7]:.3,[-6]:.333333,[-5]:.375,[-4]:.5,[-3]:.675,[-2]:.75,[-1]:.875,0:1,1:1.25,2:1.375,3:1.5,4:1.675,5:1.75,6:1.875,7:2};static smoothScrollTime=1e3;static stringEscapedCharacters=/["\\]/g;static subObjectAttributeNamePrefix="#SubObject";static subObjectAttributeNameFromEntity=(e,t=!1)=>this.subObjectAttributeNamePrefix+(!t&&e.Class?`_${e.Class.type}`:"")+"_"+e.Name;static subObjectAttributeNameFromReference=(e,t=!1)=>this.subObjectAttributeNamePrefix+(t?"":"_"+e.type)+"_"+e.path;static subObjectAttributeNameFromName=e=>this.subObjectAttributeNamePrefix+"_"+e;static switchTargetPattern=/\/Script\/[\w\.\/\:]+K2Node_Switch([A-Z]\w+)+/;static trackingMouseEventName={begin:"ueb-tracking-mouse-begin",end:"ueb-tracking-mouse-end"};static unescapedBackslash=/(?<=(?:[^\\]|^)(?:\\\\)*)\\(?!\\)/;static windowApplyEventName="ueb-window-apply";static windowApplyButtonText="OK";static windowCancelEventName="ueb-window-cancel";static windowCancelButtonText="Cancel";static windowCloseEventName="ueb-window-close";static CommonEnums={[this.paths.eAttachmentRule]:["KeepRelative","KeepWorld","SnapToTarget"],[this.paths.eDrawDebugTrace]:["None","ForOneFrame","ForDuration","Persistent"],[this.paths.eMaterialSamplerType]:["Color","Grayscale","Alpha","Normal","Masks","Distance Field Font","Linear Color","Linear Grayscale","Data","External","Virtual Color","Virtual Grayscale","Virtual Alpha","Virtual Normal","Virtual Mask","Virtual Linear Color","Virtual Linear Grayscal"],[this.paths.eNiagara_Float4Channel]:[["NewEnumerator0","R"],["NewEnumerator1","G"],["NewEnumerator2","B"],["NewEnumerator3","A"]],[this.paths.eSamplerSourceMode]:["From texture asset","Shared: Wrap","Shared: Clamp","Hidden"],[this.paths.eSearchCase]:["CaseSensitive","IgnoreCase"],[this.paths.eWorldPositionIncludedOffsets]:["Absolute World Position (Including Material Shader Offsets)","Absolute World Position (Excluding Material Shader Offsets)","Camera Relative World Position (Including Material Shader Offsets)","Camera Relative World Position (Excluding Material Shader Offsets)"],[this.paths.eSearchDir]:["FromStart","FromEnd"],[this.paths.eSpawnActorCollisionHandlingMethod]:[["Undefined","Default"],["AlwaysSpawn","Always Spawn, Ignore Collisions"],["AdjustIfPossibleButAlwaysSpawn","Try To Adjust Location, But Always Spawn"],["AdjustIfPossibleButDontSpawnIfColliding","Try To Adjust Location, Don't Spawn If Still Colliding"],["DontSpawnIfColliding","Do Not Spawn"]],[this.paths.eTextureMipValueMode]:["None (use computed mip level)","MipLevel (absolute, 0 is full resolution)","MipBias (relative to the computed mip level)","Derivative (explicit derivative to compute mip level)"],[this.paths.eTraceTypeQuery]:[["TraceTypeQuery1","Visibility"],["TraceTypeQuery2","Camera"]]};static ModifierKeys=["Ctrl","Shift","Alt","Meta"];static rgba=["R","G","B","A"];static Keys={Backspace:"Backspace",Tab:"Tab",LeftControl:"ControlLeft",RightControl:"ControlRight",LeftShift:"ShiftLeft",RightShift:"ShiftRight",LeftAlt:"AltLeft",RightAlt:"AltRight",Enter:"Enter",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Space:"Space",PageUp:"PageUp",PageDown:"PageDown",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",PrintScreen:"PrintScreen",Insert:"Insert",Delete:"Delete",Zero:"Digit0",One:"Digit1",Two:"Digit2",Three:"Digit3",Four:"Digit4",Five:"Digit5",Six:"Digit6",Seven:"Digit7",Eight:"Digit8",Nine:"Digit9",A:"KeyA",B:"KeyB",C:"KeyC",D:"KeyD",E:"KeyE",F:"KeyF",G:"KeyG",H:"KeyH",I:"KeyI",K:"KeyK",L:"KeyL",M:"KeyM",N:"KeyN",O:"KeyO",P:"KeyP",Q:"KeyQ",R:"KeyR",S:"KeyS",T:"KeyT",U:"KeyU",V:"KeyV",W:"KeyW",X:"KeyX",Y:"KeyY",Z:"KeyZ",NumPadZero:"Numpad0",NumPadOne:"Numpad1",NumPadTwo:"Numpad2",NumPadThree:"Numpad3",NumPadFour:"Numpad4",NumPadFive:"Numpad5",NumPadSix:"Numpad6",NumPadSeven:"Numpad7",NumPadEight:"Numpad8",NumPadNine:"Numpad9",Multiply:"NumpadMultiply",Add:"NumpadAdd",Subtract:"NumpadSubtract",Decimal:"NumpadDecimal",Divide:"NumpadDivide",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",NumLock:"NumLock",ScrollLock:"ScrollLock"}}class oe{static clamp(e,t=-1/0,i=1/0){return Math.min(Math.max(e,t),i)}static getScale(e){const t=e.blueprint?.getScale()??getComputedStyle(e).getPropertyValue("--ueb-scale");return""!=t?parseFloat(t):1}static minDecimals(e,t=1,i=1e-8){const s=e*10**t;return Math.abs(s%1)>i?e.toString():e.toFixed(t)}static roundDecimals(e,t=1){const i=10**t;return Math.round(e*i)/i}static printExponential(e){if(e==Number.POSITIVE_INFINITY)return"inf";if(e==Number.NEGATIVE_INFINITY)return"-inf";const t=Math.round(e);if(t>=1e3){const i=Math.floor(Math.log10(t));return`${Math.round(e/10**(i-2))/100}e+${i<10?"0":""}${i}`}return 0==Math.floor(e)?e.toString():this.roundDecimals(e,Math.max(0,3-Math.floor(e).toString().length)).toString()}static approximatelyEqual(e,t,i=1e-8){return!(Math.abs(e-t)>i)}static convertLocation(e,t,i=!1){const s=i?1:1/oe.getScale(t),r=t.getBoundingClientRect();return[Math.round((e[0]-r.x)*s),Math.round((e[1]-r.y)*s)]}static isSerialized(e,t){return e.attributes?.[t]?.serialized??e.constructor.attributes?.[t]?.serialized??!1}static objectGet(e,t,i=void 0){if(void 0!==e){if(!(t instanceof Array))throw new TypeError("UEBlueprint: Expected keys to be an array");return 0!=t.length&&t[0]in e&&void 0!==e[t[0]]?1==t.length?e[t[0]]:oe.objectGet(e[t[0]],t.slice(1),i):i}}static objectSet(e,t,i,s=Object){if(!(t instanceof Array))throw new TypeError("Expected keys to be an array.");if(1==t.length){if(t[0]in e||void 0===e[t[0]])return e[t[0]]=i,!0}else if(t.length>0)return e[t[0]]instanceof Object||(e[t[0]]=new s),oe.objectSet(e[t[0]],t.slice(1),i,s);return!1}static snapToGrid(e,t,i){return 1===i?[e,t]:[i*Math.floor(e/i),i*Math.floor(t/i)]}static mergeArrays(e=[],t=[],i=(e,t)=>e==t,s=e=>{}){let r=[];e=[...e],t=[...t];e:for(;;){for(let n=0;n(s(e),e))),...e.splice(0,1)),t.shift();continue e}break e}return r.push(...e),r.push(...t.filter((e=>!r.some((t=>i(t,e))))).map(((e,t)=>(s(e),e)))),r}static escapeNewlines(e){return e.replaceAll("\n","\\n").replaceAll("\t","\\t")}static escapeString(e,t=!0){let i=e.replaceAll(new RegExp(`(${ae.stringEscapedCharacters.source})`,"g"),"\\$1");return t&&(i=i.replaceAll("\n","\\n").replaceAll("\t","\\t")),i}static unescapeString(e){return e.replaceAll(new RegExp(ae.unescapedBackslash.source+"t","g"),"\t").replaceAll(new RegExp(ae.unescapedBackslash.source+"n","g"),"\n").replaceAll(new RegExp(`\\\\(${ae.stringEscapedCharacters.source})`,"g"),"$1")}static clearHTMLWhitespace(e){return e.replaceAll(" "," ").replaceAll(/|
/g,"\n").replaceAll(/(\)/g,"")}static encodeHTMLWhitespace(e){return e.replaceAll(" "," ")}static capitalFirstLetter(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}static formatStringName(e=""){return e.replace(/^\s*b(?=[A-Z])/,"").replaceAll(ae.nameRegexSpaceReplacement," ").trim().split(" ").map((e=>oe.capitalFirstLetter(e))).join(" ")}static getIdFromReference(e){return e.replace(/(?:.+\.)?([^\.]+)$/,"$1").replaceAll(/(?<=[a-z\d])(?=[A-Z])|(?<=[a-zA-Z])(?=\d)|(?<=[A-Z]{2})(?=[A-Z][a-z])/g,"-").toLowerCase()}static getNameFromPath(e,t=!1){const i=t?/([^\.\/]+?)(?:_\d+)$/:/([^\.\/]+)$/;return e.match(i)?.[1]??""}static getPolarCoordinates(e,t,i=!1){let s=Math.atan2(t,e);return i&&s<0&&(s=2*Math.PI+s),[Math.sqrt(e*e+t*t),s]}static getCartesianCoordinates(e,t){return[e*Math.cos(t),e*Math.sin(t)]}static range(e=0,t=0,i=(t>=e?1:-1)){return Array.from({length:Math.ceil((t-e)/i)},((t,s)=>e+s*i))}static getFirstWordOrder(e){return new RegExp(/\s*/.source+e.join(/[^\n]+\n\s*/.source)+/\s*/.source)}static paste(e,t){const i=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});i.clipboardData.setData("text",t),e.dispatchEvent(i)}static async copy(e){const t=new ClipboardEvent("copy",{bubbles:!0,cancelable:!0,clipboardData:new DataTransfer});e.dispatchEvent(t)}static animate(e,t,i,s,r=e=>{},n=e=>{const t=e**3.5;return t/(t+(1-e)**3.5)}){let a;const o=l=>{void 0===a&&(a=l);let c=(l-a)/i;oe.approximatelyEqual(c,1)||c>1?c=1:r(requestAnimationFrame(o));const u=e+(t-e)*n(c);s(u)};r(requestAnimationFrame(o))}}class le extends re{#e;get blueprint(){return this.#e}set blueprint(e){this.#e=e}#t;get entity(){return this.#t}set entity(e){this.#t=e}#i;get template(){return this.#i}isInitialized=!1;isSetup=!1;inputObjects=[];initialize(e,t){this.requestUpdate(),this.#t=e,this.#i=t,this.#i.initialize(this),this.isConnected&&this.updateComplete.then((()=>this.setup())),this.isInitialized=!0}connectedCallback(){super.connectedCallback(),this.blueprint=this.closest("ueb-blueprint"),this.isInitialized&&(this.requestUpdate(),this.updateComplete.then((()=>this.setup())))}disconnectedCallback(){super.disconnectedCallback(),this.isSetup&&this.updateComplete.then((()=>this.cleanup())),this.acknowledgeDelete()}createRenderRoot(){return this}setup(){this.template.setup(),this.isSetup=!0}cleanup(){this.template.cleanup(),this.isSetup=!1}willUpdate(e){super.willUpdate(e),this.template.willUpdate(e)}update(e){super.update(e),this.template.update(e)}render(){return this.template.render()}firstUpdated(e){super.firstUpdated(e),this.template.firstUpdated(e),this.template.inputSetup()}updated(e){super.updated(e),this.template.updated(e)}acknowledgeDelete(){let e=new CustomEvent(ae.removeEventName);this.dispatchEvent(e)}isSameGraph(e){return this.blueprint&&this.blueprint==e?.blueprint}}class ce{static arrayPin=z``;static branchNode=z``;static breakStruct=z``;static cast=z``;static close=z``;static convert=z``;static correct=z``;static delegate=z``;static doN=z``;static doOnce=z``;static enum=z``;static event=z``;static execPin=z``;static expandIcon=z``;static flipflop=z``;static forEachLoop=z``;static functionSymbol=z``;static gamepad=z``;static genericPin=z``;static keyboard=z``;static loop=z``;static macro=z``;static mapPin=z``;static makeArray=z``;static makeMap=z``;static makeSet=z``;static makeStruct=z``;static metasoundFunction=z``;static mouse=z``;static node=z``;static operationPin=z``;static pcgStackPin=z``;static pcgPin=z``;static pcgParamPin=z``;static pcgSpatialPin=z``;static plusCircle=z``;static questionMark=z``;static referencePin=z``;static reject=z``;static setPin=z``;static select=z``;static sequence=z``;static sound=z``;static spawnActor=z``;static staticPin=z``;static switch=z``;static timer=z``;static touchpad=z``}class ue{static makeSuccess(e,t,i=null,s=0){return{status:!0,value:t,position:e,bestParser:i,bestPosition:s}}static makeFailure(e=0,t=null,i=0){return{status:!1,value:null,position:e,bestParser:t,bestPosition:i}}static makeContext(e=null,t=""){return{parsernostrum:e,input:t,highlighted:null}}static makePathNode(e,t=0,i=null){return{parent:i,current:e,index:t}}}class he{static indentation=" ";static highlight="Last valid parser";Self;static frame(e,t="",i=""){t=e?"[ "+t+" ]":"";let s=e.split("\n");const r=Math.max(...s.map((e=>e.length))),n=r";const r=this.isVisited(i),n=this.isHighlighted(e,i);let a=r?"<...>":this.doToString(e,n?"":t,i,s);return n&&(a=he.frame(a,he.highlight,t)),a}doToString(e,t,i,s){return`${this.constructor.name} does not implement toString()`}}class pe extends he{#s;get value(){return this.#s}constructor(e){super(),this.#s=e}parse(e,t,i,s){i=this.makePath(i,s);const r=t+this.#s.length,n=e.input.substring(t,r);return this.#s===n?ue.makeSuccess(r,this.#s,i,r):ue.makeFailure()}doToString(e,t,i,s){return`"${this.value.replaceAll("\n","\\n").replaceAll('"','\\"')}"`}}class de extends he{static instance=new de;parse(e,t,i,s){return i=this.makePath(i,s),ue.makeSuccess(t,"",i,0)}doToString(e,t,i,s){return""}}class me extends he{#r;get parsers(){return this.#r}constructor(...e){super(),this.#r=e}parse(e,t,i,s){i=this.makePath(i,s);const r=ue.makeSuccess(0,"");for(let s=0;sr.bestPosition&&(r.bestParser=n.bestParser,r.bestPosition=n.bestPosition),n.status)return r.value=n.value,r.position=n.position,r}return r.status=!1,r.value=null,r}doToString(e,t,i,s){if(2===this.#r.length&&this.#r[1]instanceof de){let s=this.#r[0].toString(e,t,i,0);return this.#r[0]instanceof pe||(s="<"+s+">"),s+="?",s}const r=t+he.indentation;let n="ALT<\n"+r+this.#r.map(((t,s)=>t.toString(e,r+" ".repeat(0===s?0:he.indentation.length-2),i,s))).join("\n"+r+"| ")+"\n"+t+">";return n}}class ge extends he{#n;get parser(){return this.#n}#a;constructor(e,t){super(),this.#n=e,this.#a=t}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#n.parse(e,t,i,0);if(!r.status)return r;const n=this.#a(r.value,e.input,r.position).getParser().parse(e,r.position,i,0);return r.bestPosition>n.bestPosition&&(n.bestParser=r.bestParser,n.bestPosition=r.bestPosition),n}doToString(e,t,i,s){return this.#n.toString(e,t,i,0)+" => chained"}}class be extends he{static instance=new be;parse(e,t,i,s){return ue.makeFailure()}doToString(e,t,i,s){return""}}class ve extends he{#n;get parser(){return this.#n}#o="";constructor(e,t){super(),this.#n=e,this.#o=t}makePath(e,t){return e}parse(e,t,i,s){return this.parse=this.#n.parse.bind(this.#n),this.parse(e,t,i,s)}doToString(e,t,i,s){let r=this.#n.toString(e,"",i,s);return r=he.frame(r,this.#o,t),r}}class fe extends he{#n;#l;constructor(e){super(),this.#n=e}makePath(e,t){return e}isHighlighted(e,t){if(super.isHighlighted(e,t)){const i={parent:t,parser:this.#l,index:0};e.highlighted=e.highlighted instanceof he?this.#l:i}return!1}resolve(){return this.#l||(this.#l=this.#n().getParser()),this.#l}parse(e,t,i,s){return this.resolve(),this.parse=this.#l.parse.bind(this.#l),this.parse(e,t,i,s)}doToString(e,t,i,s){return this.resolve(),this.doToString=this.#l.toString.bind(this.#l),this.doToString(e,t,i,s)}}class ye extends he{#n;get parser(){return this.#n}#c;get type(){return this.#c}static Type={NEGATIVE_AHEAD:"?!",NEGATIVE_BEHIND:"?String.raw`[^${e}\\]*(?:\\.[^${e}\\]*)*`;static#m=/[-\+]?(?:\d*\.)?\d+/;static common={number:new RegExp(this.#m.source+String.raw`(?!\.)`),numberInteger:/[\-\+]?\d+(?!\.\d)/,numberNatural:/\d+/,numberExponential:new RegExp(this.#m.source+String.raw`(?:[eE][\+\-]?\d+)?(?!\.)`),numberUnit:/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/,numberByte:/0*(?:25[0-5]|2[0-4]\d|1?\d?\d)(?!\d|\.)/,whitespace:/\s+/,whitespaceOpt:/\s*/,whitespaceInline:/[^\S\n]+/,whitespaceInlineOpt:/[^\S\n]*/,whitespaceMultiline:/\s*?\n\s*/,doubleQuotedString:new RegExp(`"(${this.#d('"')})"`),singleQuotedString:new RegExp(`'(${this.#d("'")})'`),backtickQuotedString:new RegExp("`("+this.#d("`")+")`")};constructor(e,t){super(),this.#u=e,this.#h=new RegExp(`^(?:${e.source})`,e.flags),this.#p=t}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#h.exec(e.input.substring(t));r&&(t+=r[0].length);return r?ue.makeSuccess(t,this.#p(r),i,t):ue.makeFailure()}doToString(e,t,i,s){let r="/"+this.#u.source+"/";const n=Object.entries(we.common).find((([e,t])=>t.source===this.#u.source))?.[0];return n&&(r="P."+n),r}}class Se extends he{#n;get parser(){return this.#n}#g;get mapper(){return this.#g}constructor(e,t){super(),this.#n=e,this.#g=t}isHighlighted(e,t){if(super.isHighlighted(e,t)){const i={parent:t,parser:this.#n,index:0};e.highlighted=e.highlighted instanceof he?this.#n:i}return!1}parse(e,t,i,s){i=this.makePath(i,s);const r=this.#n.parse(e,t,i,0);return r.status&&(r.value=this.#g(r.value)),r}doToString(e,t,i,s){let r=this.#n.toString(e,t,i,0);if(this.#n instanceof we&&Object.values(we.common).includes(this.#n.regexp))return this.#n.regexp===we.common.numberInteger&&this.#g===BigInt?"P.numberBigInteger":r;let n=this.#g.toString();return(n.length>60||n.includes("\n"))&&(n="(...) => { ... }"),r+=` -> map<${n}>`,r}}class Ee extends we{static#g=e=>e;constructor(e){super(e,Ee.#g)}}class Ce extends we{constructor(e,t=0){super(e,(e=>e[t]))}}class Ne extends he{#r;get parsers(){return this.#r}constructor(...e){super(),this.#r=e}parse(e,t,i,s){i=this.makePath(i,s);const r=new Array(this.#r.length),n=ue.makeSuccess(t,r);for(let t=0;tn.bestPosition&&(n.bestParser=s.bestParser,n.bestPosition=s.bestPosition),!s.status){n.status=!1,n.value=null;break}n.value[t]=s.value,n.position=s.position}return n}doToString(e,t,i,s){const r=t+he.indentation,n="SEQ<\n"+r+this.#r.map(((t,s)=>t.toString(e,r,i,s))).join("\n"+r)+"\n"+t+">";return n}}class xe extends he{#n;get parser(){return this.#n}#b;get min(){return this.#b}#v;get max(){return this.#v}constructor(e,t=0,i=Number.POSITIVE_INFINITY){if(super(),t>i)throw new Error("Min is greater than max");this.#n=e,this.#b=t,this.#v=i}parse(e,t,i,s){i=this.makePath(i,s);const r=ue.makeSuccess(t,[],i);for(let t=0;tr.bestPosition&&(r.bestParser=s.bestParser,r.bestPosition=s.bestPosition),!s.status){te;static#y=([e,t])=>t;static#w=([e,t])=>[e,...t];static#S=e=>e instanceof Array?e.join(""):e;static number=this.reg(we.common.number).map(Number);static numberInteger=this.reg(we.common.numberInteger).map(Number);static numberBigInteger=this.reg(this.numberInteger.getParser().parser.regexp).map(BigInt);static numberNatural=this.reg(we.common.numberNatural).map(Number);static numberExponential=this.reg(we.common.numberExponential).map(Number);static numberUnit=this.reg(we.common.numberUnit).map(Number);static numberByte=this.reg(we.common.numberByte).map(Number);static whitespace=this.reg(we.common.whitespace);static whitespaceOpt=this.reg(we.common.whitespaceOpt);static whitespaceInline=this.reg(we.common.whitespaceInline);static whitespaceInlineOpt=this.reg(we.common.whitespaceInlineOpt);static whitespaceMultiline=this.reg(we.common.whitespaceMultiline);static doubleQuotedString=this.reg(we.common.doubleQuotedString,1);static singleQuotedString=this.reg(we.common.singleQuotedString,1);static backtickQuotedString=this.reg(we.common.backtickQuotedString,1);constructor(e,t=!1){this.#n=e}static#E(e){const t=[];for(;e;)t.push(e),e=e.parent;t.reverse();let i=new Map;for(let e=1;ei<=s||i>e))),i.set(t[e].current,s),t.splice(s+1,e-s),e=s):i.set(t[e].current,e)}return t[t.length-1]}getParser(){return this.#n}run(e){const t=this.#n.parse(ue.makeContext(this,e),0,ue.makePathNode(),0);return t.position!==e.length&&(t.status=!1),t}parse(e,t=!0){const i=this.run(e);if(i.status)return i.value;const s=[Math.ceil(30),Math.floor(30)],r=Pe.lineColumnFromOffset(e,i.bestPosition);let n=i.bestPosition;const a=e.replaceAll(/^(\s)+|\s{6,}|\s*?\n\s*/g,((e,t,s)=>{let r=t?"...":" ... ";return s<=i.bestPosition&&(i.bestPosition0&&(u="..."+u,c+=3),s[1]e.getParser()))))}static alt(...e){return new this(new me(...e.map((e=>e.getParser()))))}static lookahead(e){return new this(new ye(e.getParser(),ye.Type.POSITIVE_AHEAD))}static lazy(e){return new this(new fe(e))}times(e,t=e){return new Pe(new xe(this.#n,e,t))}many(){return this.times(0,Number.POSITIVE_INFINITY)}atLeast(e){return this.times(e,Number.POSITIVE_INFINITY)}atMost(e){return this.times(0,e)}opt(e=""){let t=Pe.success();return""!==e&&(t=t.map((()=>e))),Pe.alt(this,t)}sepBy(e,t=1,i=!1){let s=Pe.seq(this,Pe.seq(e,this).map(Pe.#y).atLeast(t-1),...i?[e.opt([])]:[]).map(Pe.#w);return 0===t&&(s=s.opt([])),s}skipSpace(){return Pe.seq(this,Pe.whitespaceOpt).map(Pe.#f)}map(e){return new Pe(new Se(this.#n,e))}chain(e){return new Pe(new ge(this.#n,e))}assert(e){return this.chain(((t,i,s)=>e(t,i,s)?Pe.success().map((()=>t)):Pe.failure()))}join(e=""){return this.map(Pe.#S)}label(e=""){return new Pe(new ve(this.#n,e))}toString(e="",t=!1,i=null){i instanceof Pe&&(i=i.getParser());const s=ue.makeContext(this,"");s.highlighted=i;const r=ue.makePathNode();return(t?"\n"+e:"")+this.#n.toString(s,e,r)}}class ke{static same=e=>e;static notWrapped=(e,t)=>t;static defaultWrapped=(e,t)=>`${e.#C}(${t})`;static wrap=this.defaultWrapped;static attributeSeparator=",";static keySeparator="=";static printKey=e=>e;static grammar=Pe.lazy((()=>this.createGrammar()));static unknownEntityGrammar;static unknownEntity;static attributes={};static lookbehind="";static default;static nullable=!1;static ignored=!1;static serialized=!1;static expected=!1;static inlined=!1;static quoted;static silent=!1;static trailing=!1;#N;get keys(){return this.#N??Object.keys(this)}set keys(e){this.#N=[...new Set(e)]}#C=this.constructor.lookbehind;get lookbehind(){return this.#C.trim()}set lookbehind(e){this.#C=e}#x=this.constructor.ignored;get ignored(){return this.#x}set ignored(e){this.#x=e}#P=this.constructor.inlined;get inlined(){return this.#P}set inlined(e){this.#P=e}#k;get quoted(){return this.#k??this.constructor.quoted??!1}set quoted(e){this.#k=e}#L;get trailing(){return this.#L??this.constructor.trailing??!1}set trailing(e){this.#L=e}constructor(e={}){const t=this.constructor.attributes,i=oe.mergeArrays(Object.keys(e),Object.entries(t).filter((([e,t])=>void 0!==t.default)).map((([e,t])=>e)));for(const s of i){if(void 0!==e[s]){e[s].constructor===Object&&(e[s]=new(void 0!==t[s]?t[s]:ke.unknownEntity)(e[s]));const i=t[s];if(this[s]=e[s],i?.compute){const t=i.compute(this).grammar.run(e[s].toString());t.status&&(this[s]=t.value)}continue}const i=t[s];void 0===i.default||(this[s]=i.default(i))}}static createGrammar(){return this.unknownEntityGrammar}static actualClass(){let e=this;for(;!e.name;)e=Object.getPrototypeOf(e);return e}static className(){return this.actualClass().name}static asUniqueClass(e=!1){let t=this;return(this.name.length||e)&&(t=class extends(this){},t.grammar=t.createGrammar()),t}static withLookbehind(e){const t=this.asUniqueClass();return t.lookbehind=e,t}static withDefault(e=e=>new e){const t=this.asUniqueClass();return t.default=e,t}static flagNullable(e=!0){const t=this.asUniqueClass();return t.nullable=e,t}static flagIgnored(e=!0){const t=this.asUniqueClass();return t.ignored=e,t}static flagSerialized(e=!0){const t=this.asUniqueClass();return t.serialized=e,t}static flagInlined(e=!0){const t=this.asUniqueClass();return t.inlined=e,t}static flagQuoted(e=!0){const t=this.asUniqueClass();return t.quoted=e,t}static flagSilent(e=!0){const t=this.asUniqueClass();return t.silent=e,t}static flagTrailing(e=!0){const t=this.asUniqueClass();return t.trailing=e,t}static asSerializedString(e){return`"${e.replaceAll(/(?<=(?:[^\\]|^)(?:\\\\)*?)"/g,'\\"')}"`}showProperty(e){let t=this[e];const i=t.constructor;if(i.silent&&void 0!==i.default){void 0===i["#default"]&&(i["#default"]=i.default(i));const e=i["#default"];return!t.equals(e)}return!0}listenAttribute(e,t){const i=Object.getOwnPropertyDescriptor(this,e),s=i.set;s?(i.set=e=>{s(e),t(e)},Object.defineProperties(this,{[e]:i})):i.value&&Object.defineProperties(this,{["#"+e]:{value:i.value,writable:!0,enumerable:!1},[e]:{enumerable:!0,get(){return this["#"+e]},set(i){t(i),this["#"+e]=i}}})}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i!==this.constructor;let l="",c=!0;const u=this instanceof ke?this.keys:Object.keys(this);for(const a of u){const o=this[a],u=o?.constructor;if(void 0===o||this instanceof ke&&!this.showProperty(a))continue;c?c=!1:l+=n;let h=this instanceof Array?`(${a})`:a;if(h.length&&(i.attributes[a]?.quoted||o.quoted)&&(h=`"${h}"`),o.inlined){const a="ArrayEntity"===u.className()?e=>s(`${h}${e}`):e=>s(`${h}.${e}`);l+=o.serialize(e,t,void 0,a,r,n,i.notWrapped);continue}h=s(h),h.length&&(l+=(n.includes("\n")?t:"")+h+r);let p=o?.serialize(e,t);l+=p}return this instanceof ke&&(o&&i.trailing||this.trailing)&&l.length&&(l+=n),a(this,l)}serialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){this.constructor;let o=this instanceof Array?ke.prototype.doSerialize.bind(this)(e,t,i,s,r,n,a):this.doSerialize(e,t,i,s,r,n,a);return i.serialized&&(o=ke.asSerializedString(o)),o}equals(e){if(!(e instanceof ke))return!1;const t=Object.keys(this),i=Object.keys(e),s=this.constructor.actualClass(),r=e.constructor.actualClass();if(!(t.length===i.length&&this.lookbehind==e.lookbehind&&(e instanceof s||this instanceof r)))return!1;for(let s=0;s{},toAttribute:(e,t)=>!0===e?"true":!1===e?"false":""};#A=!0;get uppercase(){return this.#A}set uppercase(e){this.#A=e}static createGrammar(){return Pe.regArray(/(true)|(True)|(false)|(False)/).map((e=>{const t=e[1]??e[2]?new this(!0):new this(!1);return t.uppercase=void 0!==(e[2]??e[4]),t})).label("BooleanEntity")}constructor(e=!1){super(),this.value=e}serialize(e=!1,t="",i=this.constructor){let s=this.value?this.#A?"True":"true":this.#A?"False":"false";return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}}class Ae{static#M=new Map;static registerElement(e,t){Ae.#M.set(e,t)}static getConstructor(e){return Ae.#M.get(e)}}class Me extends ke{static alternatives=[];static className(){let e=super.className();return this.alternatives.length&&(e+=".accepting("+this.alternatives.map((e=>e.className())).join(", ")+")"),e}static createGrammar(){const e=this.alternatives.map((e=>e.grammar));return 0==this.alternatives.length||e.includes(this.unknownEntityGrammar)?this.unknownEntityGrammar:Pe.alt(...e)}static accepting(...e){const t=this.asUniqueClass();return t.alternatives=e,t.grammar=t.createGrammar(),t}}class Ie{static numberRegexSource=Pe.number.getParser().parser.regexp.source;static separatedBy=(e,t,i=1)=>new RegExp(e+"(?:"+t+e+")"+(1===i?"*":2===i?"+":`{${i},}`));static Regex=class{static HexDigit=/[0-9a-fA-F]/;static InsideString=/(?:[^"\\]|\\.)*/;static InsideSingleQuotedString=/(?:[^'\\]|\\.)*/;static Integer=/[\-\+]?\d+(?!\d|\.)/;static Number=/[-\+]?(?:\d*\.)?\d+(?!\d|\.)/;static RealUnit=/\+?(?:0(?:\.\d+)?|1(?:\.0+)?)(?![\.\d])/;static Word=Ie.separatedBy("[a-zA-Z]","_");static Symbol=/[a-zA-Z_]\w*/;static DotSeparatedSymbols=Ie.separatedBy(this.Symbol.source,"\\.");static MultipleWordsSymbols=Ie.separatedBy(this.Symbol.source,"(?:\\.|\\ +)");static PathFragment=Ie.separatedBy(this.Symbol.source,"[\\.:]");static PathSpaceFragment=Ie.separatedBy(this.Symbol.source,"[\\.:\\ ]");static Path=new RegExp(`(?:\\/${this.PathFragment.source}){2,}`)};static null=Pe.reg(/\(\s*\)/).map((()=>null));static true=Pe.reg(/true/i).map((()=>!0));static false=Pe.reg(/false/i).map((()=>!1));static number=Pe.regArray(new RegExp(`(${Pe.number.getParser().parser.regexp.source})|(\\+?inf)|(-inf)`)).map((([e,t,i,s])=>t?Number(t):i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY));static bigInt=Pe.reg(new RegExp(Pe.number.getParser().parser.regexp.source)).map(BigInt).map((e=>void 0!==e[2]?Number.POSITIVE_INFINITY:void 0!==e[3]?Number.NEGATIVE_INFINITY:Number(e[1])));static naturalNumber=Pe.lazy((()=>Pe.reg(/\d+/).map(Number)));static string=Pe.doubleQuotedString.map((e=>oe.unescapeString(e)));static colorValue=Pe.numberByte;static word=Pe.reg(Ie.Regex.Word);static symbol=Pe.reg(Ie.Regex.Symbol);static symbolQuoted=Pe.reg(new RegExp('"('+Ie.Regex.Symbol.source+')"'),1);static attributeName=Pe.reg(Ie.Regex.DotSeparatedSymbols);static attributeNameQuoted=Pe.reg(new RegExp('"('+Ie.Regex.InsideString.source+')"'),1);static guid=Pe.reg(new RegExp(`${Ie.Regex.HexDigit.source}{32}`));static commaSeparation=Pe.reg(/\s*,\s*(?!\))/);static commaOrSpaceSeparation=Pe.reg(/\s*,\s*(?!\))|\s+/);static equalSeparation=Pe.reg(/\s*=\s*/);static hexColorChannel=Pe.reg(new RegExp(Ie.Regex.HexDigit.source+"{2}"));static getAttribute(e,[t,...i]){const s=e?.attributes?.[t];if(s){if(s.prototype instanceof Me)for(const e of s.alternatives){const t=this.getAttribute(e,i);if(t)return t}return i.length>0?this.getAttribute(s,i):s}}static createAttributeGrammar(e,t=this.attributeName,i=this.equalSeparation,s=(e,t,i)=>{}){return Pe.seq(t,i).chain((([t,i])=>{const r=t.split(ae.keysSeparator),n=this.getAttribute(e,r),a=n?n.grammar:ke.unknownEntityGrammar,o=r.length>1;return a.map((e=>t=>{oe.objectSet(t,r,e),r.reduce(((e,t,i)=>(e[t].inlined=o&&i{let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),s.trailing=void 0!==i,s})).chain((t=>{(e.lookbehind instanceof Array||e.lookbehind!==r)&&(e=e.withLookbehind(r));const s=Object.keys(t),n=Object.keys(e.attributes);return null!=i?Pe.success().assert((e=>s.filter((e=>n.includes(e))).length/n.length>=i)).map((()=>new e(t))):Pe.success().map((()=>new e(t)))}))}}class Te extends ke{static grammar=this.createGrammar();constructor(e=0){super(),this.value=e}static createGrammar(){return Pe.number.map((e=>new this(e)))}serialize(e=!1,t="",i=this.constructor){let s=this.value.toFixed(6);return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}toString(){return this.value.toString()}}class Oe extends ke{static attributes={...super.attributes,R:Te.withDefault(),G:Te.withDefault(),B:Te.withDefault(),A:Te.withDefault((e=>new e(1)))};static grammar=this.createGrammar();#I=new Te;get H(){return this.#I}set H(e){this.#I=e}#T=new Te;get S(){return this.#T}set S(e){this.#T=e}#O=new Te;get V(){return this.#O}set V(e){this.#O=e}constructor(e){super(e),e instanceof Array&&(e={R:e[0]??0,G:e[1]??0,B:e[2]??0,A:e[3]??1}),this.R,this.G,this.B,this.A,this.#D()}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,.5).label("LinearColorEntity")}static printLinearColor(e){return`${Math.round(255*e.R.valueOf())}, ${Math.round(255*e.G.valueOf())}, ${Math.round(255*e.B.valueOf())}`}static linearToSRGB(e){return e<=0?0:e>=1?1:e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}static sRGBtoLinear(e){return e<=0?0:e>=1?1:e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}static getWhite(){return new Oe({R:new Te(1),G:new Te(1),B:new Te(1)})}static getLinearColorFromHexGrammar(){const e=/[0-9a-fA-F]/;return Pe.regArray(new RegExp("#("+e.source+"{2})("+e.source+"{2})("+e.source+"{2})("+e.source+"{2})?")).map((([e,t,i,s,r])=>new this({R:parseInt(t,16)/255,G:parseInt(i,16)/255,B:parseInt(s,16)/255,A:parseInt(r??"FF",16)/255})))}static getLinearColorRGBListGrammar(){return Pe.seq(Pe.numberByte,Ie.commaSeparation,Pe.numberByte,Ie.commaSeparation,Pe.numberByte).map((([e,t,i,s,r])=>new this({R:e/255,G:i/255,B:r/255,A:1})))}static getLinearColorRGBGrammar(){return Pe.seq(Pe.reg(/rgb\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorRGBAGrammar(){return Pe.seq(Pe.reg(/rgba\s*\(\s*/),this.getLinearColorRGBListGrammar(),Pe.reg(/\s*\)/)).map((([e,t,i])=>t))}static getLinearColorFromAnyFormat(){return Pe.alt(this.getLinearColorFromHexGrammar(),this.getLinearColorRGBAGrammar(),this.getLinearColorRGBGrammar(),this.getLinearColorRGBListGrammar())}#D(){const e=this.R.value,t=this.G.value,i=this.B.value;if(oe.approximatelyEqual(e,t)&&oe.approximatelyEqual(e,i)&&oe.approximatelyEqual(t,i))return this.S.value=0,void(this.V.value=e);const s=Math.max(e,t,i),r=Math.min(e,t,i),n=s-r;let a;switch(s){case r:a=0;break;case e:a=(t-i)/n+(te.toString(16).toUpperCase().padStart(2,"0"))).join("")}toSRGBAString(){return this.toSRGBA().map((e=>e.toString(16).toUpperCase().padStart(2,"0"))).join("")}toHSVA(){return[this.H.value,this.S.value,this.V.value,this.A.value]}toNumber(){return(Math.round(255*this.R.value)<<24)+(Math.round(255*this.G.value)<<16)+(Math.round(255*this.B.value)<<8)+Math.round(255*this.A.value)}toArray(){return[this.R.value,this.G.value,this.B.value,this.A.value]}setFromRGBANumber(e){this.A.value=(255&e)/255,this.B.value=(e>>8&255)/255,this.G.value=(e>>16&255)/255,this.R.value=(e>>24&255)/255,this.#D()}setFromSRGBANumber(e){this.A.value=(255&e)/255,this.B.value=Oe.sRGBtoLinear((e>>8&255)/255),this.G.value=Oe.sRGBtoLinear((e>>16&255)/255),this.R.value=Oe.sRGBtoLinear((e>>24&255)/255),this.#D()}toString(){return Oe.printLinearColor(this)}}class De extends ke{static type;constructor(e=null){super();const t=this.constructor;e??=void 0!==t.default?t.default(t).getter:e,this.getter=e}static createGrammar(e=this.type?.grammar??Pe.lazy((()=>this.unknownEntityGrammar))){return this.type?.grammar.map((e=>new this((()=>e))))}static withDefault(e=e=>new e((()=>new e.type))){return super.withDefault(e)}static of(e){const t=this.asUniqueClass();return t.type=e,t.grammar=t.createGrammar(),t}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){return this.getter().serialize(e,t,i.type,s,r,n,a)}equals(e){return e instanceof De&&(e=e.getter?.()),this.getter?.().equals(e)}valueOf(e){return this.getter(e).valueOf()}toString(){return this.getter().toString()}}class $e extends ke{static numberRegexSource=String.raw`${Ie.numberRegexSource}(?<=(?:\.(\d*0+))?)`;static grammar=this.createGrammar();static precision;#$;get precision(){return this.constructor.precision??this.#$}set precision(e){this.#$=e}_value;get value(){return this._value}set value(e){-0===e&&(e=0),this._value=e}constructor(e=0,t=null){super(),this.value=Number(e),null!==t&&(this.#$=Number(t))}static createGrammar(){return Pe.regArray(new RegExp(`(?${this.numberRegexSource})|(?\\+?inf)|(?-inf)`)).map((({2:e,groups:{n:t,posInf:i,negInf:s}})=>new this(t?Number(t):i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,e?.length))).label("NumberEntity")}static withPrecision(e=0){const t=this.asUniqueClass();return t.precision=e,t}static printNumber(e){return e==Number.POSITIVE_INFINITY?"inf":e==Number.NEGATIVE_INFINITY?"-inf":oe.minDecimals(e)}serialize(e=!1,t="",i=this.constructor){if(this.value===Number.POSITIVE_INFINITY)return"+inf";if(this.value===Number.NEGATIVE_INFINITY)return"-inf";const s=i.precision??this.precision;let r=void 0!==s?this.value.toFixed(s):this.value.toString();return i.serialized&&(r=`"${r}"`),r}valueOf(){return this.value}toString(){return this.value.toString()}}class Ve extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault(),Z:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y,this.Z}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("VectorEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf(),this.Z.valueOf()]}}const Be=ae.paths,Re=/\/Script\/SequencerScripting\.MovieSceneScripting(.+)Channel/,Ge={A_AccentGrave:"à",Add:"Num +",C_Cedille:"ç",Decimal:"Num .",Divide:"Num /",E_AccentAigu:"é",E_AccentGrave:"è",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",Gamepad_Special_Left_X:"Touchpad Button X Axis",Gamepad_Special_Left_Y:"Touchpad Button Y Axis",Mouse2D:"Mouse XY 2D-Axis",Multiply:"Num *",Section:"§",Subtract:"Num -",Tilde:"`"},He={"Boolean::LogicAnd":"Logic AND","Boolean::LogicEq":"==","Boolean::LogicNEq":"!=","Boolean::LogicNot":"Logic NOT","Boolean::LogicOr":"Logic OR","Integer::BitAnd":"Bitwise AND","Integer::BitLShift":"Bitwise Left Shift","Integer::BitNot":"Bitwise NOT","Integer::BitOr":"Bitwise OR","Integer::BitRShift":"Bitwise Right Shift","Integer::BitXOr":"Bitwise XOR","Integer::EnumEq":"==","Integer::EnumNEq":"!=","Matrix::MatrixMultiply":"Multiply (Matrix * Matrix)","Matrix::MatrixVectorMultiply":"Multiply (Matrix * Vector4)",...Object.fromEntries(Object.entries({Add:"+",ArcCosine:"ArcCosine","ArcCosine(Degrees)":"ArcCos(D)","ArcCosine(Radians)":"ArcCos(R)",ArcSine:"ArcSine","ArcSine(Degrees)":"ArcSin(D)","ArcSine(Radians)":"ArcSin(R)","ArcTangent(Degrees)":"ArcTan(D)","ArcTangent(Radians)":"ArcTan(R)",CmpEQ:"==",CmpGE:">=",CmpGT:">",CmpLE:"<=",CmpLT:"<",CmpNEQ:"!=","Cosine(Degrees)":"Cos(D)","Cosine(Radians)":"Cos(R)",DegreesToRadians:"DegToRad",DistancePos:"Distance",Div:String.fromCharCode(247),FMod:"%",FModFast:"Modulo Fast",Length:"Len",Madd:`(A${String.fromCharCode(10799)}B)+C`,Mul:String.fromCharCode(10799),Negate:"-A",OneMinus:"1-A",PI:String.fromCharCode(960),RadiansToDegrees:"RadToDeg","Rand Float":"Random Float","Rand Integer":"Random Integer",Rand:"Random",Rcp:"Reciprocal",RSqrt:"Rcp Sqrt","Sine(Degrees)":"Sin(D)","Sine(Radians)":"Sin(R)",Subtract:"-","Tangent(Degrees)":"Tan(D)","Tangent(Radians)":"Tan(R)",TWO_PI:`2 ${String.fromCharCode(960)}`}).map((([e,t])=>["Numeric::"+e,t])))};function ze(e=""){switch(e=e.toLowerCase()){case"zero":return 0;case"one":return 1;case"two":return 2;case"three":return 3;case"four":return 4;case"five":return 5;case"six":return 6;case"seven":return 7;case"eight":return 8;case"nine":return 9}}function _e(e){let t;switch(e.getType()){case Be.addDelegate:t??="Bind Event to ";case Be.clearDelegate:t??="Unbind all Events from ";case Be.removeDelegate:return t??="Unbind Event from ",t+oe.formatStringName(e.DelegateReference?.MemberName?.toString().replace(/Delegate$/,"")??"None");case Be.asyncAction:if(e.ProxyFactoryFunctionName)return oe.formatStringName(e.ProxyFactoryFunctionName?.toString());case Be.actorBoundEvent:case Be.componentBoundEvent:return`${oe.formatStringName(e.DelegatePropertyName?.toString())} (${e.ComponentPropertyName?.toString()??"Unknown"})`;case Be.callDelegate:return`Call ${e.DelegateReference?.MemberName?.toString()??"None"}`;case Be.createDelegate:return"Create Event";case Be.customEvent:if(e.CustomFunctionName)return e.CustomFunctionName?.toString();case Be.dynamicCast:return e.TargetType?`Cast To ${e.TargetType?.getName()}`:"Bad cast node";case Be.enumLiteral:return`Literal enum ${e.Enum?.getName()}`;case Be.event:return`Event ${(e.EventReference?.MemberName?.toString()??"").replace(/^Receive/,"")}`;case Be.executionSequence:return"Sequence";case Be.forEachElementInEnum:return`For Each ${e.Enum?.getName()}`;case Be.forEachLoopWithBreak:return"For Each Loop with Break";case Be.functionEntry:return"UserConstructionScript"===e.FunctionReference?.MemberName?.toString()?"Construction Script":e.FunctionReference?.MemberName?.toString();case Be.functionResult:return"Return Node";case Be.ifThenElse:return"Branch";case Be.makeStruct:if(e.StructType)return`Make ${e.StructType.getName()}`;case Be.materialExpressionComponentMask:{const t=e.getMaterialSubobject();if(t)return`Mask ( ${ae.rgba.filter((e=>!0===t[e].getter().value)).map((e=>e+" ")).join("")})`}case Be.materialExpressionConstant:t??=[e.getCustomproperties().find((e=>"Value"==e.PinName.toString()))?.DefaultValue];case Be.materialExpressionConstant2Vector:t??=[e.getCustomproperties().find((e=>"X"==e.PinName?.toString()))?.DefaultValue,e.getCustomproperties().find((e=>"Y"==e.PinName?.toString()))?.DefaultValue];case Be.materialExpressionConstant3Vector:case Be.materialExpressionConstant4Vector:if(!t){const i=e.getCustomproperties().find((e=>"Constant"==e.PinName?.toString()))?.DefaultValue;t=i instanceof Ve?[i.X,i.Y,i.Z].map((e=>e.valueOf())):i instanceof Oe?[i.R,i.G,i.B,i.A].map((e=>e.valueOf())):[]}if(t?.length>0)return t.map((e=>oe.printExponential(e))).join(",");t=void 0;break;case Be.materialExpressionFunctionInput:{const t=e.getMaterialSubobject();return`Input ${t?.InputName??"In"} (${t?.InputType?.value.match(/^.+?_(\w+)$/)?.[1]??"Vector3"})`}case Be.materialExpressionLogarithm:return"Ln";case Be.materialExpressionLogarithm10:return"Log10";case Be.materialExpressionLogarithm2:return"Log2";case Be.materialExpressionMaterialFunctionCall:const i=e.getMaterialSubobject()?.MaterialFunction;if(i)return i.getName();break;case Be.materialExpressionSquareRoot:return"Sqrt";case Be.materialExpressionSubtract:const s=e.getMaterialSubobject();if(s)return`Subtract(${s.ConstA??"1"},${s.ConstB??"1"})`;case Be.metasoundEditorGraphExternalNode:{const t=e.ClassName?.Name;if(t)return"Add"===t?"+":t}case Be.niagaraNodeConvert:return`Make ${(e.AutowireMakeType?.ClassStructOrEnum??"").toString().match(/(?:Niagara)?(\w+)['"]*$/)?.[1]??""}`;case Be.pcgEditorGraphNodeInput:return"Input";case Be.pcgEditorGraphNodeOutput:return"Output";case Be.spawnActorFromClass:let r=e.getCustomproperties().find((e=>"ReturnValue"==e.PinName.toString()))?.PinType?.PinSubCategoryObject?.getName();return"Actor"===r&&(r=null),`SpawnActor ${oe.formatStringName(r??"NONE")}`;case Be.switchEnum:return`Switch on ${e.Enum?.getName()??"Enum"}`;case Be.switchInteger:return"Switch on Int";case Be.variableGet:return"";case Be.variableSet:return"SET"}const i=e.getClass();let s=e.switchTarget();if(s)return"E"!==s[0]&&(s=oe.formatStringName(s)),`Switch on ${s}`;if(e.isComment())return e.NodeComment.toString();const r=e.getHIDAttribute();if(r){const e=r.toString();let t=function(e){let t=Ge[e];if(t)return t;if(t=ze(e)?.toString(),t)return t;const i=e.match(/NumPad([a-zA-Z]+)/);return i&&(t=ze(i[1]).toString(),t)?"Num "+t:void 0}(e)??oe.formatStringName(e);return i===Be.inputDebugKey?t="Debug Key "+t:i===Be.getInputAxisKeyValue&&(t="Get "+t),t}if(i===Be.macro)return oe.formatStringName(e.MacroGraphReference?.getMacroName());const n=e.getMaterialSubobject();if(n){let e=_e(n);return e=e.match(/Material Expression (.+)/)?.[1]??e,e}if(e.isPcg()&&e.getPcgSubobject()){let t=e.getPcgSubobject();return t.NodeTitle?t.NodeTitle.toString():_e(t)}const a=e.getSubgraphObject();if(a)return a.Graph.getName();const o=e.getSettingsObject();if(o){if(o.ExportPath?.valueOf()?.type===Be.pcgHiGenGridSizeSettings)return`Grid Size: ${o.HiGenGridSize?.toString().match(/\d+/)?.[0]?.concat("00")??o.HiGenGridSize?.toString().match(/^\w+$/)?.[0]??"256"}`;if(o.BlueprintElementInstance)return oe.formatStringName(o.BlueprintElementType.getName());if(o.Operation){const e=o.Name?.toString().match(/PCGMetadata(\w+)Settings_\d+/);if(e)return oe.formatStringName(e[1]+": "+o.Operation)}const e=o.getSubgraphObject();if(e&&e.Graph)return e.Graph.getName()}let l,c=e.FunctionReference?.MemberName?.toString();if(c){const t=e.FunctionReference.MemberParent?.path??"";switch(c){case"AddKey":let e=t.match(Re);if(e)return`Add Key (${oe.formatStringName(e[1])})`;case"Concat_StrStr":return"Append"}const i=c.match(ae.lineTracePattern);if(i)return"Line Trace"+("Multi"===i[1]?" Multi ":" ")+(""===i[2]?"By Channel":oe.formatStringName(i[2]));switch(t){case Be.blueprintGameplayTagLibrary:case Be.kismetMathLibrary:case Be.slateBlueprintLibrary:case Be.timeManagementBlueprintLibrary:const e=c.match(/[BF]([A-Z]\w+)/);switch(e&&(c=e[1]),c){case"Abs":return"ABS";case"BooleanAND":return"AND";case"BooleanNAND":return"NAND";case"BooleanOR":return"OR";case"Exp":return"e";case"LineTraceSingle":return"Line Trace By Channel";case"Max":case"MaxInt64":return"MAX";case"Min":case"MinInt64":return"MIN";case"Not_PreBool":return"NOT";case"Sin":return"SIN";case"Sqrt":return"SQRT";case"Square":return"^2";case"CrossProduct2D":return"cross";case"Vector4_CrossProduct3":return"cross3";case"DotProduct2D":case"Vector4_DotProduct":return"dot";case"Vector4_DotProduct3":return"dot3"}if(c.startsWith("Add_"))return"+";if(c.startsWith("And_"))return"&";if(c.startsWith("Conv_"))return"";if(c.startsWith("Cross_"))return"cross";if(c.startsWith("Divide_"))return String.fromCharCode(247);if(c.startsWith("Dot_"))return"dot";if(c.startsWith("EqualEqual_"))return"==";if(c.startsWith("Greater_"))return">";if(c.startsWith("GreaterEqual_"))return">=";if(c.startsWith("Less_"))return"<";if(c.startsWith("LessEqual_"))return"<=";if(c.startsWith("Multiply_"))return String.fromCharCode(10799);if(c.startsWith("Not_"))return"~";if(c.startsWith("NotEqual_"))return"!=";if(c.startsWith("Or_"))return"|";if(c.startsWith("Percent_"))return"%";if(c.startsWith("Subtract_"))return"-";if(c.startsWith("Xor_"))return"^";break;case Be.blueprintSetLibrary:{const e=c.match(/Set_(\w+)/);if(e)return oe.formatStringName(e[1]).toUpperCase()}break;case Be.blueprintMapLibrary:{const e=c.match(/Map_(\w+)/);if(e)return oe.formatStringName(e[1]).toUpperCase()}break;case Be.kismetArrayLibrary:{const e=c.match(/Array_(\w+)/);if(e)return e[1].toUpperCase()}}return oe.formatStringName(c)}return e.OpName?He[e.OpName.toString()]??oe.formatStringName(e.OpName.toString().replaceAll(/(?:^\w+(?this.unknownEntityGrammar))){return this.inlined?e:Pe.seq(Pe.reg(/\(\s*/),e.sepBy(Ie.commaSeparation).opt(),Pe.reg(/\s*(,\s*)?\)/,1)).map((([e,t,i])=>{t=t instanceof Array?t:[];let s=this;return void 0!==i!==s.trailing&&(s=s.flagTrailing(void 0!==i)),new s(t)})).label(`ArrayEntity of ${this.type?.className()??"unknown values"}`)}static flagInlined(e=!0){const t=this.asUniqueClass();return t.inlined=e,t.grammar=t.createGrammar(),t}static of(e){const t=this.asUniqueClass();return t.type=e,t.grammar=t.createGrammar(),t}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){if(i.inlined)return super.serialize.bind(this.values,e,t,i,s,r,n,a)();let o=this.values.map((t=>t?.serialize(e))).join(i.attributeSeparator);return this.trailing&&(o+=i.attributeSeparator),`(${o})`}valueOf(){return this.values}equals(e){if(!(e instanceof Fe)||this.values.length!==e.values.length)return!1;for(let t=0;tje=e.default)).catch():je=window.crypto;class Ue extends ke{static grammar=this.createGrammar();static generateGuid(){let e=new Uint32Array(4);je.getRandomValues(e);let t="";return e.forEach((e=>{t+=("0".repeat(8)+e.toString(16).toUpperCase()).slice(-8)})),t}constructor(e=Ue.generateGuid()){super(),this.value=e}static createGrammar(){return Pe.reg(/[0-9A-F]{32}/i).map((e=>new this(e))).label("GuidEntity")}serialize(e=!1,t="",i=this.constructor){let s=this.value;return i.serialized&&(s=`"${s}"`),s}toString(){return this.value}}class Ke extends $e{static grammar=this.createGrammar();get value(){return super.value}set value(e){(e=Math.trunc(e))>=1<<31&&e<-(1<<31)&&(e=Math.floor(e),super.value=e)}static createGrammar(){return Pe.numberInteger.map((e=>new this(e)))}}class Ye extends Ke{static grammar=this.createGrammar();get value(){return super.value}set value(e){e=Math.round(oe.clamp(e,0)),super.value=e}static createGrammar(){return Pe.numberNatural.map((e=>new this(e)))}}const qe={Any:n``,"Any[]":n``,audio:n``,blue:n``,bool:n``,byte:n``,class:n``,default:n``,delegate:n``,enum:n``,exec:n``,float:n``,green:n``,int:n``,int32:n``,int64:n``,interface:n``,name:n``,object:n``,Param:n``,"Param[]":n``,Point:n``,"Point[]":n``,real:n``,red:n``,string:n``,struct:n``,Surface:n``,"Surface[]":n``,text:n``,time:n``,Volume:n``,"Volume[]":n``,wildcard:n``,[ae.paths.linearColor]:n``,[ae.paths.niagaraBool]:n``,[ae.paths.niagaraDataInterfaceCollisionQuery]:n``,[ae.paths.niagaraDataInterfaceCurlNoise]:n``,[ae.paths.niagaraDataInterfaceVolumeTexture]:n``,[ae.paths.niagaraFloat]:n``,[ae.paths.niagaraInt32]:n``,[ae.paths.niagaraPosition]:n``,[ae.paths.quat4f]:n``,[ae.paths.rotator]:n``,[ae.paths.transform]:n``,[ae.paths.vector]:n``,[ae.paths.vector2f]:n``,[ae.paths.vector3f]:n``,[ae.paths.vector4f]:n``},Xe=n``;function Ze(e){let t,i=e.PinFriendlyName?e.PinFriendlyName.toString():oe.formatStringName(e.PinName?.toString()??"");return(t=e.PinToolTip?.toString().match(/\s*(.+?(?=\n)|.+\S)\s*/))&&t[1].toLowerCase()===i.toLowerCase()?t[1]:(i=i.replace(/^Module\./,""),i)}class We extends Ke{static grammar=this.createGrammar();get value(){return super.value}set value(e){(e=Math.trunc(e))>=0&&e<256&&(super.value=e)}createGrammar(){return Pe.numberByte.map((e=>new this(e)))}}class Qe extends ke{static grammar=this.createGrammar();static escapedCharacters=/['"\\]/g;static unescapedBackslash=/(?<=(?:[^\\]|^)(?:\\\\)*)\\(?!\\)/;constructor(e=""){super(),this.value=e}static createGrammar(){return Pe.doubleQuotedString.map((e=>new this(Qe.unescape(e)))).label("StringEntity")}static escape(e,t=!0){let i=e.replaceAll(new RegExp(`(${Qe.escapedCharacters.source})`,"g"),"\\$1");return t&&(i=i.replaceAll("\n","\\n").replaceAll("\t","\\t")),i}static unescape(e){return e.replaceAll(new RegExp(Qe.unescapedBackslash.source+"t","g"),"\t").replaceAll(new RegExp(Qe.unescapedBackslash.source+"n","g"),"\n").replaceAll(new RegExp(`\\\\(${Qe.escapedCharacters.source})`,"g"),"$1")}doSerialize(e=!1){let t=`"${Qe.escape(this.value)}"`;return e&&(t=Qe.escape(t,!1)),t}valueOf(){return this.value}toString(){return this.value}}class Je extends ke{static grammar=this.createGrammar();static f;static createGrammar(){return Qe.grammar}static from(e){const t=this.asUniqueClass();return t.f=e,t}static compute(e){return this.f(e)}}class et extends ke{static attributeConverter={fromAttribute:(e,t)=>new this(e),toAttribute:(e,t)=>e.toString()};static grammar=this.createGrammar();static createGrammar(){return Ie.symbol.map((e=>new this(e))).label("SymbolEntity")}constructor(e=""){super(),this.value=e}serialize(e=!1,t="",i=this.constructor){let s=this.value;return i.serialized&&(s=`"${s}"`),s}toString(){return this.value}}class tt extends et{static grammar=this.createGrammar();static createGrammar(){return Ie.symbol.map((e=>new this(e)))}}class it extends tt{static grammar=this.createGrammar();static createGrammar(){return Pe.reg(Ie.Regex.InsideString).map((e=>new this(e)))}}class st extends ke{static lookbehind="INVTEXT";static grammar=this.createGrammar();constructor(e=""){super(),this.value=e}static createGrammar(){return Pe.alt(Pe.seq(Pe.reg(new RegExp(`${this.lookbehind}\\s*\\(`)),Pe.doubleQuotedString,Pe.reg(/\s*\)/)).map((([e,t,i])=>t)),Pe.reg(new RegExp(this.lookbehind)).map((()=>""))).map((e=>new this(e))).label("InvariantTextEntity")}doSerialize(){return this.lookbehind+'("'+this.value+'")'}valueOf(){return this.value}toString(){return this.value}}class rt extends ke{static attributeSeparator=", ";static printKey=e=>"";static lookbehind="NSLOCTEXT";static attributes={...super.attributes,namespace:Qe.withDefault(),key:Qe.withDefault(),value:Qe.withDefault()};static grammar=this.createGrammar();constructor(e={}){super(e),this.namespace,this.key,this.value}static createGrammar(){return Pe.regArray(new RegExp(String.raw`${rt.lookbehind}\s*\(`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*,`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*,`+String.raw`\s*"(?${Ie.Regex.InsideString.source})"\s*`+String.raw`(?,\s+)?`+String.raw`\)`,"m")).map((({groups:{namespace:e,key:t,value:i,trailing:s}})=>new this({namespace:new this.attributes.namespace(oe.unescapeString(e)),key:new this.attributes.namespace(oe.unescapeString(t)),value:new this.attributes.namespace(oe.unescapeString(i)),trailing:void 0!==s}))).label("LocalizedTextEntity")}toString(){return oe.capitalFirstLetter(this.value.valueOf())}}class nt extends ke{static attributeSeparator=", ";static lookbehind=["LOCGEN_FORMAT_NAMED","LOCGEN_FORMAT_ORDERED"];static grammar=this.createGrammar();constructor(e){super(),this.values=e}static createGrammar(){return Pe.lazy((()=>Pe.seq(Pe.reg(new RegExp(String.raw`(${this.lookbehind.join("|")})\s*\(\s*`),1),Pe.alt(...[Qe,rt,st,nt].map((e=>e.grammar))).sepBy(Pe.reg(/\s*\,\s*/)),Pe.reg(/\s*\)/)).map((([e,t])=>{const i=new this(t);return i.lookbehind=e,i})))).label("FormatTextEntity")}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i.attributeSeparator;return this.lookbehind+"("+this.values.map((t=>t.serialize(e))).join(o)+(i.trailing?o:"")+")"}toString(){const e=this.values?.[0]?.toString();if(!e)return"";const t=this.values.slice(1).map((e=>e?.valueOf()));return"LOCGEN_FORMAT_NAMED"==this.lookbehind?e.replaceAll(/\{([a-zA-Z]\w*)\}/g,((e,i)=>{const s=t.indexOf(i)+1;return s>0&&s{const s=Number(i);return s=-(1n<<63n)&&e<1n<<63n&&(this._value=e)}constructor(e=0n){super(),this.value=BigInt(e)}static createGrammar(){return Pe.numberBigInteger.map((e=>new this(e)))}serialize(e=!1,t="",i=this.constructor){let s=this.value.toString();return i.serialized&&(s=`"${s}"`),s}valueOf(){return this.value}toString(){return this.value.toString()}}class ot extends ke{static typeReference=Pe.reg(new RegExp(Ie.Regex.Path.source+"|"+Ie.symbol.getParser().regexp.source));static fullReferenceGrammar=this.createFullReferenceGrammar();static grammar=this.createGrammar();#c;get type(){return this.#c}set type(e){this.#c=e}#V;get path(){return this.#V}set path(e){this.#B="",this.#V=e}#R;get full(){return this.#R}set full(e){this.#R=e}#B="";constructor(e="None",t="",i=(e.includes("/")||t?(e,t)=>`"${e+(t?`'${t}'`:"")}"`:(e,t)=>e)){super(),this.#c=e,this.#V=t,this.#R=i}static createGrammar(){return Pe.alt(this.createFullReferenceSerializedGrammar(),this.createFullReferenceGrammar(),this.createTypeReferenceGrammar()).label("ObjectReferenceEntity")}static createFullReferenceGrammar(){return Pe.regArray(new RegExp("("+this.typeReference.getParser().regexp.source+")(?:"+`'"(${Ie.Regex.InsideString.source})"'|`+`'(${Ie.Regex.InsideSingleQuotedString.source})')`)).map((([e,t,i,s])=>{let r=!!i,n=r?["'\"","\"'"]:["'","'"];return new this(t,r?i:s,((e,t)=>e+n[0]+t+n[1]))}))}static createFullReferenceSerializedGrammar(){return Pe.regArray(new RegExp('"('+Ie.Regex.InsideString.source+"?)(?:'("+Ie.Regex.InsideSingleQuotedString.source+"?)')?\"")).map((([e,t,i])=>new this(t,i,((e,t)=>`"${e}${t?`'${t}'`:""}"`))))}static createTypeReferenceGrammar(){return this.typeReference.map((e=>new this(e,"",((e,t)=>e))))}static createNoneInstance(){return new this("None")}getName(e=!1){return this.#B?this.#B:e?oe.getNameFromPath(this.path.replace(/_C$/,""),e):this.#B=oe.getNameFromPath(this.path.replace(/_C$/,""),e)}doSerialize(e=!1){let t=this.full(this.type,this.path);return e&&(t=oe.escapeString(t,!1)),t}equals(e){return e instanceof ot&&(this.type==e.type&&this.path==e.path)}toString(){return this.full(this.type,this.path)}}class lt extends ke{static grammar=this.createGrammar();constructor(e=null,t=null){super(),this.objectName=e,this.pinGuid=t}static createGrammar(){return Pe.seq(et.grammar,Pe.whitespace,Ue.grammar).map((([e,t,i])=>new this(e,i))).label("PinReferenceEntity")}doSerialize(){return this.objectName.serialize()+" "+this.pinGuid.serialize()}}class ct extends ke{static attributes={...super.attributes,MemberParent:ot,MemberName:Qe,MemberGuid:Ue};static grammar=this.createGrammar();constructor(e){super(e),this.MemberParent,this.MemberName,this.MemberGuid}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,0,0)}}class ut extends ke{static attributes={...super.attributes,PinCategory:Qe.withDefault(),PinSubCategory:Qe,PinSubCategoryObject:ot,PinSubCategoryMemberReference:ct,ContainerType:et,bIsReference:Le,bIsConst:Le,bIsWeakPointer:Le,bIsUObjectWrapper:Le,bSerializeAsSinglePrecisionFloat:Le};static grammar=this.createGrammar();constructor(e={}){super(e),this.PinCategory,this.PinSubCategory,this.PinSubCategoryObject,this.PinSubCategoryMemberReference,this.ContainerType,this.bIsReference,this.bIsConst,this.bIsWeakPointer,this.bIsUObjectWrapper,this.bIsUObjectWrapper,this.bSerializeAsSinglePrecisionFloat}static createGrammar(){return Ie.createEntityGrammar(this).label("PinTypeEntity")}copyTypeFrom(e){for(const t of this.keys)void 0!==e[t]&&(this[t]=e[t])}}class ht extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("Vector2DEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf()]}}class pt extends ht{static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(/X\s*=\s*/.source+"(?"+Ie.numberRegexSource+")\\s+"+/Y\s*=\s*/.source+"(?"+Ie.numberRegexSource+")")).map((({groups:{x:e,y:t}})=>new this({X:new ht.attributes.X(e),Y:new ht.attributes.Y(t)}))),ht.grammar.map((e=>new this({X:e.X,Y:e.Y})))).label("RBSerializationVector2DEntity")}}class dt extends ke{static attributes={...super.attributes,R:$e.withDefault(),P:$e.withDefault(),Y:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.R,this.P,this.Y}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("RotatorEntity")}getRoll(){return this.R}getPitch(){return this.P}getYaw(){return this.Y}}class mt extends dt{static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`)).map((([e,t,i,s,r,n,a])=>new this({R:new dt.attributes.R(n,a?.length),P:new dt.attributes.P(t,i?.length),Y:new dt.attributes.Y(s,r?.length)}))),dt.grammar.map((e=>new this({R:e.R,P:e.P,Y:e.Y})))).label("SimpleSerializationRotatorEntity")}doSerialize(){const e=this.constructor.attributeSeparator;return this.P.serialize()+e+this.Y.serialize()+e+this.R.serialize()+(this.trailing?e:"")}}class gt extends ht{static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`)).map((([e,t,i,s,r])=>new this({X:new ht.attributes.X(t,i?.length),Y:new ht.attributes.Y(s,r?.length)}))),ht.grammar.map((e=>new this({X:e.X,Y:e.Y})))).label("SimpleSerializationVector2DEntity")}doSerialize(){const e=this.constructor.attributeSeparator;return this.X.serialize()+e+this.Y.serialize()+(this.trailing?e:"")}}class bt extends ke{static attributes={...super.attributes,X:$e.withDefault(),Y:$e.withDefault(),Z:$e.withDefault(),W:$e.withDefault()};static grammar=this.createGrammar();constructor(e){super(e),this.X,this.Y,this.Z,this.W}static createGrammar(){return Ie.createEntityGrammar(this,Ie.commaSeparation,1).label("Vector4DEntity")}toArray(){return[this.X.valueOf(),this.Y.valueOf(),this.Z.valueOf(),this.W.valueOf()]}}class vt extends bt{static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`+String.raw`\s*,\s*`+`(${Ie.numberRegexSource})`)).map((([e,t,i,s,r])=>new this({X:new bt.attributes.X(t),Y:new bt.attributes.Y(i),Z:new bt.attributes.Z(s),W:new bt.attributes.W(r)}))),bt.grammar)}}class ft extends Ve{static allowShortSerialization=!1;static attributeSeparator=", ";static grammar=this.createGrammar();static createGrammar(){return Pe.alt(Pe.regArray(new RegExp(`(${$e.numberRegexSource})`+(this.allowShortSerialization?"(?:":"")+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+String.raw`\s*,\s*`+`(${$e.numberRegexSource})`+(this.allowShortSerialization?")?":""))).map((([e,t,i,s,r,n,a])=>new this({X:new Ve.attributes.X(t,i?.length),Y:new Ve.attributes.Y(s,r?.length),Z:new Ve.attributes.Z(n,a?.length)}))),Ve.grammar.map((e=>new this({X:e.X,Y:e.Y,Z:e.Z}))))}static flagAllowShortSerialization(e=!0){const t=this.asUniqueClass();return e!==t.allowShortSerialization&&(t.allowShortSerialization=e,t.grammar=t.createGrammar()),t}doSerialize(){const e=this.constructor.attributeSeparator;return this.X.serialize()+e+this.Y.serialize()+e+this.Z.serialize()+(this.trailing?e:"")}}class yt extends ke{static lookbehind="Pin";static#G={bool:Le,byte:We,enum:tt,exec:Qe,float:$e,int:Ke,int64:at,name:Qe,real:$e,string:Qe,[ae.paths.linearColor]:Oe,[ae.paths.niagaraBool]:Le,[ae.paths.niagaraFloat]:$e,[ae.paths.niagaraPosition]:Ve,[ae.paths.rotator]:dt,[ae.paths.vector]:Ve,[ae.paths.vector2D]:ht,[ae.paths.vector4f]:bt};static#H={enum:it,rg:pt,[ae.paths.niagaraPosition]:ft.flagAllowShortSerialization(),[ae.paths.rotator]:mt,[ae.paths.vector]:ft,[ae.paths.vector2D]:gt,[ae.paths.vector3f]:ft,[ae.paths.vector4f]:vt};static attributes={PinId:Ue.withDefault(),PinName:Qe.withDefault(),PinFriendlyName:Me.accepting(rt,nt,st,Qe),PinToolTip:Qe,Direction:Qe,PinType:ut.withDefault().flagInlined(),LinkedTo:Fe.of(lt).withDefault().flagSilent(),SubPins:Fe.of(lt),ParentPin:lt,DefaultValue:Je.from((e=>e.getEntityType(!0)?.flagSerialized()??Qe)),AutogeneratedDefaultValue:Qe,DefaultObject:ot,PersistentGuid:Ue,bHidden:Le,bNotConnectable:Le,bDefaultValueIsReadOnly:Le,bDefaultValueIsIgnored:Le,bAdvancedView:Le,bOrphanedPin:Le};static grammar=this.createGrammar();#z=!1;set recomputesNodeTitleOnChange(e){this.#z=e}get recomputesNodeTitleOnChange(){return this.#z}#_=null;get objectEntity(){try{return this.#_}catch(e){return null}}set objectEntity(e){this.#_=e}#F;get pinIndex(){return this.#F}set pinIndex(e){this.#F=e}constructor(e={}){super(e),this.PinId,this.PinName,this.PinFriendlyName,this.PinToolTip,this.Direction,this.PinType,this.LinkedTo,this.DefaultValue,this.AutogeneratedDefaultValue,this.DefaultObject,this.PersistentGuid,this.bHidden,this.bNotConnectable,this.bDefaultValueIsReadOnly,this.bDefaultValueIsIgnored,this.bAdvancedView,this.bOrphanedPin,this.objectEntity}static createGrammar(){return Ie.createEntityGrammar(this)}static fromLegacyObject(e){return new yt(e)}getType(){const e=this.PinType.PinCategory?.toString().toLocaleLowerCase();if(["struct","class","object","type","statictype"].includes(e))return this.PinType.PinSubCategoryObject?.path;if(this.isEnum())return"enum";if(this.objectEntity?.isPcg()){const e=this.objectEntity.getPcgSubobject(),t=this.isInput()?e.InputPins?.valueOf()[this.pinIndex]:e.OutputPins?.valueOf()[this.pinIndex];if(t){const i=e[ae.subObjectAttributeNameFromReference(t,!0)];let s=i.Properties?.AllowedTypes?.toString()??"";if(""==s&&(s=this.PinType.PinCategory??"",""==s&&(s="Any")),s)return!1!==i.Properties.bAllowMultipleData?.valueOf()&&!1!==i.Properties.bAllowMultipleConnections?.valueOf()&&(s+="[]"),s}}if("optional"===e){const e=this.PinType.PinSubCategory?.toString();switch(e){case"red":return"real";case"rg":return"rg";case"rgb":return ae.paths.vector;case"rgba":return ae.paths.linearColor;default:return e}}return e}getEntityType(e=!1){const t=this.getType(),i=yt.#G[t],s=yt.#H[t];return e&&void 0!==s?s:i}pinTitle(){return Ze(this)}copyTypeFrom(e){this.PinType=e.PinType}getDefaultValue(e=!1){return void 0===this.DefaultValue&&e&&(this.DefaultValue=new(this.getEntityType(!0))),this.DefaultValue}isEnum(){const e=this.PinType.PinSubCategoryObject?.type;return e===ae.paths.enum||e===ae.paths.userDefinedEnum||"enum"===e?.toLowerCase()}isExecution(){return"exec"===this.PinType.PinCategory.toString()||this.getType()===ae.paths.niagaraParameterMap}isHidden(){return this.bHidden?.valueOf()}isInput(){return!this.isHidden()&&"EGPD_Output"!=this.Direction?.toString()}isOutput(){return!this.isHidden()&&"EGPD_Output"==this.Direction?.toString()}isLinked(){return this.LinkedTo?.length>0}linkTo(e,t){const i=this.LinkedTo.values?.some((i=>i.objectName.toString()==e&&i.pinGuid.toString()==t.PinId.toString()));return!i&&(this.LinkedTo.values.push(new lt(new et(e),t.PinId)),!0)}unlinkFrom(e,t){const i=this.LinkedTo.values?.findIndex((i=>i.objectName.toString()==e&&i.pinGuid.toString()==t.PinId.toString()));return i>=0&&(this.LinkedTo.values.splice(i,1),0===this.LinkedTo.length&&void 0===yt.attributes.LinkedTo.default&&(this.LinkedTo.values=[]),!0)}getSubCategory(){return this.PinType.PinSubCategoryObject?.path}pinColor(){return function(e){if("mask"===e.PinType.PinCategory?.toString()){const t=qe[e.PinType.PinSubCategory?.toString()];if(t)return t}else if("optional"===e.PinType.PinCategory?.toString())return Xe;const t=e.getType();return qe[t]??qe[e.PinType.PinCategory?.toString().toLowerCase()]??(t.startsWith("/Script/Niagara.")?qe.struct:qe.default)}(this)}}const wt=e=>e.PinName?.toString().match(/^\s*([A-Z])\s*$/)?.[1]?.charCodeAt(0)-"A".charCodeAt(0);class St extends ke{static attributes={...super.attributes,MacroGraph:ot,GraphBlueprint:ot,GraphGuid:Ue};static grammar=this.createGrammar();constructor(e){super(e),this.MacroGraph,this.GraphBlueprint,this.GraphGuid}static createGrammar(){return Ie.createEntityGrammar(this)}getMacroName(){const e=this.MacroGraph.path.search(":");return this.MacroGraph.path.substring(e+1)}}class Et extends ke{static grammar=this.createGrammar();static createGrammar(){return Pe.reg(new RegExp(String.raw`\(${Pe.whitespaceInlineOpt.getParser().regexp.source}\)`)).map((e=>new this)).label("NullEntity")}serialize(e=!1,t="",i=this.constructor){let s="()";return i.serialized&&(s=`"${s}"`),s}}class Ct extends ke{static attributes={...super.attributes,ScriptVariable:ot,OriginalChangeId:Ue};static grammar=this.createGrammar();constructor(e={}){super(e),this.ScriptVariable,this.OriginalChangeId}static createGrammar(){return Ie.createEntityGrammar(this).label("ScriptVariableEntity")}}class Nt extends yt{static attributes={...super.attributes,PinId:Ue};static grammar=this.createGrammar();static createGrammar(){return Pe.seq(Pe.reg(new RegExp(`(${Ie.Regex.Symbol.source}\\s*)?\\(\\s*`),1),Ie.createAttributeGrammar(this).sepBy(Ie.commaSeparation),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{e??="";let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),new this(s)})).label("UnknownPinEntity")}}class xt extends ke{static attributes={...super.attributes,MemberScope:Qe,MemberName:Qe.withDefault(),MemberGuid:Ue,bSelfContext:Le};static grammar=this.createGrammar();constructor(e){super(e),this.MemberScope,this.MemberName,this.MemberGuid,this.bSelfContext}static createGrammar(){return Ie.createEntityGrammar(this).label("VariableReferenceEntity")}}class Pt extends ke{#j=!1;get exported(){return this.#j}set exported(e){this.#j=e}static#U=/^(\w+?)(?:_(\d+))?$/;static printKey=e=>e.startsWith(ae.subObjectAttributeNamePrefix)?"":e;static attributeSeparator="\n";static wrap=this.notWrapped;static trailing=!0;static attributes={...super.attributes,Class:ot,Name:Qe,Archetype:ot,ExportPath:De.of(ot),ObjectRef:ot,BlueprintElementType:ot,BlueprintElementInstance:ot,ConstA:De.of($e),ConstB:De.of($e),PinTags:Fe.of(Et).flagInlined(),PinNames:Fe.of(Qe).flagInlined(),AxisKey:et,InputAxisKey:et,InputName:Qe,InputType:et,NumAdditionalInputs:Ye,bIsPureFunc:Le,bIsConstFunc:Le,bIsCaseSensitive:Le,VariableReference:xt,SelfContextInfo:et,DelegatePropertyName:Qe,DelegateOwnerClass:ot,ComponentPropertyName:Qe,EventReference:ct,FunctionReference:ct,FunctionScript:ot,CustomFunctionName:Qe,TargetType:ot,MacroGraphReference:St,Enum:ot,EnumEntries:Fe.of(Qe).flagInlined(),InputKey:et,OpName:Qe,CachedChangeId:Ue,FunctionDisplayName:Qe,AddedPins:Fe.of(Nt).withDefault().flagInlined().flagSilent(),ChangeId:Ue,MaterialFunction:ot,bOverrideFunction:Le,bInternalEvent:Le,bConsumeInput:Le,bExecuteWhenPaused:Le,bOverrideParentBinding:Le,bControl:Le,bAlt:Le,bShift:Le,bCommand:Le,CommentColor:Oe,bCommentBubbleVisible_InDetailsPanel:Le,bColorCommentBubble:Le,ProxyFactoryFunctionName:Qe,ProxyFactoryClass:ot,ProxyClass:ot,StructType:ot,MaterialExpression:ot,MaterialExpressionComment:ot,MoveMode:et,TimelineName:Qe,TimelineGuid:Ue,SizeX:De.of(Ke),SizeY:De.of(Ke),Text:De.of(Qe),ParameterName:Qe,ExpressionGUID:Ue,MaterialExpressionEditorX:De.of(Ke),MaterialExpressionEditorY:De.of(Ke),MaterialExpressionGuid:Ue,NodeTitle:Qe,NodeTitleColor:Oe,PositionX:De.of(Ke),PositionY:De.of(Ke),SettingsInterface:ot,PCGNode:ot,HiGenGridSize:et,Operation:et,NodePosX:Ke,NodePosY:Ke,NodeHeight:Ke,NodeWidth:Ke,Graph:ot,SubgraphInstance:Qe,InputPins:Fe.of(ot).flagInlined(),OutputPins:Fe.of(ot).flagInlined(),bExposeToLibrary:Le,bCanRenameNode:Le,bCommentBubblePinned:Le,bCommentBubbleVisible:Le,NodeComment:Qe,AdvancedPinDisplay:et,DelegateReference:xt,EnabledState:et,NodeGuid:Ue,ErrorType:Ke,ErrorMsg:Qe,ScriptVariables:Fe.flagInlined().of(Ct),Node:De.of(ot),ExportedNodes:Qe,CustomProperties:Fe.of(Me.accepting(yt,Nt)).withDefault().flagSilent()};static customPropertyGrammar=Pe.seq(Pe.reg(/CustomProperties\s+/),this.attributes.CustomProperties.type.grammar).map((([e,t])=>e=>{(e.CustomProperties??=new this.attributes.CustomProperties).values.push(t)}));static inlinedArrayEntryGrammar=Pe.seq(Pe.alt(Ie.symbolQuoted.map((e=>[e,!0])),Ie.symbol.map((e=>[e,!1]))),Pe.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`),1).map(Number)).chain((([[e,t],i])=>(this.attributes[e]?.grammar??ke.unknownEntityGrammar).map((s=>r=>{if(void 0===r[e]){let i=Fe;t!=i.quoted&&(i=i.flagQuoted(t)),i.inlined||(i=i.flagInlined()),r[e]=new i}r[e].values[i]=s}))));static grammar=this.createGrammar();static grammarMultipleObjects=Pe.seq(Pe.whitespaceOpt,this.grammar,Pe.seq(Pe.whitespace,this.grammar).map((([e,t])=>t)).many(),Pe.whitespaceOpt).map((([e,t,i,s])=>[t,...i]));constructor(e={}){if("NodePosX"in e!="NodePosY"in e){const t=Object.entries(e),[i,s]="NodePosX"in e?["NodePosY",Object.keys(e).indexOf("NodePosX")+1]:["NodePosX",Object.keys(e).indexOf("NodePosY")];t.splice(s,0,[i,new Ke(0)]),e=Object.fromEntries(t)}super(e),this.CustomProperties,this.AddedPins,this.AdvancedPinDisplay,this.Archetype,this.AxisKey,this.bIsPureFunc,this.BlueprintElementInstance,this.BlueprintElementType,this.Class,this.CommentColor,this.ComponentPropertyName,this.ConstA,this.ConstB,this.CustomFunctionName,this.DelegatePropertyName,this.DelegateReference,this.EnabledState,this.Enum,this.EnumEntries,this.EventReference,this.ExportedNodes,this.ExportPath,this.FunctionDisplayName,this.FunctionReference,this.FunctionScript,this.Graph,this.HiGenGridSize,this.InputAxisKey,this.InputKey,this.InputName,this.InputPins,this.InputType,this.MacroGraphReference,this.MaterialExpression,this.MaterialExpressionComment,this.MaterialExpressionEditorX,this.MaterialExpressionEditorY,this.MaterialFunction,this.Name,this.Node,this.NodeComment,this.NodeHeight,this.NodePosX,this.NodePosY,this.NodeTitle,this.NodeTitleColor,this.NodeWidth,this.NumAdditionalInputs,this.ObjectRef,this.Operation,this.OpName,this.OutputPins,this.ParameterName,this.PCGNode,this.PinNames,this.PinTags,this.PositionX,this.PositionY,this.ProxyFactoryFunctionName,this.ScriptVariables,this.SettingsInterface,this.SizeX,this.SizeY,this.StructType,this.SubgraphInstance,this.TargetType,this.Text,this.Text,this.VariableReference,this.Pins instanceof Fe&&this.Pins.valueOf().forEach((e=>{const t=this[ae.subObjectAttributeNameFromReference(e,!0)];if(t){const e=yt.fromLegacyObject(t);e.LinkedTo=new yt.attributes.LinkedTo,this.getCustomproperties(!0).push(e),this.CustomProperties.ignored=!0}}));const t=this.getMaterialSubobject();if(t){const e=t;if(void 0!==e.SizeX&&(e.SizeX.getter=()=>this.NodeWidth),e.SizeY&&(e.SizeY.getter=()=>this.NodeHeight),e.Text&&(e.Text.getter=()=>this.NodeComment),e.MaterialExpressionEditorX&&(e.MaterialExpressionEditorX.getter=()=>this.NodePosX),e.MaterialExpressionEditorY&&(e.MaterialExpressionEditorY.getter=()=>this.NodePosY),this.getType()===ae.paths.materialExpressionComponentMask){const t=ae.rgba.map((e=>{const t=this.getPinEntities().find((t=>t.PinName.toString()===e));return t.recomputesNodeTitleOnChange=!0,t}));e.keys=[...ae.rgba,...e.keys];const i=De.of(Le).withDefault().flagSilent();e.R=new i((()=>t[0].DefaultValue)),e.G=new i((()=>t[1].DefaultValue)),e.B=new i((()=>t[2].DefaultValue)),e.A=new i((()=>t[3].DefaultValue))}else if(this.getType()===ae.paths.materialExpressionSubtract){const t=De.of($e.withPrecision(6)).withDefault((()=>new De((()=>new $e(1))))).flagSilent(),i=this.getCustomproperties().find((e=>"A"===e.PinName?.toString())),s=this.getCustomproperties().find((e=>"B"===e.PinName?.toString()));(i||s)&&(e.keys=["ConstA","ConstB",...e.keys],i&&(i.recomputesNodeTitleOnChange=!0,e.ConstA=new t((()=>i.DefaultValue))),s&&(s.recomputesNodeTitleOnChange=!0,e.ConstB=new t((()=>s.DefaultValue))))}}const i=this.getPcgSubobject();i&&(i.PositionX&&(i.PositionX.getter=()=>this.NodePosX),i.PositionY&&(i.PositionY.getter=()=>this.NodePosY),i.getSubobjects().forEach((e=>{if(void 0!==e.Node){const t=e.Node.getter();t.type===this.PCGNode.type&&t.path===`${this.Name}.${this.PCGNode.path}`&&(e.Node.getter=()=>new ot(this.PCGNode.type,`${this.Name}.${this.PCGNode.path}`,t.full))}})));let s=0,r=0;this.getCustomproperties().forEach(((e,t)=>{e.objectEntity=this,e.pinIndex=e.isInput()?s++:e.isOutput()?r++:t})),this.mirrorNameInExportPaths()}static createGrammar(){return Pe.seq(Pe.reg(/Begin +Object/),Pe.seq(Pe.whitespace,Pe.alt(this.createSubObjectGrammar(),this.customPropertyGrammar,Ie.createAttributeGrammar(this,Pe.reg(Ie.Regex.MultipleWordsSymbols)),Ie.createAttributeGrammar(this,Ie.attributeNameQuoted,void 0,((e,t,i)=>{oe.objectSet(e,[...t,"quoted"],!0)})),this.inlinedArrayEntryGrammar)).map((([e,t])=>t)).many(),Pe.reg(/\s+End +Object/)).map((([e,t,i])=>{const s={};return t.forEach((e=>e(s))),new this(s)})).label("ObjectEntity")}static createSubObjectGrammar(){return Pe.lazy((()=>this.grammar)).map((e=>t=>{e.trailing=!1,t[ae.subObjectAttributeNameFromEntity(e)]=e}))}mirrorNameInExportPaths(e=this.Name?.toString()){if(!e)return;const t=[this];for(let i=0;i{const t=n.valueOf();return new r.type(t.type,t.path.replace(e,this.Name?.toString()??""),t.full)}))}}#K;getClass(){if(!this.#K&&(this.#K=(this.Class?.path?this.Class.path:this.Class?.type)??this.ExportPath?.valueOf()?.type??"",this.#K&&!this.#K.startsWith("/"))){let e=Object.values(ae.paths).find((e=>e.endsWith("."+this.#K)));e&&(this.#K=e)}return this.#K}getType(){const e=this.MacroGraphReference?.MacroGraph?.path;return e||(this.MaterialExpression?this.MaterialExpression.type:this.getClass())}getObjectName(e=!1){return e?this.getNameAndCounter()[0]:this.Name.toString()}getNameAndCounter(){const e=this.getObjectName().match(Pt.#U);return e?[e[1]??"",parseInt(e[2]??"0")]:["",0]}getCounter(){return this.getNameAndCounter()[1]}getNodeWidth(){return this.NodeWidth??this.isComment()?ae.defaultCommentWidth:void 0}setNodeWidth(e){this.NodeWidth||(this.NodeWidth=new Ke),this.NodeWidth.value=e}getNodeHeight(){return this.NodeHeight??this.isComment()?ae.defaultCommentHeight:void 0}setNodeHeight(e){this.NodeHeight||(this.NodeHeight=new Ke),this.NodeHeight.value=e}getNodePosX(){return this.NodePosX?.value??0}setNodePosX(e){this.NodePosX||(this.NodePosX=new Ke),this.NodePosX.value=Math.round(e)}getNodePosY(){return this.NodePosY?.value??0}setNodePosY(e){this.NodePosY||(this.NodePosY=new Ke),this.NodePosY.value=Math.round(e)}getCustomproperties(e=!1){return this.CustomProperties.values}getPinEntities(){return this.getCustomproperties().filter((e=>e.constructor===yt))}getSubobjects(){return Object.keys(this).filter((e=>e.startsWith(ae.subObjectAttributeNamePrefix))).flatMap((e=>[this[e],...this[e].getSubobjects()]))}switchTarget(){const e=this.getClass().match(ae.switchTargetPattern);if(e)return e[1]}isEvent(){switch(this.getClass()){case ae.paths.actorBoundEvent:case ae.paths.componentBoundEvent:case ae.paths.customEvent:case ae.paths.event:case ae.paths.inputAxisKeyEvent:case ae.paths.inputVectorAxisEvent:return!0}return!1}isComment(){switch(this.getClass()){case ae.paths.comment:case ae.paths.materialGraphNodeComment:return!0}return!1}isMaterial(){const e=this.getClass();return e.startsWith("/Script/Engine.MaterialExpression")||e.startsWith("/Script/InterchangeImport.MaterialExpression")||e.startsWith("/Script/UnrealEd.MaterialGraph")}getMaterialSubobject(){const e=this.MaterialExpression??this.MaterialExpressionComment;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}isPcg(){return this.getClass()===ae.paths.pcgEditorGraphNode||null!=this.getPcgSubobject()}isNiagara(){return this.Class&&(this.Class.type?this.Class.type:this.Class.path)?.startsWith("/Script/NiagaraEditor.")}getPcgSubobject(){const e=this.PCGNode;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}getSettingsObject(){const e=this.SettingsInterface;return e?this[ae.subObjectAttributeNameFromReference(e,!0)]:null}getSubgraphObject(){const e=this.SubgraphInstance;return e?this[ae.subObjectAttributeNameFromName(e)]:null}isDevelopmentOnly(){const e=this.getClass();return"DevelopmentOnly"===this.EnabledState?.toString()||e.includes("Debug",Math.max(0,e.lastIndexOf(".")))}getHIDAttribute(){return this.InputKey??this.AxisKey??this.InputAxisKey}getDelegatePin(){return this.getCustomproperties().find((e=>"delegate"===e.PinType.PinCategory.toString()))}nodeColor(){return function(e){switch(e.getType()){case ae.paths.materialExpressionConstant2Vector:case ae.paths.materialExpressionConstant3Vector:case ae.paths.materialExpressionConstant4Vector:return ae.nodeColors.yellow;case ae.paths.materialExpressionFunctionInput:case ae.paths.materialExpressionTextureCoordinate:case ae.paths.materialExpressionWorldPosition:case ae.paths.pcgEditorGraphNodeInput:case ae.paths.pcgEditorGraphNodeOutput:return ae.nodeColors.red;case ae.paths.makeStruct:return ae.nodeColors.darkBlue;case ae.paths.materialExpressionMaterialFunctionCall:return ae.nodeColors.blue;case ae.paths.materialExpressionTextureSample:return ae.nodeColors.darkTurquoise;case ae.paths.niagaraNodeInput:switch(e.Usage?.toString()){case"Attribute":return ae.nodeColors.intenseGreen;case"Parameter":default:return ae.nodeColors.red;case"RapidIterationParameter":return ae.nodeColors.black;case"SystemConstant":case"TranslatorConstant":return ae.nodeColors.gray}}switch(e.getClass()){case ae.paths.callFunction:return e.bIsPureFunc?.valueOf()?ae.nodeColors.green:ae.nodeColors.blue;case ae.paths.niagaraNodeFunctionCall:return ae.nodeColors.darkerBlue;case ae.paths.dynamicCast:return ae.nodeColors.turquoise;case ae.paths.inputDebugKey:case ae.paths.inputKey:return ae.nodeColors.red;case ae.paths.createDelegate:case ae.paths.enumLiteral:case ae.paths.makeArray:case ae.paths.makeMap:case ae.paths.materialGraphNode:case ae.paths.select:return ae.nodeColors.green;case ae.paths.executionSequence:case ae.paths.ifThenElse:case ae.paths.macro:case ae.paths.multiGate:return ae.nodeColors.gray;case ae.paths.functionEntry:case ae.paths.functionResult:return ae.nodeColors.violet;case ae.paths.timeline:return ae.nodeColors.yellow}if(e.switchTarget())return ae.nodeColors.lime;if(e.isEvent())return ae.nodeColors.red;if(e.isComment())return(e.CommentColor?e.CommentColor:Oe.getWhite()).toDimmedColor().toCSSRGBValues();const t=e.getPcgSubobject();if(t){if(t.NodeTitleColor)return t.NodeTitleColor.toDimmedColor(.1).toCSSRGBValues();switch(e.PCGNode?.getName(!0)){case"Branch":case"Select":return ae.nodeColors.intenseGreen}}return e.bIsPureFunc?.valueOf()?ae.nodeColors.green:e.Input?.Name?ae.nodeColors.gray:ae.nodeColors.blue}(this)}nodeIcon(){return function(e){if(e.isMaterial()||e.isPcg()||e.isNiagara())return null;switch(e.getType()){case ae.paths.addDelegate:case ae.paths.asyncAction:case ae.paths.callDelegate:case ae.paths.clearDelegate:case ae.paths.createDelegate:case ae.paths.functionEntry:case ae.paths.functionResult:case ae.paths.removeDelegate:return ce.node;case ae.paths.customEvent:return ce.event;case ae.paths.doN:return ce.doN;case ae.paths.doOnce:return ce.doOnce;case ae.paths.dynamicCast:return ce.cast;case ae.paths.enumLiteral:return ce.enum;case ae.paths.event:return ce.event;case ae.paths.executionSequence:case ae.paths.multiGate:return ce.sequence;case ae.paths.flipflop:return ce.flipflop;case ae.paths.forEachElementInEnum:case ae.paths.forLoop:case ae.paths.forLoopWithBreak:case ae.paths.whileLoop:return ce.loop;case ae.paths.forEachLoop:case ae.paths.forEachLoopWithBreak:return ce.forEachLoop;case ae.paths.ifThenElse:return ce.branchNode;case ae.paths.isValid:return ce.questionMark;case ae.paths.makeArray:return ce.makeArray;case ae.paths.makeMap:return ce.makeMap;case ae.paths.makeSet:return ce.makeSet;case ae.paths.makeStruct:return ce.makeStruct;case ae.paths.metasoundEditorGraphExternalNode:return ce.metasoundFunction;case ae.paths.select:return ce.select;case ae.paths.spawnActorFromClass:return ce.spawnActor;case ae.paths.timeline:return ce.timer}if(e.switchTarget())return ce.switch;if(_e(e).startsWith("Break"))return ce.breakStruct;if(e.getClass()===ae.paths.macro)return ce.macro;const t=e.getHIDAttribute()?.toString();return t?t.includes("Mouse")?ce.mouse:t.includes("Gamepad_Special")?ce.keyboard:t.includes("Gamepad")||t.includes("Steam")?ce.gamepad:t.includes("Touch")?ce.touchpad:ce.keyboard:e.getDelegatePin()?ce.event:e.ObjectRef?.type===ae.paths.ambientSound?ce.sound:ce.functionSymbol}(this)}additionalPinInserter(){return function(e){let t,i,s,r,n;switch(e.getType()){case ae.paths.commutativeAssociativeBinaryOperator:case ae.paths.promotableOperator:switch(n=e.FunctionReference?.MemberName?.toString(),n){default:if(!(n?.startsWith("Add_")||n?.startsWith("Subtract_")||n?.startsWith("Multiply_")||n?.startsWith("Divide_")))break;case"And_Int64Int64":case"And_IntInt":case"BMax":case"BMin":case"BooleanAND":case"BooleanNAND":case"BooleanOR":case"Concat_StrStr":case"FMax":case"FMin":case"Max":case"MaxInt64":case"Min":case"MinInt64":case"Or_Int64Int64":case"Or_IntInt":t??=()=>e.getPinEntities().filter((e=>e.isInput())),i??=wt,s??=(i,s=-1,r=-1)=>{const n=String.fromCharCode(i>=0?i:r+"A".charCodeAt(0)+1);return e.NumAdditionalInputs=new Ye(t().length-1),n}}break;case ae.paths.executionSequence:r??="Then";case ae.paths.multiGate:r??="Out",t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName?.toString().match(new RegExp(String.raw`^\s*${r}[_\s]+(\d+)\s*$`,"i"))?.[1]),s??=(e,t=-1,i=-1,s)=>`${r} ${e>=0?e:t>0?`${r} 0`:i+1}`;break;case ae.paths.switchInteger:t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName?.toString().match(/^\s*(\d+)\s*$/)?.[1]),s??=(e,t=-1,i=-1,s)=>(e<0?i+1:e).toString();break;case ae.paths.switchGameplayTag:s??=(t,i=-1,s=-1,r)=>{const n=`Case_${t>=0?t:i>0?"0":s+1}`;return e.PinNames??=new Fe,e.PinNames.valueOf().push(new Qe(n)),delete e.PinTags.valueOf()[e.PinTags.length-1],e.PinTags.valueOf()[e.PinTags.length]=null,n};case ae.paths.switchName:case ae.paths.switchString:t??=()=>e.getPinEntities().filter((e=>e.isOutput())),i??=e=>Number(e.PinName.toString().match(/^\s*Case[_\s]+(\d+)\s*$/i)?.[1]),s??=(t,i=-1,s=-1,r)=>{const n=`Case_${t>=0?t:i>0?"0":s+1}`;return e.PinNames??=new Fe,e.PinNames.valueOf().push(new Qe(n)),n}}if(t)return()=>{let r=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,a=[];const o=t().reduce(((e,t)=>{const s=i(t);if(isNaN(s)){if(void 0===e)return t}else if(a.push(s),r=Math.min(s,r),s>n)return n=s,t;return e}),void 0);if(r!==Number.MAX_SAFE_INTEGER&&n!==Number.MIN_SAFE_INTEGER||(r=void 0,n=void 0),!o)return null;a.sort(((e,t)=>e{const t=e-l>1;return l=e,t}));const u=new yt(o);return u.PinId=new Ue,u.PinName=new Qe(s(c,r,n,u)),u.PinToolTip=void 0,u.DefaultValue&&(u.DefaultValue=new u.DefaultValue.constructor),e.getCustomproperties(!0).push(u),u}}(this)}showProperty(e){switch(e){case"Class":case"Name":case"Archetype":case"ExportPath":case"CustomProperties":return!1}return super.showProperty(e)}doSerialize(e=!1,t="",i=this.constructor,s=i.printKey,r=i.keySeparator,n=i.attributeSeparator,a=i.wrap){const o=i!==this.constructor,l=t+ae.indentation,c=this.trailing;this.trailing=!0;const u=super.doSerialize(e,l,i,s,r,n,a);return this.trailing=c,t+"Begin Object"+(this.Class?.type||this.Class?.path?` Class${r}${this.Class.serialize(e)}`:"")+(this.Name?` Name${r}${this.Name.serialize(e)}`:"")+(this.Archetype?` Archetype${r}${this.Archetype.serialize(e)}`:"")+(this.ExportPath?.valueOf()?.type||this.ExportPath?.valueOf()?.path?` ExportPath${r}${this.ExportPath.serialize(e)}`:"")+n+u+(!0!==i.attributes.CustomProperties.ignored&&!0!==this.CustomProperties.ignored?this.getCustomproperties().map((t=>l+s("CustomProperties ")+t.serialize(e)+n)).join(""):"")+t+"End Object"+(o&&i.trailing||this.trailing?n:"")}}class kt extends Pt{constructor(e={},t=void 0){e.Class=new ot(ae.paths.knot),e.Name=new Pt.attributes.Name("K2Node_Knot");const i=new yt({PinName:new yt.attributes.PinName("InputPin")}),s=new yt({PinName:new yt.attributes.PinName("OutputPin"),Direction:new yt.attributes.Direction("EGPD_Output")});t&&(i.copyTypeFrom(t),s.copyTypeFrom(t)),e.CustomProperties=new Pt.attributes.CustomProperties([i,s]),super(e)}}class Lt{#Y;get target(){return this.#Y}#e;get blueprint(){return this.#e}consumeEvent;options;listenHandler=()=>this.listenEvents();unlistenHandler=()=>this.unlistenEvents();constructor(e,t,i={}){i.consumeEvent??=!1,i.listenOnFocus??=!1,i.unlistenOnTextEdit??=!1,this.#Y=e,this.#e=t,this.consumeEvent=i.consumeEvent,this.options=i}setup(){this.options.listenOnFocus&&(this.blueprint.addEventListener(ae.focusEventName.begin,this.listenHandler),this.blueprint.addEventListener(ae.focusEventName.end,this.unlistenHandler)),this.options.unlistenOnTextEdit&&(this.blueprint.addEventListener(ae.editTextEventName.begin,this.unlistenHandler),this.blueprint.addEventListener(ae.editTextEventName.end,this.listenHandler)),this.blueprint.focused&&this.listenEvents()}cleanup(){this.unlistenEvents(),this.blueprint.removeEventListener(ae.focusEventName.begin,this.listenHandler),this.blueprint.removeEventListener(ae.focusEventName.end,this.unlistenHandler),this.blueprint.removeEventListener(ae.editTextEventName.begin,this.unlistenHandler),this.blueprint.removeEventListener(ae.editTextEventName.end,this.listenHandler)}listenEvents(){}unlistenEvents(){}}class At extends ke{static attributes={...super.attributes,ActionName:Qe,bShift:Le,bCtrl:Le,bAlt:Le,bCmd:Le,Key:et};static grammar=this.createGrammar();constructor(e){super(e),this.ActionName,this.bShift,this.bCtrl,this.bAlt,this.bCmd,this.Key}static createGrammar(){return Pe.alt(et.grammar.map((e=>new this({Key:e}))),Ie.createEntityGrammar(this))}}class Mt extends Lt{static#q=e=>{};#X;pressedKey="";constructor(e,t,i={},s=Mt.#q,r=Mt.#q){i.activationKeys??=[],i.consumeEvent??=!0,i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,i.activationKeys instanceof Array||(i.activationKeys=[i.activationKeys]),i.activationKeys=i.activationKeys.map((e=>{if(e instanceof At)return e;if(e.constructor===String){const t=At.grammar.run(e);if(t.status)return t.value}throw new Error("Unexpected key value")})),super(e,t,i),this.onKeyDown=s,this.onKeyUp=r,this.#X=this.options.activationKeys??[];let n=this;this.keyDownHandler=e=>{n.#X.some((t=>(e=>e.bShift?.valueOf()||"LeftShift"==e.Key.valueOf()||"RightShift"==e.Key.valueOf())(t)==e.shiftKey&&(e=>e.bCtrl?.valueOf()||"LeftControl"==e.Key.valueOf()||"RightControl"==e.Key.valueOf())(t)==e.ctrlKey&&(e=>e.bAlt?.valueOf()||"LeftAlt"==e.Key.valueOf()||"RightAlt"==e.Key.valueOf())(t)==e.altKey&&ae.Keys[t.Key.value]==e.code))&&(this.consumeEvent&&(e.preventDefault(),e.stopImmediatePropagation()),this.pressedKey=e.code,n.fire(),document.removeEventListener("keydown",n.keyDownHandler),document.addEventListener("keyup",n.keyUpHandler))},this.keyUpHandler=e=>{n.#X.some((t=>t.bShift?.valueOf()&&"Shift"==e.key||t.bCtrl?.valueOf()&&"Control"==e.key||t.bAlt?.valueOf()&&"Alt"==e.key||t.bCmd?.valueOf()&&"Meta"==e.key||ae.Keys[t.Key.value]==e.code))&&(this.consumeEvent&&e.stopImmediatePropagation(),n.unfire(),this.pressedKey="",document.removeEventListener("keyup",this.keyUpHandler),document.addEventListener("keydown",this.keyDownHandler))}}listenEvents(){document.addEventListener("keydown",this.keyDownHandler)}unlistenEvents(){document.removeEventListener("keydown",this.keyDownHandler)}fire(){this.onKeyDown(this)}unfire(){this.onKeyUp(this)}}class It extends Lt{#Z=[0,0];get location(){return this.#Z}#W;get enablerKey(){return this.#W}#Q=!0;get enablerActivated(){return this.#Q}constructor(e,t,i={}){i.ignoreTranslateCompensate??=!1,i.ignoreScale??=!1,i.movementSpace??=t.getGridDOMElement()??document.documentElement,super(e,t,i),this.movementSpace=i.movementSpace,i.enablerKey&&(this.#W=i.enablerKey,this.#W.onKeyDown=()=>this.#Q=!0,this.#W.onKeyUp=()=>this.#Q=!1,this.#W.consumeEvent=!1,this.#W.listenEvents(),this.#Q=!1)}setLocationFromEvent(e){let t=oe.convertLocation([e.clientX,e.clientY],this.movementSpace,this.options.ignoreScale);return t=this.options.ignoreTranslateCompensate?t:this.blueprint.compensateTranslation(t[0],t[1]),this.#Z=[...t],this.#Z}}class Tt extends It{static#q=e=>{};#J=e=>{if(this.blueprint.setFocused(!0),!this.enablerKey||this.enablerActivated)if(e.button===this.options.clickButton)this.options.strictTarget&&e.target!==e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),document.addEventListener("mouseup",this.#ee),this.setLocationFromEvent(e),this.clickedPosition[0]=this.location[0],this.clickedPosition[1]=this.location[1],this.blueprint.mousePosition[0]=this.location[0],this.blueprint.mousePosition[1]=this.location[1],this.clicked(this.clickedPosition));else this.options.exitAnyButton||this.#ee(e)};#ee=e=>{this.options.exitAnyButton&&e.button!=this.options.clickButton||(this.consumeEvent&&e.stopImmediatePropagation(),document.removeEventListener("mouseup",this.#ee),this.unclicked())};clickedPosition=[0,0];constructor(e,t,i={},s=Tt.#q,r=Tt.#q){i.clickButton??=ae.mouseClickButton,i.consumeEvent??=!0,i.exitAnyButton??=!0,i.strictTarget??=!1,super(e,t,i),this.onClick=s,this.onUnclick=r,this.listenEvents()}listenEvents(){this.target.addEventListener("mousedown",this.#J),this.options.clickButton===ae.mouseRightClickButton&&this.target.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){this.target.removeEventListener("mousedown",this.#J)}clicked(e){this.onClick(this)}unclicked(e){this.onUnclick(this)}}class Ot extends It{static ignoreDbClick=e=>{};#te=e=>{this.options.strictTarget&&e.target!==e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),this.clickedPosition=this.setLocationFromEvent(e),this.blueprint.mousePosition=[...this.clickedPosition],this.dbclicked(this.clickedPosition))};#ie;get onDbClick(){return this.#ie}set onDbClick(e){this.#ie=e}clickedPosition=[0,0];constructor(e,t,i={},s=Ot.ignoreDbClick){i.consumeEvent??=!0,i.strictTarget??=!1,super(e,t,i),this.#ie=s,this.listenEvents()}listenEvents(){this.target.addEventListener("dblclick",this.#te)}unlistenEvents(){this.target.removeEventListener("dblclick",this.#te)}dbclicked(e){this.onDbClick(e)}}class Dt{static deleteNodes="Delete";static duplicateNodes="(bCtrl=True,Key=D)";static enableLinkDelete="LeftAlt";static enableZoomIn=["LeftControl","RightControl"];static selectAllNodes="(bCtrl=True,Key=A)"}class $t{element;get blueprint(){return this.element.blueprint}#se=[];get inputObjects(){return this.#se}initialize(e){this.element=e}createInputObjects(){return[]}setup(){this.#se.forEach((e=>e.setup()))}cleanup(){this.#se.forEach((e=>e.cleanup()))}willUpdate(e){}update(e){}render(){return z``}firstUpdated(e){}updated(e){}inputSetup(){this.#se=this.createInputObjects()}}class Vt extends $t{update(e){super.update(e);const[t,i,s,r]=[Math.round(this.element.originX),Math.round(this.element.originY),Math.round(this.element.targetX),Math.round(this.element.targetY)],[n,a,o,l]=[Math.min(t,s),Math.min(i,r),Math.abs(t-s),Math.abs(i-r)];(e.has("originX")||e.has("targetX"))&&(this.element.style.left=`${n}px`,this.element.style.width=`${o}px`),(e.has("originY")||e.has("targetY"))&&(this.element.style.top=`${a}px`,this.element.style.height=`${l}px`)}}class Bt extends Vt{static sigmoidPositive(e,t=3.7,i=1.1){return 1-Math.exp(-((e/i)**t))}static decreasingValue(e,t){const i=-e*t[0]**2,s=t[1]-i/t[0];return e=>i/e+s}static clampedLine=e=>Math.min(Math.max(0,e),1);static c1DecreasingValue=Bt.decreasingValue(-.15,[100,15]);static c2DecreasingValue=Bt.decreasingValue(-.05,[500,130]);static c2Clamped=e=>-40*Bt.clampedLine(e/200)+80;#re=`ueb-id-${Math.floor(1e12*Math.random())}`;#ne=e=>{const t=new kt({},this.element.origin.entity),i=Ae.getConstructor("ueb-node").newObject(t);i.setLocation(...this.blueprint.snapToGrid(...e));const s=i.template;this.blueprint.addGraphElement(i);const r=this.element.getInputPin(),n=this.element.getOutputPin();this.element.origin=null,this.element.target=null;const a=Ae.getConstructor("ueb-link").newObject(n,s.inputPin);this.blueprint.addGraphElement(a),this.element.origin=s.outputPin,this.element.target=r};#ae(e){const t=this.element.origin,i=this.element.target,s=t?.isKnot(),r=i?.isKnot(),n=this.element.originX,a=this.element.targetX;s&&!i&&(t?.isInputLoosely()&&a>n+ae.distanceThreshold||t?.isOutputLoosely()&&an+ae.distanceThreshold)&&(this.element.target=i.template.getoppositePin()),t&&i&&(t.isKnot()&&t.hasUpdated&&t.nodeElement.template.checkSwtichDirectionsVisually(),i.isKnot()&&i.hasUpdated&&i.nodeElement.template.checkSwtichDirectionsVisually());let o=t?.isOutputVisually()==i?.isOutputVisually();const l=Math.max(Math.abs(this.element.originX-this.element.targetX),1),c=Math.max(Math.abs(this.element.originY-this.element.targetY),1),u=Math.max(l,ae.linkMinWidth),h=l/u,p=this.element.originatesFromInput?this.element.originX{e[0]+=ae.knotOffset[0],e[1]+=ae.knotOffset[1],e=oe.snapToGrid(e[0],e[1],ae.gridSize),this.#ne(e)})),new Tt(e,this.blueprint,{enablerKey:new Mt(this.blueprint,this.blueprint,{activationKeys:Dt.enableLinkDelete})},(()=>this.blueprint.removeGraphElement(this.element)))]}willUpdate(e){super.willUpdate(e);const t=(e.get("originX")??this.element.originX)-this.element.originX,i=(e.get("originY")??this.element.originY)-this.element.originY,s=(e.get("targetX")??this.element.targetX)-this.element.targetX,r=(e.get("targetY")??this.element.targetY)-this.element.targetY;t==s&&i==r||this.#ae(e)}update(e){super.update(e);const t=this.element.getOutputPin(!0);t&&this.element.style.setProperty("--ueb-link-color-rgb",Oe.printLinearColor(t.color)),this.element.style.setProperty("--ueb-start-percentage",`${Math.round(this.element.startPercentage)}%`),this.element.style.setProperty("--ueb-link-start",`${Math.round(this.element.startPixels)}`);const i=(this.element.originY>this.element.targetY?-1:1)*(this.element.originatesFromInput?-1:1)*(this.element.origin?.isInputVisually()&&this.element.target?.isInputVisually()?-1:1),s=this.element.origin?.isInputVisually()&&this.element.target?.isInputVisually()?-1:1;this.element.style.setProperty("--ueb-link-scale-y",`${i}`),this.element.style.setProperty("--ueb-link-scale-x",`${s}`)}render(){return z` ${this.element.linkMessageIcon||this.element.linkMessageText?z``:F}`}}class Rt extends le{static properties={...super.properties,originX:{type:Number,attribute:!1},originY:{type:Number,attribute:!1},targetX:{type:Number,attribute:!1},targetY:{type:Number,attribute:!1}};constructor(){super(),this.originX=0,this.originY=0,this.targetX=0,this.targetY=0}setBothLocations([e,t]){this.originX=e,this.originY=t,this.targetX=e,this.targetY=t}addOriginLocation(e,t){this.originX+=e,this.originY+=t}addTargetLocation(e,t){this.targetX+=e,this.targetY+=t}}class Gt extends Rt{static properties={...super.properties,dragging:{type:Boolean,attribute:"data-dragging",converter:Le.booleanConverter,reflect:!0},originNode:{type:String,attribute:"data-origin-node",reflect:!0},originPin:{type:String,attribute:"data-origin-pin",reflect:!0},targetNode:{type:String,attribute:"data-target-node",reflect:!0},targetPin:{type:String,attribute:"data-target-pin",reflect:!0},originatesFromInput:{type:Boolean,attribute:"data-from-input",converter:Le.booleanConverter,reflect:!0},svgPathD:{type:String,attribute:!1},linkMessageIcon:{type:String,attribute:!1},linkMessageText:{type:String,attribute:!1}};#oe;get origin(){return this.#oe}set origin(e){this.#le(e,!1)}#Y;get target(){return this.#Y}set target(e){this.#le(e,!0)}#ce=()=>this.remove();#ue=e=>this.addOriginLocation(...e.detail.value);#he=e=>this.addTargetLocation(...e.detail.value);#pe=e=>{this.origin.isKnot()&&(this.originatesFromInput=this.origin.isInputVisually()),this.setOriginLocation()};#de=e=>this.setTargetLocation();linkMessageIcon=F;linkMessageText=F;pathElement;constructor(){super(),this.dragging=!1,this.originNode="",this.originPin="",this.targetNode="",this.targetPin="",this.originatesFromInput=!1,this.startPercentage=0,this.svgPathD="",this.startPixels=0}static newObject(e,t){const i=new Gt;return i.initialize(e,t),i}initialize(e,t){super.initialize({},new Bt),e&&(this.origin=e,t||(this.targetX=this.originX,this.targetY=this.originY)),t&&(this.target=t,e||(this.originX=this.targetX,this.originY=this.targetY))}#le(e,t){const i=()=>t?this.target:this.origin;if(i()!=e){if(i()){const e=i().getNodeElement();e.removeEventListener(ae.removeEventName,this.#ce),e.removeEventListener(ae.nodeDragEventName,t?this.#he:this.#ue),e.removeEventListener(ae.nodeReflowEventName,t?this.#de:this.#pe),this.#me()}if(t?(this.#Y=e,this.targetNode=e?.nodeElement.nodeTitle,this.targetPin=e?.pinId.toString()):(this.#oe=e,this.originNode=e?.nodeElement.nodeTitle,this.originPin=e?.pinId.toString()),i()){const e=i().getNodeElement();e.addEventListener(ae.removeEventName,this.#ce),e.addEventListener(ae.nodeDragEventName,t?this.#he:this.#ue),e.addEventListener(ae.nodeReflowEventName,t?this.#de:this.#pe),t?this.setTargetLocation():(this.setOriginLocation(),this.originatesFromInput=this.origin.isInputVisually()),this.#ge()}}}#ge(){this.origin&&this.target&&(this.origin.linkTo(this.target),this.target.linkTo(this.origin))}#me(){this.origin&&this.target&&(this.origin.unlinkFrom(this.target,!1),this.target.unlinkFrom(this.origin,!1))}cleanup(){super.cleanup(),this.#me(),this.origin=null,this.target=null}setOriginLocation(e=null,t=!0){if(null==e){const i=this;if(t&&(!this.hasUpdated||!this.origin.hasUpdated))return void Promise.all([this.updateComplete,this.origin.updateComplete]).then((()=>i.setOriginLocation(null,!1)));e=this.origin.template.getLinkLocation()}const[i,s]=e;this.originX=i,this.originY=s}setTargetLocation(e=null,t=!0){if(null==e){const i=this;if(t&&(!this.hasUpdated||!this.target.hasUpdated))return void Promise.all([this.updateComplete,this.target.updateComplete]).then((()=>i.setTargetLocation(null,!1)));e=this.target.template.getLinkLocation()}this.targetX=e[0],this.targetY=e[1]}getInputPin(e=!1){return this.origin?.isInput()?this.origin:this.target?.isInput()?this.target:e?this.origin??this.target:void 0}setInputPin(e){this.origin?.isInput()&&(this.origin=e),this.target=e}getOutputPin(e=!1){return this.origin?.isOutput()?this.origin:this.target?.isOutput()?this.target:e?this.origin??this.target:void 0}setOutputPin(e){this.target?.isOutput()&&(this.target=e),this.origin=e}getOtherPin(e){return this.origin?.nodeElement===e?this.target:this.target?.nodeElement===e?this.origin:void 0}startDragging(){this.dragging=!0}finishDragging(){this.dragging=!1}removeMessage(){this.linkMessageIcon=F,this.linkMessageText=F}setMessageConvertType(){this.linkMessageIcon=ce.convert,this.linkMessageText=z`Convert ${this.origin.pinType} to ${this.target.pinType}.`}setMessageCorrect(){this.linkMessageIcon=ce.correct,this.linkMessageText=F}setMessageReplace(){this.linkMessageIcon=ce.correct,this.linkMessageText=F}setMessageDirectionsIncompatible(){this.linkMessageIcon=ce.reject,this.linkMessageText=z`Directions are not compatbile.`}setMessagePlaceNode(){this.linkMessageIcon=F,this.linkMessageText=z`Place a new node.`}setMessageReplaceLink(){this.linkMessageIcon=ce.correct,this.linkMessageText=z`Replace existing input connections.`}setMessageReplaceOutputLink(){this.linkMessageIcon=ce.correct,this.linkMessageText=z`Replace existing output connections.`}setMessageSameNode(){this.linkMessageIcon=ce.reject,this.linkMessageText=z`Both are on the same node.`}setMessageTypesIncompatible(e,t){this.linkMessageIcon=ce.reject,this.linkMessageText=z`${oe.capitalFirstLetter(e.pinType)} is not compatible with ${oe.capitalFirstLetter(t.pinType)}.`}}class Ht extends le{static properties={...super.properties,locationX:{type:Number,attribute:!1},locationY:{type:Number,attribute:!1},sizeX:{type:Number,attribute:!1},sizeY:{type:Number,attribute:!1}};static dragEventName=ae.dragEventName;static dragGeneralEventName=ae.dragGeneralEventName;constructor(){super(),this.locationX=0,this.locationY=0,this.sizeX=0,this.sizeY=0}computeSizes(){const e=this.getBoundingClientRect();this.sizeX=this.blueprint.scaleCorrect(e.width),this.sizeY=this.blueprint.scaleCorrect(e.height)}firstUpdated(e){super.firstUpdated(e),this.computeSizes()}setLocation(e,t,i=!0){const s=e-this.locationX,r=t-this.locationY;if(this.locationX=e,this.locationY=t,this.blueprint&&i){const e=new CustomEvent(this.constructor.dragEventName,{detail:{value:[s,r]},bubbles:!1,cancelable:!0});this.dispatchEvent(e)}}addLocation(e,t,i=!0){this.setLocation(this.locationX+e,this.locationY+t,i)}acknowledgeDrag(e){const t=new CustomEvent(this.constructor.dragGeneralEventName,{detail:{value:e},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}snapToGrid(){const e=oe.snapToGrid(this.locationX,this.locationY,ae.gridSize);this.locationX==e[0]&&this.locationY==e[1]||this.setLocation(e[0],e[1])}topBoundary(e=!1){return this.template.topBoundary(e)}rightBoundary(e=!1){return this.template.rightBoundary(e)}bottomBoundary(e=!1){return this.template.bottomBoundary(e)}leftBoundary(e=!1){return this.template.leftBoundary(e)}}class zt extends It{#J=e=>{if(this.blueprint.setFocused(!0),e.button===this.options.clickButton)this.options.strictTarget&&e.target!=e.currentTarget||(this.consumeEvent&&e.stopImmediatePropagation(),this.#be.addEventListener("mousemove",this.#ve),document.addEventListener("mouseup",this.#ee),this.setLocationFromEvent(e),this.clickedPosition[0]=this.location[0],this.clickedPosition[1]=this.location[1],this.blueprint.mousePosition[0]=this.location[0],this.blueprint.mousePosition[1]=this.location[1],this.target instanceof Ht&&(this.clickedOffset=[this.clickedPosition[0]-this.target.locationX,this.clickedPosition[1]-this.target.locationY]),this.clicked(this.clickedPosition));else this.options.exitAnyButton||this.#ee(e)};#ve=e=>{this.consumeEvent&&e.stopImmediatePropagation(),this.#be.removeEventListener("mousemove",this.#ve),this.#be.addEventListener("mousemove",this.#fe);const t=this.getEvent(ae.trackingMouseEventName.begin);this.#ye=0==this.target.dispatchEvent(t),this.setLocationFromEvent(e),this.lastLocation=oe.snapToGrid(this.clickedPosition[0],this.clickedPosition[1],this.stepSize),this.startDrag(this.location),this.started=!0,this.#fe(e)};#fe=e=>{this.consumeEvent&&e.stopImmediatePropagation();const t=this.setLocationFromEvent(e),i=[e.movementX,e.movementY];if(this.dragTo(t,i),this.#ye&&(this.blueprint.mousePosition=t),this.options.scrollGraphEdge){const e=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=this.blueprint.scaleCorrect(ae.edgeScrollThreshold),r=this.blueprint.template.gridLeftVisibilityBoundary()+s,n=this.blueprint.template.gridRightVisibilityBoundary()-s;let a=0;t[0]n&&(a=t[0]-n);const o=this.blueprint.template.gridTopVisibilityBoundary()+s,l=this.blueprint.template.gridBottomVisibilityBoundary()-s;let c=0;t[1]l&&(c=t[1]-l),a=oe.clamp(this.blueprint.scaleCorrectReverse(a)**3*e*.6,-20,20),c=oe.clamp(this.blueprint.scaleCorrectReverse(c)**3*e*.6,-20,20),this.blueprint.scrollDelta(a,c)}};#ee=e=>{if(!this.options.exitAnyButton||e.button==this.options.clickButton){if(this.consumeEvent&&e.stopImmediatePropagation(),this.#be.removeEventListener("mousemove",this.#ve),this.#be.removeEventListener("mousemove",this.#fe),document.removeEventListener("mouseup",this.#ee),this.started&&this.endDrag(),this.unclicked(),this.#ye){const e=this.getEvent(ae.trackingMouseEventName.end);this.target.dispatchEvent(e),this.#ye=!1}this.started=!1}};#ye=!1;#be;#we;get draggableElement(){return this.#we}clickedOffset=[0,0];clickedPosition=[0,0];lastLocation=[0,0];started=!1;stepSize=1;constructor(e,t,i={}){i.clickButton??=ae.mouseClickButton,i.consumeEvent??=!0,i.draggableElement??=e,i.exitAnyButton??=!0,i.moveEverywhere??=!1,i.movementSpace??=t?.getGridDOMElement(),i.repositionOnClick??=!1,i.scrollGraphEdge??=!1,i.strictTarget??=!1,super(e,t,i),this.stepSize=Number(i.stepSize??ae.gridSize),this.#be=this.options.moveEverywhere?document.documentElement:this.movementSpace,this.#we=this.options.draggableElement,this.listenEvents()}listenEvents(){super.listenEvents(),this.#we.addEventListener("mousedown",this.#J),this.options.clickButton===ae.mouseRightClickButton&&this.#we.addEventListener("contextmenu",(e=>e.preventDefault()))}unlistenEvents(){super.unlistenEvents(),this.#we.removeEventListener("mousedown",this.#J)}getEvent(e){return new CustomEvent(e,{detail:{tracker:this},bubbles:!0,cancelable:!0})}clicked(e){}startDrag(e){}dragTo(e,t){}endDrag(){}unclicked(e){}}class _t extends zt{clicked(e){this.options.repositionOnClick&&(this.target.setLocation(...this.stepSize>1?oe.snapToGrid(e[0],e[1],this.stepSize):e),this.clickedOffset=[0,0])}dragTo(e,t){const i=[this.target.locationX??this.lastLocation[0],this.target.locationY??this.lastLocation[1]],[s,r]=this.stepSize>1?[oe.snapToGrid(e[0],e[1],this.stepSize),oe.snapToGrid(i[0],i[1],this.stepSize)]:[e,i];0==(t=[s[0]-this.lastLocation[0],s[1]-this.lastLocation[1]])[0]&&0==t[1]||(t[0]+=r[0]-i[0],t[1]+=r[1]-i[1],this.dragAction(s,t),this.lastLocation=s)}dragAction(e,t){this.target.setLocation(e[0]-this.clickedOffset[0],e[1]-this.clickedOffset[1])}}class Ft extends _t{#Se;#Ee;#Ce;#Ne;constructor(e,t,i={}){super(e,t,i),i.onClicked&&(this.#Se=i.onClicked),i.onStartDrag&&(this.#Ee=i.onStartDrag),i.onDrag&&(this.#Ce=i.onDrag),i.onEndDrag&&(this.#Ne=i.onEndDrag)}clicked(e){super.clicked(e),this.#Se?.()}startDrag(){super.startDrag(),this.#Ee?.()}dragAction(e,t){this.#Ce?.(e,t)}endDrag(){super.endDrag(),this.#Ne?.()}}class jt extends _t{constructor(e,t,i={}){super(e,t,i),this.draggableElement.classList.add("ueb-draggable")}startDrag(){this.target.selected||(this.blueprint.unselectAll(),this.target.setSelected(!0))}dragAction(e,t){this.target.acknowledgeDrag(t)}unclicked(){this.started?(this.blueprint.getNodes(!0).forEach((e=>e.boundComments.filter((t=>!e.isInsideComment(t))).forEach((t=>e.unbindFromComment(t))))),this.blueprint.getCommentNodes().forEach((e=>e.template.manageNodesBind()))):(this.blueprint.unselectAll(),this.target.setSelected(!0))}}class Ut extends $t{getDraggableElement(){return this.element}createDraggableObject(){const e=this.getDraggableElement();return new _t(this.element,this.blueprint,{draggableElement:e})}createInputObjects(){return[...super.createInputObjects(),this.createDraggableObject(),new Mt(this.element,this.blueprint,{activationKeys:[ae.Keys.ArrowUp,ae.Keys.ArrowRight,ae.Keys.ArrowDown,ae.Keys.ArrowLeft]},(e=>e.target.acknowledgeDrag([e.pressedKey===ae.Keys.ArrowLeft?-ae.gridSize:e.pressedKey===ae.Keys.ArrowRight?ae.gridSize:0,e.pressedKey===ae.Keys.ArrowUp?-ae.gridSize:e.pressedKey===ae.Keys.ArrowDown?ae.gridSize:0])))]}topBoundary(e=!1){return this.element.locationY}rightBoundary(e=!1){return this.element.locationX+this.element.sizeX}bottomBoundary(e=!1){return this.element.locationY+this.element.sizeY}leftBoundary(e=!1){return this.element.locationX}centerInViewport(){const e=Math.min(this.blueprint.template.viewportSize[0]/10,this.blueprint.template.viewportSize[1]/10),t=this.leftBoundary()-this.blueprint.template.gridLeftVisibilityBoundary(),i=this.blueprint.template.gridRightVisibilityBoundary()-this.rightBoundary();let s=Math.max((t+i)/2,e);const r=this.topBoundary()-this.blueprint.template.gridTopVisibilityBoundary(),n=this.blueprint.template.gridBottomVisibilityBoundary()-this.bottomBoundary();let a=Math.max((r+n)/2,e);this.blueprint.scrollDelta(t-s,r-a,!0)}}class Kt extends Ut{update(e){super.update(e),e.has("locationX")&&(this.element.style.left=`${this.element.locationX}px`),e.has("locationY")&&(this.element.style.top=`${this.element.locationY}px`)}}class Yt extends Kt{getDraggableElement(){return this.element}createDraggableObject(){return new jt(this.element,this.blueprint,{draggableElement:this.getDraggableElement(),scrollGraphEdge:!0})}firstUpdated(e){super.firstUpdated(e),this.element.selected&&!this.element.listeningDrag&&this.element.setSelected(!0)}}class qt extends Yt{static nodeStyleClasses=["ueb-node-style-default"];#xe;pinInserter;inputContainer;outputContainer;pinElement;addPinHandler=()=>{const e=this.pinInserter?.();e&&(this.defaultPin&&this.defaultPin.isInput()===e.isInput()?this.defaultPin.before(this.createPinElement(e)):(e.isInput()?this.inputContainer:this.outputContainer).appendChild(this.createPinElement(e)),this.element.acknowledgeReflow())};toggleAdvancedDisplayHandler=()=>{this.element.toggleShowAdvancedPinDisplay(),this.element.requestUpdate(),this.element.updateComplete.then((()=>this.element.acknowledgeReflow()))};createPinElement(e){const t=Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element);return this.pinInserter&&!this.defaultPin&&"Default"===t.getPinName()&&(this.defaultPin=t,this.defaultPin.classList.add("ueb-node-variadic-default")),t}initialize(e){super.initialize(e),this.#xe=function(e){switch(e.getType()){case ae.paths.addDelegate:case ae.paths.clearDelegate:case ae.paths.callDelegate:case ae.paths.removeDelegate:return null}const t=e.getPinEntities().find((e=>!e.isHidden()&&"self"===e.PinName?.toString()&&"Target"===Ze(e)));if(t){const i=e.FunctionReference?.MemberParent?.getName()??t.PinType?.PinSubCategoryObject?.getName()??"Untitled";return i.length>0?`Target is ${oe.formatStringName(i)}`:null}return null}(e.entity),this.element.classList.add(...this.constructor.nodeStyleClasses),this.element.style.setProperty("--ueb-node-color",this.getColor().cssText),this.pinInserter=this.element.entity.additionalPinInserter(),this.pinInserter&&this.element.classList.add("ueb-node-is-variadic")}getColor(){return this.element.entity.nodeColor()}render(){return z`
${this.renderTop()}
${this.pinInserter?z`
Add pin ${ce.plusCircle}
`:F} ${this.element.entity.isDevelopmentOnly()?z`
Development Only
`:F} ${this.element.advancedPinDisplay?z`
${ce.expandIcon}
`:F}
`}renderNodeIcon(){return this.element.entity.nodeIcon()}renderNodeName(){return this.element.nodeDisplayName}renderTop(){const e=this.renderNodeIcon(),t=this.renderNodeName();return z`
${e?z`
${e}
`:F} ${t?z`
${t} ${this.#xe?z`
${this.#xe}
`:F}
`:F}
`}firstUpdated(e){super.firstUpdated(e),this.inputContainer=this.element.querySelector(".ueb-node-inputs"),this.outputContainer=this.element.querySelector(".ueb-node-outputs"),this.setupPins(),this.element.updateComplete.then((()=>this.element.acknowledgeReflow()))}setupPins(){this.element.nodeNameElement=this.element.querySelector(".ueb-node-name-text");let e=!1,t=!1;for(const i of this.getPinElements())i!==this.defaultPin&&(i.isInput()?(this.inputContainer.appendChild(i),e=!0):i.isOutput()&&(this.outputContainer.appendChild(i),t=!0));this.defaultPin&&(this.defaultPin.isInput()?this.inputContainer:this.outputContainer).appendChild(this.defaultPin),e&&this.element.classList.add("ueb-node-has-inputs"),t&&this.element.classList.add("ueb-node-has-outputs")}getPinElements(){return this.element.getPinElements()}createPinElements(){return this.element.getPinEntities().filter((e=>!e.isHidden())).map((e=>this.createPinElement(e)))}getAllConnectedLinks(){const e=this.element.nodeTitle,t=`ueb-link[data-origin-node="${e}"],ueb-link[data-target-node="${e}"]`;return[...this.blueprint.querySelectorAll(t)]}}class Xt extends qt{#Pe=document.createElement("div");#ke=document.createElement("div");#Le=document.createElement("div");#Ae=document.createElement("div");#Me=document.createElement("div");#Ie=document.createElement("div");#Te=document.createElement("div");#Oe=document.createElement("div");initialize(e){super.initialize(e),this.element.classList.add("ueb-resizeable"),this.#Pe.classList.add("ueb-resizeable-top"),this.#ke.classList.add("ueb-resizeable-right"),this.#Le.classList.add("ueb-resizeable-bottom"),this.#Ae.classList.add("ueb-resizeable-left"),this.#Me.classList.add("ueb-resizeable-top-right"),this.#Ie.classList.add("ueb-resizeable-bottom-right"),this.#Te.classList.add("ueb-resizeable-bottom-left"),this.#Oe.classList.add("ueb-resizeable-top-left")}update(e){super.update(e),this.element.sizeX>=0&&e.has("sizeX")&&(this.element.style.width=`${this.element.sizeX}px`),this.element.sizeY>=0&&e.has("sizeY")&&(this.element.style.height=`${this.element.sizeY}px`)}firstUpdated(e){super.firstUpdated(e),this.element.append(this.#Pe,this.#ke,this.#Le,this.#Ae,this.#Me,this.#Ie,this.#Te,this.#Oe)}createInputObjects(){return[...super.createInputObjects(),new Ft(this.#Pe,this.blueprint,{onDrag:(e,t)=>{t[1]=e[1]-this.element.topBoundary(),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#ke,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),this.setSizeX(this.element.sizeX+t[0])},onEndDrag:()=>this.endResize()}),new Ft(this.#Le,this.blueprint,{onDrag:(e,t)=>{t[1]=e[1]-this.element.bottomBoundary(),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Ae,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#Me,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),t[1]=e[1]-this.element.topBoundary(),this.setSizeX(this.element.sizeX+t[0]),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()}),new Ft(this.#Ie,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.rightBoundary(),t[1]=e[1]-this.element.bottomBoundary(),this.setSizeX(this.element.sizeX+t[0]),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Te,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),t[1]=e[1]-this.element.bottomBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1),this.setSizeY(this.element.sizeY+t[1])},onEndDrag:()=>this.endResize()}),new Ft(this.#Oe,this.blueprint,{onDrag:(e,t)=>{t[0]=e[0]-this.element.leftBoundary(),t[1]=e[1]-this.element.topBoundary(),this.setSizeX(this.element.sizeX-t[0])&&this.element.addLocation(t[0],0,!1),this.setSizeY(this.element.sizeY-t[1])&&this.element.addLocation(0,t[1],!1)},onEndDrag:()=>this.endResize()})]}setSizeX(e){return this.element.setNodeWidth(e),!0}setSizeY(e){return this.element.setNodeHeight(e),!0}endResize(){}}class Zt extends Xt{#De=0;initialize(e){super.initialize(e),e.classList.add("ueb-node-style-comment","ueb-node-resizeable"),e.sizeX=25*ae.gridSize,e.sizeY=6*ae.gridSize,super.initialize(e)}getDraggableElement(){return this.element.querySelector(".ueb-node-top")}render(){return z`
`}firstUpdated(e){super.firstUpdated(e);const t=this.getDraggableElement().getBoundingClientRect();this.#De=t.height}manageNodesBind(){let e=this.blueprint.getNodes();for(let t of e)t.topBoundary()>=this.element.topBoundary()&&t.rightBoundary()<=this.element.rightBoundary()&&t.bottomBoundary()<=this.element.bottomBoundary()&&t.leftBoundary()>=this.element.leftBoundary()?t.bindToComment(this.element):t.unbindFromComment(this.element)}setSizeX(e){return(e=Math.round(e))>=2*ae.gridSize&&(this.element.setNodeWidth(e),!0)}setSizeY(e){return(e=Math.round(e))>=2*ae.gridSize&&(this.element.setNodeHeight(e),!0)}endResize(){this.manageNodesBind()}topBoundary(e=!1){return this.element.locationY}rightBoundary(e=!1){return this.element.locationX+this.element.sizeX}bottomBoundary(e=!1){return e?this.element.locationY+this.#De:super.bottomBoundary()}leftBoundary(e=!1){return this.element.locationX}}class Wt extends zt{#$e;#Ve=null;#Be=e=>{if(!this.enteredPin){this.linkValid=!1,this.enteredPin=e.target;const t=this.link.origin??this.target,i=this.enteredPin,s=t.isOutput()?t:i;t.isKnot()||i.isKnot()?(this.link.setMessageCorrect(),this.linkValid=!0):t.getNodeElement()===i.getNodeElement()?this.link.setMessageSameNode():t.isOutput()===i.isOutput()?this.link.setMessageDirectionsIncompatible():this.blueprint.getLinks(t,i).length?(this.link.setMessageReplaceLink(),this.linkValid=!0):"exec"===s.entity.getType()&&s.isLinked?(this.link.setMessageReplaceOutputLink(),this.linkValid=!0):"object"==t.entity.PinType.PinCategory.valueOf()&&"object"==i.entity.PinType.PinCategory.valueOf()||t.pinType==i.pinType?(this.link.setMessageCorrect(),this.linkValid=!0):(this.link.setMessageTypesIncompatible(t,i),this.linkValid=!1)}};#Re=e=>{this.enteredPin==e.target&&(this.enteredPin=null,this.linkValid=!1,this.link?.setMessagePlaceNode())};link;enteredPin;linkValid=!1;constructor(e,t,i={}){i.scrollGraphEdge??=!0,super(e,t,i)}startDrag(e){this.target.isKnot()&&(this.#Ve=this.target),this.link=Ae.getConstructor("ueb-link").newObject(this.target,null),this.blueprint.template.linksContainerElement.prepend(this.link),this.link.setMessagePlaceNode(),this.#$e=this.blueprint.querySelectorAll("ueb-pin"),this.#$e.forEach((e=>{e!=this.target&&(e.addEventListener("mouseenter",this.#Be),e.addEventListener("mouseleave",this.#Re))})),this.link.startDragging(),this.link.setTargetLocation(e)}dragTo(e,t){this.link.setTargetLocation(e)}endDrag(){if(this.#$e.forEach((e=>{e.removeEventListener("mouseenter",this.#Be),e.removeEventListener("mouseleave",this.#Re)})),this.#$e=null,this.enteredPin&&this.linkValid){if(this.#Ve){const e=this.#Ve!==this.link.origin?this.link.origin:this.enteredPin;if(this.#Ve.isInput()&&e.isInput()||this.#Ve.isOutput()&&e.isOutput()){const e=this.#Ve.template.getoppositePin();this.#Ve===this.link.origin?this.link.origin=e:this.enteredPin=e}}else this.enteredPin.isKnot()&&(this.#Ve=this.enteredPin,this.link.origin.isOutput()&&(this.enteredPin=this.enteredPin.template.getoppositePin()));this.link.origin.getLinks().find((e=>e.equals(this.enteredPin.createPinReference())))?this.link.remove():(this.blueprint.addGraphElement(this.link),this.link.target=this.enteredPin)}else this.link.remove();this.enteredPin=null,this.link.removeMessage(),this.link.finishDragging(),this.link=null,this.#Ve=null}}class Qt extends qt{#Ge=!1;#He=!1;displayName="";static nodeStyleClasses=["ueb-node-style-glass"];initialize(e){super.initialize(e),this.displayName=this.element.nodeDisplayName}render(){return z`
${this.displayName?z`
${this.displayName}
`:F} ${this.#Ge?z`
`:F} ${this.#He?z`
`:F} ${this.pinInserter?z`
Add pin ${ce.plusCircle}
`:F}
`}createPinElements(){return this.element.getPinEntities().filter((e=>!e.isHidden())).map((e=>{this.#Ge||=e.isInput(),this.#He||=e.isOutput();return Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element)}))}}class Jt extends Qt{static nodeStyleClasses=["ueb-node-style-metasound","ueb-node-style-operation"]}class ei extends Qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-conversion"]}class ti extends Qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-operation"]}class ii extends $t{static canWrapInput=!0;#ze;get iconElement(){return this.#ze}#_e;get wrapperElement(){return this.#_e}isNameRendered=!0;initialize(e){if(super.initialize(e),this.element.nodeElement){const e=this.element.nodeElement.template;this.isNameRendered=!(e instanceof ei||e instanceof ti||e instanceof Jt)}}setup(){super.setup(),this.element.nodeElement=this.element.closest("ueb-node");const e=this.element.nodeElement.template;(e instanceof ei||e instanceof ti)&&(this.isNameRendered=!1,this.element.requestUpdate())}createInputObjects(){return[new Wt(this.element,this.blueprint,{moveEverywhere:!0,draggableElement:this.getClickableElement()})]}render(){const e=z`
${this.renderIcon()}
`,t=z`
${this.isNameRendered?this.renderName():F} ${this.isInputRendered()?this.renderInput():z``}
`;return z`
${this.element.isInput()?z`${e}${t}`:z`${t}${e}`}
`}renderIcon(){if(this.element.nodeElement.entity.isPcg())switch(this.element.entity.getType()){case"Any":return ce.pcgPin;case"Param":case"Param[]":return ce.pcgParamPin;case"Spatial":case"Spatial[]":return ce.pcgSpatialPin;case"Any[]":case"Point[]":case"Surface[]":case"Volume[]":if(this.element.isOutput())return ce.pcgPin;case"Point":case"Surface":case"Volume":return ce.pcgStackPin}switch(this.element.entity.PinType.ContainerType?.toString()){case"Array":return ce.arrayPin;case"Set":return ce.setPin;case"Map":return ce.mapPin}return"delegate"===this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase()?ce.delegate:this.element.nodeElement?.template instanceof ti?ce.operationPin:"statictype"===this.element.entity.PinType.PinCategory?.toString().toLocaleLowerCase()?ce.staticPin:ce.genericPin}renderName(){let e=this.element.getPinDisplayName();const t=this.element.nodeElement,i=this.element.getPinName();return t.getType()==ae.paths.makeStruct&&i==t.entity.StructType.getName()&&(e=i),z`${e}`}isInputRendered(){return this.element.isInput()&&!this.element.entity.bDefaultValueIsIgnored?.valueOf()&&!this.element.entity.PinType.bIsReference?.valueOf()}renderInput(){return z``}updated(e){if(super.updated(e),this.element.isInput()&&e.has("isLinked")){const e=this.element.nodeElement;this.element.requestUpdate(),this.element.updateComplete.then((()=>e.acknowledgeReflow()))}}firstUpdated(e){super.firstUpdated(e),this.element.style.setProperty("--ueb-pin-color-rgb",this.element.entity.pinColor().cssText),this.#ze=this.element.querySelector(".ueb-pin-icon svg")??this.element,this.#_e=this.element.querySelector(".ueb-pin-wrapper")}getLinkLocation(e=!1){const t=(this.#ze??this.element).getBoundingClientRect(),i=[this.element.isInputVisually()!=e?t.left:t.right+1,(t.top+t.bottom)/2],s=oe.convertLocation(i,this.blueprint.template.gridElement);return this.blueprint.compensateTranslation(s[0],s[1])}getClickableElement(){return this.#_e??this.element}getAllConnectedLinks(){if(!this.element.isLinked)return[];const e=this.element.nodeElement.nodeTitle,t=this.element.pinId,i=`ueb-link[data-origin-node="${e}"][data-origin-pin="${t}"],ueb-link[data-target-node="${e}"][data-target-pin="${t}"]`;return[...this.blueprint.querySelectorAll(i)]}}class si extends ii{render(){return z`
${this.renderIcon()}
`}}class ri extends qt{static nodeStyleClasses=[...super.nodeStyleClasses,"ueb-node-style-event"];#Fe;firstUpdated(e){super.firstUpdated(e),this.element.querySelector(".ueb-node-top").appendChild(this.createDelegatePinElement())}renderTop(){const e=this.renderNodeIcon(),t=this.renderNodeName(),i=this.element.getType()===ae.paths.customEvent&&(this.element.entity.CustomFunctionName||this.element.entity.FunctionReference.MemberParent);return z`
${e?z`
${e}
`:F} ${t?z`
${t} ${i?z`
Custom Event
`:F}
`:F}
`}getPinElements(){return this.element.getPinElements().filter((e=>"delegate"!==e.entity.PinType.PinCategory?.toString()))}createDelegatePinElement(){return this.#Fe||(this.#Fe=Ae.getConstructor("ueb-pin").newObject(this.element.getPinEntities().find((e=>!e.isHidden()&&"delegate"===e.PinType.PinCategory?.toString())),new si,this.element),this.#Fe.template.isNameRendered=!1),this.#Fe}createPinElements(){return[this.createDelegatePinElement(),...this.element.getPinEntities().filter((e=>!e.isHidden()&&"delegate"!==e.PinType.PinCategory?.toString())).map((e=>Ae.getConstructor("ueb-pin").newObject(e,void 0,this.element)))]}}class ni extends si{render(){return this.element.isOutput()?super.render():z``}getoppositePin(){const e=this.element.nodeElement.template;return this.element.isOutput()?e.inputPin:e.outputPin}getLinkLocation(e=!1){return this.element.isInput()?this.getoppositePin().getLinkLocation(!e):super.getLinkLocation(e)}}class ai extends qt{#je=!1;get switchDirectionsVisually(){return this.#je}set switchDirectionsVisually(e){this.#je!=e&&(this.#je=e,this.element.acknowledgeReflow())}#Ue;get inputPin(){return this.#Ue}#Ke;get outputPin(){return this.#Ke}initialize(e){super.initialize(e),this.element.classList.add("ueb-node-style-minimal")}render(){return z`
`}setupPins(){for(const e of this.getPinElements())this.element.querySelector(".ueb-node-border").appendChild(e)}createPinElements(){const e=this.element.getPinEntities().filter((e=>!e.isHidden())),t=e[e[0].isInput()?0:1],i=e[e[0].isOutput()?0:1],s=Ae.getConstructor("ueb-pin");return[this.#Ue=s.newObject(t,new ni,this.element),this.#Ke=s.newObject(i,new ni,this.element)]}checkSwtichDirectionsVisually(){let e=0,t=0,i=0,s=0;const r=this.outputPin.getLinkLocation()[0],n=this.getAllConnectedLinks();for(const a of n){const n=a.getOtherPin(this.element),o=n.getLinkLocation()[0]-r;n?.isInput()?(i+=o,++s):n?.isOutput()&&(e+=o,++t)}e/=t,i/=s,i!e.entity.isHidden()&&!e.entity.isExecution()));this.element.style.setProperty("--ueb-node-color",e.getColor().cssText)}}const ci=["Boolean::LogicEq","Boolean::LogicNEq","Integer::EnumNEq","Integer::EnumEq",...["Abs","Add","ArcCosine(Degrees)","ArcCosine(Radians)","ArcSine(Degrees)","ArcSine(Radians)","ArcTangent(Degrees)","ArcTangent(Radians)","Ceil","CmpEQ","CmpGE","CmpGT","CmpLE","CmpLT","CmpNEQ","Cosine(Degrees)","Cosine(Radians)","DegreesToRadians","Div","Dot","Exp","Exp2","Floor","FMod","Frac","Length","Lerp","Log","Log2","Madd","Max","Min","Mul","Negate","Normalize","OneMinus","PI","RadiansToDegrees","Rcp","RcpFast","Round","RSqrt","Sign","Sine(Degrees)","Sine(Radians)","Sqrt","Step","Subtract","Tangent(Degrees)","Tangent(Radians)","Trunc","TWO_PI"].map((e=>"Numeric::"+e)),"Vector3::Cross"],ui=ae.paths;function hi(e){if(e.getClass()===ui.callFunction||e.getClass()===ui.commutativeAssociativeBinaryOperator||e.getClass()===ui.callArrayFunction){const t=e.FunctionReference?.MemberParent?.path??"",i=e.FunctionReference?.MemberName?.toString();if(i&&(t===ui.kismetMathLibrary||t===ui.kismetArrayLibrary)){if(i.startsWith("Conv_"))return ei;if(i.startsWith("Add_")||i.startsWith("And_")||i.startsWith("Boolean")||i.startsWith("Cross_")||i.startsWith("Dot_")||i.startsWith("Not_")||i.startsWith("Or_")||i.startsWith("Percent_")||i.startsWith("Xor_"))return ti;switch(i){case"Abs":case"Array_Add":case"Array_AddUnique":case"Array_Identical":case"BMax":case"BMin":case"CrossProduct2D":case"DotProduct2D":case"Exp":case"FMax":case"FMin":case"GetPI":case"Max":case"MaxInt64":case"Min":case"MinInt64":case"Sqrt":case"Square":case"Vector4_CrossProduct3":case"Vector4_DotProduct":case"Vector4_DotProduct3":case"Acos":case"Asin":case"Cos":case"DegAcos":case"DegCos":case"DegSin":case"DegTan":case"Sin":case"Tan":return ti}}if(t===ui.blueprintSetLibrary)return ti;if(t===ui.blueprintMapLibrary)return ti}switch(e.getClass()){case ui.comment:case ui.materialGraphNodeComment:return Zt;case ui.createDelegate:return qt;case ui.metasoundEditorGraphExternalNode:return"Add"==e.ClassName?.Name?Jt:oi;case ui.niagaraNodeOp:if(ci.includes(e.OpName?.toString()))return ti;break;case ui.promotableOperator:return ti;case ui.knot:return ai;case ui.literal:case ui.self:case ui.variableGet:case ui.variableSet:return li}return e.isEvent()?ri:qt}class pi extends Ht{static properties={...super.properties,selected:{type:Boolean,attribute:"data-selected",reflect:!0,converter:Le.booleanConverter}};dragHandler=e=>this.addLocation(...e.detail.value);constructor(){super(),this.selected=!1,this.listeningDrag=!1}setup(){super.setup(),this.setSelected(this.selected)}cleanup(){super.cleanup(),this.blueprint.removeEventListener(ae.nodeDragGeneralEventName,this.dragHandler)}setSelected(e=!0){this.selected=e,this.blueprint&&(this.selected?(this.listeningDrag=!0,this.blueprint.addEventListener(ae.nodeDragGeneralEventName,this.dragHandler)):(this.blueprint.removeEventListener(ae.nodeDragGeneralEventName,this.dragHandler),this.listeningDrag=!1))}}class di extends pi{static properties={...pi.properties,typePath:{type:String,attribute:"data-type",reflect:!0},nodeTitle:{type:String,attribute:"data-title",reflect:!0},advancedPinDisplay:{type:String,attribute:"data-advanced-display",converter:et.attributeConverter,reflect:!0},enabledState:{type:String,attribute:"data-enabled-state",reflect:!0},nodeDisplayName:{type:String,attribute:!1},pureFunction:{type:Boolean,converter:Le.booleanConverter,attribute:"data-pure-function",reflect:!0}};static dragEventName=ae.nodeDragEventName;static dragGeneralEventName=ae.nodeDragGeneralEventName;get blueprint(){return super.blueprint}set blueprint(e){super.blueprint=e,this.#Ye.forEach((t=>t.blueprint=e))}#qe;get nodeNameElement(){return this.#qe}set nodeNameElement(e){this.#qe=e}#Ye=[];boundComments=[];#Xe=!1;#Ze=e=>{this.selected||this.#Xe||(this.#Xe=!0,this.requestUpdate(),this.updateComplete.then((()=>this.#Xe=!1)),this.addLocation(...e.detail.value))};static fromSerializedObject(e){e=e.trim();let t=Pt.grammar.parse(e);return di.newObject(t)}static newObject(e=new Pt,t=new(hi(e))){const i=new di;return i.initialize(e,t),i}#We(e){for(let t of this.getPinElements())for(let i of t.getLinks())this.blueprint.getPin(i).redirectLink(t,new lt(new et(e),t.entity.PinId))}initialize(e=new Pt,t=new(hi(e))){this.typePath=e.getType(),this.nodeTitle=e.getObjectName(),this.advancedPinDisplay=e.AdvancedPinDisplay?.toString(),this.enabledState=e.EnabledState,this.nodeDisplayName=_e(e),this.pureFunction=e.bIsPureFunc?.valueOf(),this.dragLinkObjects=[],super.initialize(e,t),this.#Ye=this.template.createPinElements(),super.setLocation(this.entity.getNodePosX(),this.entity.getNodePosY()),this.entity.NodeWidth&&this.entity.NodeHeight?(this.sizeX=this.entity.NodeWidth.value,this.sizeY=this.entity.NodeHeight.value):this.updateComplete.then((()=>this.computeSizes())),e.listenAttribute("Name",(t=>{this.#We(t?.toString()),this.nodeTitle=t?.toString(),this.nodeDisplayName=_e(e)}))}async getUpdateComplete(){let e=await super.getUpdateComplete();for(const t of this.getPinElements())e&&=await t.updateComplete;return e}bindToComment(e){e==this||this.boundComments.includes(e)||(e.addEventListener(ae.nodeDragEventName,this.#Ze),this.boundComments.push(e))}unbindFromComment(e){const t=this.boundComments.indexOf(e);t>=0&&(e.removeEventListener(ae.nodeDragEventName,this.#Ze),this.boundComments[t]=this.boundComments[this.boundComments.length-1],this.boundComments.pop())}isInsideComment(e){return this.topBoundary()>=e.topBoundary()&&this.rightBoundary()<=e.rightBoundary()&&this.bottomBoundary()<=e.bottomBoundary()&&this.leftBoundary()>=e.leftBoundary()}getType(){return this.entity.getType()}getNodeName(){return this.entity.getObjectName()}computeNodeDisplayName(){this.nodeDisplayName=_e(this.entity)}setNodeWidth(e){this.entity.setNodeWidth(e),this.sizeX=e,this.acknowledgeReflow()}setNodeHeight(e){this.entity.setNodeHeight(e),this.sizeY=e,this.acknowledgeReflow()}sanitizeLinks(e=[]){this.getPinElements().forEach((t=>t.sanitizeLinks(e)))}getPinElements(){return this.#Ye}getPinEntities(){return this.entity.getPinEntities()}setLocation(e=0,t=0,i=!0){this.entity.setNodePosX(e),this.entity.setNodePosY(t),super.setLocation(e,t,i)}acknowledgeReflow(){this.requestUpdate(),this.updateComplete.then((()=>this.computeSizes()));let e=new CustomEvent(ae.nodeReflowEventName);this.dispatchEvent(e)}setShowAdvancedPinDisplay(e){this.entity.AdvancedPinDisplay=new et(e?"Shown":"Hidden"),this.advancedPinDisplay=this.entity.AdvancedPinDisplay}toggleShowAdvancedPinDisplay(){this.setShowAdvancedPinDisplay("Shown"!=this.entity.AdvancedPinDisplay?.toString())}}class mi extends Pt{#Qe=new Map;#Je=[];get objectEntities(){return this.#Je}static attributes={...super.attributes,ScriptVariables:super.attributes.ScriptVariables.asUniqueClass(!0).withDefault()};constructor(...e){super(...e),this.Name||(this.Name=new this.constructor.attributes.Name("Blueprint"))}getHomonymObjectEntity(e){const t=e.getObjectName();return this.#Je.find((e=>e.getObjectName()==t))}takeFreeName(e){e=e.replace(/_\d+$/,"");const t=(this.#Qe.get(e)??-1)+1;return this.#Qe.set(e,t),ae.nodeTitle(e,t)}updateNameIndex(e){const t=e.match(/(.+)_(\d+)$/);if(t){e=t[1];const i=Number(t[2]);this.#Qe.set(e,Math.max(i,this.#Qe.get(e)??0))}}addObjectEntity(e){if(!this.#Je.includes(e)){this.#Je.push(e);const[t,i]=e.getNameAndCounter();return this.#Qe.set(t,Math.max(this.#Qe.get(t)??0,i)),!0}return!1}removeObjectEntity(e){const t=this.#Je.indexOf(e);if(t>=0){const e=this.#Je.pop();return t{let i=this[ae.subObjectAttributeNameFromReference(e,t)];i.Name.value=s,i.Name=i.Name})),e.path.replace(i,s),s}variableName(e){return this[ae.subObjectAttributeNameFromReference(e.ScriptVariable,!0)]?.Variable?.Name?.toString()}variableIndex(e){let t=0;for(const i of this.ScriptVariables?.valueOf()){if(e==this.variableName(i))return t;++t}}mergeWith(e){if(0===(e.ScriptVariables?.length??0))return this;const t=this.ScriptVariables.valueOf().map((e=>e.ScriptVariable.getName()));let i=oe.mergeArrays(this.ScriptVariables.valueOf(),e.ScriptVariables.valueOf(),((e,t)=>this.variableName(e)==this.variableName(t)),(i=>{let s=i.ScriptVariable.getName();t.includes(s)&&(s=this.renameScriptVariable(i.ScriptVariable,e)),this.updateNameIndex(s)}));if(i.length===this.ScriptVariables.length)return this;i.reverse();const s=this.constructor,r=i.concat(i).map(((t,s)=>{const r=ae.subObjectAttributeNameFromReference(t.ScriptVariable,s>=i.length),n=this[r]??e[r];return n?[r,n]:null})).filter((e=>e));r.push(...Object.entries(this).filter((([e,t])=>!e.startsWith(ae.subObjectAttributeNamePrefix)&&"ExportedNodes"!==e)),["ScriptVariables",new s.attributes.ScriptVariables(i.reverse())]);const n=new mi(Object.fromEntries(r));return n.mirrorNameInExportPaths(e.Name?.toString()),n.#Qe=this.#Qe,n.#Je=this.#Je,n}getVariablesAttributesReferringTo(...e){let t=new Set(...e.flatMap((e=>e.getPinEntities())).map((e=>e.PinName.toString())));return this.ScriptVariables.valueOf().map((e=>{const t=ae.subObjectAttributeNameFromReference(e.ScriptVariable,!1),i=ae.subObjectAttributeNameFromReference(e.ScriptVariable,!0);return{simple:[t,this[t]],full:[i,this[i]],variable:e}})).filter((e=>t.has(e.full?.Variable?.Name))).reduce(((e,t)=>(e.simple.push([t.simple[0],t.simple[1]]),e.full.push([t.full[0],t.full[1]]),e.ScriptVariables.push(t.variable),e)),{simple:[],full:[],ScriptVariables:[]}),{}}}class gi extends Pt{constructor(e,t){const i=ae.paths.niagaraClipboardContent,s=e.takeFreeName("NiagaraClipboardContent"),r=`/Engine/Transient.${s}`,n=new Set;let a="";for(const i of t)i.exported&&(i.getPinEntities().map((t=>e.variableIndex(t.PinName.toString()))).filter((e=>null!=e)).forEach((e=>n.add(e))),a+=i.serialize());const o=e.ScriptVariables.valueOf().filter(((e,t)=>n.has(t))),l=o.concat(o).map(((t,i)=>{const s=ae.subObjectAttributeNameFromReference(t.ScriptVariable,i>=o.length);return[s,e[s]]}));super({Class:new ot(i),Name:new Qe(s),...Object.fromEntries(l),ExportPath:new ot(i,r),ScriptVariables:new gi.attributes.ScriptVariables(o),ExportedNodes:new Qe(btoa(a))})}}class bi extends Lt{#et;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#et=()=>s.copied()}listenEvents(){window.addEventListener("copy",this.#et)}unlistenEvents(){window.removeEventListener("copy",this.#et)}copied(){const e=this.blueprint.getSerializedText();return navigator.clipboard.writeText(e),e}}class vi extends Lt{#tt;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#tt=()=>s.cut()}listenEvents(){window.addEventListener("cut",this.#tt)}unlistenEvents(){window.removeEventListener("cut",this.#tt)}cut(){this.blueprint.template.getCopyInputObject().copied(),this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0))}}class fi extends Lt{#it;constructor(e,t,i={}){i.listenOnFocus??=!0,i.unlistenOnTextEdit??=!0,super(e,t,i);let s=this;this.#it=e=>s.pasted(e.clipboardData.getData("Text"))}listenEvents(){window.addEventListener("paste",this.#it)}unlistenEvents(){window.removeEventListener("paste",this.#it)}pasted(e){let t=0,i=0,s=0,r=Pt.grammarMultipleObjects.parse(e).map((e=>{let r=Ae.getConstructor("ueb-node").newObject(e);return t+=r.locationY,i+=r.locationX,++s,r}));t/=s,i/=s,r.length>0&&this.blueprint.unselectAll();let n=this.blueprint.mousePosition;for(const e of r)e.addLocation(n[0]-i,n[1]-t),e.snapToGrid(),e.setSelected(!0);return this.blueprint.addGraphElement(...r),r}}class yi extends It{static#q=e=>{};#st=0;get variation(){return this.#st}#rt=e=>{this.enablerKey&&!this.enablerActivated||(e.preventDefault(),this.#st=e.deltaY,this.setLocationFromEvent(e),this.wheel())};#nt=e=>e.preventDefault();constructor(e,t,i={},s=yi.#q){i.listenOnFocus=!0,i.strictTarget??=!1,super(e,t,i),this.strictTarget=i.strictTarget,this.onWheel=s}listenEvents(){this.movementSpace.addEventListener("wheel",this.#rt,!1),this.movementSpace.parentElement?.addEventListener("wheel",this.#nt)}unlistenEvents(){this.movementSpace.removeEventListener("wheel",this.#rt,!1),this.movementSpace.parentElement?.removeEventListener("wheel",this.#nt)}wheel(){this.onWheel(this)}}class wi extends yi{#at=0;#ot=!1;get enableZoonIn(){return this.#ot}set enableZoonIn(e){e!=this.#ot&&(this.#ot=e)}wheel(){if(this.#at+=-this.variation,Math.abs(this.#at)0||(e+=Math.sign(this.#at),this.blueprint.setZoom(e,this.location),this.#at=0)}}class Si extends Mt{#lt;constructor(e,t,i={}){i.activationKeys=Dt.enableZoomIn,super(e,t,i)}fire(){this.#lt=this.blueprint.template.getZoomInputObject(),this.#lt.enableZoonIn=!0}unfire(){this.#lt.enableZoonIn=!1}}class Ei extends zt{startDrag(){this.blueprint.scrolling=!0}dragTo(e,t){this.blueprint.scrollDelta(-t[0],-t[1])}endDrag(){this.blueprint.scrolling=!1}}class Ci extends It{#ct=null;#ut=e=>{e.preventDefault(),this.setLocationFromEvent(e),this.blueprint.mousePosition=[...this.location]};#ht=e=>{this.#ct||(e.preventDefault(),this.#ct=e.detail.tracker,this.unlistenMouseMove())};#pt=e=>{this.#ct==e.detail.tracker&&(e.preventDefault(),this.#ct=null,this.listenMouseMove())};constructor(e,t,i={}){i.listenOnFocus=!0,super(e,t,i)}listenMouseMove(){this.target.addEventListener("mousemove",this.#ut)}unlistenMouseMove(){this.target.removeEventListener("mousemove",this.#ut)}listenEvents(){this.listenMouseMove(),this.blueprint.addEventListener(ae.trackingMouseEventName.begin,this.#ht),this.blueprint.addEventListener(ae.trackingMouseEventName.end,this.#pt)}unlistenEvents(){this.unlistenMouseMove(),this.blueprint.removeEventListener(ae.trackingMouseEventName.begin,this.#ht),this.blueprint.removeEventListener(ae.trackingMouseEventName.end,this.#pt)}}class Ni extends zt{constructor(e,t,i={}){i.scrollGraphEdge??=!0,super(e,t,i),this.selectorElement=this.blueprint.template.selectorElement}startDrag(){this.selectorElement.beginSelect(this.clickedPosition)}dragTo(e,t){this.selectorElement.selectTo(e)}endDrag(){this.started&&this.selectorElement.endSelect()}unclicked(){this.started||this.blueprint.unselectAll()}}class xi extends Lt{#dt=e=>this.clickedSomewhere(e.target);constructor(e,t,i={}){i.listenOnFocus=!0,super(e,t,i),this.blueprint.focus&&document.addEventListener("click",this.#dt)}clickedSomewhere(e){e.closest("ueb-blueprint")||this.blueprint.setFocused(!1)}listenEvents(){document.addEventListener("click",this.#dt)}unlistenEvents(){document.removeEventListener("click",this.#dt)}}class Pi extends $t{static styleVariables={"--ueb-font-size":`${ae.fontSize}`,"--ueb-grid-expand":`${ae.expandGridSize}px`,"--ueb-grid-line-width":`${ae.gridLineWidth}px`,"--ueb-grid-set":`${ae.gridSet}`,"--ueb-grid-size":`${ae.gridSize}px`,"--ueb-link-min-width":`${ae.linkMinWidth}`,"--ueb-node-radius":`${ae.nodeRadius}px`};#mt=new ResizeObserver((e=>{const t=e.find((e=>e.target===this.viewportElement))?.devicePixelContentBoxSize?.[0];t&&(this.viewportSize[0]=t.inlineSize,this.viewportSize[1]=t.blockSize)}));#gt;#bt;#lt;headerElement;overlayElement;viewportElement;selectorElement;gridElement;linksContainerElement;nodesContainerElement;viewportSize=[0,0];#vt=()=>this.headerElement.classList.remove("ueb-zoom-changed");initialize(e){super.initialize(e),this.element.style.cssText=Object.entries(Pi.styleVariables).map((([e,t])=>`${e}:${t};`)).join("");const t=this.element.querySelector(":scope > template")?.content.textContent;t&&(this.element.requestUpdate(),this.element.updateComplete.then((()=>{this.blueprint.mousePosition=[Math.round(this.viewportSize[0]/2),Math.round(this.viewportSize[1]/2)],this.getPasteInputObject().pasted(t),this.blueprint.unselectAll()})))}setup(){super.setup(),this.#mt.observe(this.viewportElement,{box:"device-pixel-content-box"});const e=this.viewportElement.getBoundingClientRect();this.viewportSize[0]=e.width,this.viewportSize[1]=e.height,this.blueprint.nodes.length>0&&(this.blueprint.requestUpdate(),this.blueprint.updateComplete.then((()=>this.centerContentInViewport())))}cleanup(){super.cleanup(),this.#mt.unobserve(this.viewportElement)}createInputObjects(){const e=this.element.getGridDOMElement();return this.#gt=new bi(e,this.blueprint),this.#bt=new fi(e,this.blueprint),this.#lt=new wi(e,this.blueprint),[...super.createInputObjects(),this.#gt,this.#bt,this.#lt,new vi(e,this.blueprint),new Mt(e,this.blueprint,{activationKeys:Dt.duplicateNodes},(()=>this.blueprint.template.getPasteInputObject().pasted(this.blueprint.template.getCopyInputObject().copied()))),new Mt(e,this.blueprint,{activationKeys:Dt.deleteNodes},(()=>this.blueprint.removeGraphElement(...this.blueprint.getNodes(!0)))),new Mt(e,this.blueprint,{activationKeys:Dt.selectAllNodes},(()=>this.blueprint.selectAll())),new Ni(e,this.blueprint,{clickButton:ae.mouseClickButton,exitAnyButton:!0,moveEverywhere:!0}),new Ei(e,this.blueprint,{clickButton:ae.mouseRightClickButton,exitAnyButton:!1,moveEverywhere:!0}),new xi(e,this.blueprint),new Ci(e,this.blueprint),new Si(e,this.blueprint)]}render(){return z`
Zoom ${0==this.blueprint.zoom?"1:1":(this.blueprint.zoom>0?"+":"")+this.blueprint.zoom}

UEBlueprint

A stand alone implementation of the UE's Blueprint visual language editor.

Version: ${ae.VERSION}
Author: barsdeveloper
License: MIT
https://github.com/barsdeveloper/ueblueprint

`}firstUpdated(e){super.firstUpdated(e),this.headerElement=this.blueprint.querySelector(".ueb-viewport-header"),this.overlayElement=this.blueprint.querySelector(".ueb-viewport-overlay"),this.viewportElement=this.blueprint.querySelector(".ueb-viewport-body"),this.selectorElement=this.blueprint.querySelector("ueb-selector"),this.gridElement=this.viewportElement.querySelector(".ueb-grid"),this.linksContainerElement=this.blueprint.querySelector("[data-links]"),this.linksContainerElement.append(...this.blueprint.getLinks()),this.nodesContainerElement=this.blueprint.querySelector("[data-nodes]"),this.nodesContainerElement.append(...this.blueprint.getNodes()),this.viewportElement.scroll(ae.expandGridSize,ae.expandGridSize)}willUpdate(e){super.willUpdate(e),this.headerElement&&e.has("zoom")&&(this.headerElement.classList.contains("ueb-zoom-changed")&&(this.headerElement.classList.remove("ueb-zoom-changed"),this.headerElement.offsetWidth),this.headerElement.classList.add("ueb-zoom-changed"),this.headerElement.addEventListener("animationend",this.#vt,{once:!0}))}updated(e){if(super.updated(e),(e.has("scrollX")||e.has("scrollY"))&&this.viewportElement.scroll(this.blueprint.scrollX,this.blueprint.scrollY),e.has("zoom")){this.blueprint.style.setProperty("--ueb-scale",this.blueprint.getScale());const t=e.get("zoom"),i=Math.min(t,this.blueprint.zoom),s=Math.max(t,this.blueprint.zoom),r=oe.range(i,s),n=e=>`ueb-zoom-${e}`;te<0)).map(n)),this.blueprint.classList.add(...r.filter((e=>e>0)).map(n))):(this.blueprint.classList.remove(...r.filter((e=>e>0)).map(n)),this.blueprint.classList.add(...r.filter((e=>e<0)).map(n)))}}getCommentNodes(e=!1){return this.blueprint.querySelectorAll(`ueb-node[data-type="${ae.paths.comment}"]${e?'[data-selected="true"]':""}, ueb-node[data-type="${ae.paths.materialGraphNodeComment}"]${e?'[data-selected="true"]':""}`)}getPin(e){return this.blueprint.querySelector(`ueb-node[data-title="${e.objectName}"] ueb-pin[data-id="${e.pinGuid}"]`)}getCopyInputObject(){return this.#gt}getPasteInputObject(){return this.#bt}getZoomInputObject(){return this.#lt}isPointVisible(e,t){return!1}gridTopVisibilityBoundary(){return this.blueprint.scaleCorrect(this.blueprint.scrollY)-this.blueprint.translateY}gridRightVisibilityBoundary(){return this.gridLeftVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[0])}gridBottomVisibilityBoundary(){return this.gridTopVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[1])}gridLeftVisibilityBoundary(){return this.blueprint.scaleCorrect(this.blueprint.scrollX)-this.blueprint.translateX}centerViewport(e=0,t=0,i=!0){const s=this.gridLeftVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[0]/2),r=this.gridTopVisibilityBoundary()+this.blueprint.scaleCorrect(this.viewportSize[1]/2);this.blueprint.scrollDelta(this.blueprint.scaleCorrectReverse(e-s),this.blueprint.scaleCorrectReverse(t-r),i)}centerContentInViewport(e=!0){let t=0,i=0,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;const o=this.blueprint.getNodes();for(const e of o)t+=e.leftBoundary()+e.rightBoundary(),i+=e.topBoundary()+e.bottomBoundary(),s=Math.min(s,e.leftBoundary()),r=Math.max(r,e.rightBoundary()),n=Math.min(n,e.topBoundary()),a=Math.max(a,e.bottomBoundary());t=Math.round(r-s<=this.viewportSize[0]?(r+s)/2:t/(2*o.length)),i=Math.round(a-n<=this.viewportSize[1]?(a+n)/2:i/(2*o.length)),this.centerViewport(t,i,e)}}class ki extends le{static properties={selecting:{type:Boolean,attribute:"data-selecting",reflect:!0,converter:Le.booleanConverter},scrolling:{type:Boolean,attribute:"data-scrolling",reflect:!0,converter:Le.booleanConverter},focused:{type:Boolean,attribute:"data-focused",reflect:!0,converter:Le.booleanConverter},zoom:{type:Number,attribute:"data-zoom",reflect:!0},scrollX:{type:Number,attribute:!1},scrollY:{type:Number,attribute:!1},additionalX:{type:Number,attribute:!1},additionalY:{type:Number,attribute:!1},translateX:{type:Number,attribute:!1},translateY:{type:Number,attribute:!1}};static nodeBoundariesSupplier=e=>({primaryInf:e.leftBoundary(!0),primarySup:e.rightBoundary(!0),secondaryInf:e.topBoundary(!0),secondarySup:e.bottomBoundary(!0)});static nodeSelectToggleFunction=(e,t)=>{e.setSelected(t)};#ft=0;#yt=0;nodes=[];links=[];nodesNames=new Map;mousePosition=[0,0];waitingExpandUpdate=!1;constructor(){super(),this.selecting=!1,this.scrolling=!1,this.focused=!1,this.zoom=0,this.scrollX=ae.expandGridSize,this.scrollY=ae.expandGridSize,this.translateX=ae.expandGridSize,this.translateY=ae.expandGridSize,super.initialize(new mi,new Pi)}initialize(){}getGridDOMElement(){return this.template.gridElement}getScroll(){return[this.scrollX,this.scrollY]}setScroll(e,t){this.scrollX=e,this.scrollY=t}scrollDelta(e=0,t=0,i=!1,s=ae.smoothScrollTime){if(i){let i=[0,0];this.#ft&&cancelAnimationFrame(this.#ft),this.#yt&&cancelAnimationFrame(this.#yt),oe.animate(0,e,s,(e=>{this.scrollDelta(e-i[0],0,!1),i[0]=e}),(e=>this.#ft=e)),oe.animate(0,t,s,(e=>{this.scrollDelta(0,e-i[1],!1),i[1]=e}),(e=>this.#yt=e))}else{const i=[2*ae.expandGridSize,2*ae.expandGridSize];let s=this.getScroll(),r=[s[0]+e,s[1]+t],n=[0,0];for(let e=0;e<2;++e)r[e]i[e]-ae.gridExpandThreshold*ae.expandGridSize&&(n[e]=1);0==n[0]&&0==n[1]||this.seamlessExpand(n[0],n[1]),s=this.getScroll(),r=[s[0]+e,s[1]+t],this.setScroll(r[0],r[1])}}scrollCenter(e=!1){const t=this.getScroll(),i=[this.translateX-t[0],this.translateY-t[1]],s=this.getViewportSize().map((e=>e/2)),r=[i[0]-s[0],i[1]-s[1]];this.scrollDelta(r[0],r[1],e)}getViewportSize(){return[this.template.viewportElement.clientWidth,this.template.viewportElement.clientHeight]}getScrollMax(){return[this.template.viewportElement.scrollWidth-this.template.viewportElement.clientWidth,this.template.viewportElement.scrollHeight-this.template.viewportElement.clientHeight]}snapToGrid(e,t){return oe.snapToGrid(e,t,ae.gridSize)}seamlessExpand(e,t){e=Math.round(e),t=Math.round(t);let i=this.getScale();[e,t]=[-e*ae.expandGridSize,-t*ae.expandGridSize],0!=e&&(this.scrollX+=e,e/=i),0!=t&&(this.scrollY+=t,t/=i),this.translateX+=e,this.translateY+=t}progressiveSnapToGrid(e){return ae.expandGridSize*Math.round(e/ae.expandGridSize+.5*Math.sign(e))}getZoom(){return this.zoom}setZoom(e,t){if((e=oe.clamp(e,ae.minZoom,ae.maxZoom))==this.zoom)return;let i=this.getScale();if(this.zoom=e,t){t[0]+=this.translateX,t[1]+=this.translateY;let e=this.getScale()/i,s=[e*t[0],e*t[1]];this.scrollDelta((s[0]-t[0])*i,(s[1]-t[1])*i)}}getScale(){return ae.scale[this.getZoom()]}scaleCorrect(e){return e/this.getScale()}scaleCorrectReverse(e){return e*this.getScale()}compensateTranslation(e,t){return[e-=this.translateX,t-=this.translateY]}getNodes(e=!1){let t=this.nodes;return e&&(t=t.filter((e=>e.selected))),t}getCommentNodes(e=!1){let t=[...this.template.getCommentNodes(e)];return 0===t.length&&(t=this.nodes.filter((t=>t.getType()===ae.paths.comment&&(!e||t.selected)))),t}getPin(e){let t=this.template.getPin(e);return t&&t.nodeElement.getNodeName()==e.objectName.toString()||(t=[...this.nodes.find((t=>e.objectName.toString()==t.getNodeName()))?.getPinElements()??[]].find((t=>e.pinGuid.toString()==t.getPinId().toString()))),t}getLinks(e=null,t=null){if(null==e!=(null==t)){const i=e??t;return this.links.filter((e=>e.origin==i||e.target==i))}return null!=e&&null!=t?this.links.filter((i=>i.origin==e&&i.target==t||i.origin==t&&i.target==e)):this.links}getLink(e,t,i=!1){return this.links.find((s=>s.origin==e&&s.target==t||!i&&s.origin==t&&s.target==e))}selectAll(){this.getNodes().forEach((e=>ki.nodeSelectToggleFunction(e,!0)))}unselectAll(){this.getNodes().forEach((e=>ki.nodeSelectToggleFunction(e,!1)))}getSerializedText(){const e=this.blueprint.getNodes(!0).map((e=>e.entity));let t=!1,i=e.filter((e=>(t||=e.exported,!e.exported))).reduce(((e,t)=>e+t.serialize()),"");if(t){i=new gi(this.blueprint.entity,e).serialize()+i}return i}addGraphElement(...e){const t=e=>{const i=e.currentTarget;i.removeEventListener(ae.removeEventName,t);const[s,r]=i instanceof di?[this.nodes,i.entity]:i instanceof Gt?[this.links]:null,n=s?.indexOf(i);if(n>=0){const e=s.pop();ne.entity.exported=!0));continue}const s=this.entity.getHomonymObjectEntity(i.entity);if(s){const t=this.entity.takeFreeName(e);s.Name=new s.Name.constructor(t)}this.nodes.push(i),this.entity.addObjectEntity(i.entity),i.addEventListener(ae.removeEventName,t),this.template.nodesContainerElement?.appendChild(i)}else i instanceof Gt&&!this.links.includes(i)&&(this.links.push(i),i.addEventListener(ae.removeEventName,t),this.template.linksContainerElement&&!this.template.linksContainerElement.contains(i)&&this.template.linksContainerElement.appendChild(i));e.filter((e=>e instanceof di)).forEach((t=>t.sanitizeLinks(e))),e.filter((e=>e instanceof di&&e.getType()==ae.paths.comment)).forEach((e=>e.updateComplete.then((()=>e.template.manageNodesBind()))))}removeGraphElement(...e){for(let t of e){if(t.closest("ueb-blueprint")!==this)return;t.remove()}}setFocused(e=!0){if(this.focused==e)return;let t=new CustomEvent(e?ae.focusEventName.begin:ae.focusEventName.end);this.focused=e,this.focused||this.unselectAll(),this.dispatchEvent(t)}acknowledgeEditText(e){const t=new CustomEvent(e?ae.editTextEventName.begin:ae.editTextEventName.end);this.dispatchEvent(t)}}customElements.define("ueb-blueprint",ki);class Li extends Ut{#wt;get locationChangeCallback(){return this.#wt}set locationChangeCallback(e){this.#wt=e}movementSpace;movementSpaceSize=[0,0];firstUpdated(e){super.firstUpdated(e),this.movementSpace=this.element.parentElement}setup(){super.setup();const e=this.movementSpace.getBoundingClientRect();this.movementSpaceSize=[e.width,e.height]}createDraggableObject(){return new _t(this.element,this.blueprint,{draggableElement:this.movementSpace,ignoreTranslateCompensate:!0,moveEverywhere:!0,movementSpace:this.movementSpace,repositionOnClick:!0,stepSize:1})}adjustLocation(e,t){return this.locationChangeCallback?.(e,t),[e,t]}}class Ai extends Li{adjustLocation(e,t){const i=Math.round(this.movementSpaceSize[0]/2);e-=i,t=-(t-i);let[s,r]=oe.getPolarCoordinates(e,t);return s=Math.min(s,i),[e,t]=oe.getCartesianCoordinates(s,r),this.locationChangeCallback?.(e/i,t/i),[e=Math.round(e+i),t=Math.round(-t+i)]}}class Mi extends Ht{windowElement;setup(){super.setup(),this.windowElement=this.closest("ueb-window")}setLocation(e,t){super.setLocation(...this.template.adjustLocation(e,t))}}class Ii extends Mi{constructor(){super(),super.initialize({},new Ai)}static newObject(){return new Ii}initialize(){}}class Ti extends Li{adjustLocation(e,t){return e=oe.clamp(e,0,this.movementSpaceSize[0]),t=oe.clamp(t,0,this.movementSpaceSize[1]),this.locationChangeCallback?.(e/this.movementSpaceSize[0],1-t/this.movementSpaceSize[1]),[e,t]}}class Oi extends Mi{constructor(){super(),super.initialize({},new Ti)}static newObject(){return new Oi}initialize(){}}class Di extends zt{constructor(e,t,i={}){i.consumeEvent=!0,super(e,t,i)}}class $i extends $t{#St;#Et;#Ct=e=>this.element.selectedOption=e.target.selectedOptions[0].value;render(){return z` `}firstUpdated(e){super.firstUpdated(e),this.#St=this.element.querySelector("select:first-child"),this.#Et=this.element.querySelector("select:last-child");const t=new Event("input",{bubbles:!0});this.#St.dispatchEvent(t)}updated(e){super.updated(e);const t=this.#Et.getBoundingClientRect();this.element.style.setProperty("--ueb-dropdown-width",t.width+"px")}createInputObjects(){return[...super.createInputObjects(),new Di(this.element,this.blueprint)]}setSelectedValue(e){this.element.querySelector(`option[value="${e}"]`).defaultSelected=!0}getSelectedValue(){return this.#St.value}}class Vi extends le{static properties={...super.properties,options:{type:Object},selectedOption:{type:String}};constructor(){super(),super.initialize({},new $i),this.options=[],this.selectedOption=""}static newObject(e){return new Vi}initialize(){}getValue(){return this.template.getSelectedValue()}}class Bi extends $t{#Nt=()=>{this.blueprint.acknowledgeEditText(!0),this.element.selectOnFocus&&getSelection().selectAllChildren(this.element)};#xt=()=>{this.blueprint.acknowledgeEditText(!1),getSelection().removeAllRanges()};#Pt=e=>e.target.querySelectorAll("br").forEach((e=>e.remove()));#kt=e=>{"Enter"!=e.code||e.shiftKey||e.target.blur()};initialize(e){super.initialize(e),this.element.classList.add("ueb-pin-input-content"),this.element.setAttribute("role","textbox"),this.element.contentEditable="true"}firstUpdated(e){super.firstUpdated(e);const t=new Event("input",{bubbles:!0});this.element.dispatchEvent(t)}createInputObjects(){return[...super.createInputObjects(),new Di(this.element,this.blueprint)]}setup(){super.setup(),this.element.addEventListener("focus",this.#Nt),this.element.addEventListener("focusout",this.#xt),this.element.singleLine&&this.element.addEventListener("input",this.#Pt),this.element.blurOnEnter&&this.element.addEventListener("keydown",this.#kt)}cleanup(){super.cleanup(),this.element.removeEventListener("focus",this.#Nt),this.element.removeEventListener("focusout",this.#xt),this.element.removeEventListener("input",this.#Pt),this.element.removeEventListener("keydown",this.#kt)}}class Ri extends le{static properties={...super.properties,singleLine:{type:Boolean,attribute:"data-single-line",converter:Le.booleanConverter,reflect:!0},selectOnFocus:{type:Boolean,attribute:"data-select-focus",converter:Le.booleanConverter,reflect:!0},blurOnEnter:{type:Boolean,attribute:"data-blur-enter",converter:Le.booleanConverter,reflect:!0}};constructor(){super(),this.singleLine=!1,this.selectOnFocus=!0,this.blurOnEnter=!0,super.initialize({},new Bi)}static newObject(){return new Ri}initialize(){}}class Gi extends ii{#Lt;#At=()=>{const e=this.element.getDefaultValue(!0);e.value=this.#Lt.checked,this.element.setDefaultValue(e)};firstUpdated(e){super.firstUpdated(e),this.#Lt=this.element.querySelector(".ueb-pin-input")}setup(){super.setup(),this.#Lt?.addEventListener("change",this.#At)}cleanup(){super.cleanup(),this.#Lt?.removeEventListener("change",this.#At)}createInputObjects(){return[...super.createInputObjects(),new Di(this.#Lt,this.blueprint)]}renderInput(){return z``}}class Hi extends ii{static singleLineInput=!1;static selectOnFocus=!0;static saveEachInputChange=!1;#Mt;get inputWrapper(){return this.#Mt}#It;static stringFromInputToUE(e){return e.replace(/(?=\n\s*)\n$/,"")}static stringFromUEToInput(e){return e.replaceAll(/(?:\r|(?<=(?:^|[^\\])(?:\\\\)*)\\r)(?=\n)/g,"").replace(/(?<=\n\s*)$/,"\n")}#Tt=()=>this.setInputs(this.getInputs(),!0);#Ot=e=>this.#Dt(e.target);#Dt(e){if(this.element.querySelector(".ueb-pin-name")?.getBoundingClientRect().width<20)return;const t=this.blueprint.scaleCorrect(this.#Mt.getBoundingClientRect().width)+this.nameWidth,i=this.element.classList.contains("ueb-pin-input-wrap");!i&&t>ae.pinInputWrapWidth?this.element.classList.add("ueb-pin-input-wrap"):i&&t<=ae.pinInputWrapWidth&&this.element.classList.remove("ueb-pin-input-wrap")}firstUpdated(e){super.firstUpdated(e);this.constructor.canWrapInput&&this.isInputRendered()&&(this.element.addEventListener("input",this.#Ot),this.nameWidth=this.blueprint.scaleCorrect(this.element.querySelector(".ueb-pin-name")?.getBoundingClientRect().width??0)),this.#Mt=this.element.querySelector(".ueb-pin-input-wrapper"),this.#It=[...this.element.querySelectorAll("ueb-input")]}setup(){super.setup();const e=this.constructor;e.saveEachInputChange?this.element.addEventListener("input",this.#Tt):this.element.addEventListener("focusout",this.#Tt),e.canWrapInput&&this.isInputRendered()&&(this.element.addEventListener("input",this.#Ot),this.element.nodeElement.addEventListener(ae.nodeReflowEventName,this.#Ot))}cleanup(){super.cleanup(),this.element.nodeElement.removeEventListener(ae.nodeReflowEventName,this.#Ot),this.element.removeEventListener("input",this.#Ot),this.element.removeEventListener("input",this.#Tt),this.element.removeEventListener("focusout",this.#Tt)}getInput(){return this.getInputs().reduce(((e,t)=>e+t),"")}getInputs(){return this.#It.map((e=>oe.clearHTMLWhitespace(e.innerHTML)))}setInputs(e=[],t=!0){this.#It.forEach(this.constructor.singleLineInput?(t,i)=>t.innerText=e[i]:(t,i)=>t.innerText=e[i].replaceAll("\n","")),t&&this.setDefaultValue(e.map((e=>Hi.stringFromInputToUE(e))),e),this.element.requestUpdate(),this.element.nodeElement.acknowledgeReflow()}setDefaultValue(e=[],t=e){this.element.setDefaultValue(e.join(""))}renderInput(){const e=this.constructor,t=e.singleLineInput,i=e.selectOnFocus;return z`
`}}class zi extends ii{renderIcon(){return ce.execPin}renderName(){let e=this.element.entity.PinName?.toString();if(this.element.entity.PinFriendlyName)e=this.element.entity.PinFriendlyName.toString();else if("execute"===e||"then"===e)return z``;return z`${this.element.getPinDisplayName()}`}}class _i extends Hi{static singleLineInput=!0;setInputs(e=[],t=!1){if(e&&0!=e.length||(e=[this.getInput()]),super.setInputs(e,!1),t){let i=[];for(const s of e){let e=parseFloat(s);isNaN(e)&&(e=0,t=!1),i.push(e)}this.setDefaultValue(i,e)}}setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}}class Fi extends _i{renderInput(){return z`
`}} /** * @license * Copyright 2017 Google LLC @@ -30,4 +30,4 @@ class re extends S{constructor(){super(...arguments),this.renderOptions={host:th * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Ki="important",Yi=" !"+Ki,qi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Ui{constructor(e){if(super(e),e.type!==ji||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const s=e[i];return null==s?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(Yi);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?Ki:""):i[e]=s}}return _}});class Xi extends Kt{toggleAdvancedDisplayHandler;getDraggableElement(){return this.element.querySelector(".ueb-window-top")}createDraggableObject(){return new _t(this.element,this.blueprint,{draggableElement:this.getDraggableElement(),ignoreScale:!0,ignoreTranslateCompensate:!1,movementSpace:this.blueprint,stepSize:1})}setup(){const e=this.blueprint.template.gridLeftVisibilityBoundary(),t=this.blueprint.template.gridTopVisibilityBoundary();this.element.locationX=this.blueprint.scaleCorrectReverse(this.blueprint.mousePosition[0]-e),this.element.locationY=this.blueprint.scaleCorrectReverse(this.blueprint.mousePosition[1]-t),this.element.updateComplete.then((()=>{const e=this.blueprint.getBoundingClientRect();this.element.locationX+this.element.sizeX>e.width&&(this.element.locationX=e.width-this.element.sizeX),this.element.locationX=Math.max(0,this.element.locationX),this.element.locationY+this.element.sizeY>e.height&&(this.element.locationY=e.height-this.element.sizeY),this.element.locationY=Math.max(0,this.element.locationY)}))}render(){return z`
${this.renderWindowName()}
${ce.close}
${this.renderContent()}
`}renderWindowName(){return z`Window`}renderContent(){return z``}apply(){this.element.dispatchEvent(new CustomEvent(ae.windowApplyEventName)),this.element.remove()}cancel(){this.element.dispatchEvent(new CustomEvent(ae.windowCancelEventName)),this.element.remove()}}class Zi extends Xi{#$t;#Vt;#Bt;#Rt;#Gt;#Ht;#zt;#_t;#Ft;#jt;#Ut=e=>{const t=oe.clearHTMLWhitespace(e.target.innerHTML),i=parseInt(t,16);isNaN(i)||(this.color.setFromRGBANumber(i),this.element.requestUpdate())};#Kt=e=>{const t=oe.clearHTMLWhitespace(e.target.innerHTML),i=parseInt(t,16);isNaN(i)||(this.color.setFromSRGBANumber(i),this.element.requestUpdate())};#Yt=e=>t=>{"Enter"==t.code&&(t.preventDefault(),e(t))};#qt=new Oe;get color(){return this.#qt}set color(e){e.toNumber()!=this.color?.toNumber()&&(this.element.requestUpdate("color",this.#qt),this.#qt=e)}#Xt=new Oe;get fullColor(){return this.#Xt}#Zt;get initialColor(){return this.#Zt}#Wt=new Oe;#Qt(e,t,i=!1){const s=this.color.toRGBAString(),r=`${s.substring(0,2*e)}${t}${s.substring(2+2*e)}`;return i?`${r.substring(0,6)}FF`:r}initialize(e){super.initialize(e),this.#Zt=this.element.windowOptions.getPinColor(),this.color.setFromHSVA(this.initialColor.H.value,this.initialColor.S.value,this.initialColor.V.value,this.initialColor.A.value),this.fullColor.setFromHSVA(this.color.H.value,1,1,1)}firstUpdated(e){this.#$t=this.element.querySelector(".ueb-color-picker-wheel ueb-color-handler"),this.#Vt=this.element.querySelector(".ueb-color-picker-saturation ueb-ui-slider"),this.#Bt=this.element.querySelector(".ueb-color-picker-value ueb-ui-slider"),this.#Rt=this.element.querySelector(".ueb-color-picker-r ueb-ui-slider"),this.#Gt=this.element.querySelector(".ueb-color-picker-g ueb-ui-slider"),this.#Ht=this.element.querySelector(".ueb-color-picker-b ueb-ui-slider"),this.#zt=this.element.querySelector(".ueb-color-picker-a ueb-ui-slider"),this.#_t=this.element.querySelector(".ueb-color-picker-h ueb-ui-slider"),this.#Ft=this.element.querySelector(".ueb-color-picker-s ueb-ui-slider"),this.#jt=this.element.querySelector(".ueb-color-picker-v ueb-ui-slider"),this.#$t.template.locationChangeCallback=(e,t)=>{this.color.setFromWheelLocation(e,t,this.color.V.value,this.color.A.value),this.fullColor.setFromHSVA(this.color.H.value,1,1,1),this.element.requestUpdate()},this.#Vt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,t,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#Bt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,this.color.S.value,t,this.color.A.value),this.element.requestUpdate()},this.#Rt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(e,this.color.G.value,this.color.B.value,this.color.A.value),this.element.requestUpdate()},this.#Gt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,e,this.color.B.value,this.color.A.value),this.element.requestUpdate()},this.#Ht.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,this.color.G.value,e,this.color.A.value),this.element.requestUpdate()},this.#zt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,this.color.G.value,this.color.B.value,e),this.element.requestUpdate()},this.#_t.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(e,this.color.S.value,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#Ft.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,e,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#jt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,this.color.S.value,e,this.color.A.value),this.element.requestUpdate()}}renderSlider(e){let t="",i=0,s="";const r=e=>`linear-gradient(to right, #${this.#Qt(e,"00",!0)}, #${this.#Qt(e,"ff",!0)})`;switch(e){case 0:t="r",i=this.color.R.value,s=r(e);break;case 1:t="g",i=this.color.G.value,s=r(e);break;case 2:t="b",i=this.color.B.value,s=r(e);break;case 3:t="a",i=this.color.A.value,s=`${ae.alphaPattern}, ${r(e)}`;break;case 4:t="h",i=360*this.color.H.value,s="linear-gradient(to right, #f00 0%, #ff0 16.666%, #0f0 33.333%, #0ff 50%, #00f 66.666%, #f0f 83.333%, #f00 100%)";break;case 5:t="s",i=this.color.S.value,s=`linear-gradient(to right,#${this.#Wt.setFromHSVA(this.color.H.value,0,this.color.V.value,1),this.#Wt.toRGBAString()},#${this.#Wt.setFromHSVA(this.color.H.value,1,this.color.V.value,1),this.#Wt.toRGBAString()})`;break;case 6:t="v",i=this.color.V.value,s=`linear-gradient(to right, #000, #${this.fullColor.toRGBAString()})`}return s=`background: ${s};`,z`
${t.toUpperCase()}
`}renderContent(){const e=2*this.color.H.value*Math.PI,t={"--ueb-color-r":this.color.R.toString(),"--ueb-color-g":this.color.G.toString(),"--ueb-color-b":this.color.B.toString(),"--ueb-color-a":this.color.A.toString(),"--ueb-color-h":this.color.H.toString(),"--ueb-color-s":this.color.S.toString(),"--ueb-color-v":this.color.V.toString(),"--ueb-color-wheel-x":100*(this.color.S.value*Math.cos(e)*.5+.5)+"%","--ueb-color-wheel-y":100*(this.color.S.value*Math.sin(e)*.5+.5)+"%"},i=this.color.toRGBAString(),s=this.color.toSRGBAString(),r=this.fullColor.toRGBAString();return z`
Old
New
Advanced
${this.renderSlider(0)} ${this.renderSlider(1)} ${this.renderSlider(2)} ${this.renderSlider(3)}
${this.renderSlider(4)} ${this.renderSlider(5)} ${this.renderSlider(6)}
Hex Linear
Hex sRGB
${ae.windowApplyButtonText}
${ae.windowCancelButtonText}
`}renderWindowName(){return z`${ae.colorWindowName}`}}class Wi extends _i{renderInput(){return z`
`}}class Qi extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);i.X.value=e[0],i.Y.value=e[1],this.element.setDefaultValue(i)}renderInput(){return z`
X
Y
`}}class Ji extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}#ti(){return $e.printNumber(this.element.getDefaultValue()?.Z.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);if(!(i instanceof Ve))throw new TypeError("Expected DefaultValue to be a VectorEntity");i.X.value=e[0],i.Y.value=e[1],i.Z.value=e[2],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
`}}const es={bool:Gi,byte:Fi,enum:class extends Hi{static saveEachInputChange=!0;#ii;#si=[];setup(){super.setup();const e=this.element.nodeElement.entity.EnumEntries?.valueOf();this.#si=e?.map((e=>(""===e.valueOf()&&(e=new Qe("None")),[e,this.element.nodeElement.getPinEntities().find((t=>e===t.PinName))?.PinFriendlyName.toString()??e])))??ae.CommonEnums[this.element.entity.getSubCategory()]?.map((e=>e instanceof Array?e:[e,oe.formatStringName(e)]))??[];const t=this.element.getDefaultValue()?.toString();this.#si.find((([e,i])=>e===t))||this.#si.push([t,oe.formatStringName(t)]),this.element.requestUpdate()}renderInput(){return z``}firstUpdated(e){super.firstUpdated(e),this.#ii=this.element.querySelector("ueb-dropdown")}getInputs(){return[this.#ii.getValue()]}setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}},float:Wi,int:Fi,int64:class extends _i{setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=BigInt(e[0]),this.element.setDefaultValue(i),this.element.requestUpdate()}renderInput(){return z`
`}},MUTABLE_REFERENCE:class extends ii{renderIcon(){return ce.referencePin}},name:class extends Hi{static singleLineInput=!0},real:Wi,rg:Qi,string:class extends Hi{setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}},[ae.paths.linearColor]:class extends ii{#ri;#ni=e=>{e.preventDefault(),this.blueprint.setFocused(!0),this.#ri=Ae.getConstructor("ueb-window").newObject({type:new Zi,windowOptions:{getPinColor:()=>this.element.defaultValue,setPinColor:e=>this.element.setDefaultValue(e)}}),this.blueprint.append(this.#ri);const t=()=>{this.element.setDefaultValue(this.#ri.template.color)},i=()=>{this.#ri.removeEventListener(ae.windowApplyEventName,t),this.#ri.removeEventListener(ae.windowCloseEventName,i),this.#ri=null};this.#ri.addEventListener(ae.windowApplyEventName,t),this.#ri.addEventListener(ae.windowCloseEventName,i)};renderInput(){return z``}},[ae.paths.niagaraBool]:Gi,[ae.paths.niagaraFloat]:Wi,[ae.paths.niagaraInt32]:Fi,[ae.paths.niagaraPosition]:Ji,[ae.paths.rotator]:class extends _i{#ai(){return $e.printNumber(this.element.getDefaultValue()?.R.valueOf()??0)}#oi(){return $e.printNumber(this.element.getDefaultValue()?.P.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}setDefaultValue(e=[],t=e){const i=this.element.getDefaultValue(!0);if(!(i instanceof dt))throw new TypeError("Expected DefaultValue to be a RotatorEntity");i.R.value=e[0],i.P.value=e[1],i.Y.value=e[2],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
`}},[ae.paths.vector]:Ji,[ae.paths.vector2D]:Qi,[ae.paths.vector2f]:Qi,[ae.paths.vector3f]:Ji,[ae.paths.vector4f]:class extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}#ti(){return $e.printNumber(this.element.getDefaultValue()?.Z.valueOf()??0)}#li(){return $e.printNumber(this.element.getDefaultValue()?.W.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);if(!(i instanceof bt))throw new TypeError("Expected DefaultValue to be a Vector4DEntity");i.X.value=e[0],i.Y.value=e[1],i.Z.value=e[2],i.W.value=e[3],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
W
`}}};function ts(e){if("Array"===e.PinType.ContainerType?.toString())return ii;if(e.PinType.bIsReference?.valueOf()&&!e.PinType.bIsConst?.valueOf())return es.MUTABLE_REFERENCE;if(e.isExecution())return zi;const t=e.getType();return(e.isInput()?es[t]:ii)??ii}class is extends le{static properties={pinId:{type:Ue,converter:{fromAttribute:(e,t)=>e?Ue.grammar.parse(e):null,toAttribute:(e,t)=>e?.toString()},attribute:"data-id",reflect:!0},pinType:{type:String,attribute:"data-type",reflect:!0},advancedView:{type:String,attribute:"data-advanced-view",reflect:!0},color:{type:Oe,converter:{fromAttribute:(e,t)=>e?Oe.getLinearColorFromAnyFormat().parse(e):null,toAttribute:(e,t)=>e?Oe.printLinearColor(e):null},attribute:"data-color",reflect:!0},defaultValue:{type:String,attribute:!1},isLinked:{type:Boolean,converter:Le.booleanConverter,attribute:"data-linked",reflect:!0},pinDirection:{type:String,attribute:"data-direction",reflect:!0},connectable:{type:Boolean,converter:Le.booleanConverter,attribute:"data-connectable",reflect:!0}};nodeElement;static newObject(e=new yt,t=new(ts(e)),i=void 0){const s=new is;return s.initialize(e,t,i),s}initialize(e=new yt,t=new(ts(e)),i=void 0){this.nodeElement=i,this.advancedView=e.bAdvancedView?.valueOf(),this.isLinked=!1,this.connectable=!e.bNotConnectable?.valueOf(),super.initialize(e,t),this.pinId=this.entity.PinId,this.pinType=this.entity.getType(),this.defaultValue=this.entity.getDefaultValue(),this.color=is.properties.color.converter.fromAttribute(this.getColor().toString()),this.pinDirection=e.isInput()?"input":e.isOutput()?"output":"hidden"}setup(){super.setup(),this.nodeElement=this.closest("ueb-node")}createPinReference(){return new lt(new et(this.nodeElement.getNodeName()),this.getPinId())}getPinId(){return this.entity.PinId}getPinName(){return this.entity.PinName?.toString()??""}getPinDisplayName(){return this.entity.pinTitle()}getColor(){return this.entity.pinColor()}#ci(e){for(;e?.isKnot();){const t=e.nodeElement.getPinElements();e=(e=e===t[0]?t[1]:t[0]).isLinked?this.blueprint.getPin(e.getLinks()[0]):null}return e?.isKnot()?void 0:e}isInput(e=!1){let t=this;return e?this.#ci(t)?.isInput():t.entity.isInput()}isInputLoosely(){return this.isInput(!1)&&void 0===this.isInput(!0)}isInputVisually(){const e=this.nodeElement.template,t=this.isKnot();return t&&this.isInput()!=e.switchDirectionsVisually||!t&&this.isInput()}isOutput(e=!1){let t=this;return e&&e?this.#ci(t)?.isOutput():t.entity.isOutput()}isOutputLoosely(){return this.isOutput(!1)&&void 0===this.isOutput(!0)}isOutputVisually(){const e=this.nodeElement.template,t=this.isKnot();return t&&this.isOutput()!=e.switchDirectionsVisually||!t&&this.isOutput()}isKnot(){return this.nodeElement?.getType()==ae.paths.knot}getLinkLocation(e=!1){return this.template.getLinkLocation(e)}getNodeElement(){return this.nodeElement}getLinks(){return this.entity.LinkedTo?.valueOf()??[]}getDefaultValue(e=!1){return this.defaultValue=this.entity.getDefaultValue(e)}setDefaultValue(e){this.entity.DefaultValue=e,this.defaultValue=e,this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName()}sanitizeLinks(e=[]){this.entity.LinkedTo=new yt.attributes.LinkedTo(this.entity.LinkedTo?.valueOf().filter((t=>{let i=this.blueprint.getPin(t);if(i){if(e.length&&!e.includes(i.nodeElement))return!1;let t=this.blueprint.getLink(this,i);t||(t=Ae.getConstructor("ueb-link").newObject(this,i),this.blueprint.addGraphElement(t))}return i}))),this.isLinked=this.entity.isLinked()}linkTo(e){const t=this.createPinReference();this.isLinked&&(this.isInput(!0)||this.isOutput(!0)&&(this.entity.isExecution()||e.entity.isExecution()))&&!this.getLinks().some((e=>t.equals(e)))&&this.unlinkFromAll(),this.entity.linkTo(e.getNodeElement().getNodeName(),e.entity)&&(this.isLinked=this.entity.isLinked(),this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName())}unlinkFrom(e,t=!0){this.entity.unlinkFrom(e.getNodeElement().getNodeName(),e.entity)&&(this.isLinked=this.entity.isLinked(),t&&this.blueprint.getLink(this,e)?.remove(),this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName())}unlinkFromAll(){this.getLinks().length,this.getLinks().map((e=>this.blueprint.getPin(e))).forEach((e=>this.unlinkFrom(e)))}redirectLink(e,t){const i=this.getLinks().findIndex((t=>t.objectName.toString()==e.getNodeElement().getNodeName()&&t.pinGuid.toString()==e.entity.PinId.toString()));return i>=0&&(this.entity.LinkedTo.valueOf()[i]=t,!0)}}class ss{constructor(e=e=>e,t=null){this.array=new Uint32Array(t),this.comparisonValueSupplier=e,this.length=0,this.currentPosition=0}get(e){return e>=0&&e=0&&this.currentPosition=0&&this.currentPosition0?this.get(this.currentPosition-1):null}getPrevValue(){return this.currentPosition>0?this.comparisonValueSupplier(this.get(this.currentPosition-1)):Number.MIN_SAFE_INTEGER}shiftLeft(e,t=1){this.array.set(this.array.subarray(e+t),e)}shiftRight(e,t=1){this.array.set(this.array.subarray(e,-t),e+t)}}class rs{constructor(e,t,i,s){this.initialPosition=e,this.finalPosition=e,this.metadata=new Array(t.length),this.primaryOrder=new ss((e=>this.metadata[e].primaryBoundary)),this.secondaryOrder=new ss((e=>this.metadata[e].secondaryBoundary)),this.selectFunc=s,this.rectangles=t,this.primaryOrder.reserve(this.rectangles.length),this.secondaryOrder.reserve(this.rectangles.length),t.forEach(((e,t)=>{let r={primaryBoundary:this.initialPosition[0],secondaryBoundary:this.initialPosition[1],rectangle:t,onSecondaryAxis:!1};this.metadata[t]=r,s(e,!1);const n=i(e);this.initialPosition[1]{if(this.metadata[i].onSecondaryAxis)this.selectFunc(this.rectangles[i],s);else if(s){this.secondaryOrder.insert(i,e[1]);const s=this.metadata[i].secondaryBoundary;Math.sign(e[1]-s)==t[1]&&Math.sign(s-this.initialPosition[1])==t[1]&&this.selectFunc(this.rectangles[i],!0)}else this.selectFunc(this.rectangles[i],!1),this.secondaryOrder.remove(i);this.computeBoundaries(),this.selectTo(e)};e[0]this.boundaries.primaryN.v&&e[0]this.boundaries.primaryP.v&&(++this.primaryOrder.currentPosition,i(this.boundaries.primaryP.i,this.initialPosition[0]{this.selectFunc(this.rectangles[t],i),this.computeBoundaries(),this.selectTo(e)};e[1]this.boundaries.secondaryN.v&&e[1]this.boundaries.secondaryP.v&&(++this.secondaryOrder.currentPosition,s(this.boundaries.secondaryP.i,this.initialPosition[1]os.#ui[e],toAttribute:(e,t)=>Object.entries(os.#ui).find((([t,i])=>e.constructor===i))?.[0]}}};static newObject(e={},t=e.type??new Xi){const i=new os;return i.initialize(e,t),i}initialize(e={},t=e.type??new Xi){e.windowOptions??={},this.type=e.type,this.windowOptions=e.windowOptions,super.initialize(e,t)}computeSizes(){const e=this.getBoundingClientRect();this.sizeX=e.width,this.sizeY=e.height}cleanup(){super.cleanup(),this.acknowledgeClose()}acknowledgeClose(){let e=new CustomEvent(ae.windowCloseEventName);this.dispatchEvent(e)}}class ls extends ke{static attributes={...super.attributes,VariableGuid:Ue};static grammar=this.createGrammar();static{ke.unknownEntity=this}static createGrammar(){return Pe.seq(Pe.reg(new RegExp(`(${Ie.Regex.Path.source}|${Ie.Regex.Symbol.source}\\s*)?\\(\\s*`),1),Pe.seq(Ie.attributeName,Ie.equalSeparation).map((([e,t])=>e)).chain((e=>this.unknownEntityGrammar.map((t=>i=>i[e]=t)))).sepBy(Ie.commaSeparation),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{e??="";let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),new this(s)})).label("UnknownKeysEntity")}}ke.unknownEntityGrammar=Pe.alt(Le.grammar,Ue.grammar,Pe.str("None").map((()=>ot.createNoneInstance())),Et.grammar,$e.grammar,Pe.alt(ot.fullReferenceGrammar,Pe.regArray(new RegExp(`"(${Ie.Regex.Path.source})'(${Ie.Regex.Path.source}|${Ie.symbol.getParser().regexp.source})'"`)).map((([e,t,i])=>new ot(t,i,((e,t)=>`"${e}'${t}'"`))))),Qe.grammar,rt.grammar,st.grammar,nt.grammar,lt.grammar,bt.grammar,Ve.grammar,ht.grammar,dt.grammar,Oe.grammar,ls.grammar,et.grammar,Fe.of(lt).grammar,Fe.of(Me.accepting($e,Qe,et)).grammar,Pe.lazy((()=>Fe.createGrammar(ke.unknownEntityGrammar)))),function(){const e=(e,t)=>{customElements.define(e,t),Ae.registerElement(e,t)};e("ueb-color-handler",Ii),e("ueb-dropdown",Vi),e("ueb-input",Ri),e("ueb-link",Gt),e("ueb-node",di),e("ueb-pin",is),e("ueb-selector",as),e("ueb-ui-slider",Oi),e("ueb-window",os)}();export{ki as Blueprint,ae as Configuration,Gt as LinkElement,di as NodeElement,oe as Utility}; + */const Ki="important",Yi=" !"+Ki,qi=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Ui{constructor(e){if(super(e),e.type!==ji||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const s=e[i];return null==s?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(Yi);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?Ki:""):i[e]=s}}return _}});class Xi extends Kt{toggleAdvancedDisplayHandler;getDraggableElement(){return this.element.querySelector(".ueb-window-top")}createDraggableObject(){return new _t(this.element,this.blueprint,{draggableElement:this.getDraggableElement(),ignoreScale:!0,ignoreTranslateCompensate:!1,movementSpace:this.blueprint,stepSize:1})}setup(){const e=this.blueprint.template.gridLeftVisibilityBoundary(),t=this.blueprint.template.gridTopVisibilityBoundary();this.element.locationX=this.blueprint.scaleCorrectReverse(this.blueprint.mousePosition[0]-e),this.element.locationY=this.blueprint.scaleCorrectReverse(this.blueprint.mousePosition[1]-t),this.element.updateComplete.then((()=>{const e=this.blueprint.getBoundingClientRect();this.element.locationX+this.element.sizeX>e.width&&(this.element.locationX=e.width-this.element.sizeX),this.element.locationX=Math.max(0,this.element.locationX),this.element.locationY+this.element.sizeY>e.height&&(this.element.locationY=e.height-this.element.sizeY),this.element.locationY=Math.max(0,this.element.locationY)}))}render(){return z`
${this.renderWindowName()}
${ce.close}
${this.renderContent()}
`}renderWindowName(){return z`Window`}renderContent(){return z``}apply(){this.element.dispatchEvent(new CustomEvent(ae.windowApplyEventName)),this.element.remove()}cancel(){this.element.dispatchEvent(new CustomEvent(ae.windowCancelEventName)),this.element.remove()}}class Zi extends Xi{#$t;#Vt;#Bt;#Rt;#Gt;#Ht;#zt;#_t;#Ft;#jt;#Ut=e=>{const t=oe.clearHTMLWhitespace(e.target.innerHTML),i=parseInt(t,16);isNaN(i)||(this.color.setFromRGBANumber(i),this.element.requestUpdate())};#Kt=e=>{const t=oe.clearHTMLWhitespace(e.target.innerHTML),i=parseInt(t,16);isNaN(i)||(this.color.setFromSRGBANumber(i),this.element.requestUpdate())};#Yt=e=>t=>{"Enter"==t.code&&(t.preventDefault(),e(t))};#qt=new Oe;get color(){return this.#qt}set color(e){e.toNumber()!=this.color?.toNumber()&&(this.element.requestUpdate("color",this.#qt),this.#qt=e)}#Xt=new Oe;get fullColor(){return this.#Xt}#Zt;get initialColor(){return this.#Zt}#Wt=new Oe;#Qt(e,t,i=!1){const s=this.color.toRGBAString(),r=`${s.substring(0,2*e)}${t}${s.substring(2+2*e)}`;return i?`${r.substring(0,6)}FF`:r}initialize(e){super.initialize(e),this.#Zt=this.element.windowOptions.getPinColor(),this.color.setFromHSVA(this.initialColor.H.value,this.initialColor.S.value,this.initialColor.V.value,this.initialColor.A.value),this.fullColor.setFromHSVA(this.color.H.value,1,1,1)}firstUpdated(e){this.#$t=this.element.querySelector(".ueb-color-picker-wheel ueb-color-handler"),this.#Vt=this.element.querySelector(".ueb-color-picker-saturation ueb-ui-slider"),this.#Bt=this.element.querySelector(".ueb-color-picker-value ueb-ui-slider"),this.#Rt=this.element.querySelector(".ueb-color-picker-r ueb-ui-slider"),this.#Gt=this.element.querySelector(".ueb-color-picker-g ueb-ui-slider"),this.#Ht=this.element.querySelector(".ueb-color-picker-b ueb-ui-slider"),this.#zt=this.element.querySelector(".ueb-color-picker-a ueb-ui-slider"),this.#_t=this.element.querySelector(".ueb-color-picker-h ueb-ui-slider"),this.#Ft=this.element.querySelector(".ueb-color-picker-s ueb-ui-slider"),this.#jt=this.element.querySelector(".ueb-color-picker-v ueb-ui-slider"),this.#$t.template.locationChangeCallback=(e,t)=>{this.color.setFromWheelLocation(e,t,this.color.V.value,this.color.A.value),this.fullColor.setFromHSVA(this.color.H.value,1,1,1),this.element.requestUpdate()},this.#Vt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,t,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#Bt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,this.color.S.value,t,this.color.A.value),this.element.requestUpdate()},this.#Rt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(e,this.color.G.value,this.color.B.value,this.color.A.value),this.element.requestUpdate()},this.#Gt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,e,this.color.B.value,this.color.A.value),this.element.requestUpdate()},this.#Ht.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,this.color.G.value,e,this.color.A.value),this.element.requestUpdate()},this.#zt.template.locationChangeCallback=(e,t)=>{this.color.setFromRGBA(this.color.R.value,this.color.G.value,this.color.B.value,e),this.element.requestUpdate()},this.#_t.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(e,this.color.S.value,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#Ft.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,e,this.color.V.value,this.color.A.value),this.element.requestUpdate()},this.#jt.template.locationChangeCallback=(e,t)=>{this.color.setFromHSVA(this.color.H.value,this.color.S.value,e,this.color.A.value),this.element.requestUpdate()}}renderSlider(e){let t="",i=0,s="";const r=e=>`linear-gradient(to right, #${this.#Qt(e,"00",!0)}, #${this.#Qt(e,"ff",!0)})`;switch(e){case 0:t="r",i=this.color.R.value,s=r(e);break;case 1:t="g",i=this.color.G.value,s=r(e);break;case 2:t="b",i=this.color.B.value,s=r(e);break;case 3:t="a",i=this.color.A.value,s=`${ae.alphaPattern}, ${r(e)}`;break;case 4:t="h",i=360*this.color.H.value,s="linear-gradient(to right, #f00 0%, #ff0 16.666%, #0f0 33.333%, #0ff 50%, #00f 66.666%, #f0f 83.333%, #f00 100%)";break;case 5:t="s",i=this.color.S.value,s=`linear-gradient(to right,#${this.#Wt.setFromHSVA(this.color.H.value,0,this.color.V.value,1),this.#Wt.toRGBAString()},#${this.#Wt.setFromHSVA(this.color.H.value,1,this.color.V.value,1),this.#Wt.toRGBAString()})`;break;case 6:t="v",i=this.color.V.value,s=`linear-gradient(to right, #000, #${this.fullColor.toRGBAString()})`}return s=`background: ${s};`,z`
${t.toUpperCase()}
`}renderContent(){const e=2*this.color.H.value*Math.PI,t={"--ueb-color-r":this.color.R.toString(),"--ueb-color-g":this.color.G.toString(),"--ueb-color-b":this.color.B.toString(),"--ueb-color-a":this.color.A.toString(),"--ueb-color-h":this.color.H.toString(),"--ueb-color-s":this.color.S.toString(),"--ueb-color-v":this.color.V.toString(),"--ueb-color-wheel-x":100*(this.color.S.value*Math.cos(e)*.5+.5)+"%","--ueb-color-wheel-y":100*(this.color.S.value*Math.sin(e)*.5+.5)+"%"},i=this.color.toRGBAString(),s=this.color.toSRGBAString(),r=this.fullColor.toRGBAString();return z`
Old
New
Advanced
${this.renderSlider(0)} ${this.renderSlider(1)} ${this.renderSlider(2)} ${this.renderSlider(3)}
${this.renderSlider(4)} ${this.renderSlider(5)} ${this.renderSlider(6)}
Hex Linear
Hex sRGB
${ae.windowApplyButtonText}
${ae.windowCancelButtonText}
`}renderWindowName(){return z`${ae.colorWindowName}`}}class Wi extends _i{renderInput(){return z`
`}}class Qi extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);i.X.value=e[0],i.Y.value=e[1],this.element.setDefaultValue(i)}renderInput(){return z`
X
Y
`}}class Ji extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}#ti(){return $e.printNumber(this.element.getDefaultValue()?.Z.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);if(!(i instanceof Ve))throw new TypeError("Expected DefaultValue to be a VectorEntity");i.X.value=e[0],i.Y.value=e[1],i.Z.value=e[2],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
`}}const es={bool:Gi,byte:Fi,enum:class extends Hi{static saveEachInputChange=!0;#ii;#si=[];setup(){super.setup();const e=this.element.nodeElement.entity.EnumEntries?.valueOf();this.#si=e?.map((e=>(""===e.valueOf()&&(e=new Qe("None")),[e,this.element.nodeElement.getPinEntities().find((t=>e===t.PinName))?.PinFriendlyName.toString()??e])))??ae.CommonEnums[this.element.entity.getSubCategory()]?.map((e=>e instanceof Array?e:[e,oe.formatStringName(e)]))??[];const t=this.element.getDefaultValue()?.toString();this.#si.find((([e,i])=>e===t))||this.#si.push([t,oe.formatStringName(t)]),this.element.requestUpdate()}renderInput(){return z``}firstUpdated(e){super.firstUpdated(e),this.#ii=this.element.querySelector("ueb-dropdown")}getInputs(){return[this.#ii.getValue()]}setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}},float:Wi,int:Fi,int64:class extends _i{setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=BigInt(e[0]),this.element.setDefaultValue(i),this.element.requestUpdate()}renderInput(){return z`
`}},MUTABLE_REFERENCE:class extends ii{renderIcon(){return ce.referencePin}},name:class extends Hi{static singleLineInput=!0},real:Wi,rg:Qi,string:class extends Hi{setDefaultValue(e=[],t){const i=this.element.getDefaultValue();i.value=e[0],this.element.setDefaultValue(i),this.element.requestUpdate()}},[ae.paths.linearColor]:class extends ii{#ri;#ni=e=>{e.preventDefault(),this.blueprint.setFocused(!0),this.#ri=Ae.getConstructor("ueb-window").newObject({type:new Zi,windowOptions:{getPinColor:()=>this.element.defaultValue,setPinColor:e=>this.element.setDefaultValue(e)}}),this.blueprint.append(this.#ri);const t=()=>{this.element.setDefaultValue(this.#ri.template.color)},i=()=>{this.#ri.removeEventListener(ae.windowApplyEventName,t),this.#ri.removeEventListener(ae.windowCloseEventName,i),this.#ri=null};this.#ri.addEventListener(ae.windowApplyEventName,t),this.#ri.addEventListener(ae.windowCloseEventName,i)};renderInput(){return z``}},[ae.paths.niagaraBool]:Gi,[ae.paths.niagaraFloat]:Wi,[ae.paths.niagaraInt32]:Fi,[ae.paths.niagaraPosition]:Ji,[ae.paths.rotator]:class extends _i{#ai(){return $e.printNumber(this.element.getDefaultValue()?.R.valueOf()??0)}#oi(){return $e.printNumber(this.element.getDefaultValue()?.P.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}setDefaultValue(e=[],t=e){const i=this.element.getDefaultValue(!0);if(!(i instanceof dt))throw new TypeError("Expected DefaultValue to be a RotatorEntity");i.R.value=e[0],i.P.value=e[1],i.Y.value=e[2],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
`}},[ae.paths.vector]:Ji,[ae.paths.vector2D]:Qi,[ae.paths.vector2f]:Qi,[ae.paths.vector3f]:Ji,[ae.paths.vector4f]:class extends _i{#Jt(){return $e.printNumber(this.element.getDefaultValue()?.X.valueOf()??0)}#ei(){return $e.printNumber(this.element.getDefaultValue()?.Y.valueOf()??0)}#ti(){return $e.printNumber(this.element.getDefaultValue()?.Z.valueOf()??0)}#li(){return $e.printNumber(this.element.getDefaultValue()?.W.valueOf()??0)}setDefaultValue(e,t){const i=this.element.getDefaultValue(!0);if(!(i instanceof bt))throw new TypeError("Expected DefaultValue to be a Vector4DEntity");i.X.value=e[0],i.Y.value=e[1],i.Z.value=e[2],i.W.value=e[3],this.element.requestUpdate("DefaultValue",i)}renderInput(){return z`
X
Y
Z
W
`}}};function ts(e){if("Array"===e.PinType.ContainerType?.toString())return ii;if(e.PinType.bIsReference?.valueOf()&&!e.PinType.bIsConst?.valueOf())return es.MUTABLE_REFERENCE;if(e.isExecution())return zi;const t=e.getType();return(e.isInput()?es[t]:ii)??ii}class is extends le{static properties={pinId:{type:Ue,converter:{fromAttribute:(e,t)=>e?Ue.grammar.parse(e):null,toAttribute:(e,t)=>e?.toString()},attribute:"data-id",reflect:!0},pinType:{type:String,attribute:"data-type",reflect:!0},advancedView:{type:String,attribute:"data-advanced-view",reflect:!0},color:{type:Oe,converter:{fromAttribute:(e,t)=>e?Oe.getLinearColorFromAnyFormat().parse(e):null,toAttribute:(e,t)=>e?Oe.printLinearColor(e):null},attribute:"data-color",reflect:!0},defaultValue:{type:String,attribute:!1},isLinked:{type:Boolean,converter:Le.booleanConverter,attribute:"data-linked",reflect:!0},pinDirection:{type:String,attribute:"data-direction",reflect:!0},connectable:{type:Boolean,converter:Le.booleanConverter,attribute:"data-connectable",reflect:!0}};nodeElement;static newObject(e=new yt,t=new(ts(e)),i=void 0){const s=new is;return s.initialize(e,t,i),s}initialize(e=new yt,t=new(ts(e)),i=void 0){this.nodeElement=i,this.advancedView=e.bAdvancedView?.valueOf(),this.isLinked=!1,this.connectable=!e.bNotConnectable?.valueOf(),super.initialize(e,t),this.pinId=this.entity.PinId,this.pinType=this.entity.getType(),this.defaultValue=this.entity.getDefaultValue(),this.color=is.properties.color.converter.fromAttribute(this.getColor().toString()),this.pinDirection=e.isInput()?"input":e.isOutput()?"output":"hidden"}setup(){super.setup(),this.nodeElement=this.closest("ueb-node")}createPinReference(){return new lt(new et(this.nodeElement.getNodeName()),this.getPinId())}getPinId(){return this.entity.PinId}getPinName(){return this.entity.PinName?.toString()??""}getPinDisplayName(){return this.entity.pinTitle()}getColor(){return this.entity.pinColor()}#ci(e){for(;e?.isKnot();){const t=e.nodeElement.getPinElements();e=(e=e===t[0]?t[1]:t[0]).isLinked?this.blueprint.getPin(e.getLinks()[0]):null}return e?.isKnot()?void 0:e}isInput(e=!1){let t=this;return e?this.#ci(t)?.isInput():t.entity.isInput()}isInputLoosely(){return this.isInput(!1)&&void 0===this.isInput(!0)}isInputVisually(){const e=this.nodeElement.template,t=this.isKnot();return t&&this.isInput()!=e.switchDirectionsVisually||!t&&this.isInput()}isOutput(e=!1){let t=this;return e?this.#ci(t)?.isOutput():t.entity.isOutput()}isOutputLoosely(){return this.isOutput(!1)&&void 0===this.isOutput(!0)}isOutputVisually(){const e=this.nodeElement.template,t=this.isKnot();return t&&this.isOutput()!=e.switchDirectionsVisually||!t&&this.isOutput()}isKnot(){return this.nodeElement?.getType()==ae.paths.knot}getLinkLocation(e=!1){return this.template.getLinkLocation(e)}getNodeElement(){return this.nodeElement}getLinks(){return this.entity.LinkedTo?.valueOf()??[]}getDefaultValue(e=!1){return this.defaultValue=this.entity.getDefaultValue(e)}setDefaultValue(e){this.entity.DefaultValue=e,this.defaultValue=e,this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName()}sanitizeLinks(e=[]){this.entity.LinkedTo=new yt.attributes.LinkedTo(this.entity.LinkedTo?.valueOf().filter((t=>{let i=this.blueprint.getPin(t);if(i){if(e.length&&!e.includes(i.nodeElement))return!1;let t=this.blueprint.getLink(this,i);t||(t=Ae.getConstructor("ueb-link").newObject(this,i),this.blueprint.addGraphElement(t))}return i}))),this.isLinked=this.entity.isLinked()}linkTo(e){const t=this.createPinReference();this.isLinked&&this.entity.isExecution()&&this.isOutput(!0)&&this.getLinks().some((e=>!t.equals(e)))&&(this.isKnot(),this.unlinkFromAll()),this.entity.linkTo(e.getNodeElement().getNodeName(),e.entity)&&(this.isLinked=this.entity.isLinked(),this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName())}unlinkFrom(e,t=!0){this.entity.unlinkFrom(e.getNodeElement().getNodeName(),e.entity)&&(this.isLinked=this.entity.isLinked(),t&&this.blueprint.getLink(this,e)?.remove(),this.entity.recomputesNodeTitleOnChange&&this.nodeElement?.computeNodeDisplayName())}unlinkFromAll(){this.getLinks().length,this.getLinks().map((e=>this.blueprint.getPin(e))).forEach((e=>this.unlinkFrom(e)))}redirectLink(e,t){const i=this.getLinks().findIndex((t=>t.objectName.toString()==e.getNodeElement().getNodeName()&&t.pinGuid.toString()==e.entity.PinId.toString()));return i>=0&&(this.entity.LinkedTo.valueOf()[i]=t,!0)}}class ss{constructor(e=e=>e,t=null){this.array=new Uint32Array(t),this.comparisonValueSupplier=e,this.length=0,this.currentPosition=0}get(e){return e>=0&&e=0&&this.currentPosition=0&&this.currentPosition0?this.get(this.currentPosition-1):null}getPrevValue(){return this.currentPosition>0?this.comparisonValueSupplier(this.get(this.currentPosition-1)):Number.MIN_SAFE_INTEGER}shiftLeft(e,t=1){this.array.set(this.array.subarray(e+t),e)}shiftRight(e,t=1){this.array.set(this.array.subarray(e,-t),e+t)}}class rs{constructor(e,t,i,s){this.initialPosition=e,this.finalPosition=e,this.metadata=new Array(t.length),this.primaryOrder=new ss((e=>this.metadata[e].primaryBoundary)),this.secondaryOrder=new ss((e=>this.metadata[e].secondaryBoundary)),this.selectFunc=s,this.rectangles=t,this.primaryOrder.reserve(this.rectangles.length),this.secondaryOrder.reserve(this.rectangles.length),t.forEach(((e,t)=>{let r={primaryBoundary:this.initialPosition[0],secondaryBoundary:this.initialPosition[1],rectangle:t,onSecondaryAxis:!1};this.metadata[t]=r,s(e,!1);const n=i(e);this.initialPosition[1]{if(this.metadata[i].onSecondaryAxis)this.selectFunc(this.rectangles[i],s);else if(s){this.secondaryOrder.insert(i,e[1]);const s=this.metadata[i].secondaryBoundary;Math.sign(e[1]-s)==t[1]&&Math.sign(s-this.initialPosition[1])==t[1]&&this.selectFunc(this.rectangles[i],!0)}else this.selectFunc(this.rectangles[i],!1),this.secondaryOrder.remove(i);this.computeBoundaries(),this.selectTo(e)};e[0]this.boundaries.primaryN.v&&e[0]this.boundaries.primaryP.v&&(++this.primaryOrder.currentPosition,i(this.boundaries.primaryP.i,this.initialPosition[0]{this.selectFunc(this.rectangles[t],i),this.computeBoundaries(),this.selectTo(e)};e[1]this.boundaries.secondaryN.v&&e[1]this.boundaries.secondaryP.v&&(++this.secondaryOrder.currentPosition,s(this.boundaries.secondaryP.i,this.initialPosition[1]os.#ui[e],toAttribute:(e,t)=>Object.entries(os.#ui).find((([t,i])=>e.constructor===i))?.[0]}}};static newObject(e={},t=e.type??new Xi){const i=new os;return i.initialize(e,t),i}initialize(e={},t=e.type??new Xi){e.windowOptions??={},this.type=e.type,this.windowOptions=e.windowOptions,super.initialize(e,t)}computeSizes(){const e=this.getBoundingClientRect();this.sizeX=e.width,this.sizeY=e.height}cleanup(){super.cleanup(),this.acknowledgeClose()}acknowledgeClose(){let e=new CustomEvent(ae.windowCloseEventName);this.dispatchEvent(e)}}class ls extends ke{static attributes={...super.attributes,VariableGuid:Ue};static grammar=this.createGrammar();static{ke.unknownEntity=this}static createGrammar(){return Pe.seq(Pe.reg(new RegExp(`(${Ie.Regex.Path.source}|${Ie.Regex.Symbol.source}\\s*)?\\(\\s*`),1),Pe.seq(Ie.attributeName,Ie.equalSeparation).map((([e,t])=>e)).chain((e=>this.unknownEntityGrammar.map((t=>i=>i[e]=t)))).sepBy(Ie.commaSeparation),Pe.reg(/\s*(?:,\s*)?\)/)).map((([e,t,i])=>{e??="";let s={};return e.length&&(s.lookbehind=e),t.forEach((e=>e(s))),new this(s)})).label("UnknownKeysEntity")}}ke.unknownEntityGrammar=Pe.alt(Le.grammar,Ue.grammar,Pe.str("None").map((()=>ot.createNoneInstance())),Et.grammar,$e.grammar,Pe.alt(ot.fullReferenceGrammar,Pe.regArray(new RegExp(`"(${Ie.Regex.Path.source})'(${Ie.Regex.Path.source}|${Ie.symbol.getParser().regexp.source})'"`)).map((([e,t,i])=>new ot(t,i,((e,t)=>`"${e}'${t}'"`))))),Qe.grammar,rt.grammar,st.grammar,nt.grammar,lt.grammar,bt.grammar,Ve.grammar,ht.grammar,dt.grammar,Oe.grammar,ls.grammar,et.grammar,Fe.of(lt).grammar,Fe.of(Me.accepting($e,Qe,et)).grammar,Pe.lazy((()=>Fe.createGrammar(ke.unknownEntityGrammar)))),function(){const e=(e,t)=>{customElements.define(e,t),Ae.registerElement(e,t)};e("ueb-color-handler",Ii),e("ueb-dropdown",Vi),e("ueb-input",Ri),e("ueb-link",Gt),e("ueb-node",di),e("ueb-pin",is),e("ueb-selector",as),e("ueb-ui-slider",Oi),e("ueb-window",os)}();export{ki as Blueprint,ae as Configuration,Gt as LinkElement,di as NodeElement,oe as Utility}; diff --git a/js/element/LinkElement.js b/js/element/LinkElement.js index 48280b3..b46cc07 100755 --- a/js/element/LinkElement.js +++ b/js/element/LinkElement.js @@ -283,12 +283,12 @@ export default class LinkElement extends IFromToPositionedElement { this.origin = pin } - /** @param {NodeElement} pin */ - getOtherPin(pin) { - if (this.origin?.nodeElement === pin) { + /** @param {NodeElement} node */ + getOtherPin(node) { + if (this.origin?.nodeElement === node) { return this.target } - if (this.target?.nodeElement === pin) { + if (this.target?.nodeElement === node) { return this.origin } } diff --git a/js/element/PinElement.js b/js/element/PinElement.js index 100cc2d..f325fa0 100755 --- a/js/element/PinElement.js +++ b/js/element/PinElement.js @@ -164,9 +164,7 @@ export default class PinElement extends IElement { /** @type {PinElement} */ let result = this if (ignoreKnots) { - if (ignoreKnots) { - return this.#traverseKnots(result)?.isOutput() - } + return this.#traverseKnots(result)?.isOutput() } return result.entity.isOutput() } @@ -242,12 +240,13 @@ export default class PinElement extends IElement { const pinReference = this.createPinReference() if ( this.isLinked - && ( - this.isInput(true) - || this.isOutput(true) && (this.entity.isExecution() || targetPinElement.entity.isExecution()) - ) - && !this.getLinks().some(ref => pinReference.equals(ref)) + && this.entity.isExecution() + && this.isOutput(true) + && this.getLinks().some(ref => !pinReference.equals(ref)) ) { + if (this.isKnot()) { + + } this.unlinkFromAll() } if (this.entity.linkTo(targetPinElement.getNodeElement().getNodeName(), targetPinElement.entity)) { diff --git a/js/template/LinkTemplate.js b/js/template/LinkTemplate.js index 449a137..e9a4491 100755 --- a/js/template/LinkTemplate.js +++ b/js/template/LinkTemplate.js @@ -72,14 +72,14 @@ export default class LinkTemplate extends IFromToPositionedTemplate { const to = this.element.targetX // Switch actual input/output pins if allowed and makes sense - if (isOriginAKnot && (!targetPin || isTargetAKnot)) { + if (isOriginAKnot && !targetPin) { if (originPin?.isInputLoosely() && to > from + Configuration.distanceThreshold) { this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin() } else if (originPin?.isOutputLoosely() && to < from - Configuration.distanceThreshold) { this.element.origin = /** @type {KnotPinTemplate} */(originPin.template).getoppositePin() } } - if (isTargetAKnot && (!originPin || isOriginAKnot)) { + if (isTargetAKnot && !originPin) { if (targetPin?.isInputLoosely() && to < from - Configuration.distanceThreshold) { this.element.target = /** @type {KnotPinTemplate} */(targetPin.template).getoppositePin() } else if (targetPin?.isOutputLoosely() && to > from + Configuration.distanceThreshold) { @@ -90,15 +90,11 @@ export default class LinkTemplate extends IFromToPositionedTemplate { // Switch visual input/output pins if allowed and makes sense if (originPin && targetPin) { let directionsCheckedKnot - if (originPin?.isKnot()) { - // The target end has moved and origin end is a knot - directionsCheckedKnot = originPin.nodeElement - } else if (targetPin?.isKnot()) { - // The origin end has moved and target end is a knot - directionsCheckedKnot = targetPin.nodeElement + if (originPin.isKnot() && originPin.hasUpdated) { + /** @type {KnotNodeTemplate} */(originPin.nodeElement.template).checkSwtichDirectionsVisually() } - if (directionsCheckedKnot && directionsCheckedKnot.hasUpdated) { - /** @type {KnotNodeTemplate} */(directionsCheckedKnot.template).checkSwtichDirectionsVisually() + if (targetPin.isKnot() && targetPin.hasUpdated) { + /** @type {KnotNodeTemplate} */(targetPin.nodeElement.template).checkSwtichDirectionsVisually() } } diff --git a/js/template/node/KnotNodeTemplate.js b/js/template/node/KnotNodeTemplate.js index 84644c1..426d2e7 100755 --- a/js/template/node/KnotNodeTemplate.js +++ b/js/template/node/KnotNodeTemplate.js @@ -60,25 +60,27 @@ export default class KnotNodeTemplate extends NodeTemplate { } checkSwtichDirectionsVisually() { - let leftPinsLocation = 0 + let leftPinsDelta = 0 let leftPinsCount = 0 - let rightPinsLocation = 0 + let rightPinsDelta = 0 let rightPinsCount = 0 + const location = this.outputPin.getLinkLocation()[0] const links = this.getAllConnectedLinks() for (const link of links) { const pin = link.getOtherPin(this.element) + const delta = pin.getLinkLocation()[0] - location if (pin?.isInput()) { - rightPinsLocation += pin.getLinkLocation()[0] + rightPinsDelta += delta ++rightPinsCount } else if (pin?.isOutput()) { - leftPinsLocation += pin.getLinkLocation()[0] + leftPinsDelta += delta ++leftPinsCount } } - leftPinsLocation /= leftPinsCount - rightPinsLocation /= rightPinsCount - if ((rightPinsLocation < leftPinsLocation) != this.switchDirectionsVisually) { - this.switchDirectionsVisually = rightPinsLocation < leftPinsLocation + leftPinsDelta /= leftPinsCount + rightPinsDelta /= rightPinsCount + if ((rightPinsDelta < leftPinsDelta) != this.switchDirectionsVisually) { + this.switchDirectionsVisually = rightPinsDelta < leftPinsDelta } } } diff --git a/js/template/pin/BoolPinTemplate.js b/js/template/pin/BoolPinTemplate.js index c65e5d1..49acca2 100755 --- a/js/template/pin/BoolPinTemplate.js +++ b/js/template/pin/BoolPinTemplate.js @@ -40,7 +40,9 @@ export default class BoolPinTemplate extends PinTemplate { renderInput() { return html` - + ` } } diff --git a/js/template/pin/LinearColorPinTemplate.js b/js/template/pin/LinearColorPinTemplate.js index 4422317..0e5bee7 100755 --- a/js/template/pin/LinearColorPinTemplate.js +++ b/js/template/pin/LinearColorPinTemplate.js @@ -42,7 +42,8 @@ export default class LinearColorPinTemplate extends PinTemplate { renderInput() { return html` - diff --git a/tests/mirroredExportPath.spec.js b/tests/mirroredExportPathInnerRenaming.spec.js similarity index 86% rename from tests/mirroredExportPath.spec.js rename to tests/mirroredExportPathInnerRenaming.spec.js index 0be253d..5118bb4 100644 --- a/tests/mirroredExportPath.spec.js +++ b/tests/mirroredExportPathInnerRenaming.spec.js @@ -2,35 +2,6 @@ import { expect, test } from "./fixtures/test.js" const firstRowOnly = v => v.replaceAll(/^\s+|\n.+/gs, "") -test.describe.configure({ mode: "parallel" }) - -test("Renaming", async ({ blueprintPage }) => { - let source = String.raw` - Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"' - End Object - ` - await blueprintPage.paste(source) - expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( - `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"'` - ) - await blueprintPage.node.evaluate(n => n.entity.Name.value = "new name") - expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( - `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name"'` - ) - await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)("new name 2")) - expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( - `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name 2" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name 2"'` - ) - await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)()) - expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( - `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'` - ) - await blueprintPage.node.evaluate(n => delete n.entity.Name) - expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( - `Begin Object Class=/Script/UnrealEd.MaterialGraphNode ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'` - ) -}) - test("Inner renaming", async ({ blueprintPage }) => { let source = String.raw` Begin Object Class=/Script/PCGEditor.PCGEditorGraphNode Name="PCGEditorGraphNode_2" ExportPath=/Script/PCGEditor.PCGEditorGraphNode'"/Game/NewPCGGraph.NewPCGGraph:PCGEditorGraph_1.PCGEditorGraphNode_2"' diff --git a/tests/mirroredExportPathRenaming.spec.js b/tests/mirroredExportPathRenaming.spec.js new file mode 100644 index 0000000..edacd60 --- /dev/null +++ b/tests/mirroredExportPathRenaming.spec.js @@ -0,0 +1,30 @@ +import { expect, test } from "./fixtures/test.js" + +const firstRowOnly = v => v.replaceAll(/^\s+|\n.+/gs, "") + +test("Renaming", async ({ blueprintPage }) => { + let source = String.raw` + Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"' + End Object + ` + await blueprintPage.paste(source) + expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( + `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_40" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.MaterialGraphNode_40"'` + ) + await blueprintPage.node.evaluate(n => n.entity.Name.value = "new name") + expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( + `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name"'` + ) + await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)("new name 2")) + expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( + `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="new name 2" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0.new name 2"'` + ) + await blueprintPage.node.evaluate(n => n.entity.Name = new (n.entity.constructor.attributes.Name)()) + expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( + `Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="" ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'` + ) + await blueprintPage.node.evaluate(n => delete n.entity.Name) + expect(firstRowOnly(await blueprintPage.getSerializedNodes())).toEqual( + `Begin Object Class=/Script/UnrealEd.MaterialGraphNode ExportPath=/Script/UnrealEd.MaterialGraphNode'"/Engine/Transient.M_Brick_Cut_Stone:MaterialGraph_0."'` + ) +})