diff --git a/docs/Docs/getting-started.html b/docs/Docs/getting-started.html new file mode 100644 index 0000000..bdf6cee --- /dev/null +++ b/docs/Docs/getting-started.html @@ -0,0 +1,116 @@ + + +
+ +Initiating class of Awperative. Call Start() to start the kernel.
+public static class Awperative
+ Bottom class of Awperative. Contains the MonoGame instance.
+public static Base Base { get; }
+ Handles loading content through MonoGame.
+public static ContentManager ContentManager { get; }
+ List of all event hooks currently loaded in the kernel.
+public static List<AwperativeHook> EventHooks { get; }
+ Handles graphics settings through MonoGame.
+public static GraphicsDeviceManager GraphicsDeviceManager { get; }
+ List of all scenes currently loaded in the kernel.
+public static List<Scene> LoadedScenes { get; }
+ Handles drawing sprites to the screen through MonoGame.
+public static SpriteBatch SpriteBatch { get; }
+ Start() begins the game; and begins communication with all event hooks.
+public static void Start(List<AwperativeHook> __hooks)
+ __hooks List<AwperativeHook>List of all event hooks you wish to use.
+You cannot add new hooks later; so make sure to register all of them in the Start() method.
+Awperative hooks are the source of entry for scripts using Awperative. Create a hook and send into Start() to be recognized by the engine.
+public interface AwperativeHook
+ Called when the program starts; It is not recommended you load assets here.
+void Load()
+ Called when the program closes.
+void Unload()
+ Base class of Awperative. Carries events from MonoGame into scenes and hooks.
+public sealed class Base : Game, IDisposable
+ Draw() is called every frame; after Update(). Override Draw() in scripting tools to call from this event.
+protected override void Draw(GameTime __gameTime)
+ __gameTime GameTimeHooks are unable to receive both Update() and Draw()
+EndRun() is called if the program closes. Override Terminate() in scripting tools or use hooks to call from this event.
+protected override void EndRun()
+ This event may not trigger if the program is force closed.
+Initialize() is called when the program starts. Goes before LoadContent(). And prepares the kernel for use.
+protected override void Initialize()
+ It is recommended not to load content in Initialize()
+LoadContent() is called when the program starts; right after Initialize(). Override Load() in scripting tools or use hooks to call from this event.
+protected override void LoadContent()
+ It is recommended to load content during LoadContent()
+Update() is called every frame; before Draw(). Override Update() in scripting tools to call from this event.
+protected override void Update(GameTime __gameTime)
+ __gameTime GameTimeHooks are unable to receive both Update() and Draw()
+public sealed class Body : DockerEntity
+ All components attached to the body
+public List<Component> Components { get; }
+ Current scene the body exists in
+public Scene Scene { get; }
+ All tags attached to the body
+public List<string> Tags { get; }
+ Position of the body
+public Transform transform { get; }
+ public class BodyComponent : Component
+ public Body Body
+ public Transform Transform { get; }
+ public sealed record BodyCreateEvent : IEquatable<BodyCreateEvent>
+ public readonly Body body
+ public readonly Scene scene
+ public sealed record BodyDestroyEvent : IEquatable<BodyDestroyEvent>
+ public readonly Body body
+ public readonly Scene scene
+ The lowest level scripting class in Awperative. Components are scene level and provide access to all scene level methods, can be applied to any docker and inherited +Sadly component does not have excessive access to specific types. +Anything that inherits Component is built to work in any DockerEntity, which leads to generic +Assumptions. If you want to make a body specific or scene specific component both classes are available.
+public abstract class Component
+ public Scene Scene { get; set; }
+ protected Body AddBody()
+ protected Body AddBody(Transform __transform)
+ __transform Transformpublic Component AddComponent<Generic>() where Generic : Component
+ Genericpublic Component AddComponent<Generic>(object[] __args) where Generic : Component
+ __args object[]Genericpublic virtual void Create()
+ public virtual void Destroy()
+ protected void DestroyBody(Body __body)
+ __body Bodypublic virtual void Draw(GameTime __gameTime)
+ __gameTime GameTimeprotected Body[] GetBodies(string __tag)
+ __tag stringprotected Body GetBody(string __tag)
+ __tag stringpublic Component GetComponent<Generic>() where Generic : Component
+ Genericpublic Component[] GetComponents<Generic>() where Generic : Component
+ Genericpublic virtual void Load()
+ public void RemoveComponent<Generic>() where Generic : Component
+ Genericpublic virtual void Unload()
+ public virtual void Update(GameTime __gameTime)
+ __gameTime GameTimepublic sealed record ComponentCreateEvent : IEquatable<ComponentCreateEvent>
+ public readonly Body body
+ public readonly Component component
+ public readonly Scene scene
+ public sealed record ComponentDestroyEvent : IEquatable<ComponentDestroyEvent>
+ public readonly Body body
+ public readonly Component component
+ public readonly Scene scene
+ public static class Debug
+ True path of the log file Awperative dumps to.
+public static string LogFilePath { get; }
+ Writes the current message to the log file if the condition is true.
+public static void AssertAction(bool __condition, string __message)
+ Writes the current message to the log file if the condition is true.
+public static void AssertError(bool __condition, string __message)
+ Writes the current message to the log file if the condition is true. With any given call sign.
+public static void AssertGeneric(bool __condition, string __message, string __callSign, string[] __parameters, string[] __values)
+ __condition boolCondition to debug
+__message stringMessage to debug
+__callSign stringMessage identifier
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file if the condition is true.
+public static void AssertState(bool __condition, string __message)
+ Writes the current message to the log file if the condition is true.
+public static void AssertValue(bool __condition, string __message)
+ Writes the current message to the log file if the condition is true.
+public static void AssertWarning(bool __condition, string __message)
+ Writes the current message to the log file.
+public static void LogAction(string __message)
+ __message stringMessage to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogAction(string __message, string[] __parameters, string[] __values)
+ __message stringMessage to debug
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file.
+public static void LogError(string __message)
+ __message stringMessage to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogError(string __message, string[] __parameters, string[] __values)
+ __message stringMessage to debug
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogGeneric(string __message, string __callSign, string[] __parameters, string[] __values)
+ __message stringMessage to debug
+__callSign stringMessage identifier
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file.
+public static void LogState(string __message)
+ __message stringMessage to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogState(string __message, string[] __parameters, string[] __values)
+ __message stringMessage to debug
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file.
+public static void LogValue(string __message)
+ __message stringMessage to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogValue(string __message, string[] __parameters, string[] __values)
+ __message stringMessage to debug
+__parameters string[]Names of values to debug
+__values string[]Values to debug
+Writes the current message to the log file.
+public static void LogWarning(string __message)
+ __message stringMessage to debug
+Writes the current message to the log file. With any given call sign.
+public static void LogWarning(string __message, string[] __parameters, string[] __values)
+ Base class for all Awperative entities, manages components as a requirement because that is the job of all entities.
+public abstract class DockerEntity
+ public Scene Scene
+ public Component AddComponent<Generic>() where Generic : Component
+ Genericpublic Component AddComponent<Generic>(object[] __args) where Generic : Component
+ __args object[]Genericpublic Component GetComponent<Generic>() where Generic : Component
+ Genericpublic Component[] GetComponents<Generic>() where Generic : Component
+ Genericpublic void RemoveComponent(Component __component)
+ __component Componentpublic void RemoveComponent<Generic>() where Generic : Component
+ Genericpublic void RemoveComponents<Generic>() where Generic : Component
+ Genericpublic static class Config
+ public static string logFileName
+ public sealed class Scene : DockerEntity
+ public List<Body> bodies { get; }
+ public Body AddBody()
+ public Body AddBody(Transform __transform)
+ __transform Transformpublic void DestroyBody(Body __body)
+ __body Bodypublic void Draw(GameTime __gameTime)
+ __gameTime GameTimepublic Body[] GetBodies(string tag)
+ tag stringpublic Body GetBody(string tag)
+ tag stringpublic void Load()
+ public void Unload()
+ public void Update(GameTime __gameTime)
+ __gameTime GameTimepublic event EventHandler<BodyCreateEvent> BodyCreatedEvent
+ public event EventHandler<BodyDestroyEvent> BodyDestroyedEvent
+ public class SceneComponent : Component
+ public sealed record SceneCreateEvent : IEquatable<SceneCreateEvent>
+ public Scene scene
+ public sealed record SceneDestroyEvent : IEquatable<SceneDestroyEvent>
+ public Scene scene
+ public sealed class Transform
+ public Transform()
+ public Transform(Vector2 __origin, Vector2 __position, float __depth, float __rotation, Vector2 __scale)
+ __origin Vector2__position Vector2__depth float__rotation float__scale Vector2public float Depth { get; set; }
+ public Vector2 Origin { get; set; }
+ public Vector2 Position { get; set; }
+ public float Rotation { get; set; }
+ public Vector2 Scale { get; set; }
+ public Transform Clone()
+ public void Set(Vector2 __origin, Vector2 __position, float __depth, float __rotation, Vector2 __scale)
+ __origin Vector2__position Vector2__depth float__rotation float__scale Vector2public Matrix ToMatrix()
+ public event EventHandler<TransformModifyEvent> OnTransformChangedEvent
+ public sealed record TransformModifyEvent : IEquatable<TransformModifyEvent>
+ public readonly Transform after
+ public readonly Transform before
+ Initiating class of Awperative. Call Start() to start the kernel.
+Base class of Awperative. Carries events from MonoGame into scenes and hooks.
+The lowest level scripting class in Awperative. Components are scene level and provide access to all scene level methods, can be applied to any docker and inherited +Sadly component does not have excessive access to specific types. +Anything that inherits Component is built to work in any DockerEntity, which leads to generic +Assumptions. If you want to make a body specific or scene specific component both classes are available.
+Base class for all Awperative entities, manages components as a requirement because that is the job of all entities.
+Awperative hooks are the source of entry for scripts using Awperative. Create a hook and send into Start() to be recognized by the engine.
+Refer to Markdown for how to write markdown files.
+Initiating class of Awperative. Call Start() to start the kernel.
\n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.AwperativeHook.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.AwperativeHook.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.AwperativeHook", + "Summary": "Awperative hooks are the source of entry for scripts using Awperative. Create a hook and send into Start() to be recognized by the engine.
\n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Base.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Base.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Base", + "Summary": "Base class of Awperative. Carries events from MonoGame into scenes and hooks.
\n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Body.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Body.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Body", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.BodyComponent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.BodyComponent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.BodyComponent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.BodyCreateEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.BodyCreateEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.BodyCreateEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.BodyDestroyEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.BodyDestroyEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.BodyDestroyEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Component.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Component.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Component", + "Summary": "The lowest level scripting class in Awperative. Components are scene level and provide access to all scene level methods, can be applied to any docker and inherited\nSadly component does not have excessive access to specific types.\nAnything that inherits Component is built to work in any DockerEntity, which leads to generic\nAssumptions. If you want to make a body specific or scene specific component both classes are available.
\n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.ComponentCreateEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.ComponentCreateEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.ComponentCreateEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.ComponentDestroyEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.ComponentDestroyEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.ComponentDestroyEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Debug.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Debug.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Debug", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.DockerEntity.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.DockerEntity.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.DockerEntity", + "Summary": "Base class for all Awperative entities, manages components as a requirement because that is the job of all entities.
\n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Kernel.Communication.Config.Config.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Kernel.Communication.Config.Config.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Kernel.Communication.Config.Config", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Kernel.Communication.Config.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Kernel.Communication.Config.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Kernel.Communication.Config", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Scene.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Scene.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Scene", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.SceneComponent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.SceneComponent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.SceneComponent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.SceneCreateEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.SceneCreateEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.SceneCreateEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.SceneDestroyEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.SceneDestroyEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.SceneDestroyEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.Transform.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.Transform.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.Transform", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.TransformModifyEvent.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.TransformModifyEvent.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative.TransformModifyEvent", + "Summary": null + }, + { + "type": "ManagedReference", + "source_relative_path": "api/Awperative.yml", + "output": { + ".html": { + "relative_path": "api/Awperative.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "Awperative", + "Summary": null + }, + { + "type": "Toc", + "source_relative_path": "api/toc.yml", + "output": { + ".html": { + "relative_path": "api/toc.html" + }, + ".json": { + "relative_path": "api/toc.json" + } + }, + "version": "" + }, + { + "type": "Conceptual", + "source_relative_path": "index.md", + "output": { + ".html": { + "relative_path": "index.html" + } + }, + "version": "" + }, + { + "type": "Toc", + "source_relative_path": "toc.yml", + "output": { + ".html": { + "relative_path": "toc.html" + }, + ".json": { + "relative_path": "toc.json" + } + }, + "version": "" + } + ], + "groups": [ + { + "xrefmap": "xrefmap.yml" + } + ] +} \ No newline at end of file diff --git a/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js b/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js new file mode 100755 index 0000000..24618f0 --- /dev/null +++ b/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js @@ -0,0 +1,2 @@ +import{a as e,b as r}from"./chunk-6B6J5Z6Z.min.js";import"./chunk-LBFZT66H.min.js";import"./chunk-R5JLOOQ4.min.js";import"./chunk-PTL4EUOE.min.js";import"./chunk-E5F23VE2.min.js";import"./chunk-OSRY5VT3.min.js";export{e as ArchitectureModule,r as createArchitectureServices}; +//# sourceMappingURL=architecture-O4VJ6CD3-GQAMQMPJ.min.js.map diff --git a/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js.map b/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js.map new file mode 100755 index 0000000..9865211 --- /dev/null +++ b/docs/public/architecture-O4VJ6CD3-GQAMQMPJ.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": [], + "sourcesContent": [], + "mappings": "", + "names": [] +} diff --git a/docs/public/architectureDiagram-VXUJARFQ-H4V63UKK.min.js b/docs/public/architectureDiagram-VXUJARFQ-H4V63UKK.min.js new file mode 100755 index 0000000..99141ae --- /dev/null +++ b/docs/public/architectureDiagram-VXUJARFQ-H4V63UKK.min.js @@ -0,0 +1,37 @@ +import{a as qe}from"./chunk-V3WVIUUL.min.js";import{a as Qe}from"./chunk-I6VG5SPK.min.js";import"./chunk-LK7NMYKK.min.js";import{a as ze}from"./chunk-7EBV5LUJ.min.js";import"./chunk-6RTTMAJH.min.js";import"./chunk-LGVO22YL.min.js";import"./chunk-HVSI2YYT.min.js";import"./chunk-6B6J5Z6Z.min.js";import"./chunk-EU44H33B.min.js";import"./chunk-CQUFH26W.min.js";import"./chunk-LBFZT66H.min.js";import{b as Ze,c as ke,d as he,g as le}from"./chunk-XCAVDAZC.min.js";import"./chunk-R5JLOOQ4.min.js";import"./chunk-PTL4EUOE.min.js";import{a as Ee}from"./chunk-XXYYAETH.min.js";import{l as Be,p as $e}from"./chunk-QZZKR5JD.min.js";import"./chunk-CM5D5KZN.min.js";import{D as Fe,M as be,P as Pe,Q as Ge,R as Ue,S as Ye,T as Xe,U as He,V as We,W as se,q as Re,y as Se}from"./chunk-3EE2TK35.min.js";import"./chunk-E5F23VE2.min.js";import{b as ct,d as ye,j as Ve}from"./chunk-6TVUEPFY.min.js";import{a as pe,d as ur}from"./chunk-OSRY5VT3.min.js";var Te=pe((re,me)=>{(function(w,N){typeof re=="object"&&typeof me=="object"?me.exports=N():typeof define=="function"&&define.amd?define([],N):typeof re=="object"?re.layoutBase=N():w.layoutBase=N()})(re,function(){return(function(m){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return m[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return N.m=m,N.c=w,N.i=function(u){return u},N.d=function(u,o,n){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:n})},N.n=function(u){var o=u&&u.__esModule?function(){return u.default}:function(){return u};return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},N.p="",N(N.s=28)})([(function(m,w,N){"use strict";function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(8),n=N(9);function e(c,t,g){u.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=c,this.target=t}e.prototype=Object.create(u.prototype);for(var a in u)e[a]=u[a];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(c,t){for(var g=this.getOtherEnd(c),i=t.getGraphManager().getRoot();;){if(g.getOwner()==t)return g;if(g.getOwner()==i)break;g=g.getOwner().getParent()}return null},e.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=e}),(function(m,w,N){"use strict";function u(o){this.vGraphObject=o}m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(10),n=N(13),e=N(0),a=N(16),c=N(5);function t(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new n(r.x,r.y,h.width,h.height):this.rect=new n}t.prototype=Object.create(u.prototype);for(var g in u)t[g]=u[g];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(i){this.rect.width=i},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(i){this.rect.height=i},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},t.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},t.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},t.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},t.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},t.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;l-1&&S>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(A,1),y.target!=y.source&&y.target.edges.splice(S,1);var R=y.source.owner.getEdges().indexOf(y);if(R==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(R,1)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,L,y,p,C=this.getNodes(),R=C.length,A=0;AC&&(l=C),L=this.nodes.length){var tt=0;L.forEach(function(x){x.owner==f&&tt++}),tt==this.nodes.length&&(this.isConnected=!0)}},m.exports=r}),(function(m,w,N){"use strict";var u,o=N(1);function n(e){u=N(6),this.layout=e,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var e=this.layout.newGraph(),a=this.layout.newNode(null),c=this.add(e,a);return this.setRootGraph(c),this.rootGraph},n.prototype.add=function(e,a,c,t,g){if(c==null&&t==null&&g==null){if(e==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return e.parent=a,a.child=e,e}else{g=c,t=a,c=e;var i=t.getOwner(),r=g.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,t,g);if(c.isInterGraph=!0,c.source=t,c.target=g,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},n.prototype.remove=function(e){if(e instanceof u){var a=e;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(a.getEdges());for(var t,g=c.length,i=0;i
\");\n log.debug(\"vertexText\" + vertexText);\n const label = await replaceIconSubstring(decodeEntities(vertexText));\n const node = {\n isNode,\n label,\n labelStyle: style.replace(\"fill:\", \"color:\")\n };\n let vertexNode = addHtmlLabel(node, config2);\n return vertexNode;\n } else {\n const svgLabel = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n svgLabel.setAttribute(\"style\", style.replace(\"color:\", \"fill:\"));\n let rows = [];\n if (typeof vertexText === \"string\") {\n rows = vertexText.split(/\\\\n|\\n|
/gi);\n } else if (Array.isArray(vertexText)) {\n rows = vertexText;\n } else {\n rows = [];\n }\n for (const row of rows) {\n const tspan = document.createElementNS(\"http://www.w3.org/2000/svg\", \"tspan\");\n tspan.setAttributeNS(\"http://www.w3.org/XML/1998/namespace\", \"xml:space\", \"preserve\");\n tspan.setAttribute(\"dy\", \"1em\");\n tspan.setAttribute(\"x\", \"0\");\n if (isTitle) {\n tspan.setAttribute(\"class\", \"title-row\");\n } else {\n tspan.setAttribute(\"class\", \"row\");\n }\n tspan.textContent = row.trim();\n svgLabel.appendChild(tspan);\n }\n return svgLabel;\n }\n}, \"createLabel\");\nvar createLabel_default = createLabel;\n\n// src/dagre-wrapper/edges.js\nimport { line, curveBasis, select as select2 } from \"d3\";\n\n// src/dagre-wrapper/edgeMarker.ts\nvar addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id, diagramType) => {\n if (edge.arrowTypeStart) {\n addEdgeMarker(svgPath, \"start\", edge.arrowTypeStart, url, id, diagramType);\n }\n if (edge.arrowTypeEnd) {\n addEdgeMarker(svgPath, \"end\", edge.arrowTypeEnd, url, id, diagramType);\n }\n}, \"addEdgeMarkers\");\nvar arrowTypesMap = {\n arrow_cross: \"cross\",\n arrow_point: \"point\",\n arrow_barb: \"barb\",\n arrow_circle: \"circle\",\n aggregation: \"aggregation\",\n extension: \"extension\",\n composition: \"composition\",\n dependency: \"dependency\",\n lollipop: \"lollipop\"\n};\nvar addEdgeMarker = /* @__PURE__ */ __name((svgPath, position, arrowType, url, id, diagramType) => {\n const endMarkerType = arrowTypesMap[arrowType];\n if (!endMarkerType) {\n log.warn(`Unknown arrow type: ${arrowType}`);\n return;\n }\n const suffix = position === \"start\" ? \"Start\" : \"End\";\n svgPath.attr(`marker-${position}`, `url(${url}#${id}_${diagramType}-${endMarkerType}${suffix})`);\n}, \"addEdgeMarker\");\n\n// src/dagre-wrapper/edges.js\nvar edgeLabels = {};\nvar terminalLabels = {};\nvar insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {\n const config2 = getConfig2();\n const useHtmlLabels = evaluate(config2.flowchart.htmlLabels);\n const labelElement = edge.labelType === \"markdown\" ? createText(\n elem,\n edge.label,\n {\n style: edge.labelStyle,\n useHtmlLabels,\n addSvgBackground: true\n },\n config2\n ) : await createLabel_default(edge.label, edge.labelStyle);\n const edgeLabel = elem.insert(\"g\").attr(\"class\", \"edgeLabel\");\n const label = edgeLabel.insert(\"g\").attr(\"class\", \"label\");\n label.node().appendChild(labelElement);\n let bbox = labelElement.getBBox();\n if (useHtmlLabels) {\n const div = labelElement.children[0];\n const dv = select2(labelElement);\n bbox = div.getBoundingClientRect();\n dv.attr(\"width\", bbox.width);\n dv.attr(\"height\", bbox.height);\n }\n label.attr(\"transform\", \"translate(\" + -bbox.width / 2 + \", \" + -bbox.height / 2 + \")\");\n edgeLabels[edge.id] = edgeLabel;\n edge.width = bbox.width;\n edge.height = bbox.height;\n let fo;\n if (edge.startLabelLeft) {\n const startLabelElement = await createLabel_default(edge.startLabelLeft, edge.labelStyle);\n const startEdgeLabelLeft = elem.insert(\"g\").attr(\"class\", \"edgeTerminals\");\n const inner = startEdgeLabelLeft.insert(\"g\").attr(\"class\", \"inner\");\n fo = inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr(\"transform\", \"translate(\" + -slBox.width / 2 + \", \" + -slBox.height / 2 + \")\");\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startLeft = startEdgeLabelLeft;\n setTerminalWidth(fo, edge.startLabelLeft);\n }\n if (edge.startLabelRight) {\n const startLabelElement = await createLabel_default(edge.startLabelRight, edge.labelStyle);\n const startEdgeLabelRight = elem.insert(\"g\").attr(\"class\", \"edgeTerminals\");\n const inner = startEdgeLabelRight.insert(\"g\").attr(\"class\", \"inner\");\n fo = startEdgeLabelRight.node().appendChild(startLabelElement);\n inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr(\"transform\", \"translate(\" + -slBox.width / 2 + \", \" + -slBox.height / 2 + \")\");\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startRight = startEdgeLabelRight;\n setTerminalWidth(fo, edge.startLabelRight);\n }\n if (edge.endLabelLeft) {\n const endLabelElement = await createLabel_default(edge.endLabelLeft, edge.labelStyle);\n const endEdgeLabelLeft = elem.insert(\"g\").attr(\"class\", \"edgeTerminals\");\n const inner = endEdgeLabelLeft.insert(\"g\").attr(\"class\", \"inner\");\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr(\"transform\", \"translate(\" + -slBox.width / 2 + \", \" + -slBox.height / 2 + \")\");\n endEdgeLabelLeft.node().appendChild(endLabelElement);\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endLeft = endEdgeLabelLeft;\n setTerminalWidth(fo, edge.endLabelLeft);\n }\n if (edge.endLabelRight) {\n const endLabelElement = await createLabel_default(edge.endLabelRight, edge.labelStyle);\n const endEdgeLabelRight = elem.insert(\"g\").attr(\"class\", \"edgeTerminals\");\n const inner = endEdgeLabelRight.insert(\"g\").attr(\"class\", \"inner\");\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr(\"transform\", \"translate(\" + -slBox.width / 2 + \", \" + -slBox.height / 2 + \")\");\n endEdgeLabelRight.node().appendChild(endLabelElement);\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endRight = endEdgeLabelRight;\n setTerminalWidth(fo, edge.endLabelRight);\n }\n return labelElement;\n}, \"insertEdgeLabel\");\nfunction setTerminalWidth(fo, value) {\n if (getConfig2().flowchart.htmlLabels && fo) {\n fo.style.width = value.length * 9 + \"px\";\n fo.style.height = \"12px\";\n }\n}\n__name(setTerminalWidth, \"setTerminalWidth\");\nvar positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {\n log.debug(\"Moving label abc88 \", edge.id, edge.label, edgeLabels[edge.id], paths);\n let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;\n const siteConfig = getConfig2();\n const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);\n if (edge.label) {\n const el = edgeLabels[edge.id];\n let x = edge.x;\n let y = edge.y;\n if (path) {\n const pos = utils_default.calcLabelPosition(path);\n log.debug(\n \"Moving label \" + edge.label + \" from (\",\n x,\n \",\",\n y,\n \") to (\",\n pos.x,\n \",\",\n pos.y,\n \") abc88\"\n );\n if (paths.updatedPath) {\n x = pos.x;\n y = pos.y;\n }\n }\n el.attr(\"transform\", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);\n }\n if (edge.startLabelLeft) {\n const el = terminalLabels[edge.id].startLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, \"start_left\", path);\n x = pos.x;\n y = pos.y;\n }\n el.attr(\"transform\", `translate(${x}, ${y})`);\n }\n if (edge.startLabelRight) {\n const el = terminalLabels[edge.id].startRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n const pos = utils_default.calcTerminalLabelPosition(\n edge.arrowTypeStart ? 10 : 0,\n \"start_right\",\n path\n );\n x = pos.x;\n y = pos.y;\n }\n el.attr(\"transform\", `translate(${x}, ${y})`);\n }\n if (edge.endLabelLeft) {\n const el = terminalLabels[edge.id].endLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, \"end_left\", path);\n x = pos.x;\n y = pos.y;\n }\n el.attr(\"transform\", `translate(${x}, ${y})`);\n }\n if (edge.endLabelRight) {\n const el = terminalLabels[edge.id].endRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, \"end_right\", path);\n x = pos.x;\n y = pos.y;\n }\n el.attr(\"transform\", `translate(${x}, ${y})`);\n }\n}, \"positionEdgeLabel\");\nvar outsideNode = /* @__PURE__ */ __name((node, point2) => {\n const x = node.x;\n const y = node.y;\n const dx = Math.abs(point2.x - x);\n const dy = Math.abs(point2.y - y);\n const w = node.width / 2;\n const h = node.height / 2;\n if (dx >= w || dy >= h) {\n return true;\n }\n return false;\n}, \"outsideNode\");\nvar intersection = /* @__PURE__ */ __name((node, outsidePoint, insidePoint) => {\n log.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(outsidePoint)}\n insidePoint : ${JSON.stringify(insidePoint)}\n node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);\n const x = node.x;\n const y = node.y;\n const dx = Math.abs(x - insidePoint.x);\n const w = node.width / 2;\n let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;\n const h = node.height / 2;\n const Q = Math.abs(outsidePoint.y - insidePoint.y);\n const R = Math.abs(outsidePoint.x - insidePoint.x);\n if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {\n let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;\n r = R * q / Q;\n const res = {\n x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,\n y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q\n };\n if (r === 0) {\n res.x = outsidePoint.x;\n res.y = outsidePoint.y;\n }\n if (R === 0) {\n res.x = outsidePoint.x;\n }\n if (Q === 0) {\n res.y = outsidePoint.y;\n }\n log.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);\n return res;\n } else {\n if (insidePoint.x < outsidePoint.x) {\n r = outsidePoint.x - w - x;\n } else {\n r = x - w - outsidePoint.x;\n }\n let q = Q * r / R;\n let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;\n let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;\n log.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });\n if (r === 0) {\n _x = outsidePoint.x;\n _y = outsidePoint.y;\n }\n if (R === 0) {\n _x = outsidePoint.x;\n }\n if (Q === 0) {\n _y = outsidePoint.y;\n }\n return { x: _x, y: _y };\n }\n}, \"intersection\");\nvar cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {\n log.debug(\"abc88 cutPathAtIntersect\", _points, boundaryNode);\n let points = [];\n let lastPointOutside = _points[0];\n let isInside = false;\n _points.forEach((point2) => {\n if (!outsideNode(boundaryNode, point2) && !isInside) {\n const inter = intersection(boundaryNode, lastPointOutside, point2);\n let pointPresent = false;\n points.forEach((p) => {\n pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;\n });\n if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {\n points.push(inter);\n }\n isInside = true;\n } else {\n lastPointOutside = point2;\n if (!isInside) {\n points.push(point2);\n }\n }\n });\n return points;\n}, \"cutPathAtIntersect\");\nvar insertEdge = /* @__PURE__ */ __name(function(elem, e, edge, clusterDb, diagramType, graph, id) {\n let points = edge.points;\n log.debug(\"abc88 InsertEdge: edge=\", edge, \"e=\", e);\n let pointsHasChanged = false;\n const tail = graph.node(e.v);\n var head = graph.node(e.w);\n if (head?.intersect && tail?.intersect) {\n points = points.slice(1, edge.points.length - 1);\n points.unshift(tail.intersect(points[0]));\n points.push(head.intersect(points[points.length - 1]));\n }\n if (edge.toCluster) {\n log.debug(\"to cluster abc88\", clusterDb[edge.toCluster]);\n points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);\n pointsHasChanged = true;\n }\n if (edge.fromCluster) {\n log.debug(\"from cluster abc88\", clusterDb[edge.fromCluster]);\n points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();\n pointsHasChanged = true;\n }\n const lineData = points.filter((p) => !Number.isNaN(p.y));\n let curve = curveBasis;\n if (edge.curve && (diagramType === \"graph\" || diagramType === \"flowchart\")) {\n curve = edge.curve;\n }\n const { x, y } = getLineFunctionsWithOffset(edge);\n const lineFunction = line().x(x).y(y).curve(curve);\n let strokeClasses;\n switch (edge.thickness) {\n case \"normal\":\n strokeClasses = \"edge-thickness-normal\";\n break;\n case \"thick\":\n strokeClasses = \"edge-thickness-thick\";\n break;\n case \"invisible\":\n strokeClasses = \"edge-thickness-thick\";\n break;\n default:\n strokeClasses = \"\";\n }\n switch (edge.pattern) {\n case \"solid\":\n strokeClasses += \" edge-pattern-solid\";\n break;\n case \"dotted\":\n strokeClasses += \" edge-pattern-dotted\";\n break;\n case \"dashed\":\n strokeClasses += \" edge-pattern-dashed\";\n break;\n }\n const svgPath = elem.append(\"path\").attr(\"d\", lineFunction(lineData)).attr(\"id\", edge.id).attr(\"class\", \" \" + strokeClasses + (edge.classes ? \" \" + edge.classes : \"\")).attr(\"style\", edge.style);\n let url = \"\";\n if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {\n url = getUrl(true);\n }\n addEdgeMarkers(svgPath, edge, url, id, diagramType);\n let paths = {};\n if (pointsHasChanged) {\n paths.updatedPath = points;\n }\n paths.originalPath = edge.points;\n return paths;\n}, \"insertEdge\");\n\n// src/dagre-wrapper/nodes.js\nimport { select as select4 } from \"d3\";\n\n// src/dagre-wrapper/blockArrowHelper.ts\nvar expandAndDeduplicateDirections = /* @__PURE__ */ __name((directions) => {\n const uniqueDirections = /* @__PURE__ */ new Set();\n for (const direction of directions) {\n switch (direction) {\n case \"x\":\n uniqueDirections.add(\"right\");\n uniqueDirections.add(\"left\");\n break;\n case \"y\":\n uniqueDirections.add(\"up\");\n uniqueDirections.add(\"down\");\n break;\n default:\n uniqueDirections.add(direction);\n break;\n }\n }\n return uniqueDirections;\n}, \"expandAndDeduplicateDirections\");\nvar getArrowPoints = /* @__PURE__ */ __name((duplicatedDirections, bbox, node) => {\n const directions = expandAndDeduplicateDirections(duplicatedDirections);\n const f = 2;\n const height = bbox.height + 2 * node.padding;\n const midpoint = height / f;\n const width = bbox.width + 2 * midpoint + node.padding;\n const padding2 = node.padding / 2;\n if (directions.has(\"right\") && directions.has(\"left\") && directions.has(\"up\") && directions.has(\"down\")) {\n return [\n // Bottom\n { x: 0, y: 0 },\n { x: midpoint, y: 0 },\n { x: width / 2, y: 2 * padding2 },\n { x: width - midpoint, y: 0 },\n { x: width, y: 0 },\n // Right\n { x: width, y: -height / 3 },\n { x: width + 2 * padding2, y: -height / 2 },\n { x: width, y: -2 * height / 3 },\n { x: width, y: -height },\n // Top\n { x: width - midpoint, y: -height },\n { x: width / 2, y: -height - 2 * padding2 },\n { x: midpoint, y: -height },\n // Left\n { x: 0, y: -height },\n { x: 0, y: -2 * height / 3 },\n { x: -2 * padding2, y: -height / 2 },\n { x: 0, y: -height / 3 }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"left\") && directions.has(\"up\")) {\n return [\n { x: midpoint, y: 0 },\n { x: width - midpoint, y: 0 },\n { x: width, y: -height / 2 },\n { x: width - midpoint, y: -height },\n { x: midpoint, y: -height },\n { x: 0, y: -height / 2 }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"left\") && directions.has(\"down\")) {\n return [\n { x: 0, y: 0 },\n { x: midpoint, y: -height },\n { x: width - midpoint, y: -height },\n { x: width, y: 0 }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"up\") && directions.has(\"down\")) {\n return [\n { x: 0, y: 0 },\n { x: width, y: -midpoint },\n { x: width, y: -height + midpoint },\n { x: 0, y: -height }\n ];\n }\n if (directions.has(\"left\") && directions.has(\"up\") && directions.has(\"down\")) {\n return [\n { x: width, y: 0 },\n { x: 0, y: -midpoint },\n { x: 0, y: -height + midpoint },\n { x: width, y: -height }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"left\")) {\n return [\n { x: midpoint, y: 0 },\n { x: midpoint, y: -padding2 },\n { x: width - midpoint, y: -padding2 },\n { x: width - midpoint, y: 0 },\n { x: width, y: -height / 2 },\n { x: width - midpoint, y: -height },\n { x: width - midpoint, y: -height + padding2 },\n { x: midpoint, y: -height + padding2 },\n { x: midpoint, y: -height },\n { x: 0, y: -height / 2 }\n ];\n }\n if (directions.has(\"up\") && directions.has(\"down\")) {\n return [\n // Bottom center\n { x: width / 2, y: 0 },\n // Left pont of bottom arrow\n { x: 0, y: -padding2 },\n { x: midpoint, y: -padding2 },\n // Left top over vertical section\n { x: midpoint, y: -height + padding2 },\n { x: 0, y: -height + padding2 },\n // Top of arrow\n { x: width / 2, y: -height },\n { x: width, y: -height + padding2 },\n // Top of right vertical bar\n { x: width - midpoint, y: -height + padding2 },\n { x: width - midpoint, y: -padding2 },\n { x: width, y: -padding2 }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"up\")) {\n return [\n { x: 0, y: 0 },\n { x: width, y: -midpoint },\n { x: 0, y: -height }\n ];\n }\n if (directions.has(\"right\") && directions.has(\"down\")) {\n return [\n { x: 0, y: 0 },\n { x: width, y: 0 },\n { x: 0, y: -height }\n ];\n }\n if (directions.has(\"left\") && directions.has(\"up\")) {\n return [\n { x: width, y: 0 },\n { x: 0, y: -midpoint },\n { x: width, y: -height }\n ];\n }\n if (directions.has(\"left\") && directions.has(\"down\")) {\n return [\n { x: width, y: 0 },\n { x: 0, y: 0 },\n { x: width, y: -height }\n ];\n }\n if (directions.has(\"right\")) {\n return [\n { x: midpoint, y: -padding2 },\n { x: midpoint, y: -padding2 },\n { x: width - midpoint, y: -padding2 },\n { x: width - midpoint, y: 0 },\n { x: width, y: -height / 2 },\n { x: width - midpoint, y: -height },\n { x: width - midpoint, y: -height + padding2 },\n // top left corner of arrow\n { x: midpoint, y: -height + padding2 },\n { x: midpoint, y: -height + padding2 }\n ];\n }\n if (directions.has(\"left\")) {\n return [\n { x: midpoint, y: 0 },\n { x: midpoint, y: -padding2 },\n // Two points, the right corners\n { x: width - midpoint, y: -padding2 },\n { x: width - midpoint, y: -height + padding2 },\n { x: midpoint, y: -height + padding2 },\n { x: midpoint, y: -height },\n { x: 0, y: -height / 2 }\n ];\n }\n if (directions.has(\"up\")) {\n return [\n // Bottom center\n { x: midpoint, y: -padding2 },\n // Left top over vertical section\n { x: midpoint, y: -height + padding2 },\n { x: 0, y: -height + padding2 },\n // Top of arrow\n { x: width / 2, y: -height },\n { x: width, y: -height + padding2 },\n // Top of right vertical bar\n { x: width - midpoint, y: -height + padding2 },\n { x: width - midpoint, y: -padding2 }\n ];\n }\n if (directions.has(\"down\")) {\n return [\n // Bottom center\n { x: width / 2, y: 0 },\n // Left pont of bottom arrow\n { x: 0, y: -padding2 },\n { x: midpoint, y: -padding2 },\n // Left top over vertical section\n { x: midpoint, y: -height + padding2 },\n { x: width - midpoint, y: -height + padding2 },\n { x: width - midpoint, y: -padding2 },\n { x: width, y: -padding2 }\n ];\n }\n return [{ x: 0, y: 0 }];\n}, \"getArrowPoints\");\n\n// src/dagre-wrapper/intersect/intersect-node.js\nfunction intersectNode(node, point2) {\n return node.intersect(point2);\n}\n__name(intersectNode, \"intersectNode\");\nvar intersect_node_default = intersectNode;\n\n// src/dagre-wrapper/intersect/intersect-ellipse.js\nfunction intersectEllipse(node, rx, ry, point2) {\n var cx = node.x;\n var cy = node.y;\n var px = cx - point2.x;\n var py = cy - point2.y;\n var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);\n var dx = Math.abs(rx * ry * px / det);\n if (point2.x < cx) {\n dx = -dx;\n }\n var dy = Math.abs(rx * ry * py / det);\n if (point2.y < cy) {\n dy = -dy;\n }\n return { x: cx + dx, y: cy + dy };\n}\n__name(intersectEllipse, \"intersectEllipse\");\nvar intersect_ellipse_default = intersectEllipse;\n\n// src/dagre-wrapper/intersect/intersect-circle.js\nfunction intersectCircle(node, rx, point2) {\n return intersect_ellipse_default(node, rx, rx, point2);\n}\n__name(intersectCircle, \"intersectCircle\");\nvar intersect_circle_default = intersectCircle;\n\n// src/dagre-wrapper/intersect/intersect-line.js\nfunction intersectLine(p1, p2, q1, q2) {\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y;\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y;\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1;\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return;\n }\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y;\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return;\n }\n denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return;\n }\n offset = Math.abs(denom / 2);\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n return { x, y };\n}\n__name(intersectLine, \"intersectLine\");\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}\n__name(sameSign, \"sameSign\");\nvar intersect_line_default = intersectLine;\n\n// src/dagre-wrapper/intersect/intersect-polygon.js\nvar intersect_polygon_default = intersectPolygon;\nfunction intersectPolygon(node, polyPoints, point2) {\n var x1 = node.x;\n var y1 = node.y;\n var intersections = [];\n var minX = Number.POSITIVE_INFINITY;\n var minY = Number.POSITIVE_INFINITY;\n if (typeof polyPoints.forEach === \"function\") {\n polyPoints.forEach(function(entry) {\n minX = Math.min(minX, entry.x);\n minY = Math.min(minY, entry.y);\n });\n } else {\n minX = Math.min(minX, polyPoints.x);\n minY = Math.min(minY, polyPoints.y);\n }\n var left = x1 - node.width / 2 - minX;\n var top = y1 - node.height / 2 - minY;\n for (var i = 0; i < polyPoints.length; i++) {\n var p1 = polyPoints[i];\n var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];\n var intersect = intersect_line_default(\n node,\n point2,\n { x: left + p1.x, y: top + p1.y },\n { x: left + p2.x, y: top + p2.y }\n );\n if (intersect) {\n intersections.push(intersect);\n }\n }\n if (!intersections.length) {\n return node;\n }\n if (intersections.length > 1) {\n intersections.sort(function(p, q) {\n var pdx = p.x - point2.x;\n var pdy = p.y - point2.y;\n var distp = Math.sqrt(pdx * pdx + pdy * pdy);\n var qdx = q.x - point2.x;\n var qdy = q.y - point2.y;\n var distq = Math.sqrt(qdx * qdx + qdy * qdy);\n return distp < distq ? -1 : distp === distq ? 0 : 1;\n });\n }\n return intersections[0];\n}\n__name(intersectPolygon, \"intersectPolygon\");\n\n// src/dagre-wrapper/intersect/intersect-rect.js\nvar intersectRect = /* @__PURE__ */ __name((node, point2) => {\n var x = node.x;\n var y = node.y;\n var dx = point2.x - x;\n var dy = point2.y - y;\n var w = node.width / 2;\n var h = node.height / 2;\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : h * dx / dy;\n sy = h;\n } else {\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : w * dy / dx;\n }\n return { x: x + sx, y: y + sy };\n}, \"intersectRect\");\nvar intersect_rect_default = intersectRect;\n\n// src/dagre-wrapper/intersect/index.js\nvar intersect_default = {\n node: intersect_node_default,\n circle: intersect_circle_default,\n ellipse: intersect_ellipse_default,\n polygon: intersect_polygon_default,\n rect: intersect_rect_default\n};\n\n// src/dagre-wrapper/shapes/util.js\nimport { select as select3 } from \"d3\";\nvar labelHelper = /* @__PURE__ */ __name(async (parent, node, _classes, isNode) => {\n const config2 = getConfig2();\n let classes2;\n const useHtmlLabels = node.useHtmlLabels || evaluate(config2.flowchart.htmlLabels);\n if (!_classes) {\n classes2 = \"node default\";\n } else {\n classes2 = _classes;\n }\n const shapeSvg = parent.insert(\"g\").attr(\"class\", classes2).attr(\"id\", node.domId || node.id);\n const label = shapeSvg.insert(\"g\").attr(\"class\", \"label\").attr(\"style\", node.labelStyle);\n let labelText;\n if (node.labelText === void 0) {\n labelText = \"\";\n } else {\n labelText = typeof node.labelText === \"string\" ? node.labelText : node.labelText[0];\n }\n const textNode = label.node();\n let text;\n if (node.labelType === \"markdown\") {\n text = createText(\n label,\n sanitizeText(decodeEntities(labelText), config2),\n {\n useHtmlLabels,\n width: node.width || config2.flowchart.wrappingWidth,\n classes: \"markdown-node-label\"\n },\n config2\n );\n } else {\n text = textNode.appendChild(\n await createLabel_default(\n sanitizeText(decodeEntities(labelText), config2),\n node.labelStyle,\n false,\n isNode\n )\n );\n }\n let bbox = text.getBBox();\n const halfPadding = node.padding / 2;\n if (evaluate(config2.flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select3(text);\n const images = div.getElementsByTagName(\"img\");\n if (images) {\n const noImgText = labelText.replace(/]*>/g, \"\").trim() === \"\";\n await Promise.all(\n [...images].map(\n (img) => new Promise((res) => {\n function setupImage() {\n img.style.display = \"flex\";\n img.style.flexDirection = \"column\";\n if (noImgText) {\n const bodyFontSize = config2.fontSize ? config2.fontSize : window.getComputedStyle(document.body).fontSize;\n const enlargingFactor = 5;\n const width = parseInt(bodyFontSize, 10) * enlargingFactor + \"px\";\n img.style.minWidth = width;\n img.style.maxWidth = width;\n } else {\n img.style.width = \"100%\";\n }\n res(img);\n }\n __name(setupImage, \"setupImage\");\n setTimeout(() => {\n if (img.complete) {\n setupImage();\n }\n });\n img.addEventListener(\"error\", setupImage);\n img.addEventListener(\"load\", setupImage);\n })\n )\n );\n }\n bbox = div.getBoundingClientRect();\n dv.attr(\"width\", bbox.width);\n dv.attr(\"height\", bbox.height);\n }\n if (useHtmlLabels) {\n label.attr(\"transform\", \"translate(\" + -bbox.width / 2 + \", \" + -bbox.height / 2 + \")\");\n } else {\n label.attr(\"transform\", \"translate(0, \" + -bbox.height / 2 + \")\");\n }\n if (node.centerLabel) {\n label.attr(\"transform\", \"translate(\" + -bbox.width / 2 + \", \" + -bbox.height / 2 + \")\");\n }\n label.insert(\"rect\", \":first-child\");\n return { shapeSvg, bbox, halfPadding, label };\n}, \"labelHelper\");\nvar updateNodeBounds = /* @__PURE__ */ __name((node, element) => {\n const bbox = element.node().getBBox();\n node.width = bbox.width;\n node.height = bbox.height;\n}, \"updateNodeBounds\");\nfunction insertPolygonShape(parent, w, h, points) {\n return parent.insert(\"polygon\", \":first-child\").attr(\n \"points\",\n points.map(function(d) {\n return d.x + \",\" + d.y;\n }).join(\" \")\n ).attr(\"class\", \"label-container\").attr(\"transform\", \"translate(\" + -w / 2 + \",\" + h / 2 + \")\");\n}\n__name(insertPolygonShape, \"insertPolygonShape\");\n\n// src/dagre-wrapper/shapes/note.js\nvar note = /* @__PURE__ */ __name(async (parent, node) => {\n const useHtmlLabels = node.useHtmlLabels || getConfig2().flowchart.htmlLabels;\n if (!useHtmlLabels) {\n node.centerLabel = true;\n }\n const { shapeSvg, bbox, halfPadding } = await labelHelper(\n parent,\n node,\n \"node \" + node.classes,\n true\n );\n log.info(\"Classes = \", node.classes);\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n rect2.attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", -bbox.width / 2 - halfPadding).attr(\"y\", -bbox.height / 2 - halfPadding).attr(\"width\", bbox.width + node.padding).attr(\"height\", bbox.height + node.padding);\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"note\");\nvar note_default = note;\n\n// src/dagre-wrapper/nodes.js\nvar formatClass = /* @__PURE__ */ __name((str) => {\n if (str) {\n return \" \" + str;\n }\n return \"\";\n}, \"formatClass\");\nvar getClassesFromNode = /* @__PURE__ */ __name((node, otherClasses) => {\n return `${otherClasses ? otherClasses : \"node default\"}${formatClass(node.classes)} ${formatClass(\n node.class\n )}`;\n}, \"getClassesFromNode\");\nvar question = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const s = w + h;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 }\n ];\n log.info(\"Question main (Circle)\");\n const questionElem = insertPolygonShape(shapeSvg, s, s, points);\n questionElem.attr(\"style\", node.style);\n updateNodeBounds(node, questionElem);\n node.intersect = function(point2) {\n log.warn(\"Intersect called\");\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"question\");\nvar choice = /* @__PURE__ */ __name((parent, node) => {\n const shapeSvg = parent.insert(\"g\").attr(\"class\", \"node default\").attr(\"id\", node.domId || node.id);\n const s = 28;\n const points = [\n { x: 0, y: s / 2 },\n { x: s / 2, y: 0 },\n { x: 0, y: -s / 2 },\n { x: -s / 2, y: 0 }\n ];\n const choice2 = shapeSvg.insert(\"polygon\", \":first-child\").attr(\n \"points\",\n points.map(function(d) {\n return d.x + \",\" + d.y;\n }).join(\" \")\n );\n choice2.attr(\"class\", \"state-start\").attr(\"r\", 7).attr(\"width\", 28).attr(\"height\", 28);\n node.width = 28;\n node.height = 28;\n node.intersect = function(point2) {\n return intersect_default.circle(node, 14, point2);\n };\n return shapeSvg;\n}, \"choice\");\nvar hexagon = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const f = 4;\n const h = bbox.height + node.padding;\n const m = h / f;\n const w = bbox.width + 2 * m + node.padding;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 }\n ];\n const hex = insertPolygonShape(shapeSvg, w, h, points);\n hex.attr(\"style\", node.style);\n updateNodeBounds(node, hex);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"hexagon\");\nvar block_arrow = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(parent, node, void 0, true);\n const f = 2;\n const h = bbox.height + 2 * node.padding;\n const m = h / f;\n const w = bbox.width + 2 * m + node.padding;\n const points = getArrowPoints(node.directions, bbox, node);\n const blockArrow = insertPolygonShape(shapeSvg, w, h, points);\n blockArrow.attr(\"style\", node.style);\n updateNodeBounds(node, blockArrow);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"block_arrow\");\nvar rect_left_inv_arrow = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n node.width = w + h;\n node.height = h;\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"rect_left_inv_arrow\");\nvar lean_right = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(parent, node, getClassesFromNode(node), true);\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: -2 * h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + 2 * h / 6, y: -h },\n { x: h / 6, y: -h }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"lean_right\");\nvar lean_left = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 2 * h / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - 2 * h / 6, y: -h },\n { x: -h / 6, y: -h }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"lean_left\");\nvar trapezoid = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: -2 * h / 6, y: 0 },\n { x: w + 2 * h / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"trapezoid\");\nvar inv_trapezoid = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + 2 * h / 6, y: -h },\n { x: -2 * h / 6, y: -h }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"inv_trapezoid\");\nvar rect_right_inv_arrow = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"rect_right_inv_arrow\");\nvar cylinder = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry + node.padding;\n const shape = \"M 0,\" + ry + \" a \" + rx + \",\" + ry + \" 0,0,0 \" + w + \" 0 a \" + rx + \",\" + ry + \" 0,0,0 \" + -w + \" 0 l 0,\" + h + \" a \" + rx + \",\" + ry + \" 0,0,0 \" + w + \" 0 l 0,\" + -h;\n const el = shapeSvg.attr(\"label-offset-y\", ry).insert(\"path\", \":first-child\").attr(\"style\", node.style).attr(\"d\", shape).attr(\"transform\", \"translate(\" + -w / 2 + \",\" + -(h / 2 + ry) + \")\");\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n const pos = intersect_default.rect(node, point2);\n const x = pos.x - node.x;\n if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) {\n let y = ry * ry * (1 - x * x / (rx * rx));\n if (y != 0) {\n y = Math.sqrt(y);\n }\n y = ry - y;\n if (point2.y - node.y > 0) {\n y = -y;\n }\n pos.y += y;\n }\n return pos;\n };\n return shapeSvg;\n}, \"cylinder\");\nvar rect = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = await labelHelper(\n parent,\n node,\n \"node \" + node.classes + \" \" + node.class,\n true\n );\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n const totalWidth = node.positioned ? node.width : bbox.width + node.padding;\n const totalHeight = node.positioned ? node.height : bbox.height + node.padding;\n const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;\n const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;\n rect2.attr(\"class\", \"basic label-container\").attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", x).attr(\"y\", y).attr(\"width\", totalWidth).attr(\"height\", totalHeight);\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);\n propKeys.delete(\"borders\");\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"rect\");\nvar composite = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = await labelHelper(\n parent,\n node,\n \"node \" + node.classes,\n true\n );\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n const totalWidth = node.positioned ? node.width : bbox.width + node.padding;\n const totalHeight = node.positioned ? node.height : bbox.height + node.padding;\n const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;\n const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;\n rect2.attr(\"class\", \"basic cluster composite label-container\").attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"x\", x).attr(\"y\", y).attr(\"width\", totalWidth).attr(\"height\", totalHeight);\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);\n propKeys.delete(\"borders\");\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"composite\");\nvar labelRect = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg } = await labelHelper(parent, node, \"label\", true);\n log.trace(\"Classes = \", node.class);\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n const totalWidth = 0;\n const totalHeight = 0;\n rect2.attr(\"width\", totalWidth).attr(\"height\", totalHeight);\n shapeSvg.attr(\"class\", \"label edgeLabel\");\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);\n propKeys.delete(\"borders\");\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"labelRect\");\nfunction applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) {\n const strokeDashArray = [];\n const addBorder = /* @__PURE__ */ __name((length) => {\n strokeDashArray.push(length, 0);\n }, \"addBorder\");\n const skipBorder = /* @__PURE__ */ __name((length) => {\n strokeDashArray.push(0, length);\n }, \"skipBorder\");\n if (borders.includes(\"t\")) {\n log.debug(\"add top border\");\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes(\"r\")) {\n log.debug(\"add right border\");\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n if (borders.includes(\"b\")) {\n log.debug(\"add bottom border\");\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes(\"l\")) {\n log.debug(\"add left border\");\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n rect2.attr(\"stroke-dasharray\", strokeDashArray.join(\" \"));\n}\n__name(applyNodePropertyBorders, \"applyNodePropertyBorders\");\nvar rectWithTitle = /* @__PURE__ */ __name(async (parent, node) => {\n let classes2;\n if (!node.classes) {\n classes2 = \"node default\";\n } else {\n classes2 = \"node \" + node.classes;\n }\n const shapeSvg = parent.insert(\"g\").attr(\"class\", classes2).attr(\"id\", node.domId || node.id);\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n const innerLine = shapeSvg.insert(\"line\");\n const label = shapeSvg.insert(\"g\").attr(\"class\", \"label\");\n const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;\n let title = \"\";\n if (typeof text2 === \"object\") {\n title = text2[0];\n } else {\n title = text2;\n }\n log.info(\"Label text abc79\", title, text2, typeof text2 === \"object\");\n const text = label.node().appendChild(await createLabel_default(title, node.labelStyle, true, true));\n let bbox = { width: 0, height: 0 };\n if (evaluate(getConfig2().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select4(text);\n bbox = div.getBoundingClientRect();\n dv.attr(\"width\", bbox.width);\n dv.attr(\"height\", bbox.height);\n }\n log.info(\"Text 2\", text2);\n const textRows = text2.slice(1, text2.length);\n let titleBox = text.getBBox();\n const descr = label.node().appendChild(\n await createLabel_default(\n textRows.join ? textRows.join(\"
\") : textRows,\n node.labelStyle,\n true,\n true\n )\n );\n if (evaluate(getConfig2().flowchart.htmlLabels)) {\n const div = descr.children[0];\n const dv = select4(descr);\n bbox = div.getBoundingClientRect();\n dv.attr(\"width\", bbox.width);\n dv.attr(\"height\", bbox.height);\n }\n const halfPadding = node.padding / 2;\n select4(descr).attr(\n \"transform\",\n \"translate( \" + // (titleBox.width - bbox.width) / 2 +\n (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + \", \" + (titleBox.height + halfPadding + 5) + \")\"\n );\n select4(text).attr(\n \"transform\",\n \"translate( \" + // (titleBox.width - bbox.width) / 2 +\n (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + \", 0)\"\n );\n bbox = label.node().getBBox();\n label.attr(\n \"transform\",\n \"translate(\" + -bbox.width / 2 + \", \" + (-bbox.height / 2 - halfPadding + 3) + \")\"\n );\n rect2.attr(\"class\", \"outer title-state\").attr(\"x\", -bbox.width / 2 - halfPadding).attr(\"y\", -bbox.height / 2 - halfPadding).attr(\"width\", bbox.width + node.padding).attr(\"height\", bbox.height + node.padding);\n innerLine.attr(\"class\", \"divider\").attr(\"x1\", -bbox.width / 2 - halfPadding).attr(\"x2\", bbox.width / 2 + halfPadding).attr(\"y1\", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr(\"y2\", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"rectWithTitle\");\nvar stadium = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const h = bbox.height + node.padding;\n const w = bbox.width + h / 4 + node.padding;\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\").attr(\"style\", node.style).attr(\"rx\", h / 2).attr(\"ry\", h / 2).attr(\"x\", -w / 2).attr(\"y\", -h / 2).attr(\"width\", w).attr(\"height\", h);\n updateNodeBounds(node, rect2);\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"stadium\");\nvar circle2 = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const circle3 = shapeSvg.insert(\"circle\", \":first-child\");\n circle3.attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"r\", bbox.width / 2 + halfPadding).attr(\"width\", bbox.width + node.padding).attr(\"height\", bbox.height + node.padding);\n log.info(\"Circle main\");\n updateNodeBounds(node, circle3);\n node.intersect = function(point2) {\n log.info(\"Circle intersect\", node, bbox.width / 2 + halfPadding, point2);\n return intersect_default.circle(node, bbox.width / 2 + halfPadding, point2);\n };\n return shapeSvg;\n}, \"circle\");\nvar doublecircle = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const gap = 5;\n const circleGroup = shapeSvg.insert(\"g\", \":first-child\");\n const outerCircle = circleGroup.insert(\"circle\");\n const innerCircle = circleGroup.insert(\"circle\");\n circleGroup.attr(\"class\", node.class);\n outerCircle.attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"r\", bbox.width / 2 + halfPadding + gap).attr(\"width\", bbox.width + node.padding + gap * 2).attr(\"height\", bbox.height + node.padding + gap * 2);\n innerCircle.attr(\"style\", node.style).attr(\"rx\", node.rx).attr(\"ry\", node.ry).attr(\"r\", bbox.width / 2 + halfPadding).attr(\"width\", bbox.width + node.padding).attr(\"height\", bbox.height + node.padding);\n log.info(\"DoubleCircle main\");\n updateNodeBounds(node, outerCircle);\n node.intersect = function(point2) {\n log.info(\"DoubleCircle intersect\", node, bbox.width / 2 + halfPadding + gap, point2);\n return intersect_default.circle(node, bbox.width / 2 + halfPadding + gap, point2);\n };\n return shapeSvg;\n}, \"doublecircle\");\nvar subroutine = /* @__PURE__ */ __name(async (parent, node) => {\n const { shapeSvg, bbox } = await labelHelper(\n parent,\n node,\n getClassesFromNode(node, void 0),\n true\n );\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 }\n ];\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr(\"style\", node.style);\n updateNodeBounds(node, el);\n node.intersect = function(point2) {\n return intersect_default.polygon(node, points, point2);\n };\n return shapeSvg;\n}, \"subroutine\");\nvar start = /* @__PURE__ */ __name((parent, node) => {\n const shapeSvg = parent.insert(\"g\").attr(\"class\", \"node default\").attr(\"id\", node.domId || node.id);\n const circle3 = shapeSvg.insert(\"circle\", \":first-child\");\n circle3.attr(\"class\", \"state-start\").attr(\"r\", 7).attr(\"width\", 14).attr(\"height\", 14);\n updateNodeBounds(node, circle3);\n node.intersect = function(point2) {\n return intersect_default.circle(node, 7, point2);\n };\n return shapeSvg;\n}, \"start\");\nvar forkJoin = /* @__PURE__ */ __name((parent, node, dir) => {\n const shapeSvg = parent.insert(\"g\").attr(\"class\", \"node default\").attr(\"id\", node.domId || node.id);\n let width = 70;\n let height = 10;\n if (dir === \"LR\") {\n width = 10;\n height = 70;\n }\n const shape = shapeSvg.append(\"rect\").attr(\"x\", -1 * width / 2).attr(\"y\", -1 * height / 2).attr(\"width\", width).attr(\"height\", height).attr(\"class\", \"fork-join\");\n updateNodeBounds(node, shape);\n node.height = node.height + node.padding / 2;\n node.width = node.width + node.padding / 2;\n node.intersect = function(point2) {\n return intersect_default.rect(node, point2);\n };\n return shapeSvg;\n}, \"forkJoin\");\nvar end = /* @__PURE__ */ __name((parent, node) => {\n const shapeSvg = parent.insert(\"g\").attr(\"class\", \"node default\").attr(\"id\", node.domId || node.id);\n const innerCircle = shapeSvg.insert(\"circle\", \":first-child\");\n const circle3 = shapeSvg.insert(\"circle\", \":first-child\");\n circle3.attr(\"class\", \"state-start\").attr(\"r\", 7).attr(\"width\", 14).attr(\"height\", 14);\n innerCircle.attr(\"class\", \"state-end\").attr(\"r\", 5).attr(\"width\", 10).attr(\"height\", 10);\n updateNodeBounds(node, circle3);\n node.intersect = function(point2) {\n return intersect_default.circle(node, 7, point2);\n };\n return shapeSvg;\n}, \"end\");\nvar class_box = /* @__PURE__ */ __name(async (parent, node) => {\n const halfPadding = node.padding / 2;\n const rowPadding = 4;\n const lineHeight = 8;\n let classes2;\n if (!node.classes) {\n classes2 = \"node default\";\n } else {\n classes2 = \"node \" + node.classes;\n }\n const shapeSvg = parent.insert(\"g\").attr(\"class\", classes2).attr(\"id\", node.domId || node.id);\n const rect2 = shapeSvg.insert(\"rect\", \":first-child\");\n const topLine = shapeSvg.insert(\"line\");\n const bottomLine = shapeSvg.insert(\"line\");\n let maxWidth = 0;\n let maxHeight = rowPadding;\n const labelContainer = shapeSvg.insert(\"g\").attr(\"class\", \"label\");\n let verticalPos = 0;\n const hasInterface = node.classData.annotations?.[0];\n const interfaceLabelText = node.classData.annotations[0] ? \"\\xAB\" + node.classData.annotations[0] + \"\\xBB\" : \"\";\n const interfaceLabel = labelContainer.node().appendChild(await createLabel_default(interfaceLabelText, node.labelStyle, true, true));\n let interfaceBBox = interfaceLabel.getBBox();\n if (evaluate(getConfig2().flowchart.htmlLabels)) {\n const div = interfaceLabel.children[0];\n const dv = select4(interfaceLabel);\n interfaceBBox = div.getBoundingClientRect();\n dv.attr(\"width\", interfaceBBox.width);\n dv.attr(\"height\", interfaceBBox.height);\n }\n if (node.classData.annotations[0]) {\n maxHeight += interfaceBBox.height + rowPadding;\n maxWidth += interfaceBBox.width;\n }\n let classTitleString = node.classData.label;\n if (node.classData.type !== void 0 && node.classData.type !== \"\") {\n if (getConfig2().flowchart.htmlLabels) {\n classTitleString += \"<\" + node.classData.type + \">\";\n } else {\n classTitleString += \"<\" + node.classData.type + \">\";\n }\n }\n const classTitleLabel = labelContainer.node().appendChild(await createLabel_default(classTitleString, node.labelStyle, true, true));\n select4(classTitleLabel).attr(\"class\", \"classTitle\");\n let classTitleBBox = classTitleLabel.getBBox();\n if (evaluate(getConfig2().flowchart.htmlLabels)) {\n const div = classTitleLabel.children[0];\n const dv = select4(classTitleLabel);\n classTitleBBox = div.getBoundingClientRect();\n dv.attr(\"width\", classTitleBBox.width);\n dv.attr(\"height\", classTitleBBox.height);\n }\n maxHeight += classTitleBBox.height + rowPadding;\n if (classTitleBBox.width > maxWidth) {\n maxWidth = classTitleBBox.width;\n }\n const classAttributes = [];\n node.classData.members.forEach(async (member) => {\n const parsedInfo = member.getDisplayDetails();\n let parsedText = parsedInfo.displayText;\n if (getConfig2().flowchart.htmlLabels) {\n parsedText = parsedText.replace(/
/gi,yo=l(t=>t?Yi(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),bo=(()=>{let t=!1;return()=>{t||(ji(),t=!0)}})();function ji(){let t="data-temp-href-target";pt.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),pt.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}l(ji,"setupDompurifyHooks");var Vi=l(t=>(bo(),pt.sanitize(t)),"removeScript"),qi=l((t,e)=>{if(e.flowchart?.htmlLabels!==!1){let i=e.securityLevel;i==="antiscript"||i==="strict"?t=Vi(t):i!=="loose"&&(t=Yi(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=So(t))}return t},"sanitizeMore"),xt=l((t,e)=>t&&(e.dompurifyConfig?t=pt.sanitize(qi(t,e),e.dompurifyConfig).toString():t=pt.sanitize(qi(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),To=l((t,e)=>typeof t=="string"?xt(t,e):t.flat().map(i=>xt(i,e)),"sanitizeTextOrArray"),ko=l(t=>wt.test(t),"hasBreaks"),Bo=l(t=>t.split(wt),"splitBreaks"),So=l(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),Yi=l(t=>t.replace(wt,"#br#"),"breakToPlaceholder"),Fo=l(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),_o=l(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Lo=l(function(...t){let e=t.filter(i=>!isNaN(i));return Math.max(...e)},"getMax"),Ao=l(function(...t){let e=t.filter(i=>!isNaN(i));return Math.min(...e)},"getMin"),Rs=l(function(t){let e=t.split(/(,)/),i=[];for(let a=0;a